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" |
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" |
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; |
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"); |
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"); |
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 ### |
607 |
|
Detid = CaloDets[i]; |
608 |
|
SubDet = Detid.subdetId(); |
609 |
|
|
610 |
< |
if(Detid.det()==DetId::Ecal){ |
611 |
< |
if(SubDet<1 || SubDet>3) continue; |
569 |
< |
|
570 |
< |
Frog_DetId = DETID_ECAL; |
571 |
< |
FEB = ecal; |
572 |
< |
|
573 |
< |
Frog_DetId += SubDet*100000; |
574 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
575 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
576 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
577 |
< |
|
578 |
< |
if(SubDet==1){ |
579 |
< |
EBDetId detid = EBDetId(Detid); |
580 |
< |
|
581 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
582 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
583 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
584 |
< |
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_ieta()*detid.zside())*100; |
614 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
588 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
589 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
590 |
< |
|
591 |
< |
Frog_DetId += detid.tower_iphi()*1; |
592 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
593 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
594 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
595 |
< |
}else if(SubDet==2){ |
596 |
< |
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); |
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.zside()==1)+1)*10000; |
650 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
651 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
652 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
653 |
< |
|
654 |
< |
Frog_DetId += detid.ietaAbs()*100; |
655 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
656 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
657 |
< |
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); |
661 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
662 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
663 |
< |
} |
708 |
> |
Frog_DetId = DETID_CALO; |
709 |
> |
FEB = calo; |
710 |
|
|
711 |
< |
}else if(Detid.det() == DetId::Calo){ |
666 |
< |
continue; |
667 |
< |
/* |
668 |
< |
Frog_DetId = DETID_CALO + 1000000; |
669 |
< |
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 |
|
|
751 |
– |
printf("TimeStamp = %lld\n",iEvent.time().value()); |
811 |
|
FROG_Element_Event* event = new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() ); |
812 |
|
events_prim->addDaughter(event); |
813 |
|
|
825 |
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
826 |
|
|
827 |
|
edm::ESHandle<CaloGeometry> CaloGeom; |
828 |
< |
iSetup.get<CaloGeometryRecord>().get( 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); |
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 |
< |
event->addDaughter(frogEcalHit); |
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); |
1109 |
|
|
1110 |
|
// ### HCALRecHits ### |
1111 |
|
FROG_Element_Base_With_DetId* frogHcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT); |
1112 |
< |
event->addDaughter(frogHcalHit); |
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); |
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]; |