79 |
|
#include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h" |
80 |
|
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h" |
81 |
|
#include "DataFormats/TrackReco/interface/Track.h" |
82 |
+ |
#include "TrackingTools/PatternTools/interface/Trajectory.h" |
83 |
+ |
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" |
84 |
+ |
|
85 |
|
|
86 |
|
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" |
87 |
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" |
94 |
|
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h" |
95 |
|
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h" |
96 |
|
|
97 |
< |
#include "Visualisation/Frog/interface/SimEvent.h" |
98 |
< |
#include "Visualisation/Frog/interface/Geometry.h" |
97 |
> |
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" |
98 |
> |
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" |
99 |
> |
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h" |
100 |
> |
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h" |
101 |
> |
#include "DataFormats/SiStripDetId/interface/TIBDetId.h" |
102 |
> |
#include "DataFormats/SiStripDetId/interface/TIDDetId.h" |
103 |
> |
#include "DataFormats/SiStripDetId/interface/TOBDetId.h" |
104 |
> |
#include "DataFormats/SiStripDetId/interface/TECDetId.h" |
105 |
> |
|
106 |
> |
#include "DataFormats/MuonDetId/interface/DTChamberId.h" |
107 |
> |
#include "DataFormats/MuonDetId/interface/CSCDetId.h" |
108 |
> |
#include "DataFormats/MuonDetId/interface/RPCDetId.h" |
109 |
> |
|
110 |
> |
#include "DataFormats/EcalDetId/interface/EBDetId.h" |
111 |
> |
#include "DataFormats/EcalDetId/interface/EEDetId.h" |
112 |
> |
#include "DataFormats/EcalDetId/interface/ESDetId.h" |
113 |
> |
#include "DataFormats/HcalDetId/interface/HcalDetId.h" |
114 |
> |
|
115 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId.h" |
116 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h" |
117 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp" |
118 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_Track.h" |
119 |
> |
|
120 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.h" |
121 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.cpp" |
122 |
> |
|
123 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.h" |
124 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.cpp" |
125 |
> |
|
126 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h" |
127 |
> |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp" |
128 |
> |
|
129 |
|
|
130 |
|
using namespace edm; |
131 |
|
using namespace std; |
145 |
|
virtual void analyze (const edm::Event&, const edm::EventSetup&); |
146 |
|
virtual void endJob (); |
147 |
|
|
148 |
+ |
FROG_Element_Base* events_prim; |
149 |
|
|
150 |
< |
MySimEvents* MyEvents; |
117 |
< |
Geometry* Geom_Tracker; |
118 |
< |
Geometry* Geom_ECAL; |
119 |
< |
Geometry* Geom_HCAL; |
120 |
< |
Geometry* Geom_Muon; |
121 |
< |
|
122 |
< |
|
123 |
< |
std::string OutputFile; |
150 |
> |
std::string OutputFile; |
151 |
|
|
152 |
|
std::vector<InputTag> SimTrackProducers; |
153 |
|
std::vector<InputTag> SimVertexProducers; |
154 |
|
std::vector<InputTag> SimHitProducers; |
155 |
|
|
156 |
|
std::vector<InputTag> TrackProducers; |
157 |
+ |
std::vector<InputTag> TrajectoryProducers; |
158 |
|
std::vector<InputTag> EcalRecHitProducers; |
159 |
|
std::vector<InputTag> HcalHBHERecHitProducers; |
160 |
|
std::vector<InputTag> HcalHORecHitProducers; |
164 |
|
|
165 |
|
std::vector<InputTag> RPCHitsProducers; |
166 |
|
|
167 |
+ |
// ----------member data --------------------------- |
168 |
|
|
169 |
+ |
bool ProduceGeom; |
170 |
+ |
int NEventsInVisFile; |
171 |
+ |
int NEvents; |
172 |
|
|
173 |
< |
|
174 |
< |
// ----------member data --------------------------- |
173 |
> |
unsigned int SRun; |
174 |
> |
unsigned int SEvent; |
175 |
|
}; |
176 |
|
|
177 |
|
// |
186 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
187 |
|
|
188 |
|
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
189 |
+ |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
190 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
191 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
192 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
197 |
|
|
198 |
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers"); |
199 |
|
|
200 |
+ |
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" ); |
201 |
+ |
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" ); |
202 |
+ |
|
203 |
+ |
NEvents = 0; |
204 |
|
} |
205 |
|
|
206 |
|
|
212 |
|
void |
213 |
|
Frog_Analyzer::beginJob(const edm::EventSetup& iSetup) |
214 |
|
{ |
215 |
< |
DetId Detid; |
216 |
< |
int SubDet; |
215 |
> |
if(ProduceGeom){ |
216 |
> |
DetId Detid; |
217 |
> |
unsigned int SubDet; |
218 |
> |
|
219 |
> |
unsigned int Frog_DetId; |
220 |
> |
FROG_Element_Base* FEB = NULL; |
221 |
> |
FROG_Element_Base_With_DetId* FEB_Temp = NULL; |
222 |
> |
|
223 |
> |
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
224 |
> |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
225 |
> |
FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK); geom->addDaughter(tracker); |
226 |
> |
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
227 |
> |
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
228 |
> |
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
229 |
> |
|
230 |
> |
|
231 |
> |
// ### TRACKER GEOMETRY ### |
232 |
> |
|
233 |
> |
edm::ESHandle<TrackerGeometry> tkGeom; |
234 |
> |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
235 |
> |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
236 |
> |
|
237 |
> |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
238 |
> |
Detid = TrackerDets[i]->geographicalId(); |
239 |
> |
SubDet = Detid.subdetId(); |
240 |
> |
if(SubDet<1 || SubDet>6) continue; |
241 |
> |
|
242 |
> |
|
243 |
> |
GeomDet* DetUnit = TrackerDets[i]; |
244 |
> |
if(!DetUnit)continue; |
245 |
> |
const BoundPlane plane = DetUnit->surface(); |
246 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
247 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
248 |
> |
|
249 |
> |
float width = 0; |
250 |
> |
float length = 0; |
251 |
> |
float thickness = 0; |
252 |
> |
float TrapezoidalParam = 0; |
253 |
> |
|
254 |
> |
if(trapezoidalBounds){ |
255 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
256 |
> |
width = parameters[0]*2; |
257 |
> |
length = parameters[3]*2; |
258 |
> |
thickness = (*trapezoidalBounds).thickness(); |
259 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
260 |
> |
}else if(rectangularBounds){ |
261 |
> |
width = DetUnit->surface().bounds().width(); |
262 |
> |
length = DetUnit->surface().bounds().length(); |
263 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
264 |
> |
TrapezoidalParam = 1; |
265 |
> |
} |
266 |
> |
|
267 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
268 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
269 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
270 |
> |
|
271 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
272 |
> |
|
273 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
274 |
> |
Detid.rawId(), TrapezoidalParam, |
275 |
> |
Pos.x(), Pos.y(), Pos.z(), |
276 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
277 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
278 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
279 |
|
|
181 |
– |
MyEvents = new MySimEvents(); |
182 |
– |
Geom_Tracker = new Geometry(); |
183 |
– |
Geom_ECAL = new Geometry(); |
184 |
– |
Geom_HCAL = new Geometry(); |
185 |
– |
Geom_Muon = new Geometry(); |
280 |
|
|
281 |
+ |
Frog_DetId = DETID_TRK; |
282 |
+ |
FEB = tracker; |
283 |
+ |
|
284 |
+ |
Frog_DetId += SubDet*100000; |
285 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
286 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
287 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
288 |
+ |
|
289 |
+ |
if(SubDet==PixelSubdetector::PixelBarrel){ |
290 |
+ |
PXBDetId detid = PXBDetId(Detid); |
291 |
+ |
|
292 |
+ |
Frog_DetId += detid.layer()*10000; |
293 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
294 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
295 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
296 |
+ |
|
297 |
+ |
Frog_DetId += detid.ladder()*100; |
298 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
299 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
300 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
301 |
+ |
}else if(SubDet==PixelSubdetector::PixelEndcap){ |
302 |
+ |
PXFDetId detid = PXFDetId(Detid); |
303 |
+ |
|
304 |
+ |
Frog_DetId += detid.side()*10000; |
305 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
306 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
307 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
308 |
+ |
|
309 |
+ |
Frog_DetId += detid.disk()*1000; |
310 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
311 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
312 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
313 |
+ |
|
314 |
+ |
Frog_DetId += detid.blade()*10; |
315 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
316 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
317 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
318 |
+ |
|
319 |
+ |
Frog_DetId += detid.panel()*1; |
320 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
321 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
322 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
323 |
+ |
}else if(SubDet==StripSubdetector::TIB){ |
324 |
+ |
TIBDetId detid = TIBDetId(Detid); |
325 |
+ |
|
326 |
+ |
Frog_DetId += detid.layer()*10000; |
327 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
328 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
329 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
330 |
+ |
|
331 |
+ |
Frog_DetId += detid.stringNumber()*100; |
332 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
333 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
334 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
335 |
+ |
}else if(SubDet==StripSubdetector::TID){ |
336 |
+ |
TIDDetId detid = TIDDetId(Detid); |
337 |
+ |
|
338 |
+ |
Frog_DetId += detid.side()*10000; |
339 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
340 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
341 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
342 |
+ |
|
343 |
+ |
Frog_DetId += detid.wheel()*1000; |
344 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
345 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
346 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
347 |
+ |
|
348 |
+ |
Frog_DetId += detid.ring()*10; |
349 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
350 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
351 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
352 |
+ |
}else if(SubDet==StripSubdetector::TOB){ |
353 |
+ |
TOBDetId detid = TOBDetId(Detid); |
354 |
+ |
|
355 |
+ |
Frog_DetId += detid.layer()*10000; |
356 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
357 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
358 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
359 |
+ |
|
360 |
+ |
Frog_DetId += detid.rodNumber()*100; |
361 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
362 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
363 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
364 |
+ |
}else if(SubDet==StripSubdetector::TEC){ |
365 |
+ |
TECDetId detid = TECDetId(Detid); |
366 |
+ |
|
367 |
+ |
Frog_DetId += detid.side()*10000; |
368 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
369 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
370 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
371 |
+ |
|
372 |
+ |
Frog_DetId += detid.wheel()*1000; |
373 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
374 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
375 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
376 |
+ |
|
377 |
+ |
Frog_DetId += detid.ring()*10; |
378 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
379 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
380 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
381 |
+ |
|
382 |
+ |
Frog_DetId += detid.petalNumber(); |
383 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
384 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
385 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
386 |
+ |
}else{ |
387 |
+ |
if(mod)delete mod; |
388 |
+ |
continue; |
389 |
+ |
} |
390 |
+ |
FEB->addDaughter(mod); |
391 |
+ |
} |
392 |
|
|
188 |
– |
// ### TRACKER GEOMETRY ### |
393 |
|
|
394 |
< |
edm::ESHandle<TrackerGeometry> tkGeom; |
191 |
< |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
192 |
< |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
394 |
> |
// ### MUON GEOMETRY ### |
395 |
|
|
396 |
< |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
397 |
< |
Detid = TrackerDets[i]->geographicalId(); |
398 |
< |
// SubDet = Detid.subdetId(); |
399 |
< |
|
400 |
< |
GeomDet* DetUnit = TrackerDets[i]; |
401 |
< |
if(!DetUnit)continue; |
402 |
< |
const BoundPlane plane = DetUnit->surface(); |
403 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
404 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
405 |
< |
|
406 |
< |
float width = 0; |
407 |
< |
float length = 0; |
408 |
< |
float thickness = 0; |
409 |
< |
float TrapezoidalParam = 0; |
396 |
> |
edm::ESHandle<DTGeometry> DtGeom; |
397 |
> |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
398 |
> |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
399 |
> |
|
400 |
> |
edm::ESHandle<CSCGeometry> CscGeom; |
401 |
> |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
402 |
> |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
403 |
> |
|
404 |
> |
edm::ESHandle<RPCGeometry> RpcGeom; |
405 |
> |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
406 |
> |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
407 |
> |
|
408 |
> |
vector<GeomDet*> MuonDets; |
409 |
> |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
410 |
> |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
411 |
> |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
412 |
|
|
413 |
< |
if(trapezoidalBounds) |
413 |
> |
for(unsigned int i=0;i<MuonDets.size();i++) |
414 |
|
{ |
415 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
416 |
< |
width = parameters[0]*2; |
213 |
< |
length = parameters[3]*2; |
214 |
< |
thickness = (*trapezoidalBounds).thickness(); |
215 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
216 |
< |
}else if(rectangularBounds){ |
217 |
< |
width = DetUnit->surface().bounds().width(); |
218 |
< |
length = DetUnit->surface().bounds().length(); |
219 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
220 |
< |
TrapezoidalParam = 1; |
221 |
< |
} |
415 |
> |
Detid = DetId(MuonDets[i]->geographicalId()); |
416 |
> |
SubDet = Detid.subdetId(); |
417 |
|
|
418 |
< |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
419 |
< |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
420 |
< |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
421 |
< |
|
422 |
< |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
423 |
< |
|
424 |
< |
Geom_Tracker->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
425 |
< |
Pos.x(), Pos.y(), Pos.z(), |
426 |
< |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
427 |
< |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
428 |
< |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
429 |
< |
|
418 |
> |
GeomDet* DetUnit = MuonDets[i]; |
419 |
> |
if(!DetUnit)continue; |
420 |
> |
const BoundPlane plane = DetUnit->surface(); |
421 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
422 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
423 |
> |
|
424 |
> |
float width = 0; |
425 |
> |
float length = 0; |
426 |
> |
float thickness = 0; |
427 |
> |
float TrapezoidalParam = 0; |
428 |
> |
|
429 |
> |
if(trapezoidalBounds) |
430 |
> |
{ |
431 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
432 |
> |
width = parameters[0]*2; |
433 |
> |
length = parameters[3]*2; |
434 |
> |
thickness = (*trapezoidalBounds).thickness(); |
435 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
436 |
> |
}else if(rectangularBounds){ |
437 |
> |
width = DetUnit->surface().bounds().width(); |
438 |
> |
length = DetUnit->surface().bounds().length(); |
439 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
440 |
> |
TrapezoidalParam = 1; |
441 |
> |
} |
442 |
> |
|
443 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
444 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
445 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
446 |
> |
|
447 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
448 |
> |
|
449 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
450 |
> |
Detid.rawId(), TrapezoidalParam, |
451 |
> |
Pos.x(), Pos.y(), Pos.z(), |
452 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
453 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
454 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
455 |
> |
|
456 |
> |
Frog_DetId = DETID_MUON; |
457 |
> |
FEB = muon; |
458 |
> |
|
459 |
> |
Frog_DetId += SubDet*100000; |
460 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
461 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
462 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
463 |
> |
|
464 |
> |
if(SubDet==1){ |
465 |
> |
DTChamberId detid = DTChamberId(Detid); |
466 |
> |
|
467 |
> |
Frog_DetId += (detid.wheel()+3)*10000; |
468 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
469 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
470 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
471 |
> |
|
472 |
> |
Frog_DetId += detid.station()*100; |
473 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
474 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
475 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
476 |
> |
|
477 |
> |
Frog_DetId += detid.sector()*1; |
478 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
479 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
480 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
481 |
> |
}else if(SubDet==2){ |
482 |
> |
CSCDetId detid = CSCDetId(Detid); |
483 |
> |
|
484 |
> |
Frog_DetId += detid.endcap()*10000; |
485 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
486 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
487 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
488 |
> |
|
489 |
> |
Frog_DetId += detid.station()*1000; |
490 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
491 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
492 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
493 |
> |
|
494 |
> |
Frog_DetId += detid.ring()*100; |
495 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
496 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
497 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
498 |
> |
|
499 |
> |
Frog_DetId += detid.chamber()*1; |
500 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
501 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
502 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
503 |
> |
}else if(SubDet==3){ |
504 |
> |
RPCDetId detid = RPCDetId(Detid); |
505 |
> |
|
506 |
> |
Frog_DetId += (detid.region()+2)*10000; |
507 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
508 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
509 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
510 |
> |
|
511 |
> |
// Barrel |
512 |
> |
if(detid.region()==0){ |
513 |
> |
Frog_DetId += (detid.ring()+3)*1000; |
514 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
515 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
516 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
517 |
> |
// Endcap |
518 |
> |
}else{ |
519 |
> |
Frog_DetId += detid.ring()*1000; |
520 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
521 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
522 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
523 |
> |
} |
524 |
> |
|
525 |
> |
Frog_DetId += detid.station()*100; |
526 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
527 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
528 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
529 |
> |
|
530 |
> |
Frog_DetId += detid.sector()*1; |
531 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
532 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
533 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
534 |
> |
} |
535 |
|
|
536 |
< |
} |
536 |
> |
FEB->addDaughter(mod); |
537 |
> |
} |
538 |
|
|
539 |
|
|
540 |
< |
// ### CALO GEOMETRY ### |
540 |
> |
|
541 |
> |
// ### CALO GEOMETRY ### |
542 |
|
|
543 |
< |
edm::ESHandle<CaloGeometry> CaloGeom; |
544 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
545 |
< |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
244 |
< |
|
245 |
< |
for(unsigned int i=0;i<CaloDets.size();i++) |
246 |
< |
{ |
247 |
< |
Detid = CaloDets[i]; |
248 |
< |
SubDet = Detid.subdetId(); |
249 |
< |
|
250 |
< |
Geometry* Geom_temp = NULL; |
251 |
< |
if(Detid.det()==DetId::Ecal){ |
252 |
< |
Geom_temp = Geom_ECAL; |
253 |
< |
|
254 |
< |
if(SubDet<1 || SubDet>3){ |
255 |
< |
printf("Don't Save EcalTriggerTower or EcalLaserPnDiode\n"); |
256 |
< |
continue; |
257 |
< |
} |
258 |
< |
}else if(Detid.det()==DetId::Hcal){ |
259 |
< |
Geom_temp = Geom_HCAL; |
260 |
< |
|
261 |
< |
if(SubDet<1 || SubDet>4){ |
262 |
< |
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
263 |
< |
continue; |
264 |
< |
} |
265 |
< |
}else{ |
266 |
< |
continue; |
267 |
< |
} |
543 |
> |
edm::ESHandle<CaloGeometry> CaloGeom; |
544 |
> |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
545 |
> |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
546 |
|
|
547 |
< |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
548 |
< |
GlobalPoint CellPos = CellGeom->getPosition(); |
549 |
< |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
550 |
< |
|
273 |
< |
Geom_temp->Add_CaloDet(Detid.rawId(), |
274 |
< |
CellPos.x() , CellPos.y() , CellPos.z(), |
275 |
< |
CellCorners[0].x() , CellCorners[0].y() , CellCorners[0].z() , |
276 |
< |
CellCorners[1].x() , CellCorners[1].y() , CellCorners[1].z() , |
277 |
< |
CellCorners[2].x() , CellCorners[2].y() , CellCorners[2].z() , |
278 |
< |
CellCorners[3].x() , CellCorners[3].y() , CellCorners[3].z() , |
279 |
< |
CellCorners[4].x() , CellCorners[4].y() , CellCorners[4].z() , |
280 |
< |
CellCorners[5].x() , CellCorners[5].y() , CellCorners[5].z() , |
281 |
< |
CellCorners[6].x() , CellCorners[6].y() , CellCorners[6].z() , |
282 |
< |
CellCorners[7].x() , CellCorners[7].y() , CellCorners[7].z() ); |
283 |
< |
} |
547 |
> |
for(unsigned int i=0;i<CaloDets.size();i++) |
548 |
> |
{ |
549 |
> |
Detid = CaloDets[i]; |
550 |
> |
SubDet = Detid.subdetId(); |
551 |
|
|
552 |
< |
// ### MUON GEOMETRY ### |
552 |
> |
if(Detid.det()==DetId::Ecal){ |
553 |
> |
if(SubDet<1 || SubDet>3) continue; |
554 |
|
|
555 |
< |
edm::ESHandle<DTGeometry> DtGeom; |
556 |
< |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
289 |
< |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
290 |
< |
|
291 |
< |
edm::ESHandle<CSCGeometry> CscGeom; |
292 |
< |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
293 |
< |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
294 |
< |
|
295 |
< |
edm::ESHandle<RPCGeometry> RpcGeom; |
296 |
< |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
297 |
< |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
298 |
< |
|
299 |
< |
vector<GeomDet*> MuonDets; |
300 |
< |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
301 |
< |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
302 |
< |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
303 |
< |
|
304 |
< |
|
305 |
< |
for(unsigned int i=0;i<MuonDets.size();i++) |
306 |
< |
{ |
307 |
< |
Detid = DetId(MuonDets[i]->geographicalId()); |
308 |
< |
SubDet = Detid.subdetId(); |
309 |
< |
|
310 |
< |
GeomDet* DetUnit = MuonDets[i]; |
311 |
< |
if(!DetUnit)continue; |
312 |
< |
const BoundPlane plane = DetUnit->surface(); |
313 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
314 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
315 |
< |
|
316 |
< |
float width = 0; |
317 |
< |
float length = 0; |
318 |
< |
float thickness = 0; |
319 |
< |
float TrapezoidalParam = 0; |
555 |
> |
Frog_DetId = DETID_ECAL; |
556 |
> |
FEB = ecal; |
557 |
|
|
558 |
< |
if(trapezoidalBounds) |
559 |
< |
{ |
560 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
561 |
< |
width = parameters[0]*2; |
562 |
< |
length = parameters[3]*2; |
563 |
< |
thickness = (*trapezoidalBounds).thickness(); |
564 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
565 |
< |
}else if(rectangularBounds){ |
566 |
< |
width = DetUnit->surface().bounds().width(); |
567 |
< |
length = DetUnit->surface().bounds().length(); |
568 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
569 |
< |
TrapezoidalParam = 1; |
570 |
< |
} |
558 |
> |
Frog_DetId += SubDet*100000; |
559 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
560 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
561 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
562 |
> |
|
563 |
> |
if(SubDet==1){ |
564 |
> |
EBDetId detid = EBDetId(Detid); |
565 |
> |
|
566 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
567 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
568 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
569 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
570 |
> |
|
571 |
> |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
572 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
573 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
574 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
575 |
> |
|
576 |
> |
Frog_DetId += detid.tower_iphi()*1; |
577 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
578 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
579 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
580 |
> |
}else if(SubDet==2){ |
581 |
> |
EEDetId detid = EEDetId(Detid); |
582 |
> |
|
583 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
584 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
585 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
586 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
587 |
> |
|
588 |
> |
Frog_DetId += detid.iquadrant()*1000; |
589 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
590 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
591 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
592 |
> |
|
593 |
> |
Frog_DetId += detid.isc(); |
594 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(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);} |
597 |
> |
}else if(SubDet==3){ |
598 |
> |
ESDetId detid = ESDetId(Detid); |
599 |
> |
|
600 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
601 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
602 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
603 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
604 |
> |
|
605 |
> |
Frog_DetId += detid.plane()*1000; |
606 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(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);} |
609 |
> |
|
610 |
> |
Frog_DetId += detid.six()*50; |
611 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(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);} |
614 |
> |
|
615 |
> |
Frog_DetId += detid.siy(); |
616 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
617 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
618 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
619 |
> |
} |
620 |
> |
}else if(Detid.det()==DetId::Hcal){ |
621 |
> |
if(SubDet<1 || SubDet>4) continue; |
622 |
> |
|
623 |
> |
Frog_DetId = DETID_HCAL; |
624 |
> |
FEB = hcal; |
625 |
> |
|
626 |
> |
Frog_DetId += SubDet*100000; |
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 |
> |
if(true){ |
632 |
> |
HcalDetId detid = HcalDetId(Detid); |
633 |
> |
|
634 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
635 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
636 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
637 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
638 |
> |
|
639 |
> |
Frog_DetId += detid.ietaAbs()*100; |
640 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
641 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
642 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
643 |
> |
|
644 |
> |
Frog_DetId += detid.iphi()*1; |
645 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
646 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
647 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
648 |
> |
} |
649 |
> |
|
650 |
> |
}else if(Detid.det() == DetId::Calo){ |
651 |
> |
continue; |
652 |
> |
/* |
653 |
> |
Frog_DetId = DETID_CALO + 1000000; |
654 |
> |
FEB = hcal; |
655 |
> |
|
656 |
> |
Frog_DetId += SubDet*100000; |
657 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
658 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
659 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
660 |
> |
*/ |
661 |
> |
} |
662 |
> |
|
663 |
> |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
664 |
> |
GlobalPoint CellPos = CellGeom->getPosition(); |
665 |
> |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
666 |
> |
|
667 |
> |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
668 |
> |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
669 |
> |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
670 |
> |
|
671 |
> |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
672 |
> |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
673 |
> |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
674 |
> |
|
675 |
> |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
676 |
> |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
677 |
> |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
678 |
> |
|
679 |
> |
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) ); |
680 |
> |
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) ); |
681 |
> |
|
682 |
> |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
683 |
> |
Detid.rawId(), F, |
684 |
> |
cX , cY , cZ , |
685 |
> |
wX , wY , wZ , |
686 |
> |
hX , hY , hZ ); |
687 |
|
|
688 |
< |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
689 |
< |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
337 |
< |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
338 |
< |
|
339 |
< |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
340 |
< |
|
341 |
< |
Geom_Muon->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
342 |
< |
Pos.x(), Pos.y(), Pos.z(), |
343 |
< |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
344 |
< |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
345 |
< |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
346 |
< |
} |
688 |
> |
FEB->addDaughter(mod); |
689 |
> |
} |
690 |
|
|
691 |
+ |
// ### Save .geom ### |
692 |
|
|
693 |
< |
// ### Save .geom ### |
693 |
> |
FROG_Geometry* CMS_Geom = new FROG_Geometry(prim); |
694 |
> |
CMS_Geom->Save("CMS.geom"); |
695 |
> |
} |
696 |
|
|
697 |
< |
Geom_Tracker->Save("Tracker.geom"); |
352 |
< |
Geom_ECAL ->Save("Ecal.geom"); |
353 |
< |
Geom_HCAL ->Save("Hcal.geom"); |
354 |
< |
Geom_Muon ->Save("Muon.geom"); |
355 |
< |
|
697 |
> |
events_prim = new FROG_Element_Base(C_PRIMARY); |
698 |
|
} |
699 |
|
|
700 |
|
// ------------ method called once each job just after ending the event loop ------------ |
701 |
|
void |
702 |
< |
Frog_Analyzer::endJob() { |
703 |
< |
|
704 |
< |
MyEvents->Save((char*) OutputFile.c_str()); |
705 |
< |
// MyEvents->Load((char*) OutputFile.c_str()); |
702 |
> |
Frog_Analyzer::endJob() |
703 |
> |
{ |
704 |
> |
if(NEvents>0){ |
705 |
> |
char OutputFileName[1024]; |
706 |
> |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
707 |
> |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent); |
708 |
> |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
709 |
> |
|
710 |
> |
FROG_Events* events = new FROG_Events(events_prim); |
711 |
> |
events->Save((char*) OutputFileName); |
712 |
> |
delete events; |
713 |
> |
delete events_prim; |
714 |
> |
|
715 |
> |
events_prim = new FROG_Element_Base(C_PRIMARY); |
716 |
> |
NEvents=0; |
717 |
> |
} |
718 |
|
} |
719 |
|
|
720 |
|
|
727 |
|
void |
728 |
|
Frog_Analyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) |
729 |
|
{ |
730 |
< |
MySimEvent* MyEvent = new MySimEvent; |
730 |
> |
if(NEvents == 0){ |
731 |
> |
SRun = iEvent.id().run(); |
732 |
> |
SEvent = iEvent.id().event(); |
733 |
> |
} |
734 |
> |
|
735 |
> |
|
736 |
> |
FROG_Element_Event* event = new FROG_Element_Event(); |
737 |
> |
events_prim->addDaughter(event); |
738 |
|
|
739 |
|
// access the tracker |
740 |
|
edm::ESHandle<TrackerGeometry> tkGeom; |
749 |
|
edm::ESHandle<RPCGeometry> RpcGeom; |
750 |
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
751 |
|
|
391 |
– |
|
392 |
– |
// Save Data |
752 |
|
// ### SIMTRACK ### |
753 |
|
for(unsigned int i=0;i<SimTrackProducers.size();i++){ |
754 |
|
edm::Handle<std::vector< SimTrack > > h_SimTracks; |
755 |
|
iEvent.getByLabel(SimTrackProducers[i], h_SimTracks); |
756 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
757 |
|
|
758 |
+ |
FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK + i); |
759 |
+ |
event->addDaughter(frogSimTrkColl); |
760 |
+ |
|
761 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
400 |
– |
MySimTrack MysimTrack; |
762 |
|
SimTrack simTrack =SimTrackColl[a]; |
763 |
|
|
764 |
< |
MysimTrack.track_id =simTrack.trackId(); |
765 |
< |
MysimTrack.Type =simTrack.type(); |
766 |
< |
MysimTrack.parent_vertex=simTrack.vertIndex(); |
767 |
< |
MysimTrack.Px =simTrack.momentum().x(); |
768 |
< |
MysimTrack.Py =simTrack.momentum().y(); |
408 |
< |
MysimTrack.Pz =simTrack.momentum().z(); |
409 |
< |
MysimTrack.E =simTrack.momentum().e(); |
410 |
< |
MysimTrack.charge =simTrack.charge(); |
411 |
< |
|
412 |
< |
MyEvent->MySimTrackCollection.push_back(MysimTrack); |
764 |
> |
FROG_Element_Event_Sim_Track* frogSimTrk = new FROG_Element_Event_Sim_Track(simTrack.trackId(), |
765 |
> |
simTrack.momentum().x(), simTrack.momentum().y(), simTrack.momentum().z(), |
766 |
> |
simTrack.momentum().e(), simTrack.type(), simTrack.vertIndex(), |
767 |
> |
simTrack.charge() ); |
768 |
> |
frogSimTrkColl->addDaughter(frogSimTrk); |
769 |
|
} |
770 |
|
} |
771 |
|
|
775 |
|
iEvent.getByLabel(SimVertexProducers[i], h_Vertex); |
776 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
777 |
|
|
778 |
+ |
FROG_Element_Base_With_DetId* frogSimVtxColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX + i); |
779 |
+ |
event->addDaughter(frogSimVtxColl); |
780 |
+ |
|
781 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
423 |
– |
MySimVertex MyVertex; |
782 |
|
SimVertex Vertex = VertexColl[b]; |
783 |
|
|
784 |
< |
MyVertex.parentTrack_id =Vertex.parentIndex (); |
785 |
< |
MyVertex.x =Vertex.position().x(); |
786 |
< |
MyVertex.y =Vertex.position().y(); |
429 |
< |
MyVertex.z =Vertex.position().z(); |
784 |
> |
FROG_Element_Event_Sim_Vertex* frogSimVtx = new FROG_Element_Event_Sim_Vertex( |
785 |
> |
Vertex.position().x(), Vertex.position().y(), Vertex.position().z(), |
786 |
> |
Vertex.parentIndex()); |
787 |
|
|
788 |
< |
MyEvent->MySimVertexCollection.push_back(MyVertex); |
788 |
> |
frogSimVtxColl->addDaughter(frogSimVtx); |
789 |
|
} |
790 |
|
} |
791 |
|
|
792 |
+ |
|
793 |
|
// ### SIMHIT ### |
794 |
+ |
|
795 |
|
for(unsigned int i=0;i<SimHitProducers.size();i++){ |
796 |
|
edm::Handle<std::vector< PSimHit > > h_Hits; |
797 |
|
iEvent.getByLabel(SimHitProducers[i], h_Hits); |
798 |
|
std::vector< PSimHit > Hits = *h_Hits.product(); |
799 |
|
|
800 |
+ |
FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i); |
801 |
+ |
event->addDaughter(frogSimHitColl); |
802 |
+ |
|
803 |
|
for(unsigned int h=0; h<Hits.size(); h++) |
804 |
|
{ |
805 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
806 |
|
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
807 |
|
|
808 |
< |
MyPSimHit Hit; |
809 |
< |
Hit.x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
810 |
< |
Hit.y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
811 |
< |
Hit.z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
812 |
< |
Hit.ProcessType = Hits[h].processType(); |
451 |
< |
Hit.dEdX = Hits[h].energyLoss(); |
452 |
< |
|
453 |
< |
MyEvent->MyPSimHitCollection.push_back(Hit); |
808 |
> |
|
809 |
> |
FROG_Element_Event_Sim_Hit* frogSimHit = new FROG_Element_Event_Sim_Hit( |
810 |
> |
theDet->surface().toGlobal(Hits[h].localPosition()).x(),theDet->surface().toGlobal(Hits[h].localPosition()).y(),theDet->surface().toGlobal(Hits[h].localPosition()).z(), |
811 |
> |
Hits[h].energyLoss(), Hits[h].processType() ); |
812 |
> |
frogSimHitColl->addDaughter(frogSimHit); |
813 |
|
} |
814 |
|
} |
815 |
|
|
816 |
|
|
817 |
< |
// ### TRACKS ### |
817 |
> |
|
818 |
> |
// ### TRAJECTORY ### |
819 |
> |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
820 |
> |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
821 |
> |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
822 |
> |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
823 |
> |
|
824 |
> |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i); |
825 |
> |
event->addDaughter(frogTrkColl); |
826 |
> |
|
827 |
> |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
828 |
> |
Trajectory recoTraj = *it->key; |
829 |
> |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared()); |
830 |
> |
frogTrkColl->addDaughter(frogTrk); |
831 |
> |
|
832 |
> |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
833 |
> |
for(unsigned int h=0;h<measurements.size();h++){ |
834 |
> |
|
835 |
> |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
836 |
> |
if(!h_it->isValid() )continue; |
837 |
> |
DetId detId = h_it->geographicalId(); |
838 |
> |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
839 |
> |
|
840 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1); |
841 |
> |
frogTrk->addDaughter(frogHit); |
842 |
> |
} |
843 |
> |
} |
844 |
> |
} |
845 |
> |
|
846 |
> |
// ### TRACK ### |
847 |
> |
|
848 |
|
for(unsigned int i=0;i<TrackProducers.size();i++){ |
849 |
|
edm::Handle<std::vector< reco::Track > > h_Tracks; |
850 |
|
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
851 |
|
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
852 |
|
|
853 |
+ |
FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size()+i); |
854 |
+ |
event->addDaughter(frogTrkColl); |
855 |
+ |
|
856 |
+ |
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
857 |
|
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
858 |
< |
MyRecoTrack MyrecoTrack; |
466 |
< |
reco::Track recoTrack =TrackColl[t]; |
858 |
> |
reco::Track recoTrack =TrackColl[t]; |
859 |
|
|
860 |
< |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
861 |
< |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
470 |
< |
if(!h_it->isValid() )continue; |
471 |
< |
DetId detId = h_it->geographicalId(); |
472 |
< |
const GeomDet * theDet = tkGeom->idToDet(detId); |
473 |
< |
LocalPoint localPos = h_it->localPosition(); |
860 |
> |
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2()); |
861 |
> |
frogTrkColl->addDaughter(frogTrk); |
862 |
|
|
863 |
< |
MyRecoHit hit; |
864 |
< |
hit.x = theDet->surface().toGlobal(localPos).x(); |
865 |
< |
hit.y = theDet->surface().toGlobal(localPos).y(); |
866 |
< |
hit.z = theDet->surface().toGlobal(localPos).z(); |
867 |
< |
hit.DetId = detId.rawId(); |
868 |
< |
hit.Charge = -1; |
869 |
< |
MyrecoTrack.Hits.push_back(hit); |
870 |
< |
} |
871 |
< |
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
863 |
> |
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
864 |
> |
TrackingRecHitRef h_it = recoTrack.recHit(h); |
865 |
> |
if(!h_it->isValid() )continue; |
866 |
> |
DetId detId = h_it->geographicalId(); |
867 |
> |
const GeomDet * theDet = NULL; |
868 |
> |
|
869 |
> |
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId); |
870 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId); |
871 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId); |
872 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId); |
873 |
> |
|
874 |
> |
LocalPoint localPos = h_it->localPosition(); |
875 |
> |
|
876 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit( |
877 |
> |
detId.rawId(), |
878 |
> |
theDet->surface().toGlobal(localPos).x(), |
879 |
> |
theDet->surface().toGlobal(localPos).y(), |
880 |
> |
theDet->surface().toGlobal(localPos).z(), |
881 |
> |
-1); |
882 |
> |
frogTrk->addDaughter(frogHit); |
883 |
> |
} |
884 |
|
} |
885 |
|
} |
886 |
|
|
887 |
|
|
888 |
+ |
|
889 |
|
// ### ECALRecHits ### |
890 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
891 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
892 |
|
iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits); |
893 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
894 |
|
|
895 |
+ |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i); |
896 |
+ |
event->addDaughter(frogHitColl); |
897 |
+ |
|
898 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
899 |
< |
MyCaloHit temp_EcalHit; |
900 |
< |
temp_EcalHit.E = Ecal_RecHits[eh].energy(); |
901 |
< |
temp_EcalHit.t = Ecal_RecHits[eh].time(); |
498 |
< |
temp_EcalHit.DetId = (Ecal_RecHits[eh].detid()).rawId(); |
499 |
< |
|
500 |
< |
MyEvent->MyEcalCaloHitCollection.push_back(temp_EcalHit); |
899 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(), |
900 |
> |
Ecal_RecHits[eh].energy(), Ecal_RecHits[eh].time()); |
901 |
> |
frogHitColl->addDaughter(frogCaloHit); |
902 |
|
} |
903 |
|
} |
904 |
|
|
909 |
|
iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits); |
910 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
911 |
|
|
912 |
< |
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
913 |
< |
MyCaloHit temp_HcalHBHEHit; |
513 |
< |
temp_HcalHBHEHit.E = HcalHBHE_RecHits[hh].energy(); |
514 |
< |
temp_HcalHBHEHit.t = HcalHBHE_RecHits[hh].time(); |
515 |
< |
temp_HcalHBHEHit.DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
912 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i); |
913 |
> |
event->addDaughter(frogHitColl); |
914 |
|
|
915 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHBHEHit); |
915 |
> |
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
916 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(), |
917 |
> |
HcalHBHE_RecHits[hh].energy(), HcalHBHE_RecHits[hh].time()); |
918 |
> |
frogHitColl->addDaughter(frogCaloHit); |
919 |
|
} |
920 |
|
} |
921 |
|
|
521 |
– |
|
922 |
|
for(unsigned int i=0;i<HcalHORecHitProducers.size();i++){ |
923 |
|
edm::Handle<HORecHitCollection > h_HcalHO_RecHits; |
924 |
|
iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits); |
925 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
926 |
|
|
927 |
< |
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
928 |
< |
MyCaloHit temp_HcalHOHit; |
529 |
< |
temp_HcalHOHit.E = HcalHO_RecHits[hh].energy(); |
530 |
< |
temp_HcalHOHit.t = HcalHO_RecHits[hh].time(); |
531 |
< |
temp_HcalHOHit.DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
927 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i); |
928 |
> |
event->addDaughter(frogHitColl); |
929 |
|
|
930 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHOHit); |
930 |
> |
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
931 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHO_RecHits[hh].detid()).rawId(), |
932 |
> |
HcalHO_RecHits[hh].energy(), HcalHO_RecHits[hh].time()); |
933 |
> |
frogHitColl->addDaughter(frogCaloHit); |
934 |
|
} |
935 |
|
} |
936 |
|
|
537 |
– |
|
937 |
|
for(unsigned int i=0;i<HcalHFRecHitProducers.size();i++){ |
938 |
|
edm::Handle<HFRecHitCollection > h_HcalHF_RecHits; |
939 |
|
iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits); |
940 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
941 |
|
|
942 |
< |
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
943 |
< |
MyCaloHit temp_HcalHFHit; |
545 |
< |
temp_HcalHFHit.E = HcalHF_RecHits[hh].energy(); |
546 |
< |
temp_HcalHFHit.t = HcalHF_RecHits[hh].time(); |
547 |
< |
temp_HcalHFHit.DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
942 |
> |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i); |
943 |
> |
event->addDaughter(frogHitColl); |
944 |
|
|
945 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHFHit); |
945 |
> |
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
946 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHF_RecHits[hh].detid()).rawId(), |
947 |
> |
HcalHF_RecHits[hh].energy(), HcalHF_RecHits[hh].time()); |
948 |
> |
frogHitColl->addDaughter(frogCaloHit); |
949 |
|
} |
950 |
|
} |
951 |
|
|
955 |
|
iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments); |
956 |
|
CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product(); |
957 |
|
|
958 |
+ |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i); |
959 |
+ |
event->addDaughter(frogSegColl); |
960 |
+ |
|
961 |
|
for(unsigned int s=0;s<CSC_Segments.size();s++){ |
962 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
963 |
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId); |
964 |
|
|
965 |
< |
MyMuonSegment temp_CscSeg; |
966 |
< |
temp_CscSeg.DetId = theDetUnitId.rawId(); |
967 |
< |
temp_CscSeg.PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
968 |
< |
temp_CscSeg.PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
567 |
< |
temp_CscSeg.PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
568 |
< |
temp_CscSeg.DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
569 |
< |
temp_CscSeg.DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
570 |
< |
temp_CscSeg.DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
571 |
< |
|
572 |
< |
MyEvent->MyMuonSegmentCollection.push_back(temp_CscSeg); |
965 |
> |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(), |
966 |
> |
theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z() , |
967 |
> |
theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z() ); |
968 |
> |
frogSegColl->addDaughter(frogSeg); |
969 |
|
} |
970 |
|
} |
971 |
|
|
974 |
|
iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments); |
975 |
|
DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product(); |
976 |
|
|
977 |
+ |
FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i); |
978 |
+ |
event->addDaughter(frogSegColl); |
979 |
+ |
|
980 |
|
for(unsigned int s=0;s<DT_Segments.size();s++){ |
981 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
982 |
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId); |
983 |
|
|
984 |
< |
MyMuonSegment temp_DtSeg; |
985 |
< |
temp_DtSeg.DetId = theDetUnitId.rawId(); |
986 |
< |
temp_DtSeg.PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
987 |
< |
temp_DtSeg.PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
589 |
< |
temp_DtSeg.PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
590 |
< |
temp_DtSeg.DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
591 |
< |
temp_DtSeg.DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
592 |
< |
temp_DtSeg.DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
593 |
< |
|
594 |
< |
MyEvent->MyMuonSegmentCollection.push_back(temp_DtSeg); |
984 |
> |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(), |
985 |
> |
theDet->surface().toGlobal(DT_Segments[s].localPosition()).x() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).y() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).z() , |
986 |
> |
theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).z() ); |
987 |
> |
frogSegColl->addDaughter(frogSeg); |
988 |
|
} |
989 |
|
} |
990 |
|
|
994 |
|
iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits); |
995 |
|
RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product(); |
996 |
|
|
997 |
+ |
FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i); |
998 |
+ |
event->addDaughter(frogHitColl); |
999 |
+ |
|
1000 |
|
for(unsigned int h=0;h<RPC_Hits.size();h++){ |
1001 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
1002 |
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId); |
1003 |
|
|
1004 |
< |
MyMuonHit temp_RpcHit; |
1005 |
< |
temp_RpcHit.DetId = theDetUnitId.rawId(); |
1006 |
< |
temp_RpcHit.x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
611 |
< |
temp_RpcHit.y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
612 |
< |
temp_RpcHit.z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
613 |
< |
|
614 |
< |
MyEvent->MyMuonHitCollection.push_back(temp_RpcHit); |
1004 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(theDetUnitId.rawId(), |
1005 |
> |
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 ); |
1006 |
> |
frogHitColl->addDaughter(frogHit); |
1007 |
|
} |
1008 |
|
} |
1009 |
|
|
1010 |
< |
MyEvents->Events.push_back(MyEvent); |
1010 |
> |
NEvents++; |
1011 |
> |
if(NEvents == NEventsInVisFile){ |
1012 |
> |
char OutputFileName[1024]; |
1013 |
> |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
1014 |
> |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent); |
1015 |
> |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
1016 |
> |
|
1017 |
> |
FROG_Events* events = new FROG_Events(events_prim); |
1018 |
> |
events->Save((char*) OutputFileName); |
1019 |
> |
delete events; |
1020 |
> |
delete events_prim; |
1021 |
> |
|
1022 |
> |
events_prim = new FROG_Element_Base(C_PRIMARY); |
1023 |
> |
NEvents=0; |
1024 |
> |
} |
1025 |
> |
|
1026 |
|
} |
1027 |
|
|
1028 |
|
|