49 |
|
#include "Geometry/Records/interface/IdealGeometryRecord.h" |
50 |
|
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" |
51 |
|
#include "Geometry/CaloGeometry/interface/CaloGeometry.h" |
52 |
< |
#include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h" |
53 |
< |
#include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h" |
52 |
> |
//#include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h" |
53 |
> |
//#include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h" |
54 |
> |
#include "Geometry/Records/interface/CaloGeometryRecord.h" |
55 |
> |
#include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h" |
56 |
> |
#include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h" |
57 |
|
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" |
58 |
|
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h" |
59 |
|
|
63 |
|
#include "Geometry/CSCGeometry/interface/CSCGeometry.h" |
64 |
|
#include "Geometry/RPCGeometry/interface/RPCGeometry.h" |
65 |
|
|
66 |
+ |
#include "DataFormats/Common/interface/DetSetVector.h" |
67 |
+ |
#include "DataFormats/Common/interface/DetSetVectorNew.h" |
68 |
+ |
|
69 |
+ |
#include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h" |
70 |
|
|
71 |
|
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h" |
72 |
|
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" |
89 |
|
#include "TrackingTools/PatternTools/interface/Trajectory.h" |
90 |
|
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" |
91 |
|
|
92 |
+ |
#include "DataFormats/HepMCCandidate/interface/GenParticle.h" |
93 |
+ |
|
94 |
|
|
95 |
|
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" |
96 |
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" |
121 |
|
#include "DataFormats/EcalDetId/interface/ESDetId.h" |
122 |
|
#include "DataFormats/HcalDetId/interface/HcalDetId.h" |
123 |
|
|
124 |
+ |
#include "DataFormats/VertexReco/interface/NuclearInteraction.h" |
125 |
+ |
|
126 |
+ |
#include "DataFormats/JetReco/interface/Jet.h" |
127 |
+ |
#include "DataFormats/JetReco/interface/BasicJetCollection.h" |
128 |
+ |
#include "DataFormats/JetReco/interface/GenJetCollection.h" |
129 |
+ |
#include "DataFormats/JetReco/interface/CaloJetCollection.h" |
130 |
+ |
#include "DataFormats/JetReco/interface/PFJetCollection.h" |
131 |
+ |
|
132 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId.h" |
133 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h" |
134 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp" |
142 |
|
|
143 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h" |
144 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp" |
145 |
+ |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h" |
146 |
+ |
|
147 |
+ |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.h" |
148 |
+ |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.cpp" |
149 |
+ |
|
150 |
|
|
151 |
|
|
152 |
|
using namespace edm; |
153 |
|
using namespace std; |
154 |
+ |
using namespace reco; |
155 |
|
|
156 |
|
// |
157 |
|
// class decleration |
172 |
|
|
173 |
|
std::string OutputFile; |
174 |
|
|
175 |
+ |
InputTag GenParticles; |
176 |
+ |
|
177 |
|
std::vector<InputTag> SimTrackProducers; |
178 |
|
std::vector<InputTag> SimVertexProducers; |
179 |
|
std::vector<InputTag> SimHitProducers; |
180 |
+ |
std::vector<InputTag> SimCaloHitProducers; |
181 |
+ |
|
182 |
+ |
std::vector<InputTag> NIProducers; |
183 |
|
|
184 |
|
std::vector<InputTag> TrackProducers; |
185 |
|
std::vector<InputTag> TrajectoryProducers; |
186 |
+ |
std::vector<InputTag> SiStripClusterProducers; |
187 |
|
std::vector<InputTag> EcalRecHitProducers; |
188 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
189 |
|
std::vector<InputTag> HcalHORecHitProducers; |
193 |
|
|
194 |
|
std::vector<InputTag> RPCHitsProducers; |
195 |
|
|
196 |
+ |
std::vector<InputTag> CaloTowersProducers; |
197 |
+ |
bool CaloTowersProducersBasedOnCaloHits; |
198 |
+ |
|
199 |
+ |
std::vector<InputTag> BasicJetsProducers; |
200 |
+ |
std::vector<InputTag> CaloJetsProducers; |
201 |
+ |
bool CaloJetsProducersBasedOnCaloTowers; |
202 |
+ |
|
203 |
+ |
std::vector<InputTag> RecoCandidateProducers; |
204 |
+ |
|
205 |
+ |
|
206 |
|
// ----------member data --------------------------- |
207 |
|
|
208 |
|
bool ProduceGeom; |
220 |
|
{ |
221 |
|
OutputFile = iConfig.getParameter<std::string >("OutputFile"); |
222 |
|
|
223 |
+ |
GenParticles = iConfig.getParameter<InputTag>("GenParticles"); |
224 |
+ |
|
225 |
|
SimTrackProducers = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers"); |
226 |
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers"); |
227 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
228 |
+ |
SimCaloHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimCaloHitProducers"); |
229 |
+ |
|
230 |
|
|
231 |
|
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
232 |
|
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
233 |
+ |
SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers"); |
234 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
235 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
236 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
237 |
|
HcalHFRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHFRecHitProducers"); |
238 |
|
|
239 |
+ |
NIProducers = iConfig.getParameter<std::vector<InputTag> >("NIProducers"); |
240 |
+ |
|
241 |
|
DTSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("DTSegmentProducers"); |
242 |
|
CSCSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("CSCSegmentProducers"); |
243 |
|
|
244 |
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers"); |
245 |
|
|
246 |
+ |
CaloTowersProducers = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers"); |
247 |
+ |
CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits"); |
248 |
+ |
|
249 |
+ |
|
250 |
+ |
BasicJetsProducers = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers"); |
251 |
+ |
CaloJetsProducers = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers"); |
252 |
+ |
CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers"); |
253 |
+ |
|
254 |
+ |
RecoCandidateProducers = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers"); |
255 |
+ |
|
256 |
|
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" ); |
257 |
|
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" ); |
258 |
|
|
282 |
|
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
283 |
|
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
284 |
|
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
285 |
+ |
FROG_Element_Base_With_DetId* calo = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_CALO); geom->addDaughter(calo); |
286 |
+ |
|
287 |
|
|
288 |
|
|
289 |
|
// ### TRACKER GEOMETRY ### |
599 |
|
// ### CALO GEOMETRY ### |
600 |
|
|
601 |
|
edm::ESHandle<CaloGeometry> CaloGeom; |
602 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
602 |
> |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
603 |
|
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
604 |
|
|
605 |
|
for(unsigned int i=0;i<CaloDets.size();i++) |
607 |
|
Detid = CaloDets[i]; |
608 |
|
SubDet = Detid.subdetId(); |
609 |
|
|
610 |
< |
if(Detid.det()==DetId::Ecal){ |
611 |
< |
if(SubDet<1 || SubDet>3) continue; |
554 |
< |
|
555 |
< |
Frog_DetId = DETID_ECAL; |
556 |
< |
FEB = ecal; |
557 |
< |
|
558 |
< |
Frog_DetId += SubDet*100000; |
559 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
560 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
561 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
562 |
< |
|
563 |
< |
if(SubDet==1){ |
564 |
< |
EBDetId detid = EBDetId(Detid); |
565 |
< |
|
566 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
567 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
568 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
569 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
570 |
< |
|
571 |
< |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
572 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
573 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
574 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
610 |
> |
if(Detid.det()==DetId::Ecal){ |
611 |
> |
if(SubDet<1 || SubDet>3) continue; |
612 |
|
|
613 |
< |
Frog_DetId += detid.tower_iphi()*1; |
614 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
578 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
579 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
580 |
< |
}else if(SubDet==2){ |
581 |
< |
EEDetId detid = EEDetId(Detid); |
613 |
> |
Frog_DetId = DETID_ECAL; |
614 |
> |
FEB = ecal; |
615 |
|
|
616 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
617 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
618 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
619 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
620 |
< |
|
621 |
< |
Frog_DetId += detid.iquadrant()*1000; |
622 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
623 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
624 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
625 |
< |
|
626 |
< |
Frog_DetId += detid.isc(); |
627 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
628 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
629 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
630 |
< |
}else if(SubDet==3){ |
631 |
< |
ESDetId detid = ESDetId(Detid); |
616 |
> |
Frog_DetId += SubDet*100000; |
617 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
618 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
619 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
620 |
> |
|
621 |
> |
if(SubDet==1){ |
622 |
> |
EBDetId detid = EBDetId(Detid); |
623 |
> |
|
624 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
625 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
626 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
627 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
628 |
> |
|
629 |
> |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
630 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
631 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
632 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
633 |
> |
|
634 |
> |
Frog_DetId += detid.tower_iphi()*1; |
635 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
636 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
637 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
638 |
> |
}else if(SubDet==2){ |
639 |
> |
EEDetId detid = EEDetId(Detid); |
640 |
> |
|
641 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
642 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
643 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
644 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
645 |
> |
|
646 |
> |
Frog_DetId += detid.iquadrant()*1000; |
647 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
648 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
649 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
650 |
> |
|
651 |
> |
Frog_DetId += detid.isc(); |
652 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
653 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
654 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
655 |
> |
}else if(SubDet==3){ |
656 |
> |
ESDetId detid = ESDetId(Detid); |
657 |
|
|
658 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
659 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
660 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
661 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
662 |
< |
|
663 |
< |
Frog_DetId += detid.plane()*1000; |
664 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
665 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
666 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
667 |
< |
|
668 |
< |
Frog_DetId += detid.six()*50; |
669 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
670 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
671 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
672 |
< |
|
673 |
< |
Frog_DetId += detid.siy(); |
674 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
675 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
676 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
677 |
< |
} |
678 |
< |
}else if(Detid.det()==DetId::Hcal){ |
679 |
< |
if(SubDet<1 || SubDet>4) continue; |
680 |
< |
|
681 |
< |
Frog_DetId = DETID_HCAL; |
682 |
< |
FEB = hcal; |
683 |
< |
|
684 |
< |
Frog_DetId += SubDet*100000; |
685 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
686 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
687 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
688 |
< |
|
689 |
< |
if(true){ |
690 |
< |
HcalDetId detid = HcalDetId(Detid); |
691 |
< |
|
692 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
693 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
694 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
695 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
658 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
659 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
660 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
661 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
662 |
> |
|
663 |
> |
Frog_DetId += detid.plane()*1000; |
664 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
665 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
666 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
667 |
> |
|
668 |
> |
Frog_DetId += detid.six()*50; |
669 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
670 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
671 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
672 |
> |
|
673 |
> |
Frog_DetId += detid.siy(); |
674 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
675 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
676 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
677 |
> |
} |
678 |
> |
}else if(Detid.det()==DetId::Hcal){ |
679 |
> |
if(SubDet<1 || SubDet>4) continue; |
680 |
> |
|
681 |
> |
Frog_DetId = DETID_HCAL; |
682 |
> |
FEB = hcal; |
683 |
> |
|
684 |
> |
Frog_DetId += SubDet*100000; |
685 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
686 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
687 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
688 |
> |
|
689 |
> |
HcalDetId detid = HcalDetId(Detid); |
690 |
> |
|
691 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
692 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
693 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
694 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
695 |
> |
|
696 |
> |
Frog_DetId += detid.ietaAbs()*100; |
697 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
698 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
699 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
700 |
> |
|
701 |
> |
Frog_DetId += detid.iphi()*1; |
702 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
703 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
704 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
705 |
|
|
706 |
< |
Frog_DetId += detid.ietaAbs()*100; |
640 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
641 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
642 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
706 |
> |
}else if(Detid.det() == DetId::Calo){ |
707 |
|
|
708 |
< |
Frog_DetId += detid.iphi()*1; |
709 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
646 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
647 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
648 |
< |
} |
708 |
> |
Frog_DetId = DETID_CALO; |
709 |
> |
FEB = calo; |
710 |
|
|
711 |
< |
}else if(Detid.det() == DetId::Calo){ |
651 |
< |
continue; |
652 |
< |
/* |
653 |
< |
Frog_DetId = DETID_CALO + 1000000; |
654 |
< |
FEB = hcal; |
711 |
> |
if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue; |
712 |
|
|
713 |
< |
Frog_DetId += SubDet*100000; |
714 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
715 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
716 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
717 |
< |
*/ |
718 |
< |
} |
713 |
> |
Frog_DetId += SubDet*100000; |
714 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
715 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
716 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
717 |
> |
|
718 |
> |
if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){ |
719 |
> |
CaloTowerDetId detid = CaloTowerDetId(Detid); |
720 |
> |
|
721 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
722 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
723 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
724 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
725 |
> |
|
726 |
> |
Frog_DetId += (detid.ieta()*detid.zside())*100; |
727 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
728 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
729 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
730 |
> |
|
731 |
> |
Frog_DetId += detid.iphi()*1; |
732 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
733 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
734 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
735 |
> |
} |
736 |
> |
} |
737 |
|
|
738 |
< |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
739 |
< |
GlobalPoint CellPos = CellGeom->getPosition(); |
740 |
< |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
741 |
< |
|
742 |
< |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
743 |
< |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
744 |
< |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
745 |
< |
|
746 |
< |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
747 |
< |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
748 |
< |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
749 |
< |
|
750 |
< |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
751 |
< |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
752 |
< |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
753 |
< |
|
754 |
< |
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) ); |
755 |
< |
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) ); |
756 |
< |
|
757 |
< |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
758 |
< |
Detid.rawId(), F, |
759 |
< |
cX , cY , cZ , |
760 |
< |
wX , wY , wZ , |
761 |
< |
hX , hY , hZ ); |
738 |
> |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
739 |
> |
GlobalPoint CellPos = CellGeom->getPosition(); |
740 |
> |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
741 |
> |
|
742 |
> |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
743 |
> |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
744 |
> |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
745 |
> |
|
746 |
> |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
747 |
> |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
748 |
> |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
749 |
> |
|
750 |
> |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
751 |
> |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
752 |
> |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
753 |
> |
|
754 |
> |
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) ); |
755 |
> |
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) ); |
756 |
> |
|
757 |
> |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
758 |
> |
Detid.rawId(), F, |
759 |
> |
cX , cY , cZ , |
760 |
> |
wX , wY , wZ , |
761 |
> |
hX , hY , hZ ); |
762 |
|
|
763 |
< |
FEB->addDaughter(mod); |
763 |
> |
FEB->addDaughter(mod); |
764 |
|
} |
765 |
|
|
766 |
|
// ### Save .geom ### |
808 |
|
} |
809 |
|
|
810 |
|
|
811 |
< |
FROG_Element_Event* event = new FROG_Element_Event(); |
811 |
> |
FROG_Element_Event* event = new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() ); |
812 |
|
events_prim->addDaughter(event); |
813 |
|
|
814 |
|
// access the tracker |
824 |
|
edm::ESHandle<RPCGeometry> RpcGeom; |
825 |
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
826 |
|
|
827 |
+ |
edm::ESHandle<CaloGeometry> CaloGeom; |
828 |
+ |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
829 |
+ |
|
830 |
+ |
|
831 |
+ |
|
832 |
+ |
|
833 |
+ |
// ### GENPARTICLES ### |
834 |
+ |
FROG_Element_Base_With_DetId* frogGen = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_GEN); |
835 |
+ |
event->addDaughter(frogGen); |
836 |
+ |
|
837 |
+ |
edm::Handle<GenParticleCollection> h_gen_Particles; |
838 |
+ |
iEvent.getByLabel(GenParticles, h_gen_Particles); |
839 |
+ |
GenParticleCollection gen_Particles = *h_gen_Particles.product(); |
840 |
+ |
|
841 |
+ |
FROG_Element_Base_With_DetId* frogGenPartColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_GEN_CAND); |
842 |
+ |
frogGen->addDaughter(frogGenPartColl); |
843 |
+ |
|
844 |
+ |
for(unsigned int h=0;h<gen_Particles.size();h++){ |
845 |
+ |
if(gen_Particles[h].status()!=1)continue; |
846 |
+ |
FROG_Element_Event_Candidate* frogGenPart = new FROG_Element_Event_Candidate(gen_Particles[h].pdgId(), gen_Particles[h].p(), gen_Particles[h].eta(), gen_Particles[h].phi()); |
847 |
+ |
frogGenPartColl->addDaughter(frogGenPart); |
848 |
+ |
} |
849 |
+ |
|
850 |
+ |
|
851 |
+ |
|
852 |
|
// ### SIMTRACK ### |
853 |
+ |
FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK); |
854 |
+ |
event->addDaughter(frogSimTrkColl); |
855 |
+ |
|
856 |
|
for(unsigned int i=0;i<SimTrackProducers.size();i++){ |
857 |
|
edm::Handle<std::vector< SimTrack > > h_SimTracks; |
858 |
|
iEvent.getByLabel(SimTrackProducers[i], h_SimTracks); |
859 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
860 |
|
|
758 |
– |
FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK + i); |
759 |
– |
event->addDaughter(frogSimTrkColl); |
760 |
– |
|
861 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
862 |
|
SimTrack simTrack =SimTrackColl[a]; |
863 |
|
|
870 |
|
} |
871 |
|
|
872 |
|
// ### SIMVERTEX ### |
873 |
+ |
FROG_Element_Base_With_DetId* frogSimVtx = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX); |
874 |
+ |
event->addDaughter(frogSimVtx); |
875 |
+ |
|
876 |
|
for(unsigned int i=0;i<SimVertexProducers.size();i++){ |
877 |
|
edm::Handle<std::vector< SimVertex > > h_Vertex; |
878 |
|
iEvent.getByLabel(SimVertexProducers[i], h_Vertex); |
879 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
880 |
|
|
778 |
– |
FROG_Element_Base_With_DetId* frogSimVtxColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX + i); |
779 |
– |
event->addDaughter(frogSimVtxColl); |
780 |
– |
|
881 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
882 |
|
SimVertex Vertex = VertexColl[b]; |
883 |
|
|
884 |
< |
FROG_Element_Event_Sim_Vertex* frogSimVtx = new FROG_Element_Event_Sim_Vertex( |
884 |
> |
FROG_Element_Event_Sim_Vertex* frogSimVertex = new FROG_Element_Event_Sim_Vertex( |
885 |
|
Vertex.position().x(), Vertex.position().y(), Vertex.position().z(), |
886 |
|
Vertex.parentIndex()); |
887 |
|
|
888 |
< |
frogSimVtxColl->addDaughter(frogSimVtx); |
888 |
> |
frogSimVtx->addDaughter(frogSimVertex); |
889 |
|
} |
890 |
|
} |
891 |
|
|
892 |
|
|
893 |
|
// ### SIMHIT ### |
894 |
|
|
895 |
+ |
FROG_Element_Base_With_DetId* frogSimHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT); |
896 |
+ |
event->addDaughter(frogSimHit); |
897 |
|
for(unsigned int i=0;i<SimHitProducers.size();i++){ |
898 |
|
edm::Handle<std::vector< PSimHit > > h_Hits; |
899 |
|
iEvent.getByLabel(SimHitProducers[i], h_Hits); |
900 |
|
std::vector< PSimHit > Hits = *h_Hits.product(); |
901 |
|
|
902 |
< |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i); |
903 |
< |
event->addDaughter(frogSimHitColl); |
902 |
> |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i + 1); |
903 |
> |
frogSimHit->addDaughter(frogSimHitColl); |
904 |
|
|
905 |
|
for(unsigned int h=0; h<Hits.size(); h++) |
906 |
|
{ |
907 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
908 |
< |
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
908 |
> |
const GeomDet* theDet = NULL; |
909 |
> |
if(theDetUnitId.det() == DetId::Tracker)theDet = tkGeom->idToDet(theDetUnitId); |
910 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::DT) theDet = DtGeom->idToDet(theDetUnitId); |
911 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::CSC)theDet = CscGeom->idToDet(theDetUnitId); |
912 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::RPC)theDet = RpcGeom->idToDet(theDetUnitId); |
913 |
|
|
914 |
|
|
915 |
|
FROG_Element_Event_Sim_Hit* frogSimHit = new FROG_Element_Event_Sim_Hit( |
919 |
|
} |
920 |
|
} |
921 |
|
|
922 |
+ |
// ### SIMCALOHIT ### |
923 |
+ |
|
924 |
+ |
for(unsigned int i=0;i<SimCaloHitProducers.size();i++){ |
925 |
+ |
edm::Handle<std::vector< PCaloHit > > h_CaloHits; |
926 |
+ |
iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits); |
927 |
+ |
std::vector< PCaloHit > CaloHits = *h_CaloHits.product(); |
928 |
+ |
|
929 |
+ |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + SimHitProducers.size() + i + 1); |
930 |
+ |
frogSimHit->addDaughter(frogSimHitColl); |
931 |
+ |
|
932 |
+ |
for(unsigned int h=0; h<CaloHits.size(); h++) |
933 |
+ |
{ |
934 |
+ |
DetId theDetUnitId(CaloHits[h].id()); |
935 |
+ |
const CaloCellGeometry* CellGeom = NULL; |
936 |
+ |
if(theDetUnitId.det() == DetId::Ecal || theDetUnitId.det() == DetId::Hcal)CellGeom = CaloGeom->getGeometry(theDetUnitId); |
937 |
+ |
if(CellGeom==NULL)continue; |
938 |
+ |
|
939 |
+ |
|
940 |
+ |
FROG_Element_Event_Sim_Hit* frogSimCaloHit = new FROG_Element_Event_Sim_Hit( |
941 |
+ |
CellGeom->getPosition().x(),CellGeom->getPosition().y(),CellGeom->getPosition().z(), |
942 |
+ |
CaloHits[h].energy(), CaloHits[h].depth() ); |
943 |
+ |
frogSimHitColl->addDaughter(frogSimCaloHit); |
944 |
+ |
} |
945 |
+ |
} |
946 |
+ |
|
947 |
+ |
// NUCLEAR INTERACTIONS |
948 |
+ |
for(unsigned int i=0;i<NIProducers.size();i++) { |
949 |
+ |
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs; |
950 |
+ |
iEvent.getByLabel(NIProducers[i], h_NIs); |
951 |
+ |
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product(); |
952 |
+ |
FROG_Element_Base_With_DetId* frogNIColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_NUCLINT + i); |
953 |
+ |
event->addDaughter(frogNIColl); |
954 |
+ |
|
955 |
+ |
for(unsigned int h=0; h<NIs.size();h++){ |
956 |
+ |
reco::NuclearInteraction ni = NIs[i]; |
957 |
+ |
float vtx_x = ni.vertex().x(); |
958 |
+ |
float vtx_y = ni.vertex().y(); |
959 |
+ |
float vtx_z = ni.vertex().z(); |
960 |
+ |
float like = ni.likelihood(); |
961 |
+ |
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like ); |
962 |
+ |
frogNIColl->addDaughter(frogNI); |
963 |
+ |
} |
964 |
+ |
} |
965 |
+ |
|
966 |
|
|
967 |
|
|
968 |
|
// ### TRAJECTORY ### |
969 |
+ |
FROG_Element_Base_With_DetId* frogTrk = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK); |
970 |
+ |
event->addDaughter(frogTrk); |
971 |
+ |
|
972 |
|
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
973 |
|
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
974 |
|
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
975 |
|
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
976 |
|
|
977 |
< |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i); |
978 |
< |
event->addDaughter(frogTrkColl); |
977 |
> |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i + 1); |
978 |
> |
frogTrk->addDaughter(frogTrkColl); |
979 |
|
|
980 |
|
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
981 |
|
Trajectory recoTraj = *it->key; |
1003 |
|
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
1004 |
|
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
1005 |
|
|
1006 |
< |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size()+i); |
1007 |
< |
event->addDaughter(frogTrkColl); |
1006 |
> |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size() + i + 1); |
1007 |
> |
frogTrk->addDaughter(frogTrkColl); |
1008 |
|
|
1009 |
|
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
1010 |
|
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
1038 |
|
} |
1039 |
|
|
1040 |
|
|
1041 |
+ |
// ### SiStrip Clusters ### |
1042 |
+ |
FROG_Element_Base_With_DetId* frogSSTHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SISTRIPHIT); |
1043 |
+ |
event->addDaughter(frogSSTHit); |
1044 |
+ |
for(unsigned int i=0;i<SiStripClusterProducers.size();i++){ |
1045 |
+ |
edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits; |
1046 |
+ |
iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits); |
1047 |
+ |
const edmNew::DetSetVector<SiStripCluster>& Sst_Hits = *h_Sst_Hits.product(); |
1048 |
+ |
|
1049 |
+ |
|
1050 |
+ |
FROG_Element_Base_With_DetId* frogSstHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SISTRIPHIT + i + 1); |
1051 |
+ |
frogSSTHit->addDaughter(frogSstHitColl); |
1052 |
+ |
|
1053 |
+ |
for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) { |
1054 |
+ |
edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin(); |
1055 |
+ |
edmNew::DetSet<SiStripCluster>::const_iterator end =DSViter->end(); |
1056 |
+ |
for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){ |
1057 |
+ |
|
1058 |
+ |
const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) ); |
1059 |
+ |
if(!detUnit)continue; |
1060 |
+ |
|
1061 |
+ |
const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit ); |
1062 |
+ |
if(!DetUnit)continue; |
1063 |
+ |
|
1064 |
+ |
const StripTopology& Topo = DetUnit->specificTopology(); |
1065 |
+ |
|
1066 |
+ |
unsigned int Charge = 0; |
1067 |
+ |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];} |
1068 |
+ |
|
1069 |
+ |
unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2; |
1070 |
+ |
|
1071 |
+ |
float XPos = (( MiddleStrip * DetUnit->surface().bounds().width() ) / Topo.nstrips() ) - DetUnit->surface().bounds().width()/2; |
1072 |
+ |
float YPos = DetUnit->surface().bounds().thickness()/2; |
1073 |
+ |
float ZPos = DetUnit->surface().bounds().length()/2; |
1074 |
+ |
|
1075 |
+ |
Surface::GlobalPoint Pos = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) ); |
1076 |
+ |
|
1077 |
+ |
|
1078 |
+ |
FROG_Element_Event_Hit_SiStrip* frogStripHit = new FROG_Element_Event_Hit_SiStrip(iCluster->geographicalId(), Pos.x(),Pos.y(),Pos.z(), Charge); |
1079 |
+ |
frogSstHitColl->addDaughter(frogStripHit); |
1080 |
+ |
}} |
1081 |
+ |
|
1082 |
+ |
} |
1083 |
+ |
|
1084 |
+ |
|
1085 |
+ |
|
1086 |
+ |
// ### CALORecHits ### |
1087 |
+ |
FROG_Element_Base_With_DetId* frogCaloHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_CALOHIT); |
1088 |
+ |
event->addDaughter(frogCaloHit); |
1089 |
+ |
|
1090 |
|
|
1091 |
|
// ### ECALRecHits ### |
1092 |
+ |
FROG_Element_Base_With_DetId* frogEcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT); |
1093 |
+ |
frogCaloHit->addDaughter(frogEcalHit); |
1094 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
1095 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
1096 |
|
iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits); |
1097 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
1098 |
|
|
1099 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i); |
1100 |
< |
event->addDaughter(frogHitColl); |
1099 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i + 1); |
1100 |
> |
frogEcalHit->addDaughter(frogHitColl); |
1101 |
|
|
1102 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
1103 |
|
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(), |
1108 |
|
|
1109 |
|
|
1110 |
|
// ### HCALRecHits ### |
1111 |
+ |
FROG_Element_Base_With_DetId* frogHcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT); |
1112 |
+ |
frogCaloHit->addDaughter(frogHcalHit); |
1113 |
|
for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){ |
1114 |
|
edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits; |
1115 |
|
iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits); |
1116 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
1117 |
|
|
1118 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i); |
1119 |
< |
event->addDaughter(frogHitColl); |
1118 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i + 1); |
1119 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1120 |
|
|
1121 |
|
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
1122 |
|
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(), |
1130 |
|
iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits); |
1131 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
1132 |
|
|
1133 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i); |
1134 |
< |
event->addDaughter(frogHitColl); |
1133 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i + 1); |
1134 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1135 |
|
|
1136 |
|
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
1137 |
|
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHO_RecHits[hh].detid()).rawId(), |
1145 |
|
iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits); |
1146 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
1147 |
|
|
1148 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i); |
1149 |
< |
event->addDaughter(frogHitColl); |
1148 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i + 1); |
1149 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1150 |
|
|
1151 |
|
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
1152 |
|
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHF_RecHits[hh].detid()).rawId(), |
1155 |
|
} |
1156 |
|
} |
1157 |
|
|
1158 |
+ |
|
1159 |
|
// ### Muon Segments ### |
1160 |
+ |
FROG_Element_Base_With_DetId* frogMuonSeg = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG); |
1161 |
+ |
event->addDaughter(frogMuonSeg); |
1162 |
+ |
|
1163 |
|
for(unsigned int i=0;i<CSCSegmentProducers.size();i++){ |
1164 |
|
edm::Handle<CSCSegmentCollection > h_CSC_Segments; |
1165 |
|
iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments); |
1166 |
|
CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product(); |
1167 |
|
|
1168 |
< |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i); |
1169 |
< |
event->addDaughter(frogSegColl); |
1168 |
> |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i + 1); |
1169 |
> |
frogMuonSeg->addDaughter(frogSegColl); |
1170 |
|
|
1171 |
|
for(unsigned int s=0;s<CSC_Segments.size();s++){ |
1172 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
1184 |
|
iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments); |
1185 |
|
DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product(); |
1186 |
|
|
1187 |
< |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i); |
1188 |
< |
event->addDaughter(frogSegColl); |
1187 |
> |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i + 1); |
1188 |
> |
frogMuonSeg->addDaughter(frogSegColl); |
1189 |
|
|
1190 |
|
for(unsigned int s=0;s<DT_Segments.size();s++){ |
1191 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
1199 |
|
} |
1200 |
|
|
1201 |
|
// ### Muon Hits ### |
1202 |
+ |
FROG_Element_Base_With_DetId* frogMuonHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT); |
1203 |
+ |
event->addDaughter(frogMuonHit); |
1204 |
|
for(unsigned int i=0;i<RPCHitsProducers.size();i++){ |
1205 |
|
edm::Handle<RPCRecHitCollection > h_RPC_Hits; |
1206 |
|
iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits); |
1207 |
|
RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product(); |
1208 |
|
|
1209 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i); |
1210 |
< |
event->addDaughter(frogHitColl); |
1209 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i + 1); |
1210 |
> |
frogMuonHit->addDaughter(frogHitColl); |
1211 |
|
|
1212 |
|
for(unsigned int h=0;h<RPC_Hits.size();h++){ |
1213 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
1219 |
|
} |
1220 |
|
} |
1221 |
|
|
1222 |
+ |
|
1223 |
+ |
// ### Calo Towers ### |
1224 |
+ |
FROG_Element_Base_With_DetId* frogCaloTower = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_CALOTOWER); |
1225 |
+ |
event->addDaughter(frogCaloTower); |
1226 |
+ |
for(unsigned int i=0;i<CaloTowersProducers.size();i++){ |
1227 |
+ |
edm::Handle<CaloTowerCollection> h_Calo_Towers; |
1228 |
+ |
iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers); |
1229 |
+ |
CaloTowerCollection Calo_Towers = *h_Calo_Towers.product(); |
1230 |
+ |
|
1231 |
+ |
FROG_Element_Base_With_DetId* frogCaloTowerColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_CALOTOWER + i + 1); |
1232 |
+ |
frogCaloTower->addDaughter(frogCaloTowerColl); |
1233 |
+ |
|
1234 |
+ |
for(unsigned int h=0;h<Calo_Towers.size();h++){ |
1235 |
+ |
FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy()); |
1236 |
+ |
frogCaloTowerColl->addDaughter(frogTower); |
1237 |
+ |
|
1238 |
+ |
if(i==0 && CaloTowersProducersBasedOnCaloHits){ |
1239 |
+ |
frogTower->Components_CollEvtId_ = EVTID_CALOHIT; |
1240 |
+ |
std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents(); |
1241 |
+ |
for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);} |
1242 |
+ |
} |
1243 |
+ |
|
1244 |
+ |
} |
1245 |
+ |
} |
1246 |
+ |
|
1247 |
+ |
FROG_Element_Base_With_DetId* frogJet = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_JET); |
1248 |
+ |
event->addDaughter(frogJet); |
1249 |
+ |
|
1250 |
+ |
|
1251 |
+ |
// ### Basic Jets ### |
1252 |
+ |
FROG_Element_Base_With_DetId* frogBasicJet = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_JET_BASIC); |
1253 |
+ |
frogJet->addDaughter(frogBasicJet); |
1254 |
+ |
for(unsigned int i=0;i<BasicJetsProducers.size();i++){ |
1255 |
+ |
edm::Handle<BasicJetCollection> h_Basic_Jets; |
1256 |
+ |
iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets); |
1257 |
+ |
BasicJetCollection Basic_Jets = *h_Basic_Jets.product(); |
1258 |
+ |
|
1259 |
+ |
FROG_Element_Base_With_DetId* frogBasicJetColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_JET_BASIC + i + 1); |
1260 |
+ |
frogBasicJet->addDaughter(frogBasicJetColl); |
1261 |
+ |
|
1262 |
+ |
for(unsigned int h=0;h<Basic_Jets.size();h++){ |
1263 |
+ |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi()); |
1264 |
+ |
frogBasicJet->addDaughter(frogJet); |
1265 |
+ |
} |
1266 |
+ |
} |
1267 |
+ |
|
1268 |
+ |
|
1269 |
+ |
// ### Calo Jets ### |
1270 |
+ |
FROG_Element_Base_With_DetId* frogCaloJet = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_JET_CALO); |
1271 |
+ |
frogJet->addDaughter(frogCaloJet); |
1272 |
+ |
for(unsigned int i=0;i<CaloJetsProducers.size();i++){ |
1273 |
+ |
edm::Handle<CaloJetCollection> h_Calo_Jets; |
1274 |
+ |
iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets); |
1275 |
+ |
CaloJetCollection Calo_Jets = *h_Calo_Jets.product(); |
1276 |
+ |
|
1277 |
+ |
FROG_Element_Base_With_DetId* frogCaloJetColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_JET_CALO + i + 1); |
1278 |
+ |
frogCaloJet->addDaughter(frogCaloJetColl); |
1279 |
+ |
|
1280 |
+ |
for(unsigned int h=0;h<Calo_Jets.size();h++){ |
1281 |
+ |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi()); |
1282 |
+ |
frogCaloJetColl->addDaughter(frogJet); |
1283 |
+ |
|
1284 |
+ |
if(CaloJetsProducersBasedOnCaloTowers){ |
1285 |
+ |
std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents(); |
1286 |
+ |
frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1; |
1287 |
+ |
for(unsigned int t=0;t<CaloTowers.size();t++){ frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());} |
1288 |
+ |
} |
1289 |
+ |
} |
1290 |
+ |
} |
1291 |
+ |
|
1292 |
+ |
// ### RecoCandidates ### |
1293 |
+ |
FROG_Element_Base_With_DetId* frogRecoCand = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_RECOCAND); |
1294 |
+ |
event->addDaughter(frogRecoCand); |
1295 |
+ |
for(unsigned int i=0;i<RecoCandidateProducers.size();i++){ |
1296 |
+ |
edm::Handle<CandidateCollection> h_reco_Candidates; |
1297 |
+ |
iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates); |
1298 |
+ |
CandidateCollection reco_Candidates = *h_reco_Candidates.product(); |
1299 |
+ |
|
1300 |
+ |
FROG_Element_Base_With_DetId* frogRecoCandColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_RECOCAND + i + 1); |
1301 |
+ |
frogRecoCand->addDaughter(frogRecoCandColl); |
1302 |
+ |
|
1303 |
+ |
for(unsigned int h=0;h<reco_Candidates.size();h++){ |
1304 |
+ |
FROG_Element_Event_Candidate* frogCandidate = new FROG_Element_Event_Candidate(reco_Candidates[h].pdgId(), reco_Candidates[h].p(), reco_Candidates[h].eta(),reco_Candidates[h].phi()); |
1305 |
+ |
frogRecoCandColl->addDaughter(frogCandidate); |
1306 |
+ |
} |
1307 |
+ |
} |
1308 |
+ |
|
1309 |
+ |
|
1310 |
+ |
|
1311 |
|
NEvents++; |
1312 |
|
if(NEvents == NEventsInVisFile){ |
1313 |
|
char OutputFileName[1024]; |