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; |
131 |
|
std::vector<InputTag> SimHitProducers; |
132 |
|
|
133 |
|
std::vector<InputTag> TrackProducers; |
134 |
+ |
std::vector<InputTag> TrajectoryProducers; |
135 |
|
std::vector<InputTag> EcalRecHitProducers; |
136 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
137 |
|
std::vector<InputTag> HcalHORecHitProducers; |
158 |
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers"); |
159 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
160 |
|
|
161 |
< |
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
161 |
> |
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
162 |
> |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
163 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
164 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
165 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
189 |
|
Geom_ECAL = new Geometry(); |
190 |
|
Geom_HCAL = new Geometry(); |
191 |
|
Geom_Muon = new Geometry(); |
192 |
+ |
Geom_Fwd = new Geometry(); |
193 |
+ |
|
194 |
|
|
195 |
|
|
196 |
|
// ### TRACKER GEOMETRY ### |
270 |
|
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
271 |
|
continue; |
272 |
|
} |
273 |
< |
}else{ |
274 |
< |
continue; |
273 |
> |
}else if(Detid.det() == DetId::Calo){ |
274 |
> |
Geom_temp = NULL; |
275 |
> |
|
276 |
> |
// Calo Tower Geometry (SudDet=1) |
277 |
> |
// if(SubDet==1) |
278 |
> |
// //printf("Don't Save CaloTowers\n"); |
279 |
> |
// continue; |
280 |
> |
|
281 |
> |
// Forward Calo Geometry --> Castor (SudDet=3) and ZDS (SubDet=2) |
282 |
> |
if(SubDet==HcalCastorDetId::SubdetectorId || SubDet==HcalZDCDetId::SubdetectorId) |
283 |
> |
Geom_temp = Geom_Fwd; |
284 |
> |
// printf("Save FWD CaloTowers\n"); |
285 |
|
} |
286 |
|
|
287 |
|
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
288 |
|
GlobalPoint CellPos = CellGeom->getPosition(); |
289 |
|
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
290 |
|
|
291 |
< |
Geom_temp->Add_CaloDet(Detid.rawId(), |
292 |
< |
CellPos.x() , CellPos.y() , CellPos.z(), |
293 |
< |
CellCorners[0].x() , CellCorners[0].y() , CellCorners[0].z() , |
294 |
< |
CellCorners[1].x() , CellCorners[1].y() , CellCorners[1].z() , |
295 |
< |
CellCorners[2].x() , CellCorners[2].y() , CellCorners[2].z() , |
296 |
< |
CellCorners[3].x() , CellCorners[3].y() , CellCorners[3].z() , |
297 |
< |
CellCorners[4].x() , CellCorners[4].y() , CellCorners[4].z() , |
298 |
< |
CellCorners[5].x() , CellCorners[5].y() , CellCorners[5].z() , |
299 |
< |
CellCorners[6].x() , CellCorners[6].y() , CellCorners[6].z() , |
300 |
< |
CellCorners[7].x() , CellCorners[7].y() , CellCorners[7].z() ); |
291 |
> |
if(Geom_temp == Geom_ECAL || Geom_temp == Geom_HCAL){ |
292 |
> |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
293 |
> |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
294 |
> |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
295 |
> |
|
296 |
> |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
297 |
> |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
298 |
> |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
299 |
> |
|
300 |
> |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
301 |
> |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
302 |
> |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
303 |
> |
|
304 |
> |
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) ); |
305 |
> |
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) ); |
306 |
> |
|
307 |
> |
Geom_temp->Add_CaloDet(Detid.rawId(), |
308 |
> |
cX , cY , cZ , |
309 |
> |
wX , wY , wZ , |
310 |
> |
hX , hY , hZ , F ); |
311 |
> |
}else if(Geom_temp == Geom_Fwd){ |
312 |
> |
/* |
313 |
> |
Geom_temp->Add_FwdDet(Detid.rawId(), |
314 |
> |
CellCorners[0].x(), CellCorners[0].y(), CellCorners[0].z(), |
315 |
> |
CellCorners[1].x(), CellCorners[1].y(), CellCorners[1].z(), |
316 |
> |
CellCorners[2].x(), CellCorners[2].y(), CellCorners[2].z(), |
317 |
> |
CellCorners[3].x(), CellCorners[3].y(), CellCorners[3].z(), |
318 |
> |
CellCorners[4].x(), CellCorners[4].y(), CellCorners[4].z(), |
319 |
> |
CellCorners[5].x(), CellCorners[5].y(), CellCorners[5].z(), |
320 |
> |
CellCorners[6].x(), CellCorners[6].y(), CellCorners[6].z(), |
321 |
> |
CellCorners[7].x(), CellCorners[7].y(), CellCorners[7].z()); |
322 |
> |
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()); |
323 |
> |
*/ |
324 |
> |
} |
325 |
|
} |
326 |
+ |
|
327 |
|
|
328 |
|
// ### MUON GEOMETRY ### |
329 |
|
|
391 |
|
|
392 |
|
// ### Save .geom ### |
393 |
|
|
394 |
+ |
// printf("FWD Size = %i\n", Geom_Fwd->Det_ECAL_ALL.size()); |
395 |
+ |
// printf("FWD Size = %i\n", Geom_Fwd->Det_HCAL_ALL.size()); |
396 |
+ |
// printf("FWD Size = %i\n", Geom_Fwd->Det_FWD_ALL.size()); |
397 |
+ |
|
398 |
+ |
|
399 |
+ |
|
400 |
|
Geom_Tracker->Save("Tracker.geom"); |
401 |
|
Geom_ECAL ->Save("Ecal.geom"); |
402 |
|
Geom_HCAL ->Save("Hcal.geom"); |
403 |
|
Geom_Muon ->Save("Muon.geom"); |
404 |
+ |
// Geom_Fwd ->Save("Fwd.geom"); |
405 |
+ |
|
406 |
+ |
|
407 |
|
|
408 |
|
} |
409 |
|
|
449 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
450 |
|
|
451 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
452 |
< |
MySimTrack MysimTrack; |
452 |
> |
MySimTrack* MysimTrack = new MySimTrack; |
453 |
|
SimTrack simTrack =SimTrackColl[a]; |
454 |
|
|
455 |
< |
MysimTrack.track_id =simTrack.trackId(); |
456 |
< |
MysimTrack.Type =simTrack.type(); |
457 |
< |
MysimTrack.parent_vertex=simTrack.vertIndex(); |
458 |
< |
MysimTrack.Px =simTrack.momentum().x(); |
459 |
< |
MysimTrack.Py =simTrack.momentum().y(); |
460 |
< |
MysimTrack.Pz =simTrack.momentum().z(); |
461 |
< |
MysimTrack.E =simTrack.momentum().e(); |
462 |
< |
MysimTrack.charge =simTrack.charge(); |
455 |
> |
MysimTrack->track_id =simTrack.trackId(); |
456 |
> |
MysimTrack->Type =simTrack.type(); |
457 |
> |
MysimTrack->parent_vertex=simTrack.vertIndex(); |
458 |
> |
MysimTrack->Px =simTrack.momentum().x(); |
459 |
> |
MysimTrack->Py =simTrack.momentum().y(); |
460 |
> |
MysimTrack->Pz =simTrack.momentum().z(); |
461 |
> |
MysimTrack->E =simTrack.momentum().e(); |
462 |
> |
MysimTrack->charge =simTrack.charge(); |
463 |
|
|
464 |
|
MyEvent->MySimTrackCollection.push_back(MysimTrack); |
465 |
|
} |
472 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
473 |
|
|
474 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
475 |
< |
MySimVertex MyVertex; |
475 |
> |
MySimVertex* MyVertex = new MySimVertex; |
476 |
|
SimVertex Vertex = VertexColl[b]; |
477 |
|
|
478 |
< |
MyVertex.parentTrack_id =Vertex.parentIndex (); |
479 |
< |
MyVertex.x =Vertex.position().x(); |
480 |
< |
MyVertex.y =Vertex.position().y(); |
481 |
< |
MyVertex.z =Vertex.position().z(); |
478 |
> |
MyVertex->parentTrack_id=Vertex.parentIndex (); |
479 |
> |
MyVertex->x =Vertex.position().x(); |
480 |
> |
MyVertex->y =Vertex.position().y(); |
481 |
> |
MyVertex->z =Vertex.position().z(); |
482 |
|
|
483 |
|
MyEvent->MySimVertexCollection.push_back(MyVertex); |
484 |
|
} |
495 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
496 |
|
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
497 |
|
|
498 |
< |
MyPSimHit Hit; |
499 |
< |
Hit.x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
500 |
< |
Hit.y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
501 |
< |
Hit.z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
502 |
< |
Hit.ProcessType = Hits[h].processType(); |
503 |
< |
Hit.dEdX = Hits[h].energyLoss(); |
498 |
> |
MyPSimHit* Hit = new MyPSimHit; |
499 |
> |
Hit->x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
500 |
> |
Hit->y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
501 |
> |
Hit->z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
502 |
> |
Hit->ProcessType = Hits[h].processType(); |
503 |
> |
Hit->dEdX = Hits[h].energyLoss(); |
504 |
|
|
505 |
|
MyEvent->MyPSimHitCollection.push_back(Hit); |
506 |
|
} |
507 |
|
} |
508 |
|
|
509 |
|
|
510 |
< |
// ### TRACKS ### |
510 |
> |
// ### TRAJECTORY ### |
511 |
> |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
512 |
> |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
513 |
> |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
514 |
> |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
515 |
> |
|
516 |
> |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
517 |
> |
Trajectory recoTraj = *it->key; |
518 |
> |
MyRecoTrack* MyrecoTrack = new MyRecoTrack; |
519 |
> |
|
520 |
> |
MyRecoTrackInfo* info = new MyRecoTrackInfo; |
521 |
> |
info->Coll = i; |
522 |
> |
info->P = it->val->p(); |
523 |
> |
info->Pt = it->val->pt(); |
524 |
> |
info->chi2 = it->key->chiSquared(); |
525 |
> |
MyrecoTrack->Info = info; |
526 |
> |
|
527 |
> |
|
528 |
> |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
529 |
> |
for(unsigned int h=0;h<measurements.size();h++){ |
530 |
> |
|
531 |
> |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
532 |
> |
if(!h_it->isValid() )continue; |
533 |
> |
DetId detId = h_it->geographicalId(); |
534 |
> |
// const GeomDet * theDet = tkGeom->idToDet(detId); |
535 |
> |
// LocalPoint localPos = h_it->localPosition(); |
536 |
> |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
537 |
> |
|
538 |
> |
MyRecoHit* hit = new MyRecoHit; |
539 |
> |
/* |
540 |
> |
hit->x = theDet->surface().toGlobal(localPos).x(); |
541 |
> |
hit->y = theDet->surface().toGlobal(localPos).y(); |
542 |
> |
hit->z = theDet->surface().toGlobal(localPos).z(); |
543 |
> |
*/ |
544 |
> |
hit->x = globalPos.x(); |
545 |
> |
hit->y = globalPos.y(); |
546 |
> |
hit->z = globalPos.z(); |
547 |
> |
hit->DetId = detId.rawId(); |
548 |
> |
hit->Charge = -1; |
549 |
> |
MyrecoTrack->Hits.push_back(hit); |
550 |
> |
} |
551 |
> |
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
552 |
> |
} |
553 |
> |
} |
554 |
> |
|
555 |
> |
// ### TRACK ### |
556 |
> |
|
557 |
|
for(unsigned int i=0;i<TrackProducers.size();i++){ |
558 |
|
edm::Handle<std::vector< reco::Track > > h_Tracks; |
559 |
|
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
560 |
|
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
561 |
|
|
562 |
|
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
465 |
– |
MyRecoTrack MyrecoTrack; |
563 |
|
reco::Track recoTrack =TrackColl[t]; |
564 |
|
|
565 |
+ |
MyRecoTrack* MyrecoTrack = new MyRecoTrack; |
566 |
+ |
MyRecoTrackInfo* info = new MyRecoTrackInfo; |
567 |
+ |
info->Coll = TrajectoryProducers.size()+i; |
568 |
+ |
info->P = recoTrack.p(); |
569 |
+ |
info->Pt = recoTrack.pt(); |
570 |
+ |
info->chi2 = recoTrack.chi2(); |
571 |
+ |
MyrecoTrack->Info = info; |
572 |
+ |
|
573 |
+ |
|
574 |
|
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
575 |
|
TrackingRecHitRef h_it = recoTrack.recHit(h); |
576 |
|
if(!h_it->isValid() )continue; |
578 |
|
const GeomDet * theDet = tkGeom->idToDet(detId); |
579 |
|
LocalPoint localPos = h_it->localPosition(); |
580 |
|
|
581 |
< |
MyRecoHit hit; |
582 |
< |
hit.x = theDet->surface().toGlobal(localPos).x(); |
583 |
< |
hit.y = theDet->surface().toGlobal(localPos).y(); |
584 |
< |
hit.z = theDet->surface().toGlobal(localPos).z(); |
585 |
< |
hit.DetId = detId.rawId(); |
586 |
< |
hit.Charge = -1; |
587 |
< |
MyrecoTrack.Hits.push_back(hit); |
581 |
> |
MyRecoHit* hit = new MyRecoHit; |
582 |
> |
hit->x = theDet->surface().toGlobal(localPos).x(); |
583 |
> |
hit->y = theDet->surface().toGlobal(localPos).y(); |
584 |
> |
hit->z = theDet->surface().toGlobal(localPos).z(); |
585 |
> |
hit->DetId = detId.rawId(); |
586 |
> |
hit->Charge = -1; |
587 |
> |
MyrecoTrack->Hits.push_back(hit); |
588 |
|
} |
589 |
|
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
590 |
|
} |
591 |
|
} |
592 |
|
|
593 |
|
|
594 |
+ |
|
595 |
|
// ### ECALRecHits ### |
596 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
597 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
599 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
600 |
|
|
601 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
602 |
< |
MyCaloHit temp_EcalHit; |
603 |
< |
temp_EcalHit.E = Ecal_RecHits[eh].energy(); |
604 |
< |
temp_EcalHit.t = Ecal_RecHits[eh].time(); |
605 |
< |
temp_EcalHit.DetId = (Ecal_RecHits[eh].detid()).rawId(); |
602 |
> |
MyCaloHit* temp_EcalHit = new MyCaloHit; |
603 |
> |
temp_EcalHit->E = Ecal_RecHits[eh].energy(); |
604 |
> |
temp_EcalHit->t = Ecal_RecHits[eh].time(); |
605 |
> |
temp_EcalHit->DetId = (Ecal_RecHits[eh].detid()).rawId(); |
606 |
|
|
607 |
|
MyEvent->MyEcalCaloHitCollection.push_back(temp_EcalHit); |
608 |
|
} |
616 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
617 |
|
|
618 |
|
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
619 |
< |
MyCaloHit temp_HcalHBHEHit; |
620 |
< |
temp_HcalHBHEHit.E = HcalHBHE_RecHits[hh].energy(); |
621 |
< |
temp_HcalHBHEHit.t = HcalHBHE_RecHits[hh].time(); |
622 |
< |
temp_HcalHBHEHit.DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
619 |
> |
MyCaloHit* temp_HcalHBHEHit = new MyCaloHit; |
620 |
> |
temp_HcalHBHEHit->E = HcalHBHE_RecHits[hh].energy(); |
621 |
> |
temp_HcalHBHEHit->t = HcalHBHE_RecHits[hh].time(); |
622 |
> |
temp_HcalHBHEHit->DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
623 |
|
|
624 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHBHEHit); |
625 |
|
} |
632 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
633 |
|
|
634 |
|
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
635 |
< |
MyCaloHit temp_HcalHOHit; |
636 |
< |
temp_HcalHOHit.E = HcalHO_RecHits[hh].energy(); |
637 |
< |
temp_HcalHOHit.t = HcalHO_RecHits[hh].time(); |
638 |
< |
temp_HcalHOHit.DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
635 |
> |
MyCaloHit* temp_HcalHOHit = new MyCaloHit; |
636 |
> |
temp_HcalHOHit->E = HcalHO_RecHits[hh].energy(); |
637 |
> |
temp_HcalHOHit->t = HcalHO_RecHits[hh].time(); |
638 |
> |
temp_HcalHOHit->DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
639 |
|
|
640 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHOHit); |
641 |
|
} |
648 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
649 |
|
|
650 |
|
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
651 |
< |
MyCaloHit temp_HcalHFHit; |
652 |
< |
temp_HcalHFHit.E = HcalHF_RecHits[hh].energy(); |
653 |
< |
temp_HcalHFHit.t = HcalHF_RecHits[hh].time(); |
654 |
< |
temp_HcalHFHit.DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
651 |
> |
MyCaloHit* temp_HcalHFHit = new MyCaloHit; |
652 |
> |
temp_HcalHFHit->E = HcalHF_RecHits[hh].energy(); |
653 |
> |
temp_HcalHFHit->t = HcalHF_RecHits[hh].time(); |
654 |
> |
temp_HcalHFHit->DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
655 |
|
|
656 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHFHit); |
657 |
|
} |
667 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
668 |
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId); |
669 |
|
|
670 |
< |
MyMuonSegment temp_CscSeg; |
671 |
< |
temp_CscSeg.DetId = theDetUnitId.rawId(); |
672 |
< |
temp_CscSeg.PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
673 |
< |
temp_CscSeg.PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
674 |
< |
temp_CscSeg.PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
675 |
< |
temp_CscSeg.DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
676 |
< |
temp_CscSeg.DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
677 |
< |
temp_CscSeg.DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
670 |
> |
MyMuonSegment* temp_CscSeg = new MyMuonSegment; |
671 |
> |
temp_CscSeg->DetId = theDetUnitId.rawId(); |
672 |
> |
temp_CscSeg->PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
673 |
> |
temp_CscSeg->PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
674 |
> |
temp_CscSeg->PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
675 |
> |
temp_CscSeg->DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
676 |
> |
temp_CscSeg->DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
677 |
> |
temp_CscSeg->DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
678 |
|
|
679 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_CscSeg); |
680 |
|
} |
689 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
690 |
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId); |
691 |
|
|
692 |
< |
MyMuonSegment temp_DtSeg; |
693 |
< |
temp_DtSeg.DetId = theDetUnitId.rawId(); |
694 |
< |
temp_DtSeg.PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
695 |
< |
temp_DtSeg.PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
696 |
< |
temp_DtSeg.PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
697 |
< |
temp_DtSeg.DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
698 |
< |
temp_DtSeg.DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
699 |
< |
temp_DtSeg.DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
692 |
> |
MyMuonSegment* temp_DtSeg = new MyMuonSegment; |
693 |
> |
temp_DtSeg->DetId = theDetUnitId.rawId(); |
694 |
> |
temp_DtSeg->PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
695 |
> |
temp_DtSeg->PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
696 |
> |
temp_DtSeg->PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
697 |
> |
temp_DtSeg->DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
698 |
> |
temp_DtSeg->DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
699 |
> |
temp_DtSeg->DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
700 |
|
|
701 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_DtSeg); |
702 |
|
} |
712 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
713 |
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId); |
714 |
|
|
715 |
< |
MyMuonHit temp_RpcHit; |
716 |
< |
temp_RpcHit.DetId = theDetUnitId.rawId(); |
717 |
< |
temp_RpcHit.x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
718 |
< |
temp_RpcHit.y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
719 |
< |
temp_RpcHit.z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
715 |
> |
MyMuonHit* temp_RpcHit = new MyMuonHit; |
716 |
> |
temp_RpcHit->DetId = theDetUnitId.rawId(); |
717 |
> |
temp_RpcHit->x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
718 |
> |
temp_RpcHit->y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
719 |
> |
temp_RpcHit->z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
720 |
|
|
721 |
|
MyEvent->MyMuonHitCollection.push_back(temp_RpcHit); |
722 |
|
} |
723 |
|
} |
724 |
|
|
618 |
– |
printf("RPC Hits = %i\n",MyEvent->MyMuonHitCollection.size()); |
619 |
– |
|
725 |
|
MyEvents->Events.push_back(MyEvent); |
726 |
|
} |
727 |
|
|