79 |
|
#include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h" |
80 |
|
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h" |
81 |
|
#include "DataFormats/TrackReco/interface/Track.h" |
82 |
+ |
#include "TrackingTools/PatternTools/interface/Trajectory.h" |
83 |
+ |
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" |
84 |
+ |
|
85 |
|
|
86 |
|
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" |
87 |
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" |
121 |
|
Geometry* Geom_ECAL; |
122 |
|
Geometry* Geom_HCAL; |
123 |
|
Geometry* Geom_Muon; |
124 |
+ |
Geometry* Geom_Fwd; |
125 |
|
|
126 |
|
|
127 |
|
std::string OutputFile; |
130 |
|
std::vector<InputTag> SimVertexProducers; |
131 |
|
std::vector<InputTag> SimHitProducers; |
132 |
|
|
133 |
< |
std::vector<InputTag> TrackProducers; |
133 |
> |
std::vector<InputTag> TrajectoryProducers; |
134 |
|
std::vector<InputTag> EcalRecHitProducers; |
135 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
136 |
|
std::vector<InputTag> HcalHORecHitProducers; |
157 |
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers"); |
158 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
159 |
|
|
160 |
< |
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
160 |
> |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
161 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
162 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
163 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
187 |
|
Geom_ECAL = new Geometry(); |
188 |
|
Geom_HCAL = new Geometry(); |
189 |
|
Geom_Muon = new Geometry(); |
190 |
+ |
Geom_Fwd = new Geometry(); |
191 |
+ |
|
192 |
|
|
193 |
|
|
194 |
|
// ### TRACKER GEOMETRY ### |
268 |
|
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
269 |
|
continue; |
270 |
|
} |
271 |
< |
}else{ |
272 |
< |
continue; |
271 |
> |
}else if(Detid.det() == DetId::Calo){ |
272 |
> |
Geom_temp = NULL; |
273 |
> |
|
274 |
> |
// Calo Tower Geometry (SudDet=1) |
275 |
> |
// if(SubDet==1) |
276 |
> |
// //printf("Don't Save CaloTowers\n"); |
277 |
> |
// continue; |
278 |
> |
|
279 |
> |
// Forward Calo Geometry --> Castor (SudDet=3) and ZDS (SubDet=2) |
280 |
> |
if(SubDet==HcalCastorDetId::SubdetectorId || SubDet==HcalZDCDetId::SubdetectorId) |
281 |
> |
Geom_temp = Geom_Fwd; |
282 |
> |
// printf("Save FWD CaloTowers\n"); |
283 |
|
} |
284 |
|
|
285 |
|
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
286 |
|
GlobalPoint CellPos = CellGeom->getPosition(); |
287 |
|
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
288 |
|
|
289 |
< |
Geom_temp->Add_CaloDet(Detid.rawId(), |
290 |
< |
CellPos.x() , CellPos.y() , CellPos.z(), |
291 |
< |
CellCorners[0].x() , CellCorners[0].y() , CellCorners[0].z() , |
292 |
< |
CellCorners[1].x() , CellCorners[1].y() , CellCorners[1].z() , |
293 |
< |
CellCorners[2].x() , CellCorners[2].y() , CellCorners[2].z() , |
294 |
< |
CellCorners[3].x() , CellCorners[3].y() , CellCorners[3].z() , |
295 |
< |
CellCorners[4].x() , CellCorners[4].y() , CellCorners[4].z() , |
296 |
< |
CellCorners[5].x() , CellCorners[5].y() , CellCorners[5].z() , |
297 |
< |
CellCorners[6].x() , CellCorners[6].y() , CellCorners[6].z() , |
298 |
< |
CellCorners[7].x() , CellCorners[7].y() , CellCorners[7].z() ); |
289 |
> |
if(Geom_temp == Geom_ECAL || Geom_temp == Geom_HCAL){ |
290 |
> |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
291 |
> |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
292 |
> |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
293 |
> |
|
294 |
> |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
295 |
> |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
296 |
> |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
297 |
> |
|
298 |
> |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
299 |
> |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
300 |
> |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
301 |
> |
|
302 |
> |
float F = sqrt( pow(CellCorners[4].x()+CellCorners[6].x(),2) + pow(CellCorners[4].y()+CellCorners[6].y(),2) + pow(CellCorners[4].z()+CellCorners[6].z(),2) ); |
303 |
> |
F /= sqrt( pow(CellCorners[0].x()+CellCorners[2].x(),2) + pow(CellCorners[0].y()+CellCorners[2].y(),2) + pow(CellCorners[0].z()+CellCorners[2].z(),2) ); |
304 |
> |
|
305 |
> |
Geom_temp->Add_CaloDet(Detid.rawId(), |
306 |
> |
cX , cY , cZ , |
307 |
> |
wX , wY , wZ , |
308 |
> |
hX , hY , hZ , F ); |
309 |
> |
}else if(Geom_temp == Geom_Fwd){ |
310 |
> |
/* |
311 |
> |
Geom_temp->Add_FwdDet(Detid.rawId(), |
312 |
> |
CellCorners[0].x(), CellCorners[0].y(), CellCorners[0].z(), |
313 |
> |
CellCorners[1].x(), CellCorners[1].y(), CellCorners[1].z(), |
314 |
> |
CellCorners[2].x(), CellCorners[2].y(), CellCorners[2].z(), |
315 |
> |
CellCorners[3].x(), CellCorners[3].y(), CellCorners[3].z(), |
316 |
> |
CellCorners[4].x(), CellCorners[4].y(), CellCorners[4].z(), |
317 |
> |
CellCorners[5].x(), CellCorners[5].y(), CellCorners[5].z(), |
318 |
> |
CellCorners[6].x(), CellCorners[6].y(), CellCorners[6].z(), |
319 |
> |
CellCorners[7].x(), CellCorners[7].y(), CellCorners[7].z()); |
320 |
> |
printf("SubDet = %i : (%6.2f,%6.2f,%6.2f) --> 7 (%6.2f,%6.2f,%6.2f) \n", SubDet,CellCorners[0].x(), CellCorners[0].y(), CellCorners[0].z(),CellCorners[6].x(), CellCorners[6].y(), CellCorners[6].z()); |
321 |
> |
*/ |
322 |
> |
} |
323 |
|
} |
324 |
+ |
|
325 |
|
|
326 |
|
// ### MUON GEOMETRY ### |
327 |
|
|
386 |
|
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
387 |
|
} |
388 |
|
|
389 |
+ |
// ### FORWARD GEOMETRY ### |
390 |
+ |
// edm::ESHandle<CaloGeometry> ForwardGeom; |
391 |
+ |
// iSetup.get<IdealGeometryRecord>().get( ForwardGeom ); |
392 |
+ |
// const vector<DetId> FwdDets = ForwardGeom->getValidDetIds(DetId::Calo, HcalCastorDetId::SubdetectorId); |
393 |
+ |
// printf("FwdDetsSize = %i\n",FwdDets.size()); |
394 |
|
|
395 |
|
// ### Save .geom ### |
396 |
|
|
397 |
+ |
printf("FWD Size = %i\n", Geom_Fwd->Det_ECAL_ALL.size()); |
398 |
+ |
printf("FWD Size = %i\n", Geom_Fwd->Det_HCAL_ALL.size()); |
399 |
+ |
printf("FWD Size = %i\n", Geom_Fwd->Det_FWD_ALL.size()); |
400 |
+ |
|
401 |
+ |
|
402 |
+ |
|
403 |
|
Geom_Tracker->Save("Tracker.geom"); |
404 |
|
Geom_ECAL ->Save("Ecal.geom"); |
405 |
|
Geom_HCAL ->Save("Hcal.geom"); |
406 |
|
Geom_Muon ->Save("Muon.geom"); |
407 |
+ |
// Geom_Fwd ->Save("Fwd.geom"); |
408 |
+ |
|
409 |
+ |
|
410 |
|
|
411 |
|
} |
412 |
|
|
452 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
453 |
|
|
454 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
455 |
< |
MySimTrack MysimTrack; |
455 |
> |
MySimTrack* MysimTrack = new MySimTrack; |
456 |
|
SimTrack simTrack =SimTrackColl[a]; |
457 |
|
|
458 |
< |
MysimTrack.track_id =simTrack.trackId(); |
459 |
< |
MysimTrack.Type =simTrack.type(); |
460 |
< |
MysimTrack.parent_vertex=simTrack.vertIndex(); |
461 |
< |
MysimTrack.Px =simTrack.momentum().x(); |
462 |
< |
MysimTrack.Py =simTrack.momentum().y(); |
463 |
< |
MysimTrack.Pz =simTrack.momentum().z(); |
464 |
< |
MysimTrack.E =simTrack.momentum().e(); |
465 |
< |
MysimTrack.charge =simTrack.charge(); |
458 |
> |
MysimTrack->track_id =simTrack.trackId(); |
459 |
> |
MysimTrack->Type =simTrack.type(); |
460 |
> |
MysimTrack->parent_vertex=simTrack.vertIndex(); |
461 |
> |
MysimTrack->Px =simTrack.momentum().x(); |
462 |
> |
MysimTrack->Py =simTrack.momentum().y(); |
463 |
> |
MysimTrack->Pz =simTrack.momentum().z(); |
464 |
> |
MysimTrack->E =simTrack.momentum().e(); |
465 |
> |
MysimTrack->charge =simTrack.charge(); |
466 |
|
|
467 |
|
MyEvent->MySimTrackCollection.push_back(MysimTrack); |
468 |
|
} |
475 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
476 |
|
|
477 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
478 |
< |
MySimVertex MyVertex; |
478 |
> |
MySimVertex* MyVertex = new MySimVertex; |
479 |
|
SimVertex Vertex = VertexColl[b]; |
480 |
|
|
481 |
< |
MyVertex.parentTrack_id =Vertex.parentIndex (); |
482 |
< |
MyVertex.x =Vertex.position().x(); |
483 |
< |
MyVertex.y =Vertex.position().y(); |
484 |
< |
MyVertex.z =Vertex.position().z(); |
481 |
> |
MyVertex->parentTrack_id=Vertex.parentIndex (); |
482 |
> |
MyVertex->x =Vertex.position().x(); |
483 |
> |
MyVertex->y =Vertex.position().y(); |
484 |
> |
MyVertex->z =Vertex.position().z(); |
485 |
|
|
486 |
|
MyEvent->MySimVertexCollection.push_back(MyVertex); |
487 |
|
} |
498 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
499 |
|
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
500 |
|
|
501 |
< |
MyPSimHit Hit; |
502 |
< |
Hit.x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
503 |
< |
Hit.y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
504 |
< |
Hit.z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
505 |
< |
Hit.ProcessType = Hits[h].processType(); |
506 |
< |
Hit.dEdX = Hits[h].energyLoss(); |
501 |
> |
MyPSimHit* Hit = new MyPSimHit; |
502 |
> |
Hit->x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
503 |
> |
Hit->y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
504 |
> |
Hit->z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
505 |
> |
Hit->ProcessType = Hits[h].processType(); |
506 |
> |
Hit->dEdX = Hits[h].energyLoss(); |
507 |
|
|
508 |
|
MyEvent->MyPSimHitCollection.push_back(Hit); |
509 |
|
} |
511 |
|
|
512 |
|
|
513 |
|
// ### TRACKS ### |
514 |
< |
for(unsigned int i=0;i<TrackProducers.size();i++){ |
515 |
< |
edm::Handle<std::vector< reco::Track > > h_Tracks; |
516 |
< |
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
517 |
< |
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
518 |
< |
|
519 |
< |
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
520 |
< |
MyRecoTrack MyrecoTrack; |
521 |
< |
reco::Track recoTrack =TrackColl[t]; |
514 |
> |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
515 |
> |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
516 |
> |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
517 |
> |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
518 |
> |
|
519 |
> |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
520 |
> |
Trajectory recoTraj = *it->key; |
521 |
> |
MyRecoTrack* MyrecoTrack = new MyRecoTrack; |
522 |
> |
|
523 |
> |
MyRecoTrackInfo* info = new MyRecoTrackInfo; |
524 |
> |
info->Coll = i; |
525 |
> |
info->P = it->val->p(); |
526 |
> |
info->Pt = it->val->pt(); |
527 |
> |
info->chi2 = it->key->chiSquared(); |
528 |
> |
MyrecoTrack->Info = info; |
529 |
|
|
530 |
< |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
531 |
< |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
530 |
> |
|
531 |
> |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
532 |
> |
for(unsigned int h=0;h<measurements.size();h++){ |
533 |
> |
|
534 |
> |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
535 |
|
if(!h_it->isValid() )continue; |
536 |
|
DetId detId = h_it->geographicalId(); |
537 |
< |
const GeomDet * theDet = tkGeom->idToDet(detId); |
538 |
< |
LocalPoint localPos = h_it->localPosition(); |
539 |
< |
|
540 |
< |
MyRecoHit hit; |
541 |
< |
hit.x = theDet->surface().toGlobal(localPos).x(); |
542 |
< |
hit.y = theDet->surface().toGlobal(localPos).y(); |
543 |
< |
hit.z = theDet->surface().toGlobal(localPos).z(); |
544 |
< |
hit.DetId = detId.rawId(); |
545 |
< |
hit.Charge = -1; |
546 |
< |
MyrecoTrack.Hits.push_back(hit); |
537 |
> |
// const GeomDet * theDet = tkGeom->idToDet(detId); |
538 |
> |
// LocalPoint localPos = h_it->localPosition(); |
539 |
> |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
540 |
> |
|
541 |
> |
MyRecoHit* hit = new MyRecoHit; |
542 |
> |
/* |
543 |
> |
hit->x = theDet->surface().toGlobal(localPos).x(); |
544 |
> |
hit->y = theDet->surface().toGlobal(localPos).y(); |
545 |
> |
hit->z = theDet->surface().toGlobal(localPos).z(); |
546 |
> |
*/ |
547 |
> |
hit->x = globalPos.x(); |
548 |
> |
hit->y = globalPos.y(); |
549 |
> |
hit->z = globalPos.z(); |
550 |
> |
hit->DetId = detId.rawId(); |
551 |
> |
hit->Charge = -1; |
552 |
> |
MyrecoTrack->Hits.push_back(hit); |
553 |
|
} |
554 |
|
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
555 |
|
} |
563 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
564 |
|
|
565 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
566 |
< |
MyCaloHit temp_EcalHit; |
567 |
< |
temp_EcalHit.E = Ecal_RecHits[eh].energy(); |
568 |
< |
temp_EcalHit.t = Ecal_RecHits[eh].time(); |
569 |
< |
temp_EcalHit.DetId = (Ecal_RecHits[eh].detid()).rawId(); |
566 |
> |
MyCaloHit* temp_EcalHit = new MyCaloHit; |
567 |
> |
temp_EcalHit->E = Ecal_RecHits[eh].energy(); |
568 |
> |
temp_EcalHit->t = Ecal_RecHits[eh].time(); |
569 |
> |
temp_EcalHit->DetId = (Ecal_RecHits[eh].detid()).rawId(); |
570 |
|
|
571 |
|
MyEvent->MyEcalCaloHitCollection.push_back(temp_EcalHit); |
572 |
|
} |
580 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
581 |
|
|
582 |
|
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
583 |
< |
MyCaloHit temp_HcalHBHEHit; |
584 |
< |
temp_HcalHBHEHit.E = HcalHBHE_RecHits[hh].energy(); |
585 |
< |
temp_HcalHBHEHit.t = HcalHBHE_RecHits[hh].time(); |
586 |
< |
temp_HcalHBHEHit.DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
583 |
> |
MyCaloHit* temp_HcalHBHEHit = new MyCaloHit; |
584 |
> |
temp_HcalHBHEHit->E = HcalHBHE_RecHits[hh].energy(); |
585 |
> |
temp_HcalHBHEHit->t = HcalHBHE_RecHits[hh].time(); |
586 |
> |
temp_HcalHBHEHit->DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
587 |
|
|
588 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHBHEHit); |
589 |
|
} |
596 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
597 |
|
|
598 |
|
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
599 |
< |
MyCaloHit temp_HcalHOHit; |
600 |
< |
temp_HcalHOHit.E = HcalHO_RecHits[hh].energy(); |
601 |
< |
temp_HcalHOHit.t = HcalHO_RecHits[hh].time(); |
602 |
< |
temp_HcalHOHit.DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
599 |
> |
MyCaloHit* temp_HcalHOHit = new MyCaloHit; |
600 |
> |
temp_HcalHOHit->E = HcalHO_RecHits[hh].energy(); |
601 |
> |
temp_HcalHOHit->t = HcalHO_RecHits[hh].time(); |
602 |
> |
temp_HcalHOHit->DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
603 |
|
|
604 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHOHit); |
605 |
|
} |
612 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
613 |
|
|
614 |
|
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
615 |
< |
MyCaloHit temp_HcalHFHit; |
616 |
< |
temp_HcalHFHit.E = HcalHF_RecHits[hh].energy(); |
617 |
< |
temp_HcalHFHit.t = HcalHF_RecHits[hh].time(); |
618 |
< |
temp_HcalHFHit.DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
615 |
> |
MyCaloHit* temp_HcalHFHit = new MyCaloHit; |
616 |
> |
temp_HcalHFHit->E = HcalHF_RecHits[hh].energy(); |
617 |
> |
temp_HcalHFHit->t = HcalHF_RecHits[hh].time(); |
618 |
> |
temp_HcalHFHit->DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
619 |
|
|
620 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHFHit); |
621 |
|
} |
631 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
632 |
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId); |
633 |
|
|
634 |
< |
MyMuonSegment temp_CscSeg; |
635 |
< |
temp_CscSeg.DetId = theDetUnitId.rawId(); |
636 |
< |
temp_CscSeg.PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
637 |
< |
temp_CscSeg.PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
638 |
< |
temp_CscSeg.PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
639 |
< |
temp_CscSeg.DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
640 |
< |
temp_CscSeg.DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
641 |
< |
temp_CscSeg.DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
634 |
> |
MyMuonSegment* temp_CscSeg = new MyMuonSegment; |
635 |
> |
temp_CscSeg->DetId = theDetUnitId.rawId(); |
636 |
> |
temp_CscSeg->PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
637 |
> |
temp_CscSeg->PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
638 |
> |
temp_CscSeg->PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
639 |
> |
temp_CscSeg->DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
640 |
> |
temp_CscSeg->DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
641 |
> |
temp_CscSeg->DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
642 |
|
|
643 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_CscSeg); |
644 |
|
} |
653 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
654 |
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId); |
655 |
|
|
656 |
< |
MyMuonSegment temp_DtSeg; |
657 |
< |
temp_DtSeg.DetId = theDetUnitId.rawId(); |
658 |
< |
temp_DtSeg.PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
659 |
< |
temp_DtSeg.PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
660 |
< |
temp_DtSeg.PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
661 |
< |
temp_DtSeg.DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
662 |
< |
temp_DtSeg.DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
663 |
< |
temp_DtSeg.DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
656 |
> |
MyMuonSegment* temp_DtSeg = new MyMuonSegment; |
657 |
> |
temp_DtSeg->DetId = theDetUnitId.rawId(); |
658 |
> |
temp_DtSeg->PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
659 |
> |
temp_DtSeg->PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
660 |
> |
temp_DtSeg->PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
661 |
> |
temp_DtSeg->DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
662 |
> |
temp_DtSeg->DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
663 |
> |
temp_DtSeg->DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
664 |
|
|
665 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_DtSeg); |
666 |
|
} |
676 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
677 |
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId); |
678 |
|
|
679 |
< |
MyMuonHit temp_RpcHit; |
680 |
< |
temp_RpcHit.DetId = theDetUnitId.rawId(); |
681 |
< |
temp_RpcHit.x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
682 |
< |
temp_RpcHit.y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
683 |
< |
temp_RpcHit.z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
679 |
> |
MyMuonHit* temp_RpcHit = new MyMuonHit; |
680 |
> |
temp_RpcHit->DetId = theDetUnitId.rawId(); |
681 |
> |
temp_RpcHit->x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
682 |
> |
temp_RpcHit->y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
683 |
> |
temp_RpcHit->z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
684 |
|
|
685 |
|
MyEvent->MyMuonHitCollection.push_back(temp_RpcHit); |
686 |
|
} |