126 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h" |
127 |
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp" |
128 |
|
|
129 |
+ |
#include "DataFormats/VertexReco/interface/NuclearInteraction.h" |
130 |
+ |
|
131 |
+ |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h" |
132 |
+ |
|
133 |
|
|
134 |
|
using namespace edm; |
135 |
|
using namespace std; |
156 |
|
std::vector<InputTag> SimTrackProducers; |
157 |
|
std::vector<InputTag> SimVertexProducers; |
158 |
|
std::vector<InputTag> SimHitProducers; |
159 |
+ |
std::vector<InputTag> NIProducers; |
160 |
|
|
161 |
|
std::vector<InputTag> TrackProducers; |
162 |
|
std::vector<InputTag> TrajectoryProducers; |
169 |
|
|
170 |
|
std::vector<InputTag> RPCHitsProducers; |
171 |
|
|
167 |
– |
|
172 |
|
// ----------member data --------------------------- |
173 |
+ |
|
174 |
+ |
bool ProduceGeom; |
175 |
+ |
int NEventsInVisFile; |
176 |
+ |
int NEvents; |
177 |
+ |
|
178 |
+ |
unsigned int SRun; |
179 |
+ |
unsigned int SEvent; |
180 |
|
}; |
181 |
|
|
182 |
|
// |
197 |
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers"); |
198 |
|
HcalHFRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHFRecHitProducers"); |
199 |
|
|
200 |
+ |
NIProducers = iConfig.getParameter<std::vector<InputTag> >("NIProducers"); |
201 |
+ |
|
202 |
|
DTSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("DTSegmentProducers"); |
203 |
|
CSCSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("CSCSegmentProducers"); |
204 |
|
|
205 |
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers"); |
206 |
|
|
207 |
+ |
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" ); |
208 |
+ |
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" ); |
209 |
+ |
|
210 |
+ |
NEvents = 0; |
211 |
|
} |
212 |
|
|
213 |
|
|
219 |
|
void |
220 |
|
Frog_Analyzer::beginJob(const edm::EventSetup& iSetup) |
221 |
|
{ |
222 |
< |
DetId Detid; |
223 |
< |
unsigned int SubDet; |
224 |
< |
|
225 |
< |
unsigned int Frog_DetId; |
226 |
< |
FROG_Element_Base* FEB = NULL; |
227 |
< |
FROG_Element_Base_With_DetId* FEB_Temp = NULL; |
228 |
< |
|
229 |
< |
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
230 |
< |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
231 |
< |
FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK); geom->addDaughter(tracker); |
232 |
< |
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
233 |
< |
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
234 |
< |
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
235 |
< |
|
236 |
< |
|
237 |
< |
// ### TRACKER GEOMETRY ### |
238 |
< |
|
239 |
< |
edm::ESHandle<TrackerGeometry> tkGeom; |
240 |
< |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
241 |
< |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
242 |
< |
|
243 |
< |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
244 |
< |
Detid = TrackerDets[i]->geographicalId(); |
245 |
< |
SubDet = Detid.subdetId(); |
246 |
< |
if(SubDet<1 || SubDet>6) continue; |
222 |
> |
if(ProduceGeom){ |
223 |
> |
DetId Detid; |
224 |
> |
unsigned int SubDet; |
225 |
> |
|
226 |
> |
unsigned int Frog_DetId; |
227 |
> |
FROG_Element_Base* FEB = NULL; |
228 |
> |
FROG_Element_Base_With_DetId* FEB_Temp = NULL; |
229 |
> |
|
230 |
> |
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); |
231 |
> |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom); |
232 |
> |
FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK); geom->addDaughter(tracker); |
233 |
> |
FROG_Element_Base_With_DetId* muon = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON); geom->addDaughter(muon); |
234 |
> |
FROG_Element_Base_With_DetId* ecal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL); geom->addDaughter(ecal); |
235 |
> |
FROG_Element_Base_With_DetId* hcal = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL); geom->addDaughter(hcal); |
236 |
> |
|
237 |
> |
|
238 |
> |
// ### TRACKER GEOMETRY ### |
239 |
> |
|
240 |
> |
edm::ESHandle<TrackerGeometry> tkGeom; |
241 |
> |
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
242 |
> |
vector<GeomDet*> TrackerDets = tkGeom->dets(); |
243 |
> |
|
244 |
> |
for(unsigned int i=0;i<TrackerDets.size();i++){ |
245 |
> |
Detid = TrackerDets[i]->geographicalId(); |
246 |
> |
SubDet = Detid.subdetId(); |
247 |
> |
if(SubDet<1 || SubDet>6) continue; |
248 |
|
|
249 |
|
|
250 |
< |
GeomDet* DetUnit = TrackerDets[i]; |
251 |
< |
if(!DetUnit)continue; |
252 |
< |
const BoundPlane plane = DetUnit->surface(); |
253 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
254 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
255 |
< |
|
256 |
< |
float width = 0; |
257 |
< |
float length = 0; |
258 |
< |
float thickness = 0; |
259 |
< |
float TrapezoidalParam = 0; |
260 |
< |
|
261 |
< |
if(trapezoidalBounds){ |
262 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
263 |
< |
width = parameters[0]*2; |
264 |
< |
length = parameters[3]*2; |
265 |
< |
thickness = (*trapezoidalBounds).thickness(); |
266 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
267 |
< |
}else if(rectangularBounds){ |
268 |
< |
width = DetUnit->surface().bounds().width(); |
269 |
< |
length = DetUnit->surface().bounds().length(); |
270 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
271 |
< |
TrapezoidalParam = 1; |
272 |
< |
} |
250 |
> |
GeomDet* DetUnit = TrackerDets[i]; |
251 |
> |
if(!DetUnit)continue; |
252 |
> |
const BoundPlane plane = DetUnit->surface(); |
253 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
254 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
255 |
> |
|
256 |
> |
float width = 0; |
257 |
> |
float length = 0; |
258 |
> |
float thickness = 0; |
259 |
> |
float TrapezoidalParam = 0; |
260 |
> |
|
261 |
> |
if(trapezoidalBounds){ |
262 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
263 |
> |
width = parameters[0]*2; |
264 |
> |
length = parameters[3]*2; |
265 |
> |
thickness = (*trapezoidalBounds).thickness(); |
266 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
267 |
> |
}else if(rectangularBounds){ |
268 |
> |
width = DetUnit->surface().bounds().width(); |
269 |
> |
length = DetUnit->surface().bounds().length(); |
270 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
271 |
> |
TrapezoidalParam = 1; |
272 |
> |
} |
273 |
|
|
274 |
< |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
275 |
< |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
276 |
< |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
277 |
< |
|
278 |
< |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
279 |
< |
|
280 |
< |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
281 |
< |
Detid.rawId(), TrapezoidalParam, |
282 |
< |
Pos.x(), Pos.y(), Pos.z(), |
283 |
< |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
284 |
< |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
285 |
< |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
274 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
275 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
276 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
277 |
> |
|
278 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
279 |
> |
|
280 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
281 |
> |
Detid.rawId(), TrapezoidalParam, |
282 |
> |
Pos.x(), Pos.y(), Pos.z(), |
283 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
284 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
285 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
286 |
|
|
287 |
|
|
288 |
< |
Frog_DetId = DETID_TRK; |
289 |
< |
FEB = tracker; |
288 |
> |
Frog_DetId = DETID_TRK; |
289 |
> |
FEB = tracker; |
290 |
|
|
291 |
< |
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; |
291 |
> |
Frog_DetId += SubDet*100000; |
292 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
293 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
294 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
295 |
|
|
296 |
< |
Frog_DetId += detid.rodNumber()*100; |
297 |
< |
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); |
296 |
> |
if(SubDet==PixelSubdetector::PixelBarrel){ |
297 |
> |
PXBDetId detid = PXBDetId(Detid); |
298 |
|
|
299 |
< |
Frog_DetId += detid.side()*10000; |
300 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
301 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
302 |
< |
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);} |
299 |
> |
Frog_DetId += detid.layer()*10000; |
300 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
301 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
302 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
303 |
|
|
304 |
< |
Frog_DetId += detid.ring()*10; |
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);} |
304 |
> |
Frog_DetId += detid.ladder()*100; |
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 |
> |
}else if(SubDet==PixelSubdetector::PixelEndcap){ |
309 |
> |
PXFDetId detid = PXFDetId(Detid); |
310 |
|
|
311 |
< |
Frog_DetId += detid.petalNumber(); |
312 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
313 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
314 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
375 |
< |
}else{ |
376 |
< |
if(mod)delete mod; |
377 |
< |
continue; |
378 |
< |
} |
379 |
< |
FEB->addDaughter(mod); |
380 |
< |
} |
311 |
> |
Frog_DetId += detid.side()*10000; |
312 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
313 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
314 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
315 |
|
|
316 |
+ |
Frog_DetId += detid.disk()*1000; |
317 |
+ |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
318 |
+ |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
319 |
+ |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
320 |
|
|
321 |
< |
// ### MUON GEOMETRY ### |
321 |
> |
Frog_DetId += detid.blade()*10; |
322 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
323 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
324 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
325 |
|
|
326 |
< |
edm::ESHandle<DTGeometry> DtGeom; |
327 |
< |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
328 |
< |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
329 |
< |
|
330 |
< |
edm::ESHandle<CSCGeometry> CscGeom; |
331 |
< |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
391 |
< |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
392 |
< |
|
393 |
< |
edm::ESHandle<RPCGeometry> RpcGeom; |
394 |
< |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
395 |
< |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
396 |
< |
|
397 |
< |
vector<GeomDet*> MuonDets; |
398 |
< |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
399 |
< |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
400 |
< |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
401 |
< |
|
402 |
< |
|
403 |
< |
for(unsigned int i=0;i<MuonDets.size();i++) |
404 |
< |
{ |
405 |
< |
Detid = DetId(MuonDets[i]->geographicalId()); |
406 |
< |
SubDet = Detid.subdetId(); |
407 |
< |
|
408 |
< |
GeomDet* DetUnit = MuonDets[i]; |
409 |
< |
if(!DetUnit)continue; |
410 |
< |
const BoundPlane plane = DetUnit->surface(); |
411 |
< |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
412 |
< |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
413 |
< |
|
414 |
< |
float width = 0; |
415 |
< |
float length = 0; |
416 |
< |
float thickness = 0; |
417 |
< |
float TrapezoidalParam = 0; |
326 |
> |
Frog_DetId += detid.panel()*1; |
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 |
> |
}else if(SubDet==StripSubdetector::TIB){ |
331 |
> |
TIBDetId detid = TIBDetId(Detid); |
332 |
|
|
333 |
< |
if(trapezoidalBounds) |
334 |
< |
{ |
335 |
< |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
336 |
< |
width = parameters[0]*2; |
423 |
< |
length = parameters[3]*2; |
424 |
< |
thickness = (*trapezoidalBounds).thickness(); |
425 |
< |
TrapezoidalParam = parameters[1]/parameters[0]; |
426 |
< |
}else if(rectangularBounds){ |
427 |
< |
width = DetUnit->surface().bounds().width(); |
428 |
< |
length = DetUnit->surface().bounds().length(); |
429 |
< |
thickness = DetUnit->surface().bounds().thickness(); |
430 |
< |
TrapezoidalParam = 1; |
431 |
< |
} |
333 |
> |
Frog_DetId += detid.layer()*10000; |
334 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
335 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
336 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
337 |
|
|
338 |
< |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
339 |
< |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
340 |
< |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
341 |
< |
|
342 |
< |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
343 |
< |
|
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);} |
338 |
> |
Frog_DetId += detid.stringNumber()*100; |
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 |
> |
}else if(SubDet==StripSubdetector::TID){ |
343 |
> |
TIDDetId detid = TIDDetId(Detid); |
344 |
|
|
345 |
< |
if(SubDet==1){ |
346 |
< |
DTChamberId detid = DTChamberId(Detid); |
345 |
> |
Frog_DetId += detid.side()*10000; |
346 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
347 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
348 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
349 |
|
|
350 |
< |
Frog_DetId += (detid.wheel()+3)*10000; |
351 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
352 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
353 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
350 |
> |
Frog_DetId += detid.wheel()*1000; |
351 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
352 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
353 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
354 |
> |
|
355 |
> |
Frog_DetId += detid.ring()*10; |
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 |
> |
}else if(SubDet==StripSubdetector::TOB){ |
360 |
> |
TOBDetId detid = TOBDetId(Detid); |
361 |
|
|
362 |
< |
Frog_DetId += detid.station()*100; |
363 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
364 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
365 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
362 |
> |
Frog_DetId += detid.layer()*10000; |
363 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
364 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
365 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
366 |
|
|
367 |
< |
Frog_DetId += detid.sector()*1; |
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 |
< |
}else if(SubDet==2){ |
372 |
< |
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);} |
367 |
> |
Frog_DetId += detid.rodNumber()*100; |
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 |
> |
}else if(SubDet==StripSubdetector::TEC){ |
372 |
> |
TECDetId detid = TECDetId(Detid); |
373 |
|
|
374 |
< |
Frog_DetId += detid.chamber()*1; |
375 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
376 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
377 |
< |
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); |
374 |
> |
Frog_DetId += detid.side()*10000; |
375 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
376 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
377 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
378 |
|
|
379 |
< |
Frog_DetId += (detid.region()+2)*10000; |
380 |
< |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
381 |
< |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
382 |
< |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
379 |
> |
Frog_DetId += detid.wheel()*1000; |
380 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
381 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
382 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
383 |
|
|
384 |
< |
// Barrel |
502 |
< |
if(detid.region()==0){ |
503 |
< |
Frog_DetId += (detid.ring()+3)*1000; |
384 |
> |
Frog_DetId += detid.ring()*10; |
385 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
386 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
387 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
388 |
< |
// Endcap |
389 |
< |
}else{ |
509 |
< |
Frog_DetId += detid.ring()*1000; |
388 |
> |
|
389 |
> |
Frog_DetId += detid.petalNumber(); |
390 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
391 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
392 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
393 |
+ |
}else{ |
394 |
+ |
if(mod)delete mod; |
395 |
+ |
continue; |
396 |
|
} |
397 |
< |
|
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);} |
397 |
> |
FEB->addDaughter(mod); |
398 |
|
} |
399 |
|
|
526 |
– |
FEB->addDaughter(mod); |
527 |
– |
} |
400 |
|
|
401 |
+ |
// ### MUON GEOMETRY ### |
402 |
|
|
403 |
< |
|
404 |
< |
// ### CALO GEOMETRY ### |
403 |
> |
edm::ESHandle<DTGeometry> DtGeom; |
404 |
> |
iSetup.get<MuonGeometryRecord>().get( DtGeom ); |
405 |
> |
const vector<GeomDet*> DtDets = DtGeom->dets(); |
406 |
> |
|
407 |
> |
edm::ESHandle<CSCGeometry> CscGeom; |
408 |
> |
iSetup.get<MuonGeometryRecord>().get( CscGeom ); |
409 |
> |
const vector<GeomDet*> CscDets = CscGeom->dets(); |
410 |
> |
|
411 |
> |
edm::ESHandle<RPCGeometry> RpcGeom; |
412 |
> |
iSetup.get<MuonGeometryRecord>().get( RpcGeom ); |
413 |
> |
const vector<GeomDet*> RpcDets = RpcGeom->dets(); |
414 |
> |
|
415 |
> |
vector<GeomDet*> MuonDets; |
416 |
> |
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);} |
417 |
> |
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);} |
418 |
> |
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);} |
419 |
|
|
420 |
< |
edm::ESHandle<CaloGeometry> CaloGeom; |
421 |
< |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
422 |
< |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
423 |
< |
|
424 |
< |
for(unsigned int i=0;i<CaloDets.size();i++) |
425 |
< |
{ |
426 |
< |
Detid = CaloDets[i]; |
427 |
< |
SubDet = Detid.subdetId(); |
420 |
> |
for(unsigned int i=0;i<MuonDets.size();i++) |
421 |
> |
{ |
422 |
> |
Detid = DetId(MuonDets[i]->geographicalId()); |
423 |
> |
SubDet = Detid.subdetId(); |
424 |
> |
|
425 |
> |
GeomDet* DetUnit = MuonDets[i]; |
426 |
> |
if(!DetUnit)continue; |
427 |
> |
const BoundPlane plane = DetUnit->surface(); |
428 |
> |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
429 |
> |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
430 |
> |
|
431 |
> |
float width = 0; |
432 |
> |
float length = 0; |
433 |
> |
float thickness = 0; |
434 |
> |
float TrapezoidalParam = 0; |
435 |
> |
|
436 |
> |
if(trapezoidalBounds) |
437 |
> |
{ |
438 |
> |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
439 |
> |
width = parameters[0]*2; |
440 |
> |
length = parameters[3]*2; |
441 |
> |
thickness = (*trapezoidalBounds).thickness(); |
442 |
> |
TrapezoidalParam = parameters[1]/parameters[0]; |
443 |
> |
}else if(rectangularBounds){ |
444 |
> |
width = DetUnit->surface().bounds().width(); |
445 |
> |
length = DetUnit->surface().bounds().length(); |
446 |
> |
thickness = DetUnit->surface().bounds().thickness(); |
447 |
> |
TrapezoidalParam = 1; |
448 |
> |
} |
449 |
|
|
450 |
< |
if(Detid.det()==DetId::Ecal){ |
451 |
< |
if(SubDet<1 || SubDet>3) continue; |
450 |
> |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
451 |
> |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
452 |
> |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
453 |
> |
|
454 |
> |
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
455 |
> |
|
456 |
> |
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod( |
457 |
> |
Detid.rawId(), TrapezoidalParam, |
458 |
> |
Pos.x(), Pos.y(), Pos.z(), |
459 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
460 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
461 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
462 |
|
|
463 |
< |
Frog_DetId = DETID_ECAL; |
464 |
< |
FEB = ecal; |
463 |
> |
Frog_DetId = DETID_MUON; |
464 |
> |
FEB = muon; |
465 |
|
|
466 |
|
Frog_DetId += SubDet*100000; |
467 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
469 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
470 |
|
|
471 |
|
if(SubDet==1){ |
472 |
< |
EBDetId detid = EBDetId(Detid); |
472 |
> |
DTChamberId detid = DTChamberId(Detid); |
473 |
|
|
474 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
474 |
> |
Frog_DetId += (detid.wheel()+3)*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.tower_ieta()*detid.zside())*100; |
479 |
> |
Frog_DetId += detid.station()*100; |
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.tower_iphi()*1; |
484 |
> |
Frog_DetId += detid.sector()*1; |
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 |
|
}else if(SubDet==2){ |
489 |
< |
EEDetId detid = EEDetId(Detid); |
490 |
< |
|
491 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
489 |
> |
CSCDetId detid = CSCDetId(Detid); |
490 |
> |
|
491 |
> |
Frog_DetId += detid.endcap()*10000; |
492 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
493 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
494 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
495 |
< |
|
496 |
< |
Frog_DetId += detid.iquadrant()*1000; |
495 |
> |
|
496 |
> |
Frog_DetId += detid.station()*1000; |
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 |
< |
Frog_DetId += detid.isc(); |
500 |
> |
|
501 |
> |
Frog_DetId += detid.ring()*100; |
502 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
503 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
504 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
505 |
< |
}else if(SubDet==3){ |
506 |
< |
ESDetId detid = ESDetId(Detid); |
589 |
< |
|
590 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
505 |
> |
|
506 |
> |
Frog_DetId += detid.chamber()*1; |
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 |
+ |
}else if(SubDet==3){ |
511 |
+ |
RPCDetId detid = RPCDetId(Detid); |
512 |
|
|
513 |
< |
Frog_DetId += detid.plane()*1000; |
513 |
> |
Frog_DetId += (detid.region()+2)*10000; |
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 |
|
|
518 |
< |
Frog_DetId += detid.six()*50; |
518 |
> |
// Barrel |
519 |
> |
if(detid.region()==0){ |
520 |
> |
Frog_DetId += (detid.ring()+3)*1000; |
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 |
> |
// Endcap |
525 |
> |
}else{ |
526 |
> |
Frog_DetId += detid.ring()*1000; |
527 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
528 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
529 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
530 |
> |
} |
531 |
> |
|
532 |
> |
Frog_DetId += detid.station()*100; |
533 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
534 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
535 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
536 |
|
|
537 |
< |
Frog_DetId += detid.siy(); |
537 |
> |
Frog_DetId += detid.sector()*1; |
538 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
539 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
540 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
541 |
|
} |
610 |
– |
}else if(Detid.det()==DetId::Hcal){ |
611 |
– |
if(SubDet<1 || SubDet>4) continue; |
542 |
|
|
543 |
< |
Frog_DetId = DETID_HCAL; |
544 |
< |
FEB = hcal; |
543 |
> |
FEB->addDaughter(mod); |
544 |
> |
} |
545 |
> |
|
546 |
|
|
547 |
< |
Frog_DetId += SubDet*100000; |
548 |
< |
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);} |
547 |
> |
|
548 |
> |
// ### CALO GEOMETRY ### |
549 |
|
|
550 |
< |
if(true){ |
551 |
< |
HcalDetId detid = HcalDetId(Detid); |
550 |
> |
edm::ESHandle<CaloGeometry> CaloGeom; |
551 |
> |
iSetup.get<IdealGeometryRecord>().get( CaloGeom ); |
552 |
> |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds(); |
553 |
|
|
554 |
< |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
554 |
> |
for(unsigned int i=0;i<CaloDets.size();i++) |
555 |
> |
{ |
556 |
> |
Detid = CaloDets[i]; |
557 |
> |
SubDet = Detid.subdetId(); |
558 |
> |
|
559 |
> |
if(Detid.det()==DetId::Ecal){ |
560 |
> |
if(SubDet<1 || SubDet>3) continue; |
561 |
> |
|
562 |
> |
Frog_DetId = DETID_ECAL; |
563 |
> |
FEB = ecal; |
564 |
> |
|
565 |
> |
Frog_DetId += SubDet*100000; |
566 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
567 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
568 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
569 |
|
|
570 |
< |
Frog_DetId += detid.ietaAbs()*100; |
570 |
> |
if(SubDet==1){ |
571 |
> |
EBDetId detid = EBDetId(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.tower_ieta()*detid.zside())*100; |
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.tower_iphi()*1; |
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==2){ |
588 |
> |
EEDetId detid = EEDetId(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.iquadrant()*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.isc(); |
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 |
> |
}else if(SubDet==3){ |
605 |
> |
ESDetId detid = ESDetId(Detid); |
606 |
> |
|
607 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
608 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
609 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
610 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
611 |
> |
|
612 |
> |
Frog_DetId += detid.plane()*1000; |
613 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
614 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
615 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
616 |
> |
|
617 |
> |
Frog_DetId += detid.six()*50; |
618 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
619 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
620 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
621 |
> |
|
622 |
> |
Frog_DetId += detid.siy(); |
623 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
624 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
625 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
626 |
> |
} |
627 |
> |
}else if(Detid.det()==DetId::Hcal){ |
628 |
> |
if(SubDet<1 || SubDet>4) continue; |
629 |
> |
|
630 |
> |
Frog_DetId = DETID_HCAL; |
631 |
> |
FEB = hcal; |
632 |
> |
|
633 |
> |
Frog_DetId += SubDet*100000; |
634 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
635 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
636 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
637 |
|
|
638 |
< |
Frog_DetId += detid.iphi()*1; |
638 |
> |
if(true){ |
639 |
> |
HcalDetId detid = HcalDetId(Detid); |
640 |
> |
|
641 |
> |
Frog_DetId += ((detid.zside()==1)+1)*10000; |
642 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
643 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
644 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
645 |
> |
|
646 |
> |
Frog_DetId += detid.ietaAbs()*100; |
647 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
648 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
649 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
650 |
> |
|
651 |
> |
Frog_DetId += detid.iphi()*1; |
652 |
> |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
653 |
> |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
654 |
> |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
655 |
> |
} |
656 |
> |
|
657 |
> |
}else if(Detid.det() == DetId::Calo){ |
658 |
> |
continue; |
659 |
> |
/* |
660 |
> |
Frog_DetId = DETID_CALO + 1000000; |
661 |
> |
FEB = hcal; |
662 |
> |
|
663 |
> |
Frog_DetId += SubDet*100000; |
664 |
|
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB); |
665 |
|
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId); |
666 |
|
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);} |
667 |
+ |
*/ |
668 |
|
} |
669 |
|
|
670 |
+ |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
671 |
+ |
GlobalPoint CellPos = CellGeom->getPosition(); |
672 |
+ |
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
673 |
+ |
|
674 |
+ |
float cX = (CellCorners[0].x() + CellCorners[2].x())/2; |
675 |
+ |
float cY = (CellCorners[0].y() + CellCorners[2].y())/2; |
676 |
+ |
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2; |
677 |
+ |
|
678 |
+ |
float wX = (CellCorners[1].x() - CellCorners[0].x())/2; |
679 |
+ |
float wY = (CellCorners[1].y() - CellCorners[0].y())/2; |
680 |
+ |
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2; |
681 |
+ |
|
682 |
+ |
float hX = (CellCorners[3].x() - CellCorners[0].x())/2; |
683 |
+ |
float hY = (CellCorners[3].y() - CellCorners[0].y())/2; |
684 |
+ |
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2; |
685 |
+ |
|
686 |
+ |
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) ); |
687 |
+ |
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) ); |
688 |
+ |
|
689 |
+ |
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod( |
690 |
+ |
Detid.rawId(), F, |
691 |
+ |
cX , cY , cZ , |
692 |
+ |
wX , wY , wZ , |
693 |
+ |
hX , hY , hZ ); |
694 |
|
|
695 |
< |
|
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 |
< |
*/ |
695 |
> |
FEB->addDaughter(mod); |
696 |
|
} |
697 |
|
|
698 |
< |
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 ); |
698 |
> |
// ### Save .geom ### |
699 |
|
|
700 |
< |
FEB->addDaughter(mod); |
700 |
> |
FROG_Geometry* CMS_Geom = new FROG_Geometry(prim); |
701 |
> |
CMS_Geom->Save("CMS.geom"); |
702 |
|
} |
703 |
|
|
683 |
– |
|
684 |
– |
|
685 |
– |
// ### Save .geom ### |
686 |
– |
|
687 |
– |
FROG_Geometry* CMS_Geom = new FROG_Geometry(prim); |
688 |
– |
CMS_Geom->Save("CMS.geom"); |
689 |
– |
|
704 |
|
events_prim = new FROG_Element_Base(C_PRIMARY); |
705 |
|
} |
706 |
|
|
707 |
|
// ------------ method called once each job just after ending the event loop ------------ |
708 |
|
void |
709 |
|
Frog_Analyzer::endJob() |
710 |
< |
{ |
711 |
< |
FROG_Events* events = new FROG_Events(events_prim); |
712 |
< |
events->Save((char*) OutputFile.c_str()); |
710 |
> |
{ |
711 |
> |
if(NEvents>0){ |
712 |
> |
char OutputFileName[1024]; |
713 |
> |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
714 |
> |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent); |
715 |
> |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
716 |
> |
|
717 |
> |
FROG_Events* events = new FROG_Events(events_prim); |
718 |
> |
events->Save((char*) OutputFileName); |
719 |
> |
delete events; |
720 |
> |
delete events_prim; |
721 |
> |
|
722 |
> |
events_prim = new FROG_Element_Base(C_PRIMARY); |
723 |
> |
NEvents=0; |
724 |
> |
} |
725 |
|
} |
726 |
|
|
727 |
|
|
734 |
|
void |
735 |
|
Frog_Analyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) |
736 |
|
{ |
737 |
< |
FROG_Element_Event* event = new FROG_Element_Event(); |
737 |
> |
if(NEvents == 0){ |
738 |
> |
SRun = iEvent.id().run(); |
739 |
> |
SEvent = iEvent.id().event(); |
740 |
> |
} |
741 |
> |
|
742 |
> |
|
743 |
> |
FROG_Element_Event* event = new FROG_Element_Event(iEvent.id().run(), iEvent.id().event() ); |
744 |
|
events_prim->addDaughter(event); |
745 |
|
|
746 |
|
// access the tracker |
820 |
|
} |
821 |
|
} |
822 |
|
|
823 |
+ |
// NUCLEAR INTERACTIONS |
824 |
+ |
for(unsigned int i=0;i<NIProducers.size();i++) { |
825 |
+ |
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs; |
826 |
+ |
iEvent.getByLabel(NIProducers[i], h_NIs); |
827 |
+ |
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product(); |
828 |
+ |
FROG_Element_Base_With_DetId* frogNIColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_NUCLINT + i); |
829 |
+ |
event->addDaughter(frogNIColl); |
830 |
+ |
|
831 |
+ |
for(unsigned int h=0; h<NIs.size();h++){ |
832 |
+ |
reco::NuclearInteraction ni = NIs[i]; |
833 |
+ |
float vtx_x = ni.vertex().x(); |
834 |
+ |
float vtx_y = ni.vertex().y(); |
835 |
+ |
float vtx_z = ni.vertex().z(); |
836 |
+ |
float like = ni.likelihood(); |
837 |
+ |
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like ); |
838 |
+ |
frogNIColl->addDaughter(frogNI); |
839 |
+ |
} |
840 |
+ |
} |
841 |
|
|
842 |
|
|
843 |
|
// ### TRAJECTORY ### |
1032 |
|
} |
1033 |
|
} |
1034 |
|
|
1035 |
+ |
NEvents++; |
1036 |
+ |
if(NEvents == NEventsInVisFile){ |
1037 |
+ |
char OutputFileName[1024]; |
1038 |
+ |
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str()); |
1039 |
+ |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent); |
1040 |
+ |
sprintf(OutputFileName,"%s.vis",OutputFileName); |
1041 |
+ |
|
1042 |
+ |
FROG_Events* events = new FROG_Events(events_prim); |
1043 |
+ |
events->Save((char*) OutputFileName); |
1044 |
+ |
delete events; |
1045 |
+ |
delete events_prim; |
1046 |
|
|
1047 |
+ |
events_prim = new FROG_Element_Base(C_PRIMARY); |
1048 |
+ |
NEvents=0; |
1049 |
+ |
} |
1050 |
|
|
1051 |
|
} |
1052 |
|
|