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 |
> |
|
56 |
> |
#include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h" |
57 |
> |
#include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h" |
58 |
|
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" |
59 |
|
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h" |
60 |
|
|
64 |
|
#include "Geometry/CSCGeometry/interface/CSCGeometry.h" |
65 |
|
#include "Geometry/RPCGeometry/interface/RPCGeometry.h" |
66 |
|
|
67 |
+ |
#include "DataFormats/Common/interface/DetSetVector.h" |
68 |
+ |
#include "DataFormats/Common/interface/DetSetVectorNew.h" |
69 |
+ |
|
70 |
+ |
#include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h" |
71 |
|
|
72 |
|
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h" |
73 |
|
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" |
90 |
|
#include "TrackingTools/PatternTools/interface/Trajectory.h" |
91 |
|
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" |
92 |
|
|
93 |
+ |
#include "DataFormats/HepMCCandidate/interface/GenParticle.h" |
94 |
+ |
|
95 |
|
|
96 |
|
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" |
97 |
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" |
104 |
|
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h" |
105 |
|
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h" |
106 |
|
|
107 |
< |
#include "Visualisation/Frog/interface/SimEvent.h" |
108 |
< |
#include "Visualisation/Frog/interface/Geometry.h" |
107 |
> |
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" |
108 |
> |
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" |
109 |
> |
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h" |
110 |
> |
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h" |
111 |
> |
#include "DataFormats/SiStripDetId/interface/TIBDetId.h" |
112 |
> |
#include "DataFormats/SiStripDetId/interface/TIDDetId.h" |
113 |
> |
#include "DataFormats/SiStripDetId/interface/TOBDetId.h" |
114 |
> |
#include "DataFormats/SiStripDetId/interface/TECDetId.h" |
115 |
> |
|
116 |
> |
#include "DataFormats/MuonDetId/interface/DTChamberId.h" |
117 |
> |
#include "DataFormats/MuonDetId/interface/CSCDetId.h" |
118 |
> |
#include "DataFormats/MuonDetId/interface/RPCDetId.h" |
119 |
> |
|
120 |
> |
#include "DataFormats/EcalDetId/interface/EBDetId.h" |
121 |
> |
#include "DataFormats/EcalDetId/interface/EEDetId.h" |
122 |
> |
#include "DataFormats/EcalDetId/interface/ESDetId.h" |
123 |
> |
#include "DataFormats/HcalDetId/interface/HcalDetId.h" |
124 |
> |
|
125 |
> |
#include "DataFormats/VertexReco/interface/NuclearInteraction.h" |
126 |
> |
|
127 |
> |
#include "DataFormats/JetReco/interface/Jet.h" |
128 |
> |
#include "DataFormats/JetReco/interface/BasicJetCollection.h" |
129 |
> |
#include "DataFormats/JetReco/interface/GenJetCollection.h" |
130 |
> |
#include "DataFormats/JetReco/interface/CaloJetCollection.h" |
131 |
> |
#include "DataFormats/JetReco/interface/PFJetCollection.h" |
132 |
> |
#include "DataFormats/METReco/interface/CaloMET.h" |
133 |
> |
#include "DataFormats/METReco/interface/CaloMETFwd.h" |
134 |
> |
|
135 |
> |
#define FROG_ZLIB |
136 |
> |
|
137 |
> |
//#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId_And_Name.h" |
138 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h" |
139 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp" |
140 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_Track.h" |
141 |
> |
|
142 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.h" |
143 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.cpp" |
144 |
> |
|
145 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.h" |
146 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.cpp" |
147 |
> |
|
148 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h" |
149 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp" |
150 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h" |
151 |
> |
|
152 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.h" |
153 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.cpp" |
154 |
> |
|
155 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.h" |
156 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.cpp" |
157 |
> |
|
158 |
> |
|
159 |
|
|
160 |
|
using namespace edm; |
161 |
|
using namespace std; |
162 |
+ |
using namespace reco; |
163 |
|
|
164 |
|
// |
165 |
|
// class decleration |
176 |
|
virtual void analyze (const edm::Event&, const edm::EventSetup&); |
177 |
|
virtual void endJob (); |
178 |
|
|
179 |
+ |
FROG_Events* events; |
180 |
+ |
FROG_Element_Base* events_prim; |
181 |
|
|
182 |
< |
MySimEvents* MyEvents; |
120 |
< |
Geometry* Geom_Tracker; |
121 |
< |
Geometry* Geom_ECAL; |
122 |
< |
Geometry* Geom_HCAL; |
123 |
< |
Geometry* Geom_Muon; |
182 |
> |
std::string OutputFile; |
183 |
|
|
184 |
< |
|
126 |
< |
std::string OutputFile; |
184 |
> |
std::vector<InputTag> GenParticlesProducers; |
185 |
|
|
186 |
|
std::vector<InputTag> SimTrackProducers; |
187 |
|
std::vector<InputTag> SimVertexProducers; |
188 |
|
std::vector<InputTag> SimHitProducers; |
189 |
+ |
std::vector<InputTag> SimCaloHitProducers; |
190 |
+ |
|
191 |
+ |
std::vector<InputTag> NIProducers; |
192 |
|
|
193 |
+ |
std::vector<InputTag> TrackProducers; |
194 |
|
std::vector<InputTag> TrajectoryProducers; |
195 |
+ |
std::vector<InputTag> SiStripClusterProducers; |
196 |
|
std::vector<InputTag> EcalRecHitProducers; |
197 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
198 |
|
std::vector<InputTag> HcalHORecHitProducers; |
202 |
|
|
203 |
|
std::vector<InputTag> RPCHitsProducers; |
204 |
|
|
205 |
+ |
std::vector<InputTag> CaloTowersProducers; |
206 |
+ |
bool CaloTowersProducersBasedOnCaloHits; |
207 |
+ |
|
208 |
+ |
std::vector<InputTag> BasicJetsProducers; |
209 |
+ |
std::vector<InputTag> CaloJetsProducers; |
210 |
+ |
bool CaloJetsProducersBasedOnCaloTowers; |
211 |
|
|
212 |
+ |
std::vector<InputTag> RecoCandidateProducers; |
213 |
+ |
std::vector<InputTag> CaloMETProducers; |
214 |
|
|
215 |
|
|
216 |
|
// ----------member data --------------------------- |
217 |
+ |
|
218 |
+ |
bool CompressFiles; |
219 |
+ |
|
220 |
+ |
|
221 |
+ |
bool ProduceGeom; |
222 |
+ |
int NEventsInVisFile; |
223 |
+ |
int NEvents; |
224 |
+ |
|
225 |
+ |
unsigned int SRun; |
226 |
+ |
unsigned int SEvent; |
227 |
|
}; |
228 |
|
|
229 |
|
// |
233 |
|
{ |
234 |
|
OutputFile = iConfig.getParameter<std::string >("OutputFile"); |
235 |
|
|
236 |
+ |
GenParticlesProducers = iConfig.getParameter<std::vector<InputTag> >("GenParticlesProducers"); |
237 |
+ |
|
238 |
|
SimTrackProducers = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers"); |
239 |
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers"); |
240 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
241 |
+ |
SimCaloHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimCaloHitProducers"); |
242 |
+ |
|
243 |
|
|
244 |
< |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
244 |
> |
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
245 |
> |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
246 |
> |
SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers"); |
247 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
248 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
249 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
250 |
|
HcalHFRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHFRecHitProducers"); |
251 |
|
|
252 |
+ |
NIProducers = iConfig.getParameter<std::vector<InputTag> >("NIProducers"); |
253 |
+ |
|
254 |
|
DTSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("DTSegmentProducers"); |
255 |
|
CSCSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("CSCSegmentProducers"); |
256 |
|
|
257 |
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers"); |
258 |
|
|
259 |
+ |
CaloTowersProducers = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers"); |
260 |
+ |
CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits"); |
261 |
+ |
|
262 |
+ |
|
263 |
+ |
BasicJetsProducers = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers"); |
264 |
+ |
CaloJetsProducers = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers"); |
265 |
+ |
CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers"); |
266 |
+ |
|
267 |
+ |
RecoCandidateProducers = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers"); |
268 |
+ |
CaloMETProducers = iConfig.getParameter<std::vector<InputTag> >("CaloMETProducers"); |
269 |
+ |
|
270 |
+ |
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" ); |
271 |
+ |
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" ); |
272 |
+ |
CompressFiles = iConfig.getParameter<bool >("CompressFiles" ); |
273 |
+ |
|
274 |
+ |
|
275 |
+ |
NEvents = 0; |
276 |
|
} |
277 |
|
|
278 |
|
|
284 |
|
void |
285 |
|
Frog_Analyzer::beginJob(const edm::EventSetup& iSetup) |
286 |
|
{ |
287 |
< |
DetId Detid; |
288 |
< |
int SubDet; |
289 |
< |
|
290 |
< |
MyEvents = new MySimEvents(); |
291 |
< |
Geom_Tracker = new Geometry(); |
292 |
< |
Geom_ECAL = new Geometry(); |
293 |
< |
Geom_HCAL = new Geometry(); |
294 |
< |
Geom_Muon = new Geometry(); |
287 |
> |
if(ProduceGeom){ |
288 |
> |
DetId Detid; |
289 |
> |
unsigned int SubDet; |
290 |
> |
|
291 |
> |
unsigned int Frog_DetId; |
292 |
> |
FROG_Element_Base* FEB = NULL; |
293 |
> |
FROG_Element_Base_With_DetId_And_Name* FEB_Temp = NULL; |
294 |
> |
|
295 |
> |
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
296 |
> |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
297 |
> |
FROG_Element_Base_With_DetId_And_Name* tracker = new FROG_Element_Base_With_DetId_And_Name( DETID_TRK , "Tracker"); geom->addDaughter(tracker); |
298 |
> |
FROG_Element_Base_With_DetId_And_Name* muon = new FROG_Element_Base_With_DetId_And_Name( DETID_MUON , "Muon"); geom->addDaughter(muon); |
299 |
> |
FROG_Element_Base_With_DetId_And_Name* ecal = new FROG_Element_Base_With_DetId_And_Name( DETID_ECAL , "ECAL"); geom->addDaughter(ecal); |
300 |
> |
FROG_Element_Base_With_DetId_And_Name* hcal = new FROG_Element_Base_With_DetId_And_Name( DETID_HCAL , "HCAL"); geom->addDaughter(hcal); |
301 |
> |
FROG_Element_Base_With_DetId_And_Name* calo = new FROG_Element_Base_With_DetId_And_Name( DETID_CALO , "Calo"); geom->addDaughter(calo); |
302 |
|
|
303 |
|
|
191 |
– |
// ### TRACKER GEOMETRY ### |
304 |
|
|
305 |
< |
edm::ESHandle<TrackerGeometry> tkGeom; |
306 |
< |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
307 |
< |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
305 |
> |
// ### TRACKER GEOMETRY ### |
306 |
> |
|
307 |
> |
edm::ESHandle<TrackerGeometry> tkGeom; |
308 |
> |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
309 |
> |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
310 |
> |
|
311 |
> |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
312 |
> |
Detid = TrackerDets[i]->geographicalId(); |
313 |
> |
SubDet = Detid.subdetId(); |
314 |
> |
if(SubDet<1 || SubDet>6) continue; |
315 |
|
|
197 |
– |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
198 |
– |
Detid = TrackerDets[i]->geographicalId(); |
199 |
– |
// SubDet = Detid.subdetId(); |
316 |
|
|
317 |
< |
GeomDet* DetUnit = TrackerDets[i]; |
318 |
< |
if(!DetUnit)continue; |
319 |
< |
const BoundPlane plane = DetUnit->surface(); |
320 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
321 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
322 |
< |
|
323 |
< |
float width = 0; |
324 |
< |
float length = 0; |
325 |
< |
float thickness = 0; |
326 |
< |
float TrapezoidalParam = 0; |
317 |
> |
GeomDet* DetUnit = TrackerDets[i]; |
318 |
> |
if(!DetUnit)continue; |
319 |
> |
const BoundPlane plane = DetUnit->surface(); |
320 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
321 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
322 |
> |
|
323 |
> |
float width = 0; |
324 |
> |
float length = 0; |
325 |
> |
float thickness = 0; |
326 |
> |
float TrapezoidalParam = 0; |
327 |
> |
|
328 |
> |
if(trapezoidalBounds){ |
329 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
330 |
> |
width = parameters[0]*2; |
331 |
> |
length = parameters[3]*2; |
332 |
> |
thickness = (*trapezoidalBounds).thickness(); |
333 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
334 |
> |
}else if(rectangularBounds){ |
335 |
> |
width = DetUnit->surface().bounds().width(); |
336 |
> |
length = DetUnit->surface().bounds().length(); |
337 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
338 |
> |
TrapezoidalParam = 1; |
339 |
> |
} |
340 |
> |
|
341 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
342 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
343 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
344 |
> |
|
345 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
346 |
> |
|
347 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
348 |
> |
Detid.rawId(), TrapezoidalParam, |
349 |
> |
Pos.x(), Pos.y(), Pos.z(), |
350 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
351 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
352 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
353 |
|
|
354 |
< |
if(trapezoidalBounds) |
355 |
< |
{ |
356 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
357 |
< |
width = parameters[0]*2; |
358 |
< |
length = parameters[3]*2; |
359 |
< |
thickness = (*trapezoidalBounds).thickness(); |
360 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
361 |
< |
}else if(rectangularBounds){ |
362 |
< |
width = DetUnit->surface().bounds().width(); |
363 |
< |
length = DetUnit->surface().bounds().length(); |
364 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
365 |
< |
TrapezoidalParam = 1; |
354 |
> |
|
355 |
> |
Frog_DetId = DETID_TRK; |
356 |
> |
FEB = tracker; |
357 |
> |
|
358 |
> |
Frog_DetId += SubDet*100000; |
359 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
360 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
361 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
362 |
> |
|
363 |
> |
if(SubDet==PixelSubdetector::PixelBarrel){ |
364 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIB"); FEB_Temp->addDaughter(FEB);} |
365 |
> |
|
366 |
> |
PXBDetId detid = PXBDetId(Detid); |
367 |
> |
|
368 |
> |
Frog_DetId += detid.layer()*10000; |
369 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
370 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
371 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer() ); FEB_Temp->addDaughter(FEB);} |
372 |
> |
|
373 |
> |
Frog_DetId += detid.ladder()*100; |
374 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
375 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
376 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ladder%i", detid.ladder() ); FEB_Temp->addDaughter(FEB);} |
377 |
> |
}else if(SubDet==PixelSubdetector::PixelEndcap){ |
378 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIE"); FEB_Temp->addDaughter(FEB);} |
379 |
> |
|
380 |
> |
PXFDetId detid = PXFDetId(Detid); |
381 |
> |
|
382 |
> |
Frog_DetId += detid.side()*10000; |
383 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
384 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
385 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);} |
386 |
> |
|
387 |
> |
Frog_DetId += detid.disk()*1000; |
388 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
389 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
390 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Disk%i", detid.disk()); FEB_Temp->addDaughter(FEB);} |
391 |
> |
|
392 |
> |
Frog_DetId += detid.blade()*10; |
393 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
394 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
395 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Blade%i", detid.blade()); FEB_Temp->addDaughter(FEB);} |
396 |
> |
|
397 |
> |
Frog_DetId += detid.panel()*1; |
398 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
399 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
400 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Panel%i", detid.panel()); FEB_Temp->addDaughter(FEB);} |
401 |
> |
}else if(SubDet==StripSubdetector::TIB){ |
402 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TIB"); FEB_Temp->addDaughter(FEB);} |
403 |
> |
|
404 |
> |
TIBDetId detid = TIBDetId(Detid); |
405 |
> |
|
406 |
> |
Frog_DetId += detid.layer()*10000; |
407 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
408 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
409 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);} |
410 |
> |
|
411 |
> |
Frog_DetId += detid.stringNumber()*100; |
412 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
413 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
414 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "String%i", detid.stringNumber()); FEB_Temp->addDaughter(FEB);} |
415 |
> |
}else if(SubDet==StripSubdetector::TID){ |
416 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TID"); FEB_Temp->addDaughter(FEB);} |
417 |
> |
|
418 |
> |
TIDDetId detid = TIDDetId(Detid); |
419 |
> |
|
420 |
> |
Frog_DetId += detid.side()*10000; |
421 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
422 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
423 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Slide%i", detid.side()); FEB_Temp->addDaughter(FEB);} |
424 |
> |
|
425 |
> |
Frog_DetId += detid.wheel()*1000; |
426 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
427 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
428 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel()); FEB_Temp->addDaughter(FEB);} |
429 |
> |
|
430 |
> |
Frog_DetId += detid.ring()*10; |
431 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
432 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
433 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
434 |
> |
}else if(SubDet==StripSubdetector::TOB){ |
435 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TOB"); FEB_Temp->addDaughter(FEB);} |
436 |
> |
|
437 |
> |
TOBDetId detid = TOBDetId(Detid); |
438 |
> |
|
439 |
> |
Frog_DetId += detid.layer()*10000; |
440 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
441 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
442 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);} |
443 |
> |
|
444 |
> |
Frog_DetId += detid.rodNumber()*100; |
445 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
446 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
447 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Rod%i", detid.rodNumber()); FEB_Temp->addDaughter(FEB);} |
448 |
> |
}else if(SubDet==StripSubdetector::TEC){ |
449 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TEC"); FEB_Temp->addDaughter(FEB);} |
450 |
> |
|
451 |
> |
TECDetId detid = TECDetId(Detid); |
452 |
> |
|
453 |
> |
Frog_DetId += detid.side()*10000; |
454 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
455 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
456 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);} |
457 |
> |
|
458 |
> |
Frog_DetId += detid.wheel()*1000; |
459 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
460 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
461 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel() ); FEB_Temp->addDaughter(FEB);} |
462 |
> |
|
463 |
> |
Frog_DetId += detid.ring()*10; |
464 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
465 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
466 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
467 |
> |
|
468 |
> |
Frog_DetId += detid.petalNumber(); |
469 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
470 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
471 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Petal%i", detid.petalNumber()); FEB_Temp->addDaughter(FEB);} |
472 |
> |
}else{ |
473 |
> |
if(mod)delete mod; |
474 |
> |
continue; |
475 |
> |
} |
476 |
> |
FEB->addDaughter(mod); |
477 |
|
} |
478 |
|
|
226 |
– |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
227 |
– |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
228 |
– |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
229 |
– |
|
230 |
– |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
231 |
– |
|
232 |
– |
Geom_Tracker->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
233 |
– |
Pos.x(), Pos.y(), Pos.z(), |
234 |
– |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
235 |
– |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
236 |
– |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
237 |
– |
|
479 |
|
|
480 |
< |
} |
480 |
> |
// ### MUON GEOMETRY ### |
481 |
|
|
482 |
+ |
edm::ESHandle<DTGeometry> DtGeom; |
483 |
+ |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
484 |
+ |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
485 |
+ |
|
486 |
+ |
edm::ESHandle<CSCGeometry> CscGeom; |
487 |
+ |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
488 |
+ |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
489 |
+ |
|
490 |
+ |
edm::ESHandle<RPCGeometry> RpcGeom; |
491 |
+ |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
492 |
+ |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
493 |
+ |
|
494 |
+ |
vector<GeomDet*> MuonDets; |
495 |
+ |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
496 |
+ |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
497 |
+ |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
498 |
|
|
499 |
< |
// ### CALO GEOMETRY ### |
499 |
> |
for(unsigned int i=0;i<MuonDets.size();i++) |
500 |
> |
{ |
501 |
> |
Detid = DetId(MuonDets[i]->geographicalId()); |
502 |
> |
SubDet = Detid.subdetId(); |
503 |
|
|
504 |
< |
edm::ESHandle<CaloGeometry> CaloGeom; |
505 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
506 |
< |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
507 |
< |
|
508 |
< |
for(unsigned int i=0;i<CaloDets.size();i++) |
509 |
< |
{ |
510 |
< |
Detid = CaloDets[i]; |
511 |
< |
SubDet = Detid.subdetId(); |
512 |
< |
|
513 |
< |
Geometry* Geom_temp = NULL; |
514 |
< |
if(Detid.det()==DetId::Ecal){ |
515 |
< |
Geom_temp = Geom_ECAL; |
516 |
< |
|
517 |
< |
if(SubDet<1 || SubDet>3){ |
518 |
< |
printf("Don't Save EcalTriggerTower or EcalLaserPnDiode\n"); |
519 |
< |
continue; |
520 |
< |
} |
521 |
< |
}else if(Detid.det()==DetId::Hcal){ |
522 |
< |
Geom_temp = Geom_HCAL; |
523 |
< |
|
524 |
< |
if(SubDet<1 || SubDet>4){ |
525 |
< |
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
526 |
< |
continue; |
527 |
< |
} |
528 |
< |
}else{ |
529 |
< |
continue; |
530 |
< |
} |
504 |
> |
GeomDet* DetUnit = MuonDets[i]; |
505 |
> |
if(!DetUnit)continue; |
506 |
> |
const BoundPlane plane = DetUnit->surface(); |
507 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
508 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
509 |
> |
|
510 |
> |
float width = 0; |
511 |
> |
float length = 0; |
512 |
> |
float thickness = 0; |
513 |
> |
float TrapezoidalParam = 0; |
514 |
> |
|
515 |
> |
if(trapezoidalBounds) |
516 |
> |
{ |
517 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
518 |
> |
width = parameters[0]*2; |
519 |
> |
length = parameters[3]*2; |
520 |
> |
thickness = (*trapezoidalBounds).thickness(); |
521 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
522 |
> |
}else if(rectangularBounds){ |
523 |
> |
width = DetUnit->surface().bounds().width(); |
524 |
> |
length = DetUnit->surface().bounds().length(); |
525 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
526 |
> |
TrapezoidalParam = 1; |
527 |
> |
} |
528 |
> |
|
529 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
530 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
531 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
532 |
> |
|
533 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
534 |
> |
|
535 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
536 |
> |
Detid.rawId(), TrapezoidalParam, |
537 |
> |
Pos.x(), Pos.y(), Pos.z(), |
538 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
539 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
540 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
541 |
> |
|
542 |
> |
Frog_DetId = DETID_MUON; |
543 |
> |
FEB = muon; |
544 |
> |
|
545 |
> |
Frog_DetId += SubDet*100000; |
546 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
547 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
548 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
549 |
> |
|
550 |
> |
if(SubDet==1){ |
551 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "DT"); FEB_Temp->addDaughter(FEB);} |
552 |
> |
|
553 |
> |
DTChamberId detid = DTChamberId(Detid); |
554 |
> |
|
555 |
> |
Frog_DetId += (detid.wheel()+3)*10000; |
556 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
557 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
558 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%+i", detid.wheel()); FEB_Temp->addDaughter(FEB);} |
559 |
> |
|
560 |
> |
Frog_DetId += detid.station()*100; |
561 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
562 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
563 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
564 |
> |
|
565 |
> |
Frog_DetId += detid.sector()*1; |
566 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
567 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
568 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);} |
569 |
> |
}else if(SubDet==2){ |
570 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CSC"); FEB_Temp->addDaughter(FEB);} |
571 |
|
|
572 |
< |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
573 |
< |
GlobalPoint CellPos = CellGeom->getPosition(); |
574 |
< |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
575 |
< |
|
576 |
< |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
577 |
< |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
578 |
< |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
579 |
< |
|
580 |
< |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
581 |
< |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
582 |
< |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
583 |
< |
|
584 |
< |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
585 |
< |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
586 |
< |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
572 |
> |
CSCDetId detid = CSCDetId(Detid); |
573 |
> |
|
574 |
> |
Frog_DetId += detid.endcap()*10000; |
575 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
576 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
577 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i", detid.endcap()); FEB_Temp->addDaughter(FEB);} |
578 |
> |
|
579 |
> |
Frog_DetId += detid.station()*1000; |
580 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
581 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
582 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
583 |
> |
|
584 |
> |
Frog_DetId += detid.ring()*100; |
585 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
586 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
587 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
588 |
> |
|
589 |
> |
Frog_DetId += detid.chamber()*1; |
590 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
591 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
592 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Chamber%i", detid.chamber()); FEB_Temp->addDaughter(FEB);} |
593 |
> |
}else if(SubDet==3){ |
594 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "RPC"); FEB_Temp->addDaughter(FEB);} |
595 |
> |
|
596 |
> |
RPCDetId detid = RPCDetId(Detid); |
597 |
> |
|
598 |
> |
Frog_DetId += (detid.region()+2)*10000; |
599 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
600 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
601 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Region+%i", detid.region()); FEB_Temp->addDaughter(FEB);} |
602 |
> |
|
603 |
> |
// Barrel |
604 |
> |
if(detid.region()==0){ |
605 |
> |
Frog_DetId += (detid.ring()+3)*1000; |
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_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
609 |
> |
// Endcap |
610 |
> |
}else{ |
611 |
> |
Frog_DetId += detid.ring()*1000; |
612 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
613 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
614 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);} |
615 |
> |
} |
616 |
> |
|
617 |
> |
Frog_DetId += detid.station()*100; |
618 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
619 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
620 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);} |
621 |
> |
|
622 |
> |
Frog_DetId += detid.sector()*1; |
623 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
624 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
625 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);} |
626 |
> |
} |
627 |
|
|
628 |
< |
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) ); |
629 |
< |
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) ); |
628 |
> |
FEB->addDaughter(mod); |
629 |
> |
} |
630 |
|
|
291 |
– |
Geom_temp->Add_CaloDet(Detid.rawId(), |
292 |
– |
cX , cY , cZ , |
293 |
– |
wX , wY , wZ , |
294 |
– |
hX , hY , hZ , F ); |
295 |
– |
} |
631 |
|
|
632 |
< |
// ### MUON GEOMETRY ### |
632 |
> |
|
633 |
> |
// ### CALO GEOMETRY ### |
634 |
|
|
635 |
< |
edm::ESHandle<DTGeometry> DtGeom; |
636 |
< |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
637 |
< |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
638 |
< |
|
303 |
< |
edm::ESHandle<CSCGeometry> CscGeom; |
304 |
< |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
305 |
< |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
306 |
< |
|
307 |
< |
edm::ESHandle<RPCGeometry> RpcGeom; |
308 |
< |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
309 |
< |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
310 |
< |
|
311 |
< |
vector<GeomDet*> MuonDets; |
312 |
< |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
313 |
< |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
314 |
< |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
315 |
< |
|
316 |
< |
|
317 |
< |
for(unsigned int i=0;i<MuonDets.size();i++) |
318 |
< |
{ |
319 |
< |
Detid = DetId(MuonDets[i]->geographicalId()); |
320 |
< |
SubDet = Detid.subdetId(); |
321 |
< |
|
322 |
< |
GeomDet* DetUnit = MuonDets[i]; |
323 |
< |
if(!DetUnit)continue; |
324 |
< |
const BoundPlane plane = DetUnit->surface(); |
325 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
326 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
327 |
< |
|
328 |
< |
float width = 0; |
329 |
< |
float length = 0; |
330 |
< |
float thickness = 0; |
331 |
< |
float TrapezoidalParam = 0; |
635 |
> |
edm::ESHandle<CaloGeometry> CaloGeom; |
636 |
> |
// iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
637 |
> |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
638 |
> |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
639 |
|
|
640 |
< |
if(trapezoidalBounds) |
640 |
> |
for(unsigned int i=0;i<CaloDets.size();i++) |
641 |
|
{ |
642 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
643 |
< |
width = parameters[0]*2; |
337 |
< |
length = parameters[3]*2; |
338 |
< |
thickness = (*trapezoidalBounds).thickness(); |
339 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
340 |
< |
}else if(rectangularBounds){ |
341 |
< |
width = DetUnit->surface().bounds().width(); |
342 |
< |
length = DetUnit->surface().bounds().length(); |
343 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
344 |
< |
TrapezoidalParam = 1; |
345 |
< |
} |
642 |
> |
Detid = CaloDets[i]; |
643 |
> |
SubDet = Detid.subdetId(); |
644 |
|
|
645 |
< |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
646 |
< |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
647 |
< |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
648 |
< |
|
649 |
< |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
650 |
< |
|
651 |
< |
Geom_Muon->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
652 |
< |
Pos.x(), Pos.y(), Pos.z(), |
653 |
< |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
654 |
< |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
655 |
< |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
656 |
< |
} |
645 |
> |
if(Detid.det()==DetId::Ecal){ |
646 |
> |
if(SubDet<1 || SubDet>3) continue; |
647 |
> |
|
648 |
> |
Frog_DetId = DETID_ECAL; |
649 |
> |
FEB = ecal; |
650 |
> |
|
651 |
> |
Frog_DetId += SubDet*100000; |
652 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
653 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
654 |
> |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);} |
655 |
> |
|
656 |
> |
if(SubDet==1){ |
657 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EB"); FEB_Temp->addDaughter(FEB);} |
658 |
> |
|
659 |
> |
EBDetId detid = EBDetId(Detid); |
660 |
> |
|
661 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
662 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
663 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
664 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
665 |
> |
|
666 |
> |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
667 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
668 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
669 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIEta%+i", detid.tower_ieta()); FEB_Temp->addDaughter(FEB);} |
670 |
> |
|
671 |
> |
Frog_DetId += detid.tower_iphi()*1; |
672 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
673 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
674 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIPhi%i", detid.tower_iphi()); FEB_Temp->addDaughter(FEB);} |
675 |
> |
}else if(SubDet==2){ |
676 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EE"); FEB_Temp->addDaughter(FEB);} |
677 |
> |
|
678 |
> |
EEDetId detid = EEDetId(Detid); |
679 |
> |
|
680 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
681 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
682 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
683 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
684 |
> |
|
685 |
> |
Frog_DetId += detid.iquadrant()*1000; |
686 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
687 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
688 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Quadran%i", detid.iquadrant()); FEB_Temp->addDaughter(FEB);} |
689 |
> |
|
690 |
> |
Frog_DetId += detid.isc(); |
691 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
692 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
693 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ISC%i", detid.isc()); FEB_Temp->addDaughter(FEB);} |
694 |
> |
}else if(SubDet==3){ |
695 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ES"); FEB_Temp->addDaughter(FEB);} |
696 |
|
|
697 |
+ |
ESDetId detid = ESDetId(Detid); |
698 |
+ |
|
699 |
+ |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
700 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
701 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
702 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
703 |
+ |
|
704 |
+ |
Frog_DetId += detid.plane()*1000; |
705 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
706 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
707 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Plane%i", detid.plane()); FEB_Temp->addDaughter(FEB);} |
708 |
+ |
|
709 |
+ |
Frog_DetId += detid.six()*50; |
710 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
711 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
712 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Six%i", detid.six()); FEB_Temp->addDaughter(FEB);} |
713 |
+ |
|
714 |
+ |
Frog_DetId += detid.siy(); |
715 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
716 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
717 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Siy%i", detid.siy()); FEB_Temp->addDaughter(FEB);} |
718 |
+ |
} |
719 |
+ |
}else if(Detid.det()==DetId::Hcal){ |
720 |
+ |
if(SubDet<1 || SubDet>4) continue; |
721 |
+ |
|
722 |
+ |
Frog_DetId = DETID_HCAL; |
723 |
+ |
FEB = hcal; |
724 |
+ |
|
725 |
+ |
Frog_DetId += SubDet*100000; |
726 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
727 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
728 |
+ |
if(FEB==NULL){ |
729 |
+ |
if(SubDet==1){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HB"); FEB_Temp->addDaughter(FEB);} |
730 |
+ |
if(SubDet==2){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HE"); FEB_Temp->addDaughter(FEB);} |
731 |
+ |
if(SubDet==3){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HO"); FEB_Temp->addDaughter(FEB);} |
732 |
+ |
if(SubDet==4){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HF"); FEB_Temp->addDaughter(FEB);} |
733 |
+ |
} |
734 |
+ |
|
735 |
+ |
HcalDetId detid = HcalDetId(Detid); |
736 |
+ |
|
737 |
+ |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
738 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
739 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
740 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
741 |
+ |
|
742 |
+ |
Frog_DetId += detid.ietaAbs()*100; |
743 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
744 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
745 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);} |
746 |
+ |
|
747 |
+ |
Frog_DetId += detid.iphi()*1; |
748 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
749 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
750 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);} |
751 |
+ |
|
752 |
+ |
}else if(Detid.det() == DetId::Calo){ |
753 |
|
|
754 |
< |
// ### Save .geom ### |
754 |
> |
Frog_DetId = DETID_CALO; |
755 |
> |
FEB = calo; |
756 |
|
|
757 |
< |
Geom_Tracker->Save("Tracker.geom"); |
364 |
< |
Geom_ECAL ->Save("Ecal.geom"); |
365 |
< |
Geom_HCAL ->Save("Hcal.geom"); |
366 |
< |
Geom_Muon ->Save("Muon.geom"); |
757 |
> |
if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue; |
758 |
|
|
759 |
+ |
Frog_DetId += SubDet*100000; |
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, "CaloTowers"); FEB_Temp->addDaughter(FEB);} |
763 |
+ |
|
764 |
+ |
if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){ |
765 |
+ |
CaloTowerDetId detid = CaloTowerDetId(Detid); |
766 |
+ |
|
767 |
+ |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
768 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
769 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
770 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);} |
771 |
+ |
|
772 |
+ |
Frog_DetId += (detid.ieta()*detid.zside())*100; |
773 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
774 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
775 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);} |
776 |
+ |
|
777 |
+ |
Frog_DetId += detid.iphi()*1; |
778 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB); |
779 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
780 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);} |
781 |
+ |
} |
782 |
+ |
} |
783 |
+ |
|
784 |
+ |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
785 |
+ |
GlobalPoint CellPos = CellGeom->getPosition(); |
786 |
+ |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
787 |
+ |
|
788 |
+ |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
789 |
+ |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
790 |
+ |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
791 |
+ |
|
792 |
+ |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
793 |
+ |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
794 |
+ |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
795 |
+ |
|
796 |
+ |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
797 |
+ |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
798 |
+ |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
799 |
+ |
|
800 |
+ |
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) ); |
801 |
+ |
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) ); |
802 |
+ |
|
803 |
+ |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
804 |
+ |
Detid.rawId(), F, |
805 |
+ |
cX , cY , cZ , |
806 |
+ |
wX , wY , wZ , |
807 |
+ |
hX , hY , hZ ); |
808 |
+ |
|
809 |
+ |
FEB->addDaughter(mod); |
810 |
+ |
} |
811 |
+ |
|
812 |
+ |
// ### Save .geom ### |
813 |
+ |
|
814 |
+ |
FROG_Geometry* CMS_Geom = new FROG_Geometry(prim); |
815 |
+ |
CMS_Geom->Save("CMS.geom", CompressFiles); |
816 |
+ |
delete CMS_Geom; |
817 |
+ |
} |
818 |
+ |
|
819 |
+ |
events_prim = new FROG_Element_Base(C_PRIMARY); |
820 |
+ |
events = new FROG_Events(events_prim); |
821 |
|
} |
822 |
|
|
823 |
|
// ------------ method called once each job just after ending the event loop ------------ |
824 |
|
void |
825 |
< |
Frog_Analyzer::endJob() { |
826 |
< |
|
827 |
< |
MyEvents->Save((char*) OutputFile.c_str()); |
828 |
< |
// MyEvents->Load((char*) OutputFile.c_str()); |
825 |
> |
Frog_Analyzer::endJob() |
826 |
> |
{ |
827 |
> |
if(NEvents>0){ |
828 |
> |
char OutputFileName[1024]; |
829 |
> |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
830 |
> |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent); |
831 |
> |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
832 |
> |
|
833 |
> |
// FROG_Events* events = new FROG_Events(events_prim); |
834 |
> |
events->Save((char*) OutputFileName, CompressFiles); |
835 |
> |
delete events; |
836 |
> |
delete events_prim; |
837 |
> |
|
838 |
> |
// events_prim = new FROG_Element_Base(C_PRIMARY); |
839 |
> |
NEvents=0; |
840 |
> |
} |
841 |
|
} |
842 |
|
|
843 |
|
|
850 |
|
void |
851 |
|
Frog_Analyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) |
852 |
|
{ |
853 |
< |
MySimEvent* MyEvent = new MySimEvent; |
853 |
> |
if(NEvents == 0){ |
854 |
> |
SRun = iEvent.id().run(); |
855 |
> |
SEvent = iEvent.id().event(); |
856 |
> |
} |
857 |
> |
|
858 |
> |
|
859 |
> |
FROG_Element_Event* event = new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() ); |
860 |
> |
events_prim->addDaughter(event); |
861 |
|
|
862 |
|
// access the tracker |
863 |
|
edm::ESHandle<TrackerGeometry> tkGeom; |
872 |
|
edm::ESHandle<RPCGeometry> RpcGeom; |
873 |
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
874 |
|
|
875 |
+ |
edm::ESHandle<CaloGeometry> CaloGeom; |
876 |
+ |
iSetup.get<CaloGeometryRecord>().get( CaloGeom ); |
877 |
+ |
|
878 |
+ |
|
879 |
+ |
// ### GEN OBJECTS CONTAINER ### |
880 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogGen = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "GEN"); |
881 |
+ |
event->addDaughter(frogGen); |
882 |
+ |
|
883 |
+ |
// ### GENPARTICLES ### |
884 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogGenPartColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND, "GenParticles"); |
885 |
+ |
frogGen->addDaughter(frogGenPartColl); |
886 |
+ |
|
887 |
+ |
|
888 |
+ |
for(unsigned int i=0;i<GenParticlesProducers.size();i++){ |
889 |
+ |
edm::Handle<GenParticleCollection> h_gen_Particles; |
890 |
+ |
iEvent.getByLabel(GenParticlesProducers[i], h_gen_Particles); |
891 |
+ |
GenParticleCollection gen_Particles = *h_gen_Particles.product(); |
892 |
+ |
|
893 |
+ |
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()); |
894 |
+ |
frogGenPartColl->addDaughter(frogGenPartCollb); |
895 |
+ |
|
896 |
+ |
for(unsigned int h=0;h<gen_Particles.size();h++){ |
897 |
+ |
if(gen_Particles[h].status()!=1)continue; |
898 |
+ |
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()); |
899 |
+ |
frogGenPartCollb->addDaughter(frogGenPart); |
900 |
+ |
} |
901 |
+ |
} |
902 |
+ |
|
903 |
+ |
|
904 |
+ |
// ### SIM OBJECTS CONTAINER ### |
905 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogSim = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIM, "SIM"); |
906 |
+ |
event->addDaughter(frogSim); |
907 |
|
|
404 |
– |
// Save Data |
908 |
|
// ### SIMTRACK ### |
909 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogSimTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMTRK, "SimTracks"); |
910 |
+ |
frogSim->addDaughter(frogSimTrkColl); |
911 |
+ |
|
912 |
|
for(unsigned int i=0;i<SimTrackProducers.size();i++){ |
913 |
|
edm::Handle<std::vector< SimTrack > > h_SimTracks; |
914 |
|
iEvent.getByLabel(SimTrackProducers[i], h_SimTracks); |
915 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
916 |
|
|
917 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
412 |
– |
MySimTrack* MysimTrack = new MySimTrack; |
918 |
|
SimTrack simTrack =SimTrackColl[a]; |
919 |
|
|
920 |
< |
MysimTrack->track_id =simTrack.trackId(); |
921 |
< |
MysimTrack->Type =simTrack.type(); |
922 |
< |
MysimTrack->parent_vertex=simTrack.vertIndex(); |
923 |
< |
MysimTrack->Px =simTrack.momentum().x(); |
924 |
< |
MysimTrack->Py =simTrack.momentum().y(); |
420 |
< |
MysimTrack->Pz =simTrack.momentum().z(); |
421 |
< |
MysimTrack->E =simTrack.momentum().e(); |
422 |
< |
MysimTrack->charge =simTrack.charge(); |
423 |
< |
|
424 |
< |
MyEvent->MySimTrackCollection.push_back(MysimTrack); |
920 |
> |
FROG_Element_Event_Sim_Track* frogSimTrk = new FROG_Element_Event_Sim_Track(simTrack.trackId(), |
921 |
> |
simTrack.momentum().x(), simTrack.momentum().y(), simTrack.momentum().z(), |
922 |
> |
simTrack.momentum().e(), simTrack.type(), simTrack.vertIndex(), |
923 |
> |
simTrack.charge() ); |
924 |
> |
frogSimTrkColl->addDaughter(frogSimTrk); |
925 |
|
} |
926 |
|
} |
927 |
|
|
928 |
|
// ### SIMVERTEX ### |
929 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogSimVtx = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMVTX, "SimVertex"); |
930 |
+ |
frogSim->addDaughter(frogSimVtx); |
931 |
+ |
|
932 |
|
for(unsigned int i=0;i<SimVertexProducers.size();i++){ |
933 |
|
edm::Handle<std::vector< SimVertex > > h_Vertex; |
934 |
|
iEvent.getByLabel(SimVertexProducers[i], h_Vertex); |
935 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
936 |
|
|
937 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
435 |
– |
MySimVertex* MyVertex = new MySimVertex; |
938 |
|
SimVertex Vertex = VertexColl[b]; |
939 |
|
|
940 |
< |
MyVertex->parentTrack_id=Vertex.parentIndex (); |
941 |
< |
MyVertex->x =Vertex.position().x(); |
942 |
< |
MyVertex->y =Vertex.position().y(); |
441 |
< |
MyVertex->z =Vertex.position().z(); |
940 |
> |
FROG_Element_Event_Sim_Vertex* frogSimVertex = new FROG_Element_Event_Sim_Vertex( |
941 |
> |
Vertex.position().x(), Vertex.position().y(), Vertex.position().z(), |
942 |
> |
Vertex.parentIndex()); |
943 |
|
|
944 |
< |
MyEvent->MySimVertexCollection.push_back(MyVertex); |
944 |
> |
frogSimVtx->addDaughter(frogSimVertex); |
945 |
|
} |
946 |
|
} |
947 |
|
|
948 |
+ |
|
949 |
|
// ### SIMHIT ### |
950 |
+ |
|
951 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogSimHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT, "SimHits"); |
952 |
+ |
frogSim->addDaughter(frogSimHit); |
953 |
|
for(unsigned int i=0;i<SimHitProducers.size();i++){ |
954 |
|
edm::Handle<std::vector< PSimHit > > h_Hits; |
955 |
|
iEvent.getByLabel(SimHitProducers[i], h_Hits); |
956 |
|
std::vector< PSimHit > Hits = *h_Hits.product(); |
957 |
|
|
958 |
+ |
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() ); |
959 |
+ |
frogSimHit->addDaughter(frogSimHitColl); |
960 |
+ |
|
961 |
|
for(unsigned int h=0; h<Hits.size(); h++) |
962 |
|
{ |
963 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
964 |
< |
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
964 |
> |
const GeomDet* theDet = NULL; |
965 |
> |
if(theDetUnitId.det() == DetId::Tracker)theDet = tkGeom->idToDet(theDetUnitId); |
966 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::DT) theDet = DtGeom->idToDet(theDetUnitId); |
967 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::CSC)theDet = CscGeom->idToDet(theDetUnitId); |
968 |
> |
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::RPC)theDet = RpcGeom->idToDet(theDetUnitId); |
969 |
> |
|
970 |
> |
|
971 |
> |
FROG_Element_Event_Sim_Hit* frogSimHit = new FROG_Element_Event_Sim_Hit( |
972 |
> |
theDet->surface().toGlobal(Hits[h].localPosition()).x(),theDet->surface().toGlobal(Hits[h].localPosition()).y(),theDet->surface().toGlobal(Hits[h].localPosition()).z(), |
973 |
> |
Hits[h].energyLoss(), Hits[h].processType() ); |
974 |
> |
frogSimHitColl->addDaughter(frogSimHit); |
975 |
> |
} |
976 |
> |
} |
977 |
|
|
978 |
< |
MyPSimHit* Hit = new MyPSimHit; |
459 |
< |
Hit->x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
460 |
< |
Hit->y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
461 |
< |
Hit->z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
462 |
< |
Hit->ProcessType = Hits[h].processType(); |
463 |
< |
Hit->dEdX = Hits[h].energyLoss(); |
978 |
> |
// ### SIMCALOHIT ### |
979 |
|
|
980 |
< |
MyEvent->MyPSimHitCollection.push_back(Hit); |
980 |
> |
for(unsigned int i=0;i<SimCaloHitProducers.size();i++){ |
981 |
> |
edm::Handle<std::vector< PCaloHit > > h_CaloHits; |
982 |
> |
iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits); |
983 |
> |
std::vector< PCaloHit > CaloHits = *h_CaloHits.product(); |
984 |
> |
|
985 |
> |
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()); |
986 |
> |
frogSimHit->addDaughter(frogSimHitColl); |
987 |
> |
|
988 |
> |
for(unsigned int h=0; h<CaloHits.size(); h++) |
989 |
> |
{ |
990 |
> |
DetId theDetUnitId(CaloHits[h].id()); |
991 |
> |
const CaloCellGeometry* CellGeom = NULL; |
992 |
> |
if(theDetUnitId.det() == DetId::Ecal || theDetUnitId.det() == DetId::Hcal)CellGeom = CaloGeom->getGeometry(theDetUnitId); |
993 |
> |
if(CellGeom==NULL)continue; |
994 |
> |
|
995 |
> |
|
996 |
> |
FROG_Element_Event_Sim_Hit* frogSimCaloHit = new FROG_Element_Event_Sim_Hit( |
997 |
> |
CellGeom->getPosition().x(),CellGeom->getPosition().y(),CellGeom->getPosition().z(), |
998 |
> |
CaloHits[h].energy(), CaloHits[h].depth() ); |
999 |
> |
frogSimHitColl->addDaughter(frogSimCaloHit); |
1000 |
|
} |
1001 |
< |
} |
1001 |
> |
} |
1002 |
|
|
1003 |
|
|
470 |
– |
// ### TRACKS ### |
471 |
– |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
472 |
– |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
473 |
– |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
474 |
– |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
1004 |
|
|
476 |
– |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
477 |
– |
Trajectory recoTraj = *it->key; |
478 |
– |
MyRecoTrack* MyrecoTrack = new MyRecoTrack; |
1005 |
|
|
1006 |
< |
MyRecoTrackInfo* info = new MyRecoTrackInfo; |
1007 |
< |
info->Coll = i; |
1008 |
< |
info->P = it->val->p(); |
483 |
< |
info->Pt = it->val->pt(); |
484 |
< |
MyrecoTrack->Info = info; |
1006 |
> |
// ### LOW RECO OBJECTS CONTAINER ### |
1007 |
> |
FROG_Element_Base_With_DetId_And_Name* frogLowReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_LOWRECO, "RECO LOW"); |
1008 |
> |
event->addDaughter(frogLowReco); |
1009 |
|
|
1010 |
|
|
487 |
– |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
488 |
– |
for(unsigned int h=0;h<measurements.size();h++){ |
1011 |
|
|
1012 |
< |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
1013 |
< |
if(!h_it->isValid() )continue; |
1014 |
< |
DetId detId = h_it->geographicalId(); |
1015 |
< |
// const GeomDet * theDet = tkGeom->idToDet(detId); |
1016 |
< |
// LocalPoint localPos = h_it->localPosition(); |
1017 |
< |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
1012 |
> |
// ### SiStrip Clusters ### |
1013 |
> |
FROG_Element_Base_With_DetId_And_Name* frogSSTHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT, "SiStrip Clusters"); |
1014 |
> |
frogLowReco->addDaughter(frogSSTHit); |
1015 |
> |
for(unsigned int i=0;i<SiStripClusterProducers.size();i++){ |
1016 |
> |
edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits; |
1017 |
> |
iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits); |
1018 |
> |
const edmNew::DetSetVector<SiStripCluster>& Sst_Hits = *h_Sst_Hits.product(); |
1019 |
> |
|
1020 |
> |
|
1021 |
> |
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()); |
1022 |
> |
frogSSTHit->addDaughter(frogSstHitColl); |
1023 |
> |
|
1024 |
> |
|
1025 |
> |
for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) { |
1026 |
> |
edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin(); |
1027 |
> |
edmNew::DetSet<SiStripCluster>::const_iterator end =DSViter->end(); |
1028 |
> |
for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){ |
1029 |
> |
|
1030 |
> |
const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) ); |
1031 |
> |
if(!detUnit)continue; |
1032 |
> |
|
1033 |
> |
const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit ); |
1034 |
> |
if(!DetUnit)continue; |
1035 |
> |
|
1036 |
> |
const StripTopology& Topo = DetUnit->specificTopology(); |
1037 |
> |
|
1038 |
> |
unsigned int Charge = 0; |
1039 |
> |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];} |
1040 |
> |
|
1041 |
> |
unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2; |
1042 |
> |
|
1043 |
> |
float Pitch = DetUnit->surface().bounds().width() / Topo.nstrips(); |
1044 |
> |
float XPos = (MiddleStrip * Pitch) - DetUnit->surface().bounds().width()/2; |
1045 |
> |
//float YPos = DetUnit->surface().bounds().thickness()/2; |
1046 |
> |
//float ZPos = DetUnit->surface().bounds().length()/2; |
1047 |
> |
|
1048 |
> |
Surface::GlobalPoint Pos = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) ); |
1049 |
> |
|
1050 |
> |
|
1051 |
> |
FROG_Element_Event_Hit_SiStrip* frogStripHit = new FROG_Element_Event_Hit_SiStrip(iCluster->geographicalId(), iCluster->firstStrip(), Pitch); |
1052 |
> |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){frogStripHit->Ampl_.push_back(iCluster->amplitudes()[i]);} |
1053 |
> |
frogSstHitColl->addDaughter(frogStripHit); |
1054 |
> |
}} |
1055 |
|
|
497 |
– |
MyRecoHit* hit = new MyRecoHit; |
498 |
– |
/* |
499 |
– |
hit->x = theDet->surface().toGlobal(localPos).x(); |
500 |
– |
hit->y = theDet->surface().toGlobal(localPos).y(); |
501 |
– |
hit->z = theDet->surface().toGlobal(localPos).z(); |
502 |
– |
*/ |
503 |
– |
hit->x = globalPos.x(); |
504 |
– |
hit->y = globalPos.y(); |
505 |
– |
hit->z = globalPos.z(); |
506 |
– |
hit->DetId = detId.rawId(); |
507 |
– |
hit->Charge = -1; |
508 |
– |
MyrecoTrack->Hits.push_back(hit); |
509 |
– |
} |
510 |
– |
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
511 |
– |
} |
1056 |
|
} |
1057 |
|
|
1058 |
|
|
1059 |
+ |
|
1060 |
+ |
// ### CALORecHits ### |
1061 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogCaloHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOHIT, "CALO Hits"); |
1062 |
+ |
frogLowReco->addDaughter(frogCaloHit); |
1063 |
+ |
|
1064 |
+ |
|
1065 |
|
// ### ECALRecHits ### |
1066 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogEcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT, "ECAL RecHits"); |
1067 |
+ |
frogCaloHit->addDaughter(frogEcalHit); |
1068 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
1069 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
1070 |
|
iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits); |
1071 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
1072 |
|
|
1073 |
+ |
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()); |
1074 |
+ |
frogEcalHit->addDaughter(frogHitColl); |
1075 |
+ |
|
1076 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
1077 |
< |
MyCaloHit* temp_EcalHit = new MyCaloHit; |
1078 |
< |
temp_EcalHit->E = Ecal_RecHits[eh].energy(); |
1079 |
< |
temp_EcalHit->t = Ecal_RecHits[eh].time(); |
525 |
< |
temp_EcalHit->DetId = (Ecal_RecHits[eh].detid()).rawId(); |
526 |
< |
|
527 |
< |
MyEvent->MyEcalCaloHitCollection.push_back(temp_EcalHit); |
1077 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(), |
1078 |
> |
Ecal_RecHits[eh].energy(), Ecal_RecHits[eh].time()); |
1079 |
> |
frogHitColl->addDaughter(frogCaloHit); |
1080 |
|
} |
1081 |
|
} |
1082 |
|
|
1083 |
|
|
1084 |
|
// ### HCALRecHits ### |
1085 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogHcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT, "HCAL RecHits"); |
1086 |
+ |
frogCaloHit->addDaughter(frogHcalHit); |
1087 |
|
for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){ |
1088 |
|
edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits; |
1089 |
|
iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits); |
1090 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
1091 |
|
|
1092 |
< |
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
1093 |
< |
MyCaloHit* temp_HcalHBHEHit = new MyCaloHit; |
540 |
< |
temp_HcalHBHEHit->E = HcalHBHE_RecHits[hh].energy(); |
541 |
< |
temp_HcalHBHEHit->t = HcalHBHE_RecHits[hh].time(); |
542 |
< |
temp_HcalHBHEHit->DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
1092 |
> |
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()); |
1093 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1094 |
|
|
1095 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHBHEHit); |
1095 |
> |
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
1096 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(), |
1097 |
> |
HcalHBHE_RecHits[hh].energy(), HcalHBHE_RecHits[hh].time()); |
1098 |
> |
frogHitColl->addDaughter(frogCaloHit); |
1099 |
|
} |
1100 |
|
} |
1101 |
|
|
548 |
– |
|
1102 |
|
for(unsigned int i=0;i<HcalHORecHitProducers.size();i++){ |
1103 |
|
edm::Handle<HORecHitCollection > h_HcalHO_RecHits; |
1104 |
|
iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits); |
1105 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
1106 |
|
|
1107 |
< |
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
1108 |
< |
MyCaloHit* temp_HcalHOHit = new MyCaloHit; |
556 |
< |
temp_HcalHOHit->E = HcalHO_RecHits[hh].energy(); |
557 |
< |
temp_HcalHOHit->t = HcalHO_RecHits[hh].time(); |
558 |
< |
temp_HcalHOHit->DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
1107 |
> |
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()); |
1108 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1109 |
|
|
1110 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHOHit); |
1110 |
> |
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
1111 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHO_RecHits[hh].detid()).rawId(), |
1112 |
> |
HcalHO_RecHits[hh].energy(), HcalHO_RecHits[hh].time()); |
1113 |
> |
frogHitColl->addDaughter(frogCaloHit); |
1114 |
|
} |
1115 |
|
} |
1116 |
|
|
564 |
– |
|
1117 |
|
for(unsigned int i=0;i<HcalHFRecHitProducers.size();i++){ |
1118 |
|
edm::Handle<HFRecHitCollection > h_HcalHF_RecHits; |
1119 |
|
iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits); |
1120 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
1121 |
|
|
1122 |
< |
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
1123 |
< |
MyCaloHit* temp_HcalHFHit = new MyCaloHit; |
572 |
< |
temp_HcalHFHit->E = HcalHF_RecHits[hh].energy(); |
573 |
< |
temp_HcalHFHit->t = HcalHF_RecHits[hh].time(); |
574 |
< |
temp_HcalHFHit->DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
1122 |
> |
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()); |
1123 |
> |
frogHcalHit->addDaughter(frogHitColl); |
1124 |
|
|
1125 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHFHit); |
1125 |
> |
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
1126 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHF_RecHits[hh].detid()).rawId(), |
1127 |
> |
HcalHF_RecHits[hh].energy(), HcalHF_RecHits[hh].time()); |
1128 |
> |
frogHitColl->addDaughter(frogCaloHit); |
1129 |
|
} |
1130 |
|
} |
1131 |
|
|
1132 |
+ |
|
1133 |
|
// ### Muon Segments ### |
1134 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogMuonSeg = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG, "MuonSegments"); |
1135 |
+ |
frogLowReco->addDaughter(frogMuonSeg); |
1136 |
+ |
|
1137 |
|
for(unsigned int i=0;i<CSCSegmentProducers.size();i++){ |
1138 |
|
edm::Handle<CSCSegmentCollection > h_CSC_Segments; |
1139 |
|
iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments); |
1140 |
|
CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product(); |
1141 |
|
|
1142 |
+ |
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()); |
1143 |
+ |
frogMuonSeg->addDaughter(frogSegColl); |
1144 |
+ |
|
1145 |
|
for(unsigned int s=0;s<CSC_Segments.size();s++){ |
1146 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
1147 |
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId); |
1148 |
|
|
1149 |
< |
MyMuonSegment* temp_CscSeg = new MyMuonSegment; |
1150 |
< |
temp_CscSeg->DetId = theDetUnitId.rawId(); |
1151 |
< |
temp_CscSeg->PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
1152 |
< |
temp_CscSeg->PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
594 |
< |
temp_CscSeg->PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
595 |
< |
temp_CscSeg->DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
596 |
< |
temp_CscSeg->DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
597 |
< |
temp_CscSeg->DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
598 |
< |
|
599 |
< |
MyEvent->MyMuonSegmentCollection.push_back(temp_CscSeg); |
1149 |
> |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(), |
1150 |
> |
theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z() , |
1151 |
> |
theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z() ); |
1152 |
> |
frogSegColl->addDaughter(frogSeg); |
1153 |
|
} |
1154 |
|
} |
1155 |
|
|
1158 |
|
iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments); |
1159 |
|
DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product(); |
1160 |
|
|
1161 |
+ |
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()); |
1162 |
+ |
frogMuonSeg->addDaughter(frogSegColl); |
1163 |
+ |
|
1164 |
|
for(unsigned int s=0;s<DT_Segments.size();s++){ |
1165 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
1166 |
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId); |
1167 |
|
|
1168 |
< |
MyMuonSegment* temp_DtSeg = new MyMuonSegment; |
1169 |
< |
temp_DtSeg->DetId = theDetUnitId.rawId(); |
1170 |
< |
temp_DtSeg->PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
1171 |
< |
temp_DtSeg->PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
616 |
< |
temp_DtSeg->PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
617 |
< |
temp_DtSeg->DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
618 |
< |
temp_DtSeg->DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
619 |
< |
temp_DtSeg->DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
620 |
< |
|
621 |
< |
MyEvent->MyMuonSegmentCollection.push_back(temp_DtSeg); |
1168 |
> |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(), |
1169 |
> |
theDet->surface().toGlobal(DT_Segments[s].localPosition()).x() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).y() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).z() , |
1170 |
> |
theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).z() ); |
1171 |
> |
frogSegColl->addDaughter(frogSeg); |
1172 |
|
} |
1173 |
|
} |
1174 |
|
|
1175 |
|
// ### Muon Hits ### |
1176 |
+ |
FROG_Element_Base_With_DetId_And_Name* frogMuonHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT, "MuonHits"); |
1177 |
+ |
frogLowReco->addDaughter(frogMuonHit); |
1178 |
|
for(unsigned int i=0;i<RPCHitsProducers.size();i++){ |
1179 |
|
edm::Handle<RPCRecHitCollection > h_RPC_Hits; |
1180 |
|
iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits); |
1181 |
|
RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product(); |
1182 |
|
|
1183 |
+ |
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()); |
1184 |
+ |
frogMuonHit->addDaughter(frogHitColl); |
1185 |
+ |
|
1186 |
|
for(unsigned int h=0;h<RPC_Hits.size();h++){ |
1187 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
1188 |
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId); |
1189 |
|
|
1190 |
< |
MyMuonHit* temp_RpcHit = new MyMuonHit; |
1191 |
< |
temp_RpcHit->DetId = theDetUnitId.rawId(); |
1192 |
< |
temp_RpcHit->x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
1193 |
< |
temp_RpcHit->y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
1194 |
< |
temp_RpcHit->z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
1190 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(theDetUnitId.rawId(), |
1191 |
> |
theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x() , theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y() , theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(), -1 ); |
1192 |
> |
frogHitColl->addDaughter(frogHit); |
1193 |
> |
} |
1194 |
> |
} |
1195 |
> |
|
1196 |
> |
|
1197 |
> |
// ### Calo Towers ### |
1198 |
> |
FROG_Element_Base_With_DetId_And_Name* frogCaloTower = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER, "CaloTowers"); |
1199 |
> |
frogLowReco->addDaughter(frogCaloTower); |
1200 |
> |
for(unsigned int i=0;i<CaloTowersProducers.size();i++){ |
1201 |
> |
edm::Handle<CaloTowerCollection> h_Calo_Towers; |
1202 |
> |
iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers); |
1203 |
> |
CaloTowerCollection Calo_Towers = *h_Calo_Towers.product(); |
1204 |
> |
|
1205 |
> |
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()); |
1206 |
> |
frogCaloTower->addDaughter(frogCaloTowerColl); |
1207 |
> |
|
1208 |
> |
for(unsigned int h=0;h<Calo_Towers.size();h++){ |
1209 |
> |
FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy()); |
1210 |
> |
frogCaloTowerColl->addDaughter(frogTower); |
1211 |
> |
|
1212 |
> |
if(i==0 && CaloTowersProducersBasedOnCaloHits){ |
1213 |
> |
frogTower->Components_CollEvtId_ = EVTID_CALOHIT; |
1214 |
> |
|
1215 |
> |
|
1216 |
> |
for(unsigned int D=0;D<Calo_Towers[h].constituentsSize();D++){frogTower->Components_Vector_.push_back(Calo_Towers[h].constituent(D));} |
1217 |
> |
|
1218 |
> |
// std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents(); |
1219 |
> |
// for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);} |
1220 |
> |
} |
1221 |
> |
|
1222 |
> |
} |
1223 |
> |
} |
1224 |
> |
|
1225 |
> |
|
1226 |
> |
|
1227 |
> |
// ### MED RECO OBJECTS CONTAINER ### |
1228 |
> |
FROG_Element_Base_With_DetId_And_Name* frogMedReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_MEDRECO, "RECO MED"); |
1229 |
> |
event->addDaughter(frogMedReco); |
1230 |
> |
|
1231 |
> |
|
1232 |
> |
|
1233 |
> |
|
1234 |
> |
|
1235 |
> |
FROG_Element_Base_With_DetId_And_Name* frogNIVertex = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT, "Vertex from NI"); |
1236 |
> |
frogMedReco->addDaughter(frogNIVertex); |
1237 |
> |
|
1238 |
> |
// NUCLEAR INTERACTIONS |
1239 |
> |
for(unsigned int i=0;i<NIProducers.size();i++) { |
1240 |
> |
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs; |
1241 |
> |
iEvent.getByLabel(NIProducers[i], h_NIs); |
1242 |
> |
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product(); |
1243 |
> |
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()); |
1244 |
> |
frogNIVertex->addDaughter(frogNIColl); |
1245 |
> |
|
1246 |
> |
for(unsigned int h=0; h<NIs.size();h++){ |
1247 |
> |
reco::NuclearInteraction ni = NIs[i]; |
1248 |
> |
float vtx_x = ni.vertex().x(); |
1249 |
> |
float vtx_y = ni.vertex().y(); |
1250 |
> |
float vtx_z = ni.vertex().z(); |
1251 |
> |
float like = ni.likelihood(); |
1252 |
> |
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like ); |
1253 |
> |
frogNIColl->addDaughter(frogNI); |
1254 |
> |
} |
1255 |
> |
} |
1256 |
> |
|
1257 |
> |
|
1258 |
> |
|
1259 |
> |
// ### TRAJECTORY ### |
1260 |
> |
FROG_Element_Base_With_DetId_And_Name* frogTrk = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK, "Tracks & Trajectories"); |
1261 |
> |
frogMedReco->addDaughter(frogTrk); |
1262 |
> |
|
1263 |
> |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
1264 |
> |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
1265 |
> |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
1266 |
> |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
1267 |
> |
|
1268 |
> |
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()); |
1269 |
> |
frogTrk->addDaughter(frogTrkColl); |
1270 |
|
|
1271 |
< |
MyEvent->MyMuonHitCollection.push_back(temp_RpcHit); |
1271 |
> |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
1272 |
> |
Trajectory recoTraj = *it->key; |
1273 |
> |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared()); |
1274 |
> |
frogTrkColl->addDaughter(frogTrk); |
1275 |
> |
|
1276 |
> |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
1277 |
> |
for(unsigned int h=0;h<measurements.size();h++){ |
1278 |
> |
|
1279 |
> |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
1280 |
> |
if(!h_it->isValid() )continue; |
1281 |
> |
DetId detId = h_it->geographicalId(); |
1282 |
> |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
1283 |
> |
|
1284 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1); |
1285 |
> |
frogTrk->addDaughter(frogHit); |
1286 |
> |
} |
1287 |
> |
// printf("Add a Trajectory\n"); |
1288 |
> |
} |
1289 |
> |
} |
1290 |
> |
|
1291 |
> |
|
1292 |
> |
|
1293 |
> |
|
1294 |
> |
// ### TRACK ### |
1295 |
> |
|
1296 |
> |
for(unsigned int i=0;i<TrackProducers.size();i++){ |
1297 |
> |
edm::Handle<std::vector< reco::Track > > h_Tracks; |
1298 |
> |
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
1299 |
> |
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
1300 |
> |
|
1301 |
> |
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()); |
1302 |
> |
frogTrk->addDaughter(frogTrkColl); |
1303 |
> |
|
1304 |
> |
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
1305 |
> |
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
1306 |
> |
reco::Track recoTrack =TrackColl[t]; |
1307 |
> |
|
1308 |
> |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2()); |
1309 |
> |
frogTrkColl->addDaughter(frogTrk); |
1310 |
> |
|
1311 |
> |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
1312 |
> |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
1313 |
> |
if(!h_it->isValid() )continue; |
1314 |
> |
DetId detId = h_it->geographicalId(); |
1315 |
> |
const GeomDet * theDet = NULL; |
1316 |
> |
|
1317 |
> |
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId); |
1318 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId); |
1319 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId); |
1320 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId); |
1321 |
> |
|
1322 |
> |
LocalPoint localPos = h_it->localPosition(); |
1323 |
> |
|
1324 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit( |
1325 |
> |
detId.rawId(), |
1326 |
> |
theDet->surface().toGlobal(localPos).x(), |
1327 |
> |
theDet->surface().toGlobal(localPos).y(), |
1328 |
> |
theDet->surface().toGlobal(localPos).z(), |
1329 |
> |
-1); |
1330 |
> |
frogTrk->addDaughter(frogHit); |
1331 |
> |
} |
1332 |
> |
//printf("Add a Track\n"); |
1333 |
> |
|
1334 |
> |
} |
1335 |
> |
} |
1336 |
> |
|
1337 |
> |
|
1338 |
> |
|
1339 |
> |
|
1340 |
> |
|
1341 |
> |
|
1342 |
> |
// ### HIGH RECO OBJECTS CONTAINER ### |
1343 |
> |
FROG_Element_Base_With_DetId_And_Name* frogHighReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_HIGHRECO, "RECO HIGH"); |
1344 |
> |
event->addDaughter(frogHighReco); |
1345 |
> |
|
1346 |
> |
|
1347 |
> |
|
1348 |
> |
FROG_Element_Base_With_DetId_And_Name* frogJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET, "Jets"); |
1349 |
> |
frogHighReco->addDaughter(frogJet); |
1350 |
> |
|
1351 |
> |
|
1352 |
> |
// ### Basic Jets ### |
1353 |
> |
FROG_Element_Base_With_DetId_And_Name* frogBasicJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC, "BasicJets"); |
1354 |
> |
frogJet->addDaughter(frogBasicJet); |
1355 |
> |
for(unsigned int i=0;i<BasicJetsProducers.size();i++){ |
1356 |
> |
edm::Handle<BasicJetCollection> h_Basic_Jets; |
1357 |
> |
iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets); |
1358 |
> |
BasicJetCollection Basic_Jets = *h_Basic_Jets.product(); |
1359 |
> |
|
1360 |
> |
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()); |
1361 |
> |
frogBasicJet->addDaughter(frogBasicJetColl); |
1362 |
> |
|
1363 |
> |
for(unsigned int h=0;h<Basic_Jets.size();h++){ |
1364 |
> |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi()); |
1365 |
> |
frogBasicJet->addDaughter(frogJet); |
1366 |
> |
} |
1367 |
> |
} |
1368 |
> |
|
1369 |
> |
|
1370 |
> |
// ### Calo Jets ### |
1371 |
> |
FROG_Element_Base_With_DetId_And_Name* frogCaloJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO, "CaloJets"); |
1372 |
> |
frogJet->addDaughter(frogCaloJet); |
1373 |
> |
for(unsigned int i=0;i<CaloJetsProducers.size();i++){ |
1374 |
> |
edm::Handle<CaloJetCollection> h_Calo_Jets; |
1375 |
> |
iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets); |
1376 |
> |
CaloJetCollection Calo_Jets = *h_Calo_Jets.product(); |
1377 |
> |
|
1378 |
> |
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()); |
1379 |
> |
frogCaloJet->addDaughter(frogCaloJetColl); |
1380 |
> |
|
1381 |
> |
for(unsigned int h=0;h<Calo_Jets.size();h++){ |
1382 |
> |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi()); |
1383 |
> |
frogCaloJetColl->addDaughter(frogJet); |
1384 |
> |
|
1385 |
> |
if(CaloJetsProducersBasedOnCaloTowers){ |
1386 |
> |
|
1387 |
> |
std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents(); |
1388 |
> |
frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1; |
1389 |
> |
for(unsigned int t=0;t<CaloTowers.size();t++){ frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());} |
1390 |
> |
} |
1391 |
|
} |
1392 |
|
} |
1393 |
|
|
1394 |
< |
MyEvents->Events.push_back(MyEvent); |
1394 |
> |
// ### MET ### |
1395 |
> |
FROG_Element_Base_With_DetId_And_Name* frogMET = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO, "MET"); |
1396 |
> |
frogHighReco->addDaughter(frogMET); |
1397 |
> |
for(unsigned int i=0;i<CaloMETProducers.size();i++){ |
1398 |
> |
edm::Handle<CaloMETCollection> h_met; |
1399 |
> |
iEvent.getByLabel(CaloMETProducers[i], h_met); |
1400 |
> |
CaloMETCollection reco_met = *h_met.product(); |
1401 |
> |
|
1402 |
> |
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()); |
1403 |
> |
frogMET->addDaughter(frogMETColl); |
1404 |
> |
|
1405 |
> |
for(unsigned int h=0;h<reco_met.size();h++){ |
1406 |
> |
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()); |
1407 |
> |
frogMETColl->addDaughter(frogMETevt); |
1408 |
> |
} |
1409 |
> |
} |
1410 |
> |
|
1411 |
> |
|
1412 |
> |
// ### RecoCandidates ### |
1413 |
> |
FROG_Element_Base_With_DetId_And_Name* frogRecoCand = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND, "RecoCandidates"); |
1414 |
> |
frogHighReco->addDaughter(frogRecoCand); |
1415 |
> |
for(unsigned int i=0;i<RecoCandidateProducers.size();i++){ |
1416 |
> |
edm::Handle<CandidateCollection> h_reco_Candidates; |
1417 |
> |
iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates); |
1418 |
> |
CandidateCollection reco_Candidates = *h_reco_Candidates.product(); |
1419 |
> |
|
1420 |
> |
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()); |
1421 |
> |
frogRecoCand->addDaughter(frogRecoCandColl); |
1422 |
> |
|
1423 |
> |
for(unsigned int h=0;h<reco_Candidates.size();h++){ |
1424 |
> |
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()); |
1425 |
> |
frogRecoCandColl->addDaughter(frogCandidate); |
1426 |
> |
} |
1427 |
> |
} |
1428 |
> |
|
1429 |
> |
|
1430 |
> |
|
1431 |
> |
NEvents++; |
1432 |
> |
|
1433 |
> |
char OutputFileName[1024]; |
1434 |
> |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
1435 |
> |
if(NEventsInVisFile>0)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent); |
1436 |
> |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
1437 |
> |
events->SaveInLive((char*) OutputFileName, (unsigned int)-1); |
1438 |
> |
|
1439 |
> |
if(NEvents == NEventsInVisFile){ |
1440 |
> |
delete events; |
1441 |
> |
delete events_prim; |
1442 |
> |
|
1443 |
> |
events_prim = new FROG_Element_Base(C_PRIMARY); |
1444 |
> |
events = new FROG_Events(events_prim); |
1445 |
> |
NEvents=0; |
1446 |
> |
|
1447 |
> |
#ifdef FROG_ZLIB |
1448 |
> |
if(CompressFiles){ |
1449 |
> |
FROG_ZLIB_Deflate(OutputFileName); |
1450 |
> |
} |
1451 |
> |
#endif |
1452 |
> |
} |
1453 |
|
} |
1454 |
|
|
1455 |
|
|