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 "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId.h" |
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 |
> |
#include "DataFormats/METReco/interface/CaloMET.h" |
132 |
> |
#include "DataFormats/METReco/interface/CaloMETFwd.h" |
133 |
> |
|
134 |
> |
//#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId_And_Name.h" |
135 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h" |
136 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp" |
137 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_Track.h" |
144 |
|
|
145 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h" |
146 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp" |
147 |
+ |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h" |
148 |
|
|
149 |
< |
#include "DataFormats/VertexReco/interface/NuclearInteraction.h" |
149 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.h" |
150 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.cpp" |
151 |
|
|
131 |
– |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h" |
152 |
|
|
153 |
|
|
154 |
|
using namespace edm; |
155 |
|
using namespace std; |
156 |
+ |
using namespace reco; |
157 |
|
|
158 |
|
// |
159 |
|
// class decleration |
174 |
|
|
175 |
|
std::string OutputFile; |
176 |
|
|
177 |
+ |
std::vector<InputTag> GenParticlesProducers; |
178 |
+ |
|
179 |
|
std::vector<InputTag> SimTrackProducers; |
180 |
|
std::vector<InputTag> SimVertexProducers; |
181 |
|
std::vector<InputTag> SimHitProducers; |
185 |
|
|
186 |
|
std::vector<InputTag> TrackProducers; |
187 |
|
std::vector<InputTag> TrajectoryProducers; |
188 |
+ |
std::vector<InputTag> SiStripClusterProducers; |
189 |
|
std::vector<InputTag> EcalRecHitProducers; |
190 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
191 |
|
std::vector<InputTag> HcalHORecHitProducers; |
195 |
|
|
196 |
|
std::vector<InputTag> RPCHitsProducers; |
197 |
|
|
198 |
+ |
std::vector<InputTag> CaloTowersProducers; |
199 |
+ |
bool CaloTowersProducersBasedOnCaloHits; |
200 |
+ |
|
201 |
+ |
std::vector<InputTag> BasicJetsProducers; |
202 |
+ |
std::vector<InputTag> CaloJetsProducers; |
203 |
+ |
bool CaloJetsProducersBasedOnCaloTowers; |
204 |
+ |
|
205 |
+ |
std::vector<InputTag> RecoCandidateProducers; |
206 |
+ |
std::vector<InputTag> CaloMETProducers; |
207 |
+ |
|
208 |
+ |
|
209 |
|
// ----------member data --------------------------- |
210 |
|
|
211 |
|
bool ProduceGeom; |
223 |
|
{ |
224 |
|
OutputFile = iConfig.getParameter<std::string >("OutputFile"); |
225 |
|
|
226 |
+ |
GenParticlesProducers = iConfig.getParameter<std::vector<InputTag> >("GenParticlesProducers"); |
227 |
+ |
|
228 |
|
SimTrackProducers = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers"); |
229 |
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers"); |
230 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
233 |
|
|
234 |
|
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
235 |
|
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
236 |
+ |
SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers"); |
237 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
238 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
239 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
246 |
|
|
247 |
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers"); |
248 |
|
|
249 |
+ |
CaloTowersProducers = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers"); |
250 |
+ |
CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits"); |
251 |
+ |
|
252 |
+ |
|
253 |
+ |
BasicJetsProducers = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers"); |
254 |
+ |
CaloJetsProducers = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers"); |
255 |
+ |
CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers"); |
256 |
+ |
|
257 |
+ |
RecoCandidateProducers = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers"); |
258 |
+ |
CaloMETProducers = iConfig.getParameter<std::vector<InputTag> >("CaloMETProducers"); |
259 |
+ |
|
260 |
|
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" ); |
261 |
|
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" ); |
262 |
|
|
278 |
|
|
279 |
|
unsigned int Frog_DetId; |
280 |
|
FROG_Element_Base* FEB = NULL; |
281 |
< |
FROG_Element_Base_With_DetId* FEB_Temp = NULL; |
281 |
> |
FROG_Element_Base_With_DetId_And_Name* FEB_Temp = NULL; |
282 |
|
|
283 |
|
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
284 |
< |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
285 |
< |
FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK); geom->addDaughter(tracker); |
286 |
< |
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
287 |
< |
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
288 |
< |
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
284 |
> |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
285 |
> |
FROG_Element_Base_With_DetId_And_Name* tracker = new FROG_Element_Base_With_DetId_And_Name( DETID_TRK , "Tracker"); geom->addDaughter(tracker); |
286 |
> |
FROG_Element_Base_With_DetId_And_Name* muon = new FROG_Element_Base_With_DetId_And_Name( DETID_MUON , "Muon"); geom->addDaughter(muon); |
287 |
> |
FROG_Element_Base_With_DetId_And_Name* ecal = new FROG_Element_Base_With_DetId_And_Name( DETID_ECAL , "ECAL"); geom->addDaughter(ecal); |
288 |
> |
FROG_Element_Base_With_DetId_And_Name* hcal = new FROG_Element_Base_With_DetId_And_Name( DETID_HCAL , "HCAL"); geom->addDaughter(hcal); |
289 |
> |
FROG_Element_Base_With_DetId_And_Name* calo = new FROG_Element_Base_With_DetId_And_Name( DETID_CALO , "Calo"); geom->addDaughter(calo); |
290 |
> |
|
291 |
|
|
292 |
|
|
293 |
|
// ### TRACKER GEOMETRY ### |
344 |
|
FEB = tracker; |
345 |
|
|
346 |
|
Frog_DetId += SubDet*100000; |
347 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
347 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
348 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
349 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
349 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
350 |
|
|
351 |
|
if(SubDet==PixelSubdetector::PixelBarrel){ |
352 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIB"); FEB_Temp->addDaughter(FEB);} |
353 |
+ |
|
354 |
|
PXBDetId detid = PXBDetId(Detid); |
355 |
|
|
356 |
|
Frog_DetId += detid.layer()*10000; |
357 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
357 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
358 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
359 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
359 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer() ); FEB_Temp->addDaughter(FEB);} |
360 |
|
|
361 |
|
Frog_DetId += detid.ladder()*100; |
362 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
362 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
363 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
364 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
364 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ladder%i", detid.ladder() ); FEB_Temp->addDaughter(FEB);} |
365 |
|
}else if(SubDet==PixelSubdetector::PixelEndcap){ |
366 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIE"); FEB_Temp->addDaughter(FEB);} |
367 |
+ |
|
368 |
|
PXFDetId detid = PXFDetId(Detid); |
369 |
|
|
370 |
|
Frog_DetId += detid.side()*10000; |
371 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
371 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
372 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
373 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
373 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);} |
374 |
|
|
375 |
|
Frog_DetId += detid.disk()*1000; |
376 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
376 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
377 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
378 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
378 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Disk%i", detid.disk()); FEB_Temp->addDaughter(FEB);} |
379 |
|
|
380 |
|
Frog_DetId += detid.blade()*10; |
381 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
381 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
382 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
383 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
383 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Blade%i", detid.blade()); FEB_Temp->addDaughter(FEB);} |
384 |
|
|
385 |
|
Frog_DetId += detid.panel()*1; |
386 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
386 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
387 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
388 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
388 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Panel%i", detid.panel()); FEB_Temp->addDaughter(FEB);} |
389 |
|
}else if(SubDet==StripSubdetector::TIB){ |
390 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TIB"); FEB_Temp->addDaughter(FEB);} |
391 |
+ |
|
392 |
|
TIBDetId detid = TIBDetId(Detid); |
393 |
|
|
394 |
|
Frog_DetId += detid.layer()*10000; |
395 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
395 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
396 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
397 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
397 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);} |
398 |
|
|
399 |
|
Frog_DetId += detid.stringNumber()*100; |
400 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
400 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
401 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
402 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
402 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "String%i", detid.stringNumber()); FEB_Temp->addDaughter(FEB);} |
403 |
|
}else if(SubDet==StripSubdetector::TID){ |
404 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TID"); FEB_Temp->addDaughter(FEB);} |
405 |
+ |
|
406 |
|
TIDDetId detid = TIDDetId(Detid); |
407 |
|
|
408 |
|
Frog_DetId += detid.side()*10000; |
409 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
409 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
410 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
411 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
411 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Slide%i", detid.side()); FEB_Temp->addDaughter(FEB);} |
412 |
|
|
413 |
|
Frog_DetId += detid.wheel()*1000; |
414 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
414 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
415 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
416 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
416 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel()); FEB_Temp->addDaughter(FEB);} |
417 |
|
|
418 |
|
Frog_DetId += detid.ring()*10; |
419 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
419 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
420 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
421 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
421 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
422 |
|
}else if(SubDet==StripSubdetector::TOB){ |
423 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TOB"); FEB_Temp->addDaughter(FEB);} |
424 |
+ |
|
425 |
|
TOBDetId detid = TOBDetId(Detid); |
426 |
|
|
427 |
|
Frog_DetId += detid.layer()*10000; |
428 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
428 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
429 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
430 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
430 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);} |
431 |
|
|
432 |
|
Frog_DetId += detid.rodNumber()*100; |
433 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
433 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
434 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
435 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
435 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Rod%i", detid.rodNumber()); FEB_Temp->addDaughter(FEB);} |
436 |
|
}else if(SubDet==StripSubdetector::TEC){ |
437 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TEC"); FEB_Temp->addDaughter(FEB);} |
438 |
+ |
|
439 |
|
TECDetId detid = TECDetId(Detid); |
440 |
|
|
441 |
|
Frog_DetId += detid.side()*10000; |
442 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
442 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
443 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
444 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
444 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);} |
445 |
|
|
446 |
|
Frog_DetId += detid.wheel()*1000; |
447 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
447 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
448 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
449 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
449 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel() ); FEB_Temp->addDaughter(FEB);} |
450 |
|
|
451 |
|
Frog_DetId += detid.ring()*10; |
452 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
452 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
453 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
454 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
454 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
455 |
|
|
456 |
|
Frog_DetId += detid.petalNumber(); |
457 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
457 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
458 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
459 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
459 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Petal%i", detid.petalNumber()); FEB_Temp->addDaughter(FEB);} |
460 |
|
}else{ |
461 |
|
if(mod)delete mod; |
462 |
|
continue; |
531 |
|
FEB = muon; |
532 |
|
|
533 |
|
Frog_DetId += SubDet*100000; |
534 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
534 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
535 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
536 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
536 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
537 |
|
|
538 |
|
if(SubDet==1){ |
539 |
< |
DTChamberId detid = DTChamberId(Detid); |
539 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "DT"); FEB_Temp->addDaughter(FEB);} |
540 |
> |
|
541 |
> |
DTChamberId detid = DTChamberId(Detid); |
542 |
|
|
543 |
|
Frog_DetId += (detid.wheel()+3)*10000; |
544 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
544 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
545 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
546 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
546 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%+i", detid.wheel()); FEB_Temp->addDaughter(FEB);} |
547 |
|
|
548 |
|
Frog_DetId += detid.station()*100; |
549 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
549 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
550 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
551 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
551 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
552 |
|
|
553 |
|
Frog_DetId += detid.sector()*1; |
554 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
554 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
555 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
556 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
556 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);} |
557 |
|
}else if(SubDet==2){ |
558 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CSC"); FEB_Temp->addDaughter(FEB);} |
559 |
+ |
|
560 |
|
CSCDetId detid = CSCDetId(Detid); |
561 |
|
|
562 |
|
Frog_DetId += detid.endcap()*10000; |
563 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
563 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
564 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
565 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
565 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i", detid.endcap()); FEB_Temp->addDaughter(FEB);} |
566 |
|
|
567 |
|
Frog_DetId += detid.station()*1000; |
568 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
568 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
569 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
570 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
570 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
571 |
|
|
572 |
|
Frog_DetId += detid.ring()*100; |
573 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
573 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
574 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
575 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
575 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
576 |
|
|
577 |
|
Frog_DetId += detid.chamber()*1; |
578 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
578 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
579 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
580 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
580 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Chamber%i", detid.chamber()); FEB_Temp->addDaughter(FEB);} |
581 |
|
}else if(SubDet==3){ |
582 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "RPC"); FEB_Temp->addDaughter(FEB);} |
583 |
+ |
|
584 |
|
RPCDetId detid = RPCDetId(Detid); |
585 |
|
|
586 |
|
Frog_DetId += (detid.region()+2)*10000; |
587 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
587 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(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);} |
589 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Region+%i", detid.region()); FEB_Temp->addDaughter(FEB);} |
590 |
|
|
591 |
|
// Barrel |
592 |
|
if(detid.region()==0){ |
593 |
|
Frog_DetId += (detid.ring()+3)*1000; |
594 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
594 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
595 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
596 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
596 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
597 |
|
// Endcap |
598 |
|
}else{ |
599 |
|
Frog_DetId += detid.ring()*1000; |
600 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
600 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
601 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
602 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
602 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
603 |
|
} |
604 |
|
|
605 |
|
Frog_DetId += detid.station()*100; |
606 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
606 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
607 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
608 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
608 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
609 |
|
|
610 |
|
Frog_DetId += detid.sector()*1; |
611 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
611 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
612 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
613 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
613 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);} |
614 |
|
} |
615 |
|
|
616 |
|
FEB->addDaughter(mod); |
621 |
|
// ### CALO GEOMETRY ### |
622 |
|
|
623 |
|
edm::ESHandle<CaloGeometry> CaloGeom; |
624 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
624 |
> |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
625 |
|
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
626 |
|
|
627 |
|
for(unsigned int i=0;i<CaloDets.size();i++) |
629 |
|
Detid = CaloDets[i]; |
630 |
|
SubDet = Detid.subdetId(); |
631 |
|
|
632 |
< |
if(Detid.det()==DetId::Ecal){ |
633 |
< |
if(SubDet<1 || SubDet>3) continue; |
565 |
< |
|
566 |
< |
Frog_DetId = DETID_ECAL; |
567 |
< |
FEB = ecal; |
568 |
< |
|
569 |
< |
Frog_DetId += SubDet*100000; |
570 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
571 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
572 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
573 |
< |
|
574 |
< |
if(SubDet==1){ |
575 |
< |
EBDetId detid = EBDetId(Detid); |
576 |
< |
|
577 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
578 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
579 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
580 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
581 |
< |
|
582 |
< |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
583 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
584 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
585 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
586 |
< |
|
587 |
< |
Frog_DetId += detid.tower_iphi()*1; |
588 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
589 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
590 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
591 |
< |
}else if(SubDet==2){ |
592 |
< |
EEDetId detid = EEDetId(Detid); |
632 |
> |
if(Detid.det()==DetId::Ecal){ |
633 |
> |
if(SubDet<1 || SubDet>3) continue; |
634 |
|
|
635 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
636 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
596 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
597 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
635 |
> |
Frog_DetId = DETID_ECAL; |
636 |
> |
FEB = ecal; |
637 |
|
|
638 |
< |
Frog_DetId += detid.iquadrant()*1000; |
639 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
640 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
641 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
638 |
> |
Frog_DetId += SubDet*100000; |
639 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
640 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
641 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
642 |
> |
|
643 |
> |
if(SubDet==1){ |
644 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EB"); FEB_Temp->addDaughter(FEB);} |
645 |
> |
|
646 |
> |
EBDetId detid = EBDetId(Detid); |
647 |
> |
|
648 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
649 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
650 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
651 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
652 |
> |
|
653 |
> |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
654 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
655 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
656 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIEta%+i", detid.tower_ieta()); FEB_Temp->addDaughter(FEB);} |
657 |
> |
|
658 |
> |
Frog_DetId += detid.tower_iphi()*1; |
659 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
660 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
661 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIPhi%i", detid.tower_iphi()); FEB_Temp->addDaughter(FEB);} |
662 |
> |
}else if(SubDet==2){ |
663 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EE"); FEB_Temp->addDaughter(FEB);} |
664 |
> |
|
665 |
> |
EEDetId detid = EEDetId(Detid); |
666 |
> |
|
667 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
668 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
669 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
670 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
671 |
> |
|
672 |
> |
Frog_DetId += detid.iquadrant()*1000; |
673 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
674 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
675 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Quadran%i", detid.iquadrant()); FEB_Temp->addDaughter(FEB);} |
676 |
> |
|
677 |
> |
Frog_DetId += detid.isc(); |
678 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
679 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
680 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ISC%i", detid.isc()); FEB_Temp->addDaughter(FEB);} |
681 |
> |
}else if(SubDet==3){ |
682 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ES"); FEB_Temp->addDaughter(FEB);} |
683 |
|
|
684 |
< |
Frog_DetId += detid.isc(); |
605 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
606 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
607 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
608 |
< |
}else if(SubDet==3){ |
609 |
< |
ESDetId detid = ESDetId(Detid); |
684 |
> |
ESDetId detid = ESDetId(Detid); |
685 |
|
|
686 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
687 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
688 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
689 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
690 |
< |
|
691 |
< |
Frog_DetId += detid.plane()*1000; |
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.six()*50; |
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);} |
686 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
687 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
688 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
689 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
690 |
> |
|
691 |
> |
Frog_DetId += detid.plane()*1000; |
692 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
693 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
694 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Plane%i", detid.plane()); FEB_Temp->addDaughter(FEB);} |
695 |
> |
|
696 |
> |
Frog_DetId += detid.six()*50; |
697 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
698 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
699 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Six%i", detid.six()); FEB_Temp->addDaughter(FEB);} |
700 |
> |
|
701 |
> |
Frog_DetId += detid.siy(); |
702 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
703 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
704 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Siy%i", detid.siy()); FEB_Temp->addDaughter(FEB);} |
705 |
> |
} |
706 |
> |
}else if(Detid.det()==DetId::Hcal){ |
707 |
> |
if(SubDet<1 || SubDet>4) continue; |
708 |
> |
|
709 |
> |
Frog_DetId = DETID_HCAL; |
710 |
> |
FEB = hcal; |
711 |
> |
|
712 |
> |
Frog_DetId += SubDet*100000; |
713 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
714 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
715 |
> |
if(FEB==NULL){ |
716 |
> |
if(SubDet==1){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HB"); FEB_Temp->addDaughter(FEB);} |
717 |
> |
if(SubDet==2){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HE"); FEB_Temp->addDaughter(FEB);} |
718 |
> |
if(SubDet==3){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HO"); FEB_Temp->addDaughter(FEB);} |
719 |
> |
if(SubDet==4){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HF"); FEB_Temp->addDaughter(FEB);} |
720 |
> |
} |
721 |
> |
|
722 |
> |
HcalDetId detid = HcalDetId(Detid); |
723 |
> |
|
724 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
725 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
726 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
727 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
728 |
> |
|
729 |
> |
Frog_DetId += detid.ietaAbs()*100; |
730 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
731 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
732 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);} |
733 |
> |
|
734 |
> |
Frog_DetId += detid.iphi()*1; |
735 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
736 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
737 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);} |
738 |
|
|
739 |
< |
Frog_DetId += detid.siy(); |
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 |
< |
} |
631 |
< |
}else if(Detid.det()==DetId::Hcal){ |
632 |
< |
if(SubDet<1 || SubDet>4) continue; |
739 |
> |
}else if(Detid.det() == DetId::Calo){ |
740 |
|
|
741 |
< |
Frog_DetId = DETID_HCAL; |
742 |
< |
FEB = hcal; |
741 |
> |
Frog_DetId = DETID_CALO; |
742 |
> |
FEB = calo; |
743 |
|
|
744 |
< |
Frog_DetId += SubDet*100000; |
638 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
639 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
640 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
641 |
< |
|
642 |
< |
if(true){ |
643 |
< |
HcalDetId detid = HcalDetId(Detid); |
644 |
< |
|
645 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
646 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
647 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
648 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
649 |
< |
|
650 |
< |
Frog_DetId += detid.ietaAbs()*100; |
651 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
652 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
653 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
654 |
< |
|
655 |
< |
Frog_DetId += detid.iphi()*1; |
656 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
657 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
658 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
659 |
< |
} |
660 |
< |
|
661 |
< |
}else if(Detid.det() == DetId::Calo){ |
662 |
< |
continue; |
663 |
< |
/* |
664 |
< |
Frog_DetId = DETID_CALO + 1000000; |
665 |
< |
FEB = hcal; |
744 |
> |
if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue; |
745 |
|
|
746 |
< |
Frog_DetId += SubDet*100000; |
747 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
748 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
749 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
750 |
< |
*/ |
751 |
< |
} |
746 |
> |
Frog_DetId += SubDet*100000; |
747 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
748 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
749 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CaloTowers"); FEB_Temp->addDaughter(FEB);} |
750 |
> |
|
751 |
> |
if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){ |
752 |
> |
CaloTowerDetId detid = CaloTowerDetId(Detid); |
753 |
> |
|
754 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
755 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
756 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
757 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
758 |
> |
|
759 |
> |
Frog_DetId += (detid.ieta()*detid.zside())*100; |
760 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
761 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
762 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);} |
763 |
> |
|
764 |
> |
Frog_DetId += detid.iphi()*1; |
765 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
766 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
767 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);} |
768 |
> |
} |
769 |
> |
} |
770 |
|
|
771 |
< |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
772 |
< |
GlobalPoint CellPos = CellGeom->getPosition(); |
773 |
< |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
774 |
< |
|
775 |
< |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
776 |
< |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
777 |
< |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
778 |
< |
|
779 |
< |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
780 |
< |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
781 |
< |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
782 |
< |
|
783 |
< |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
784 |
< |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
785 |
< |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
786 |
< |
|
787 |
< |
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) ); |
788 |
< |
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) ); |
789 |
< |
|
790 |
< |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
791 |
< |
Detid.rawId(), F, |
792 |
< |
cX , cY , cZ , |
793 |
< |
wX , wY , wZ , |
794 |
< |
hX , hY , hZ ); |
771 |
> |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
772 |
> |
GlobalPoint CellPos = CellGeom->getPosition(); |
773 |
> |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
774 |
> |
|
775 |
> |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
776 |
> |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
777 |
> |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
778 |
> |
|
779 |
> |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
780 |
> |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
781 |
> |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
782 |
> |
|
783 |
> |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
784 |
> |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
785 |
> |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
786 |
> |
|
787 |
> |
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) ); |
788 |
> |
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) ); |
789 |
> |
|
790 |
> |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
791 |
> |
Detid.rawId(), F, |
792 |
> |
cX , cY , cZ , |
793 |
> |
wX , wY , wZ , |
794 |
> |
hX , hY , hZ ); |
795 |
|
|
796 |
< |
FEB->addDaughter(mod); |
796 |
> |
FEB->addDaughter(mod); |
797 |
|
} |
798 |
|
|
799 |
|
// ### Save .geom ### |
858 |
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
859 |
|
|
860 |
|
edm::ESHandle<CaloGeometry> CaloGeom; |
861 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
861 |
> |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
862 |
> |
|
863 |
|
|
864 |
+ |
// ### GEN OBJECTS CONTAINER ### |
865 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogGen = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "GEN"); |
866 |
+ |
event->addDaughter(frogGen); |
867 |
+ |
|
868 |
+ |
// ### GENPARTICLES ### |
869 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogGenPartColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND, "GenParticles"); |
870 |
+ |
frogGen->addDaughter(frogGenPartColl); |
871 |
+ |
|
872 |
+ |
|
873 |
+ |
for(unsigned int i=0;i<GenParticlesProducers.size();i++){ |
874 |
+ |
edm::Handle<GenParticleCollection> h_gen_Particles; |
875 |
+ |
iEvent.getByLabel(GenParticlesProducers[i], h_gen_Particles); |
876 |
+ |
GenParticleCollection gen_Particles = *h_gen_Particles.product(); |
877 |
+ |
|
878 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogGenPartCollb = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND + i + 1, GenParticlesProducers[i].encode().c_str()); |
879 |
+ |
frogGenPartColl->addDaughter(frogGenPartCollb); |
880 |
+ |
|
881 |
+ |
for(unsigned int h=0;h<gen_Particles.size();h++){ |
882 |
+ |
if(gen_Particles[h].status()!=1)continue; |
883 |
+ |
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()); |
884 |
+ |
frogGenPartCollb->addDaughter(frogGenPart); |
885 |
+ |
} |
886 |
+ |
} |
887 |
+ |
|
888 |
+ |
|
889 |
+ |
// ### SIM OBJECTS CONTAINER ### |
890 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogSim = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "SIM"); |
891 |
+ |
event->addDaughter(frogSim); |
892 |
|
|
893 |
|
// ### SIMTRACK ### |
894 |
< |
FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK); |
895 |
< |
event->addDaughter(frogSimTrkColl); |
894 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSimTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMTRK, "SimTracks"); |
895 |
> |
frogSim->addDaughter(frogSimTrkColl); |
896 |
|
|
897 |
|
for(unsigned int i=0;i<SimTrackProducers.size();i++){ |
898 |
|
edm::Handle<std::vector< SimTrack > > h_SimTracks; |
911 |
|
} |
912 |
|
|
913 |
|
// ### SIMVERTEX ### |
914 |
< |
FROG_Element_Base_With_DetId* frogSimVtx = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX); |
915 |
< |
event->addDaughter(frogSimVtx); |
914 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSimVtx = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMVTX, "SimVertex"); |
915 |
> |
frogSim->addDaughter(frogSimVtx); |
916 |
|
|
917 |
|
for(unsigned int i=0;i<SimVertexProducers.size();i++){ |
918 |
|
edm::Handle<std::vector< SimVertex > > h_Vertex; |
933 |
|
|
934 |
|
// ### SIMHIT ### |
935 |
|
|
936 |
< |
FROG_Element_Base_With_DetId* frogSimHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT); |
937 |
< |
event->addDaughter(frogSimHit); |
936 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSimHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT, "SimHits"); |
937 |
> |
frogSim->addDaughter(frogSimHit); |
938 |
|
for(unsigned int i=0;i<SimHitProducers.size();i++){ |
939 |
|
edm::Handle<std::vector< PSimHit > > h_Hits; |
940 |
|
iEvent.getByLabel(SimHitProducers[i], h_Hits); |
941 |
|
std::vector< PSimHit > Hits = *h_Hits.product(); |
942 |
|
|
943 |
< |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i + 1); |
943 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSimHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT + i + 1, SimHitProducers[i].encode().c_str() ); |
944 |
|
frogSimHit->addDaughter(frogSimHitColl); |
945 |
|
|
946 |
|
for(unsigned int h=0; h<Hits.size(); h++) |
967 |
|
iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits); |
968 |
|
std::vector< PCaloHit > CaloHits = *h_CaloHits.product(); |
969 |
|
|
970 |
< |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + SimHitProducers.size() + i + 1); |
970 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSimHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT + SimHitProducers.size() + i + 1, SimCaloHitProducers[i].encode().c_str()); |
971 |
|
frogSimHit->addDaughter(frogSimHitColl); |
972 |
|
|
973 |
|
for(unsigned int h=0; h<CaloHits.size(); h++) |
985 |
|
} |
986 |
|
} |
987 |
|
|
862 |
– |
// NUCLEAR INTERACTIONS |
863 |
– |
for(unsigned int i=0;i<NIProducers.size();i++) { |
864 |
– |
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs; |
865 |
– |
iEvent.getByLabel(NIProducers[i], h_NIs); |
866 |
– |
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product(); |
867 |
– |
FROG_Element_Base_With_DetId* frogNIColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_NUCLINT + i); |
868 |
– |
event->addDaughter(frogNIColl); |
988 |
|
|
870 |
– |
for(unsigned int h=0; h<NIs.size();h++){ |
871 |
– |
reco::NuclearInteraction ni = NIs[i]; |
872 |
– |
float vtx_x = ni.vertex().x(); |
873 |
– |
float vtx_y = ni.vertex().y(); |
874 |
– |
float vtx_z = ni.vertex().z(); |
875 |
– |
float like = ni.likelihood(); |
876 |
– |
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like ); |
877 |
– |
frogNIColl->addDaughter(frogNI); |
878 |
– |
} |
879 |
– |
} |
989 |
|
|
990 |
|
|
991 |
+ |
// ### LOW RECO OBJECTS CONTAINER ### |
992 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogLowReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "RECO LOW"); |
993 |
+ |
event->addDaughter(frogLowReco); |
994 |
|
|
883 |
– |
// ### TRAJECTORY ### |
884 |
– |
FROG_Element_Base_With_DetId* frogTrk = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK); |
885 |
– |
event->addDaughter(frogTrk); |
995 |
|
|
887 |
– |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
888 |
– |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
889 |
– |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
890 |
– |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
996 |
|
|
997 |
< |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i + 1); |
998 |
< |
frogTrk->addDaughter(frogTrkColl); |
997 |
> |
// ### SiStrip Clusters ### |
998 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSSTHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT, "SiStrip Clusters"); |
999 |
> |
frogLowReco->addDaughter(frogSSTHit); |
1000 |
> |
for(unsigned int i=0;i<SiStripClusterProducers.size();i++){ |
1001 |
> |
edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits; |
1002 |
> |
iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits); |
1003 |
> |
const edmNew::DetSetVector<SiStripCluster>& Sst_Hits = *h_Sst_Hits.product(); |
1004 |
|
|
895 |
– |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
896 |
– |
Trajectory recoTraj = *it->key; |
897 |
– |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared()); |
898 |
– |
frogTrkColl->addDaughter(frogTrk); |
1005 |
|
|
1006 |
< |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
1007 |
< |
for(unsigned int h=0;h<measurements.size();h++){ |
1006 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSstHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT + i + 1, SiStripClusterProducers[i].encode().c_str()); |
1007 |
> |
frogSSTHit->addDaughter(frogSstHitColl); |
1008 |
|
|
903 |
– |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
904 |
– |
if(!h_it->isValid() )continue; |
905 |
– |
DetId detId = h_it->geographicalId(); |
906 |
– |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
1009 |
|
|
1010 |
< |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1); |
1011 |
< |
frogTrk->addDaughter(frogHit); |
1012 |
< |
} |
1013 |
< |
} |
912 |
< |
} |
1010 |
> |
for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) { |
1011 |
> |
edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin(); |
1012 |
> |
edmNew::DetSet<SiStripCluster>::const_iterator end =DSViter->end(); |
1013 |
> |
for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){ |
1014 |
|
|
1015 |
< |
// ### TRACK ### |
1015 |
> |
const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) ); |
1016 |
> |
if(!detUnit)continue; |
1017 |
|
|
1018 |
< |
for(unsigned int i=0;i<TrackProducers.size();i++){ |
1019 |
< |
edm::Handle<std::vector< reco::Track > > h_Tracks; |
918 |
< |
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
919 |
< |
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
1018 |
> |
const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit ); |
1019 |
> |
if(!DetUnit)continue; |
1020 |
|
|
1021 |
< |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size() + i + 1); |
922 |
< |
frogTrk->addDaughter(frogTrkColl); |
1021 |
> |
const StripTopology& Topo = DetUnit->specificTopology(); |
1022 |
|
|
1023 |
< |
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
1024 |
< |
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
926 |
< |
reco::Track recoTrack =TrackColl[t]; |
1023 |
> |
unsigned int Charge = 0; |
1024 |
> |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];} |
1025 |
|
|
1026 |
< |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2()); |
929 |
< |
frogTrkColl->addDaughter(frogTrk); |
1026 |
> |
unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2; |
1027 |
|
|
1028 |
< |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
1029 |
< |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
1030 |
< |
if(!h_it->isValid() )continue; |
1031 |
< |
DetId detId = h_it->geographicalId(); |
935 |
< |
const GeomDet * theDet = NULL; |
1028 |
> |
float Pitch = DetUnit->surface().bounds().width() / Topo.nstrips(); |
1029 |
> |
float XPos = (MiddleStrip * Pitch) - DetUnit->surface().bounds().width()/2; |
1030 |
> |
//float YPos = DetUnit->surface().bounds().thickness()/2; |
1031 |
> |
//float ZPos = DetUnit->surface().bounds().length()/2; |
1032 |
|
|
1033 |
< |
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId); |
938 |
< |
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId); |
939 |
< |
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId); |
940 |
< |
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId); |
1033 |
> |
Surface::GlobalPoint Pos = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) ); |
1034 |
|
|
942 |
– |
LocalPoint localPos = h_it->localPosition(); |
1035 |
|
|
1036 |
< |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit( |
1037 |
< |
detId.rawId(), |
1038 |
< |
theDet->surface().toGlobal(localPos).x(), |
1039 |
< |
theDet->surface().toGlobal(localPos).y(), |
1040 |
< |
theDet->surface().toGlobal(localPos).z(), |
949 |
< |
-1); |
950 |
< |
frogTrk->addDaughter(frogHit); |
951 |
< |
} |
952 |
< |
} |
1036 |
> |
FROG_Element_Event_Hit_SiStrip* frogStripHit = new FROG_Element_Event_Hit_SiStrip(iCluster->geographicalId(), iCluster->firstStrip(), Pitch); |
1037 |
> |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){frogStripHit->Ampl_.push_back(iCluster->amplitudes()[i]);} |
1038 |
> |
frogSstHitColl->addDaughter(frogStripHit); |
1039 |
> |
}} |
1040 |
> |
|
1041 |
|
} |
1042 |
|
|
1043 |
|
|
1044 |
+ |
|
1045 |
+ |
// ### CALORecHits ### |
1046 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOHIT, "CALO Hits"); |
1047 |
+ |
frogLowReco->addDaughter(frogCaloHit); |
1048 |
+ |
|
1049 |
+ |
|
1050 |
|
// ### ECALRecHits ### |
1051 |
< |
FROG_Element_Base_With_DetId* frogEcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT); |
1052 |
< |
event->addDaughter(frogEcalHit); |
1051 |
> |
FROG_Element_Base_With_DetId_And_Name* frogEcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT, "ECAL RecHits"); |
1052 |
> |
frogCaloHit->addDaughter(frogEcalHit); |
1053 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
1054 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
1055 |
|
iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits); |
1056 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
1057 |
|
|
1058 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i + 1); |
1058 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT + i + 1, EcalRecHitProducers[i].encode().c_str()); |
1059 |
|
frogEcalHit->addDaughter(frogHitColl); |
1060 |
|
|
1061 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
1067 |
|
|
1068 |
|
|
1069 |
|
// ### HCALRecHits ### |
1070 |
< |
FROG_Element_Base_With_DetId* frogHcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT); |
1071 |
< |
event->addDaughter(frogHcalHit); |
1070 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT, "HCAL RecHits"); |
1071 |
> |
frogCaloHit->addDaughter(frogHcalHit); |
1072 |
|
for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){ |
1073 |
|
edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits; |
1074 |
|
iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits); |
1075 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
1076 |
|
|
1077 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i + 1); |
1077 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + i + 1, HcalHBHERecHitProducers[i].encode().c_str()); |
1078 |
|
frogHcalHit->addDaughter(frogHitColl); |
1079 |
|
|
1080 |
|
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
1089 |
|
iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits); |
1090 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
1091 |
|
|
1092 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i + 1); |
1092 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i + 1, HcalHORecHitProducers[i].encode().c_str()); |
1093 |
|
frogHcalHit->addDaughter(frogHitColl); |
1094 |
|
|
1095 |
|
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
1104 |
|
iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits); |
1105 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
1106 |
|
|
1107 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i + 1); |
1107 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i + 1, HcalHFRecHitProducers[i].encode().c_str()); |
1108 |
|
frogHcalHit->addDaughter(frogHitColl); |
1109 |
|
|
1110 |
|
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
1116 |
|
|
1117 |
|
|
1118 |
|
// ### Muon Segments ### |
1119 |
< |
FROG_Element_Base_With_DetId* frogMuonSeg = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG); |
1120 |
< |
event->addDaughter(frogMuonSeg); |
1119 |
> |
FROG_Element_Base_With_DetId_And_Name* frogMuonSeg = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG, "MuonSegments"); |
1120 |
> |
frogLowReco->addDaughter(frogMuonSeg); |
1121 |
|
|
1122 |
|
for(unsigned int i=0;i<CSCSegmentProducers.size();i++){ |
1123 |
|
edm::Handle<CSCSegmentCollection > h_CSC_Segments; |
1124 |
|
iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments); |
1125 |
|
CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product(); |
1126 |
|
|
1127 |
< |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i + 1); |
1127 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSegColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG + i + 1, CSCSegmentProducers[i].encode().c_str()); |
1128 |
|
frogMuonSeg->addDaughter(frogSegColl); |
1129 |
|
|
1130 |
|
for(unsigned int s=0;s<CSC_Segments.size();s++){ |
1143 |
|
iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments); |
1144 |
|
DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product(); |
1145 |
|
|
1146 |
< |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i + 1); |
1146 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSegColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG + CSCSegmentProducers.size() + i + 1, DTSegmentProducers[i].encode().c_str()); |
1147 |
|
frogMuonSeg->addDaughter(frogSegColl); |
1148 |
|
|
1149 |
|
for(unsigned int s=0;s<DT_Segments.size();s++){ |
1158 |
|
} |
1159 |
|
|
1160 |
|
// ### Muon Hits ### |
1161 |
< |
FROG_Element_Base_With_DetId* frogMuonHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT); |
1162 |
< |
event->addDaughter(frogMuonHit); |
1161 |
> |
FROG_Element_Base_With_DetId_And_Name* frogMuonHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT, "MuonHits"); |
1162 |
> |
frogLowReco->addDaughter(frogMuonHit); |
1163 |
|
for(unsigned int i=0;i<RPCHitsProducers.size();i++){ |
1164 |
|
edm::Handle<RPCRecHitCollection > h_RPC_Hits; |
1165 |
|
iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits); |
1166 |
|
RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product(); |
1167 |
|
|
1168 |
< |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i + 1); |
1168 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT + i + 1, RPCHitsProducers[i].encode().c_str()); |
1169 |
|
frogMuonHit->addDaughter(frogHitColl); |
1170 |
|
|
1171 |
|
for(unsigned int h=0;h<RPC_Hits.size();h++){ |
1179 |
|
} |
1180 |
|
|
1181 |
|
|
1182 |
+ |
// ### Calo Towers ### |
1183 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloTower = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER, "CaloTowers"); |
1184 |
+ |
frogLowReco->addDaughter(frogCaloTower); |
1185 |
+ |
for(unsigned int i=0;i<CaloTowersProducers.size();i++){ |
1186 |
+ |
edm::Handle<CaloTowerCollection> h_Calo_Towers; |
1187 |
+ |
iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers); |
1188 |
+ |
CaloTowerCollection Calo_Towers = *h_Calo_Towers.product(); |
1189 |
+ |
|
1190 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloTowerColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER + i + 1, CaloTowersProducers[i].encode().c_str()); |
1191 |
+ |
frogCaloTower->addDaughter(frogCaloTowerColl); |
1192 |
+ |
|
1193 |
+ |
for(unsigned int h=0;h<Calo_Towers.size();h++){ |
1194 |
+ |
FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy()); |
1195 |
+ |
frogCaloTowerColl->addDaughter(frogTower); |
1196 |
+ |
|
1197 |
+ |
if(i==0 && CaloTowersProducersBasedOnCaloHits){ |
1198 |
+ |
frogTower->Components_CollEvtId_ = EVTID_CALOHIT; |
1199 |
+ |
std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents(); |
1200 |
+ |
for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);} |
1201 |
+ |
} |
1202 |
+ |
|
1203 |
+ |
} |
1204 |
+ |
} |
1205 |
+ |
|
1206 |
+ |
|
1207 |
+ |
|
1208 |
+ |
// ### MED RECO OBJECTS CONTAINER ### |
1209 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogMedReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "RECO MED"); |
1210 |
+ |
event->addDaughter(frogMedReco); |
1211 |
+ |
|
1212 |
+ |
|
1213 |
+ |
|
1214 |
+ |
|
1215 |
+ |
|
1216 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogNIVertex = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT, "Vertex from NI"); |
1217 |
+ |
frogMedReco->addDaughter(frogNIVertex); |
1218 |
+ |
|
1219 |
+ |
// NUCLEAR INTERACTIONS |
1220 |
+ |
for(unsigned int i=0;i<NIProducers.size();i++) { |
1221 |
+ |
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs; |
1222 |
+ |
iEvent.getByLabel(NIProducers[i], h_NIs); |
1223 |
+ |
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product(); |
1224 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogNIColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT + i + 1, NIProducers[i].encode().c_str()); |
1225 |
+ |
frogNIVertex->addDaughter(frogNIColl); |
1226 |
+ |
|
1227 |
+ |
for(unsigned int h=0; h<NIs.size();h++){ |
1228 |
+ |
reco::NuclearInteraction ni = NIs[i]; |
1229 |
+ |
float vtx_x = ni.vertex().x(); |
1230 |
+ |
float vtx_y = ni.vertex().y(); |
1231 |
+ |
float vtx_z = ni.vertex().z(); |
1232 |
+ |
float like = ni.likelihood(); |
1233 |
+ |
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like ); |
1234 |
+ |
frogNIColl->addDaughter(frogNI); |
1235 |
+ |
} |
1236 |
+ |
} |
1237 |
+ |
|
1238 |
+ |
|
1239 |
+ |
|
1240 |
+ |
// ### TRAJECTORY ### |
1241 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogTrk = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK, "Tracks & Trajectories"); |
1242 |
+ |
frogMedReco->addDaughter(frogTrk); |
1243 |
+ |
|
1244 |
+ |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
1245 |
+ |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
1246 |
+ |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
1247 |
+ |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
1248 |
+ |
|
1249 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK + i + 1, "Traj | %s", TrajectoryProducers[i].encode().c_str()); |
1250 |
+ |
frogTrk->addDaughter(frogTrkColl); |
1251 |
+ |
|
1252 |
+ |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
1253 |
+ |
Trajectory recoTraj = *it->key; |
1254 |
+ |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared()); |
1255 |
+ |
frogTrkColl->addDaughter(frogTrk); |
1256 |
+ |
|
1257 |
+ |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
1258 |
+ |
for(unsigned int h=0;h<measurements.size();h++){ |
1259 |
+ |
|
1260 |
+ |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
1261 |
+ |
if(!h_it->isValid() )continue; |
1262 |
+ |
DetId detId = h_it->geographicalId(); |
1263 |
+ |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
1264 |
+ |
|
1265 |
+ |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1); |
1266 |
+ |
frogTrk->addDaughter(frogHit); |
1267 |
+ |
} |
1268 |
+ |
// printf("Add a Trajectory\n"); |
1269 |
+ |
} |
1270 |
+ |
} |
1271 |
+ |
|
1272 |
+ |
|
1273 |
+ |
|
1274 |
+ |
|
1275 |
+ |
// ### TRACK ### |
1276 |
+ |
|
1277 |
+ |
for(unsigned int i=0;i<TrackProducers.size();i++){ |
1278 |
+ |
edm::Handle<std::vector< reco::Track > > h_Tracks; |
1279 |
+ |
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
1280 |
+ |
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
1281 |
+ |
|
1282 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK + TrajectoryProducers.size() + i + 1, "Track | %s", TrackProducers[i].encode().c_str()); |
1283 |
+ |
frogTrk->addDaughter(frogTrkColl); |
1284 |
+ |
|
1285 |
+ |
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
1286 |
+ |
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
1287 |
+ |
reco::Track recoTrack =TrackColl[t]; |
1288 |
+ |
|
1289 |
+ |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2()); |
1290 |
+ |
frogTrkColl->addDaughter(frogTrk); |
1291 |
+ |
|
1292 |
+ |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
1293 |
+ |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
1294 |
+ |
if(!h_it->isValid() )continue; |
1295 |
+ |
DetId detId = h_it->geographicalId(); |
1296 |
+ |
const GeomDet * theDet = NULL; |
1297 |
+ |
|
1298 |
+ |
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId); |
1299 |
+ |
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId); |
1300 |
+ |
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId); |
1301 |
+ |
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId); |
1302 |
+ |
|
1303 |
+ |
LocalPoint localPos = h_it->localPosition(); |
1304 |
+ |
|
1305 |
+ |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit( |
1306 |
+ |
detId.rawId(), |
1307 |
+ |
theDet->surface().toGlobal(localPos).x(), |
1308 |
+ |
theDet->surface().toGlobal(localPos).y(), |
1309 |
+ |
theDet->surface().toGlobal(localPos).z(), |
1310 |
+ |
-1); |
1311 |
+ |
frogTrk->addDaughter(frogHit); |
1312 |
+ |
} |
1313 |
+ |
//printf("Add a Track\n"); |
1314 |
+ |
|
1315 |
+ |
} |
1316 |
+ |
} |
1317 |
+ |
|
1318 |
+ |
|
1319 |
+ |
|
1320 |
+ |
|
1321 |
+ |
|
1322 |
+ |
|
1323 |
+ |
// ### HIGH RECO OBJECTS CONTAINER ### |
1324 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogHighReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "RECO HIGH"); |
1325 |
+ |
event->addDaughter(frogHighReco); |
1326 |
+ |
|
1327 |
+ |
|
1328 |
+ |
|
1329 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET, "Jets"); |
1330 |
+ |
frogHighReco->addDaughter(frogJet); |
1331 |
+ |
|
1332 |
+ |
|
1333 |
+ |
// ### Basic Jets ### |
1334 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogBasicJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC, "BasicJets"); |
1335 |
+ |
frogJet->addDaughter(frogBasicJet); |
1336 |
+ |
for(unsigned int i=0;i<BasicJetsProducers.size();i++){ |
1337 |
+ |
edm::Handle<BasicJetCollection> h_Basic_Jets; |
1338 |
+ |
iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets); |
1339 |
+ |
BasicJetCollection Basic_Jets = *h_Basic_Jets.product(); |
1340 |
+ |
|
1341 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogBasicJetColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC + i + 1, BasicJetsProducers[i].encode().c_str()); |
1342 |
+ |
frogBasicJet->addDaughter(frogBasicJetColl); |
1343 |
+ |
|
1344 |
+ |
for(unsigned int h=0;h<Basic_Jets.size();h++){ |
1345 |
+ |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi()); |
1346 |
+ |
frogBasicJet->addDaughter(frogJet); |
1347 |
+ |
} |
1348 |
+ |
} |
1349 |
+ |
|
1350 |
+ |
|
1351 |
+ |
// ### Calo Jets ### |
1352 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO, "CaloJets"); |
1353 |
+ |
frogJet->addDaughter(frogCaloJet); |
1354 |
+ |
for(unsigned int i=0;i<CaloJetsProducers.size();i++){ |
1355 |
+ |
edm::Handle<CaloJetCollection> h_Calo_Jets; |
1356 |
+ |
iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets); |
1357 |
+ |
CaloJetCollection Calo_Jets = *h_Calo_Jets.product(); |
1358 |
+ |
|
1359 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloJetColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO + i + 1, CaloJetsProducers[i].encode().c_str()); |
1360 |
+ |
frogCaloJet->addDaughter(frogCaloJetColl); |
1361 |
+ |
|
1362 |
+ |
for(unsigned int h=0;h<Calo_Jets.size();h++){ |
1363 |
+ |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi()); |
1364 |
+ |
frogCaloJetColl->addDaughter(frogJet); |
1365 |
+ |
|
1366 |
+ |
if(CaloJetsProducersBasedOnCaloTowers){ |
1367 |
+ |
std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents(); |
1368 |
+ |
frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1; |
1369 |
+ |
for(unsigned int t=0;t<CaloTowers.size();t++){ frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());} |
1370 |
+ |
} |
1371 |
+ |
} |
1372 |
+ |
} |
1373 |
+ |
|
1374 |
+ |
// ### MET ### |
1375 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogMET = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO, "MET"); |
1376 |
+ |
frogHighReco->addDaughter(frogMET); |
1377 |
+ |
for(unsigned int i=0;i<CaloMETProducers.size();i++){ |
1378 |
+ |
edm::Handle<CaloMETCollection> h_met; |
1379 |
+ |
iEvent.getByLabel(CaloMETProducers[i], h_met); |
1380 |
+ |
CaloMETCollection reco_met = *h_met.product(); |
1381 |
+ |
|
1382 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogMETColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO + i + 1, CaloMETProducers[i].encode().c_str()); |
1383 |
+ |
frogMET->addDaughter(frogMETColl); |
1384 |
+ |
|
1385 |
+ |
for(unsigned int h=0;h<reco_met.size();h++){ |
1386 |
+ |
FROG_Element_Event_MET* frogMETevt = new FROG_Element_Event_MET(i, reco_met[h].p(), reco_met[h].eta(),reco_met[h].phi(), reco_met[h].sumEt()); |
1387 |
+ |
frogMETColl->addDaughter(frogMETevt); |
1388 |
+ |
} |
1389 |
+ |
} |
1390 |
+ |
|
1391 |
+ |
|
1392 |
+ |
// ### RecoCandidates ### |
1393 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogRecoCand = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND, "RecoCandidates"); |
1394 |
+ |
frogHighReco->addDaughter(frogRecoCand); |
1395 |
+ |
for(unsigned int i=0;i<RecoCandidateProducers.size();i++){ |
1396 |
+ |
edm::Handle<CandidateCollection> h_reco_Candidates; |
1397 |
+ |
iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates); |
1398 |
+ |
CandidateCollection reco_Candidates = *h_reco_Candidates.product(); |
1399 |
+ |
|
1400 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogRecoCandColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND + i + 1, RecoCandidateProducers[i].encode().c_str()); |
1401 |
+ |
frogRecoCand->addDaughter(frogRecoCandColl); |
1402 |
+ |
|
1403 |
+ |
for(unsigned int h=0;h<reco_Candidates.size();h++){ |
1404 |
+ |
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()); |
1405 |
+ |
frogRecoCandColl->addDaughter(frogCandidate); |
1406 |
+ |
} |
1407 |
+ |
} |
1408 |
+ |
|
1409 |
+ |
|
1410 |
+ |
|
1411 |
|
NEvents++; |
1412 |
|
if(NEvents == NEventsInVisFile){ |
1413 |
|
char OutputFileName[1024]; |