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 |
> |
|
128 |
|
|
129 |
|
using namespace edm; |
130 |
|
using namespace std; |
144 |
|
virtual void analyze (const edm::Event&, const edm::EventSetup&); |
145 |
|
virtual void endJob (); |
146 |
|
|
147 |
+ |
FROG_Events* events; |
148 |
+ |
FROG_Element_Base* event_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; |
165 |
|
std::vector<InputTag> RPCHitsProducers; |
166 |
|
|
167 |
|
|
140 |
– |
|
141 |
– |
|
168 |
|
// ----------member data --------------------------- |
169 |
|
}; |
170 |
|
|
180 |
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers"); |
181 |
|
|
182 |
|
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers"); |
183 |
+ |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers"); |
184 |
|
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers"); |
185 |
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers"); |
186 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
203 |
|
Frog_Analyzer::beginJob(const edm::EventSetup& iSetup) |
204 |
|
{ |
205 |
|
DetId Detid; |
206 |
< |
int SubDet; |
206 |
> |
unsigned int SubDet; |
207 |
|
|
208 |
< |
MyEvents = new MySimEvents(); |
209 |
< |
Geom_Tracker = new Geometry(); |
210 |
< |
Geom_ECAL = new Geometry(); |
211 |
< |
Geom_HCAL = new Geometry(); |
212 |
< |
Geom_Muon = new Geometry(); |
208 |
> |
unsigned int Frog_DetId; |
209 |
> |
FROG_Element_Base* FEB = NULL; |
210 |
> |
FROG_Element_Base_With_DetId* FEB_Temp = NULL; |
211 |
> |
|
212 |
> |
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
213 |
> |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
214 |
> |
FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK); geom->addDaughter(tracker); |
215 |
> |
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
216 |
> |
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
217 |
> |
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
218 |
|
|
219 |
|
|
220 |
|
// ### TRACKER GEOMETRY ### |
225 |
|
|
226 |
|
for(unsigned int i=0;i<TrackerDets.size();i++){ |
227 |
|
Detid = TrackerDets[i]->geographicalId(); |
228 |
< |
// SubDet = Detid.subdetId(); |
228 |
> |
SubDet = Detid.subdetId(); |
229 |
> |
if(SubDet<1 || SubDet>6) continue; |
230 |
> |
|
231 |
|
|
232 |
|
GeomDet* DetUnit = TrackerDets[i]; |
233 |
|
if(!DetUnit)continue; |
240 |
|
float thickness = 0; |
241 |
|
float TrapezoidalParam = 0; |
242 |
|
|
243 |
< |
if(trapezoidalBounds) |
210 |
< |
{ |
243 |
> |
if(trapezoidalBounds){ |
244 |
|
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
245 |
|
width = parameters[0]*2; |
246 |
|
length = parameters[3]*2; |
247 |
< |
thickness = (*trapezoidalBounds).thickness(); |
247 |
> |
thickness = (*trapezoidalBounds).thickness(); |
248 |
|
TrapezoidalParam = parameters[1]/parameters[0]; |
249 |
|
}else if(rectangularBounds){ |
250 |
|
width = DetUnit->surface().bounds().width(); |
259 |
|
|
260 |
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
261 |
|
|
262 |
< |
Geom_Tracker->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
263 |
< |
Pos.x(), Pos.y(), Pos.z(), |
264 |
< |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
262 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
263 |
> |
Detid.rawId(), TrapezoidalParam, |
264 |
> |
Pos.x(), Pos.y(), Pos.z(), |
265 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
266 |
|
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
267 |
|
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
234 |
– |
|
235 |
– |
|
236 |
– |
} |
237 |
– |
|
238 |
– |
|
239 |
– |
// ### CALO GEOMETRY ### |
240 |
– |
|
241 |
– |
edm::ESHandle<CaloGeometry> CaloGeom; |
242 |
– |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
243 |
– |
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(); |
268 |
|
|
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; |
269 |
|
|
270 |
< |
if(SubDet<1 || SubDet>4){ |
271 |
< |
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
272 |
< |
continue; |
273 |
< |
} |
270 |
> |
Frog_DetId = DETID_TRK; |
271 |
> |
FEB = tracker; |
272 |
> |
|
273 |
> |
Frog_DetId += SubDet*100000; |
274 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
275 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
276 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
277 |
> |
|
278 |
> |
if(SubDet==PixelSubdetector::PixelBarrel){ |
279 |
> |
PXBDetId detid = PXBDetId(Detid); |
280 |
> |
|
281 |
> |
Frog_DetId += detid.layer()*10000; |
282 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
283 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
284 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
285 |
> |
|
286 |
> |
Frog_DetId += detid.ladder()*100; |
287 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
288 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
289 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
290 |
> |
}else if(SubDet==PixelSubdetector::PixelEndcap){ |
291 |
> |
PXFDetId detid = PXFDetId(Detid); |
292 |
> |
|
293 |
> |
Frog_DetId += detid.side()*10000; |
294 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
295 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
296 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
297 |
> |
|
298 |
> |
Frog_DetId += detid.disk()*1000; |
299 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
300 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
301 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
302 |
> |
|
303 |
> |
Frog_DetId += detid.blade()*10; |
304 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
305 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
306 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
307 |
> |
|
308 |
> |
Frog_DetId += detid.panel()*1; |
309 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
310 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
311 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
312 |
> |
}else if(SubDet==StripSubdetector::TIB){ |
313 |
> |
TIBDetId detid = TIBDetId(Detid); |
314 |
> |
|
315 |
> |
Frog_DetId += detid.layer()*10000; |
316 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
317 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
318 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
319 |
> |
|
320 |
> |
Frog_DetId += detid.stringNumber()*100; |
321 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
322 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
323 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
324 |
> |
}else if(SubDet==StripSubdetector::TID){ |
325 |
> |
TIDDetId detid = TIDDetId(Detid); |
326 |
> |
|
327 |
> |
Frog_DetId += detid.side()*10000; |
328 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
329 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
330 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
331 |
> |
|
332 |
> |
Frog_DetId += detid.wheel()*1000; |
333 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
334 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
335 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
336 |
> |
|
337 |
> |
Frog_DetId += detid.ring()*10; |
338 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
339 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
340 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
341 |
> |
}else if(SubDet==StripSubdetector::TOB){ |
342 |
> |
TOBDetId detid = TOBDetId(Detid); |
343 |
> |
|
344 |
> |
Frog_DetId += detid.layer()*10000; |
345 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
346 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
347 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
348 |
> |
|
349 |
> |
Frog_DetId += detid.rodNumber()*100; |
350 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
351 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
352 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
353 |
> |
}else if(SubDet==StripSubdetector::TEC){ |
354 |
> |
TECDetId detid = TECDetId(Detid); |
355 |
> |
|
356 |
> |
Frog_DetId += detid.side()*10000; |
357 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
358 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
359 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
360 |
> |
|
361 |
> |
Frog_DetId += detid.wheel()*1000; |
362 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
363 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
364 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
365 |
> |
|
366 |
> |
Frog_DetId += detid.ring()*10; |
367 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
368 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
369 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
370 |
> |
|
371 |
> |
Frog_DetId += detid.petalNumber(); |
372 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
373 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
374 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
375 |
|
}else{ |
376 |
< |
continue; |
376 |
> |
if(mod)delete mod; |
377 |
> |
continue; |
378 |
|
} |
379 |
< |
|
269 |
< |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
270 |
< |
GlobalPoint CellPos = CellGeom->getPosition(); |
271 |
< |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
272 |
< |
|
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() ); |
379 |
> |
FEB->addDaughter(mod); |
380 |
|
} |
381 |
|
|
382 |
+ |
|
383 |
|
// ### MUON GEOMETRY ### |
384 |
|
|
385 |
|
edm::ESHandle<DTGeometry> DtGeom; |
436 |
|
|
437 |
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
438 |
|
|
439 |
< |
Geom_Muon->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
439 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
440 |
> |
Detid.rawId(), TrapezoidalParam, |
441 |
|
Pos.x(), Pos.y(), Pos.z(), |
442 |
|
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
443 |
|
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
444 |
|
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
445 |
+ |
|
446 |
+ |
Frog_DetId = DETID_MUON; |
447 |
+ |
FEB = muon; |
448 |
+ |
|
449 |
+ |
Frog_DetId += SubDet*100000; |
450 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
451 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
452 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
453 |
+ |
|
454 |
+ |
if(SubDet==1){ |
455 |
+ |
DTChamberId detid = DTChamberId(Detid); |
456 |
+ |
|
457 |
+ |
Frog_DetId += (detid.wheel()+3)*10000; |
458 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
459 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
460 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
461 |
+ |
|
462 |
+ |
Frog_DetId += detid.station()*100; |
463 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
464 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
465 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
466 |
+ |
|
467 |
+ |
Frog_DetId += detid.sector()*1; |
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 |
+ |
}else if(SubDet==2){ |
472 |
+ |
CSCDetId detid = CSCDetId(Detid); |
473 |
+ |
|
474 |
+ |
Frog_DetId += detid.endcap()*10000; |
475 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
476 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
477 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
478 |
+ |
|
479 |
+ |
Frog_DetId += detid.station()*1000; |
480 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
481 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
482 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
483 |
+ |
|
484 |
+ |
Frog_DetId += detid.ring()*100; |
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.chamber()*1; |
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 |
+ |
}else if(SubDet==3){ |
494 |
+ |
RPCDetId detid = RPCDetId(Detid); |
495 |
+ |
|
496 |
+ |
Frog_DetId += (detid.region()+2)*10000; |
497 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
498 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
499 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
500 |
+ |
|
501 |
+ |
// Barrel |
502 |
+ |
if(detid.region()==0){ |
503 |
+ |
Frog_DetId += (detid.ring()+3)*1000; |
504 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
505 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
506 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
507 |
+ |
// Endcap |
508 |
+ |
}else{ |
509 |
+ |
Frog_DetId += detid.ring()*1000; |
510 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
511 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
512 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
513 |
+ |
} |
514 |
+ |
|
515 |
+ |
Frog_DetId += detid.station()*100; |
516 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
517 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
518 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
519 |
+ |
|
520 |
+ |
Frog_DetId += detid.sector()*1; |
521 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
522 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
523 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
524 |
+ |
} |
525 |
+ |
|
526 |
+ |
FEB->addDaughter(mod); |
527 |
|
} |
528 |
|
|
529 |
|
|
530 |
< |
// ### Save .geom ### |
530 |
> |
|
531 |
> |
// ### CALO GEOMETRY ### |
532 |
|
|
533 |
< |
Geom_Tracker->Save("Tracker.geom"); |
534 |
< |
Geom_ECAL ->Save("Ecal.geom"); |
535 |
< |
Geom_HCAL ->Save("Hcal.geom"); |
536 |
< |
Geom_Muon ->Save("Muon.geom"); |
533 |
> |
edm::ESHandle<CaloGeometry> CaloGeom; |
534 |
> |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
535 |
> |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
536 |
> |
|
537 |
> |
for(unsigned int i=0;i<CaloDets.size();i++) |
538 |
> |
{ |
539 |
> |
Detid = CaloDets[i]; |
540 |
> |
SubDet = Detid.subdetId(); |
541 |
> |
|
542 |
> |
if(Detid.det()==DetId::Ecal){ |
543 |
> |
if(SubDet<1 || SubDet>3) continue; |
544 |
> |
|
545 |
> |
Frog_DetId = DETID_ECAL; |
546 |
> |
FEB = ecal; |
547 |
> |
|
548 |
> |
Frog_DetId += SubDet*100000; |
549 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
550 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
551 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
552 |
> |
|
553 |
> |
if(SubDet==1){ |
554 |
> |
EBDetId detid = EBDetId(Detid); |
555 |
> |
|
556 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
557 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
558 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
559 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
560 |
> |
|
561 |
> |
Frog_DetId += (detid.tower_ieta()*detid.zside())*100; |
562 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
563 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
564 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
565 |
> |
|
566 |
> |
Frog_DetId += detid.tower_iphi()*1; |
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 |
> |
}else if(SubDet==2){ |
571 |
> |
EEDetId detid = EEDetId(Detid); |
572 |
> |
|
573 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
574 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
575 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
576 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
577 |
> |
|
578 |
> |
Frog_DetId += detid.iquadrant()*1000; |
579 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
580 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
581 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
582 |
> |
|
583 |
> |
Frog_DetId += detid.isc(); |
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 |
> |
}else if(SubDet==3){ |
588 |
> |
ESDetId detid = ESDetId(Detid); |
589 |
|
|
590 |
+ |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
591 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
592 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
593 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
594 |
+ |
|
595 |
+ |
Frog_DetId += detid.plane()*1000; |
596 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
597 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
598 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
599 |
+ |
|
600 |
+ |
Frog_DetId += detid.six()*50; |
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.siy(); |
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 |
+ |
}else if(Detid.det()==DetId::Hcal){ |
611 |
+ |
if(SubDet<1 || SubDet>4) continue; |
612 |
+ |
|
613 |
+ |
Frog_DetId = DETID_HCAL; |
614 |
+ |
FEB = hcal; |
615 |
+ |
|
616 |
+ |
Frog_DetId += SubDet*100000; |
617 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
618 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
619 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
620 |
+ |
|
621 |
+ |
if(true){ |
622 |
+ |
HcalDetId detid = HcalDetId(Detid); |
623 |
+ |
|
624 |
+ |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
625 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
626 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
627 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
628 |
+ |
|
629 |
+ |
Frog_DetId += detid.ietaAbs()*100; |
630 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
631 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
632 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
633 |
+ |
|
634 |
+ |
Frog_DetId += detid.iphi()*1; |
635 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
636 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
637 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
638 |
+ |
} |
639 |
+ |
|
640 |
+ |
|
641 |
+ |
|
642 |
+ |
}else if(Detid.det() == DetId::Calo){ |
643 |
+ |
continue; |
644 |
+ |
/* |
645 |
+ |
Frog_DetId = DETID_CALO + 1000000; |
646 |
+ |
FEB = hcal; |
647 |
+ |
|
648 |
+ |
Frog_DetId += SubDet*100000; |
649 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
650 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
651 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
652 |
+ |
*/ |
653 |
+ |
} |
654 |
+ |
|
655 |
+ |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
656 |
+ |
GlobalPoint CellPos = CellGeom->getPosition(); |
657 |
+ |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
658 |
+ |
|
659 |
+ |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
660 |
+ |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
661 |
+ |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
662 |
+ |
|
663 |
+ |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
664 |
+ |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
665 |
+ |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
666 |
+ |
|
667 |
+ |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
668 |
+ |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
669 |
+ |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
670 |
+ |
|
671 |
+ |
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) ); |
672 |
+ |
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) ); |
673 |
+ |
|
674 |
+ |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
675 |
+ |
Detid.rawId(), F, |
676 |
+ |
cX , cY , cZ , |
677 |
+ |
wX , wY , wZ , |
678 |
+ |
hX , hY , hZ ); |
679 |
+ |
|
680 |
+ |
FEB->addDaughter(mod); |
681 |
+ |
} |
682 |
+ |
|
683 |
+ |
|
684 |
+ |
|
685 |
+ |
// ### Save .geom ### |
686 |
+ |
|
687 |
+ |
Geometry* CMS_Geom = new Geometry(prim); |
688 |
+ |
CMS_Geom->Save("CMS.geom"); |
689 |
+ |
|
690 |
+ |
event_prim = new FROG_Element_Base(C_PRIMARY); |
691 |
+ |
events = new FROG_Events(event_prim); |
692 |
+ |
|
693 |
|
} |
694 |
|
|
695 |
|
// ------------ method called once each job just after ending the event loop ------------ |
696 |
|
void |
697 |
< |
Frog_Analyzer::endJob() { |
698 |
< |
|
699 |
< |
MyEvents->Save((char*) OutputFile.c_str()); |
363 |
< |
// MyEvents->Load((char*) OutputFile.c_str()); |
697 |
> |
Frog_Analyzer::endJob() |
698 |
> |
{ |
699 |
> |
events->Save((char*) OutputFile.c_str()); |
700 |
|
} |
701 |
|
|
702 |
|
|
709 |
|
void |
710 |
|
Frog_Analyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) |
711 |
|
{ |
712 |
< |
MySimEvent* MyEvent = new MySimEvent; |
712 |
> |
FROG_Event* event = new FROG_Event(); |
713 |
|
|
714 |
|
// access the tracker |
715 |
|
edm::ESHandle<TrackerGeometry> tkGeom; |
733 |
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product(); |
734 |
|
|
735 |
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) { |
400 |
– |
MySimTrack MysimTrack; |
736 |
|
SimTrack simTrack =SimTrackColl[a]; |
737 |
|
|
738 |
< |
MysimTrack.track_id =simTrack.trackId(); |
739 |
< |
MysimTrack.Type =simTrack.type(); |
740 |
< |
MysimTrack.parent_vertex=simTrack.vertIndex(); |
741 |
< |
MysimTrack.Px =simTrack.momentum().x(); |
407 |
< |
MysimTrack.Py =simTrack.momentum().y(); |
408 |
< |
MysimTrack.Pz =simTrack.momentum().z(); |
409 |
< |
MysimTrack.E =simTrack.momentum().e(); |
410 |
< |
MysimTrack.charge =simTrack.charge(); |
738 |
> |
FROG_Element_Event_Sim_Track* frogSimTrk = new FROG_Element_Event_Sim_Track(simTrack.trackId(), |
739 |
> |
simTrack.momentum().x(), simTrack.momentum().y(), simTrack.momentum().z(), |
740 |
> |
simTrack.momentum().e(), simTrack.type(), simTrack.vertIndex(), |
741 |
> |
simTrack.charge() ); |
742 |
|
|
743 |
< |
MyEvent->MySimTrackCollection.push_back(MysimTrack); |
743 |
> |
event->addSimTrack( frogSimTrk ); |
744 |
> |
// MyEvent->MySimTrackCollection.push_back(MysimTrack); |
745 |
|
} |
746 |
|
} |
747 |
|
|
752 |
|
std::vector< SimVertex > VertexColl = *h_Vertex.product(); |
753 |
|
|
754 |
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) { |
423 |
– |
MySimVertex MyVertex; |
755 |
|
SimVertex Vertex = VertexColl[b]; |
756 |
|
|
757 |
< |
MyVertex.parentTrack_id =Vertex.parentIndex (); |
758 |
< |
MyVertex.x =Vertex.position().x(); |
759 |
< |
MyVertex.y =Vertex.position().y(); |
429 |
< |
MyVertex.z =Vertex.position().z(); |
757 |
> |
FROG_Element_Event_Sim_Vertex* frogSimVtx = new FROG_Element_Event_Sim_Vertex( |
758 |
> |
Vertex.position().x(), Vertex.position().y(), Vertex.position().z(), |
759 |
> |
Vertex.parentIndex()); |
760 |
|
|
761 |
< |
MyEvent->MySimVertexCollection.push_back(MyVertex); |
761 |
> |
event->addSimVertex(frogSimVtx); |
762 |
|
} |
763 |
|
} |
764 |
|
|
765 |
+ |
|
766 |
|
// ### SIMHIT ### |
767 |
+ |
/* |
768 |
|
for(unsigned int i=0;i<SimHitProducers.size();i++){ |
769 |
|
edm::Handle<std::vector< PSimHit > > h_Hits; |
770 |
|
iEvent.getByLabel(SimHitProducers[i], h_Hits); |
775 |
|
DetId theDetUnitId(Hits[h].detUnitId()); |
776 |
|
const GeomDet* theDet = tkGeom->idToDet(theDetUnitId); |
777 |
|
|
778 |
< |
MyPSimHit Hit; |
779 |
< |
Hit.x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
780 |
< |
Hit.y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
781 |
< |
Hit.z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
782 |
< |
Hit.ProcessType = Hits[h].processType(); |
783 |
< |
Hit.dEdX = Hits[h].energyLoss(); |
778 |
> |
MyPSimHit* Hit = new MyPSimHit; |
779 |
> |
Hit->x = theDet->surface().toGlobal(Hits[h].localPosition()).x(); |
780 |
> |
Hit->y = theDet->surface().toGlobal(Hits[h].localPosition()).y(); |
781 |
> |
Hit->z = theDet->surface().toGlobal(Hits[h].localPosition()).z(); |
782 |
> |
Hit->ProcessType = Hits[h].processType(); |
783 |
> |
Hit->dEdX = Hits[h].energyLoss(); |
784 |
|
|
785 |
|
MyEvent->MyPSimHitCollection.push_back(Hit); |
786 |
|
} |
787 |
|
} |
788 |
+ |
*/ |
789 |
+ |
|
790 |
+ |
|
791 |
+ |
// ### TRAJECTORY ### |
792 |
+ |
for(unsigned int i=0;i<TrajectoryProducers.size();i++){ |
793 |
+ |
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle; |
794 |
+ |
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle); |
795 |
+ |
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product(); |
796 |
+ |
|
797 |
+ |
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) { |
798 |
+ |
Trajectory recoTraj = *it->key; |
799 |
+ |
FROG_Element_Event_Track* frogRecoTk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared()); |
800 |
+ |
|
801 |
+ |
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements(); |
802 |
+ |
for(unsigned int h=0;h<measurements.size();h++){ |
803 |
+ |
|
804 |
+ |
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit(); |
805 |
+ |
if(!h_it->isValid() )continue; |
806 |
+ |
DetId detId = h_it->geographicalId(); |
807 |
+ |
GlobalPoint globalPos = measurements[h].updatedState().globalPosition(); |
808 |
|
|
809 |
+ |
FROG_Element_Event_Hit* frogHit = |
810 |
+ |
new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1); |
811 |
+ |
frogRecoTk->addHit(frogHit); |
812 |
+ |
} |
813 |
+ |
// MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
814 |
+ |
event->addRecoTrack(frogRecoTk); |
815 |
+ |
} |
816 |
+ |
} |
817 |
+ |
|
818 |
+ |
// ### TRACK ### |
819 |
|
|
458 |
– |
// ### TRACKS ### |
820 |
|
for(unsigned int i=0;i<TrackProducers.size();i++){ |
821 |
|
edm::Handle<std::vector< reco::Track > > h_Tracks; |
822 |
|
iEvent.getByLabel(TrackProducers[i], h_Tracks); |
823 |
|
std::vector< reco::Track > TrackColl = *h_Tracks.product(); |
824 |
|
|
825 |
+ |
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size()); |
826 |
|
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) { |
465 |
– |
MyRecoTrack MyrecoTrack; |
827 |
|
reco::Track recoTrack =TrackColl[t]; |
828 |
|
|
829 |
+ |
FROG_Element_Event_Track* frogRecoTk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2()); |
830 |
+ |
|
831 |
+ |
|
832 |
|
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){ |
833 |
|
TrackingRecHitRef h_it = recoTrack.recHit(h); |
834 |
|
if(!h_it->isValid() )continue; |
835 |
|
DetId detId = h_it->geographicalId(); |
836 |
< |
const GeomDet * theDet = tkGeom->idToDet(detId); |
836 |
> |
const GeomDet * theDet = NULL; |
837 |
> |
|
838 |
> |
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId); |
839 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId); |
840 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId); |
841 |
> |
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId); |
842 |
> |
|
843 |
> |
|
844 |
|
LocalPoint localPos = h_it->localPosition(); |
845 |
|
|
846 |
< |
MyRecoHit hit; |
847 |
< |
hit.x = theDet->surface().toGlobal(localPos).x(); |
848 |
< |
hit.y = theDet->surface().toGlobal(localPos).y(); |
849 |
< |
hit.z = theDet->surface().toGlobal(localPos).z(); |
850 |
< |
hit.DetId = detId.rawId(); |
851 |
< |
hit.Charge = -1; |
852 |
< |
MyrecoTrack.Hits.push_back(hit); |
846 |
> |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit( |
847 |
> |
detId.rawId(), |
848 |
> |
theDet->surface().toGlobal(localPos).x(), |
849 |
> |
theDet->surface().toGlobal(localPos).y(), |
850 |
> |
theDet->surface().toGlobal(localPos).z(), |
851 |
> |
-1); |
852 |
> |
frogRecoTk->addHit(frogHit); |
853 |
|
} |
854 |
< |
MyEvent->MyRecoTrackCollection.push_back(MyrecoTrack); |
854 |
> |
event->addRecoTrack(frogRecoTk); |
855 |
|
} |
856 |
|
} |
857 |
|
|
858 |
|
|
859 |
+ |
|
860 |
|
// ### ECALRecHits ### |
861 |
|
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){ |
862 |
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits; |
864 |
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product(); |
865 |
|
|
866 |
|
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){ |
867 |
< |
MyCaloHit temp_EcalHit; |
868 |
< |
temp_EcalHit.E = Ecal_RecHits[eh].energy(); |
869 |
< |
temp_EcalHit.t = Ecal_RecHits[eh].time(); |
870 |
< |
temp_EcalHit.DetId = (Ecal_RecHits[eh].detid()).rawId(); |
499 |
< |
|
500 |
< |
MyEvent->MyEcalCaloHitCollection.push_back(temp_EcalHit); |
867 |
> |
temp_EcalHit->DetId = (Ecal_RecHits[eh].detid()).rawId(); |
868 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(), |
869 |
> |
Ecal_RecHits[eh].energy(), Ecal_RecHits[eh].time()); |
870 |
> |
event->addCaloHit(frogCaloHit); |
871 |
|
} |
872 |
|
} |
873 |
|
|
879 |
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product(); |
880 |
|
|
881 |
|
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){ |
882 |
< |
MyCaloHit temp_HcalHBHEHit; |
883 |
< |
temp_HcalHBHEHit.E = HcalHBHE_RecHits[hh].energy(); |
884 |
< |
temp_HcalHBHEHit.t = HcalHBHE_RecHits[hh].time(); |
515 |
< |
temp_HcalHBHEHit.DetId = (HcalHBHE_RecHits[hh].detid()).rawId(); |
516 |
< |
|
517 |
< |
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHBHEHit); |
882 |
> |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(), |
883 |
> |
HcalHBHE_RecHits[hh].energy(), HcalHBHE_RecHits[hh].time()); |
884 |
> |
event->addCaloHit(frogCaloHit); |
885 |
|
} |
886 |
|
} |
887 |
|
|
892 |
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product(); |
893 |
|
|
894 |
|
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){ |
895 |
< |
MyCaloHit temp_HcalHOHit; |
896 |
< |
temp_HcalHOHit.E = HcalHO_RecHits[hh].energy(); |
897 |
< |
temp_HcalHOHit.t = HcalHO_RecHits[hh].time(); |
898 |
< |
temp_HcalHOHit.DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
895 |
> |
MyCaloHit* temp_HcalHOHit = new MyCaloHit; |
896 |
> |
temp_HcalHOHit->E = HcalHO_RecHits[hh].energy(); |
897 |
> |
temp_HcalHOHit->t = HcalHO_RecHits[hh].time(); |
898 |
> |
temp_HcalHOHit->DetId = (HcalHO_RecHits[hh].detid()).rawId(); |
899 |
|
|
900 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHOHit); |
901 |
|
} |
908 |
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product(); |
909 |
|
|
910 |
|
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){ |
911 |
< |
MyCaloHit temp_HcalHFHit; |
912 |
< |
temp_HcalHFHit.E = HcalHF_RecHits[hh].energy(); |
913 |
< |
temp_HcalHFHit.t = HcalHF_RecHits[hh].time(); |
914 |
< |
temp_HcalHFHit.DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
911 |
> |
MyCaloHit* temp_HcalHFHit = new MyCaloHit; |
912 |
> |
temp_HcalHFHit->E = HcalHF_RecHits[hh].energy(); |
913 |
> |
temp_HcalHFHit->t = HcalHF_RecHits[hh].time(); |
914 |
> |
temp_HcalHFHit->DetId = (HcalHF_RecHits[hh].detid()).rawId(); |
915 |
|
|
916 |
|
MyEvent->MyHcalCaloHitCollection.push_back(temp_HcalHFHit); |
917 |
|
} |
927 |
|
DetId theDetUnitId = CSC_Segments[s].geographicalId(); |
928 |
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId); |
929 |
|
|
930 |
< |
MyMuonSegment temp_CscSeg; |
931 |
< |
temp_CscSeg.DetId = theDetUnitId.rawId(); |
932 |
< |
temp_CscSeg.PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
933 |
< |
temp_CscSeg.PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
934 |
< |
temp_CscSeg.PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
935 |
< |
temp_CscSeg.DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
936 |
< |
temp_CscSeg.DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
937 |
< |
temp_CscSeg.DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
930 |
> |
MyMuonSegment* temp_CscSeg = new MyMuonSegment; |
931 |
> |
temp_CscSeg->DetId = theDetUnitId.rawId(); |
932 |
> |
temp_CscSeg->PosX = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x(); |
933 |
> |
temp_CscSeg->PosY = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y(); |
934 |
> |
temp_CscSeg->PosZ = theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z(); |
935 |
> |
temp_CscSeg->DirX = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(); |
936 |
> |
temp_CscSeg->DirY = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(); |
937 |
> |
temp_CscSeg->DirZ = theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z(); |
938 |
|
|
939 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_CscSeg); |
940 |
|
} |
949 |
|
DetId theDetUnitId = DT_Segments[s].geographicalId(); |
950 |
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId); |
951 |
|
|
952 |
< |
MyMuonSegment temp_DtSeg; |
953 |
< |
temp_DtSeg.DetId = theDetUnitId.rawId(); |
954 |
< |
temp_DtSeg.PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
955 |
< |
temp_DtSeg.PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
956 |
< |
temp_DtSeg.PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
957 |
< |
temp_DtSeg.DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
958 |
< |
temp_DtSeg.DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
959 |
< |
temp_DtSeg.DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
952 |
> |
MyMuonSegment* temp_DtSeg = new MyMuonSegment; |
953 |
> |
temp_DtSeg->DetId = theDetUnitId.rawId(); |
954 |
> |
temp_DtSeg->PosX = theDet->surface().toGlobal(DT_Segments[s].localPosition()).x(); |
955 |
> |
temp_DtSeg->PosY = theDet->surface().toGlobal(DT_Segments[s].localPosition()).y(); |
956 |
> |
temp_DtSeg->PosZ = theDet->surface().toGlobal(DT_Segments[s].localPosition()).z(); |
957 |
> |
temp_DtSeg->DirX = theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(); |
958 |
> |
temp_DtSeg->DirY = theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(); |
959 |
> |
temp_DtSeg->DirZ = theDet->surface().toGlobal(DT_Segments[s].localDirection()).z(); |
960 |
|
|
961 |
|
MyEvent->MyMuonSegmentCollection.push_back(temp_DtSeg); |
962 |
|
} |
972 |
|
DetId theDetUnitId = RPC_Hits[h].geographicalId(); |
973 |
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId); |
974 |
|
|
975 |
< |
MyMuonHit temp_RpcHit; |
976 |
< |
temp_RpcHit.DetId = theDetUnitId.rawId(); |
977 |
< |
temp_RpcHit.x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
978 |
< |
temp_RpcHit.y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
979 |
< |
temp_RpcHit.z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
975 |
> |
MyMuonHit* temp_RpcHit = new MyMuonHit; |
976 |
> |
temp_RpcHit->DetId = theDetUnitId.rawId(); |
977 |
> |
temp_RpcHit->x = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x(); |
978 |
> |
temp_RpcHit->y = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y(); |
979 |
> |
temp_RpcHit->z = theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(); |
980 |
|
|
981 |
|
MyEvent->MyMuonHitCollection.push_back(temp_RpcHit); |
982 |
|
} |
983 |
|
} |
984 |
|
|
618 |
– |
printf("RPC Hits = %i\n",MyEvent->MyMuonHitCollection.size()); |
619 |
– |
|
985 |
|
MyEvents->Events.push_back(MyEvent); |
986 |
+ |
*/ |
987 |
+ |
|
988 |
+ |
// event_prim->addDaughter(event); |
989 |
+ |
events->addEvent(event); |
990 |
|
} |
991 |
|
|
992 |
|
|