Fork me on GitHub

source: svn/trunk/src/FrogUtil.cc@ 840

Last change on this file since 840 was 580, checked in by cp3-support, 13 years ago

updated to use FROG 3.0

File size: 22.3 KB
Line 
1/***********************************************************************
2** **
3** /----------------------------------------------\ **
4** | Delphes, a framework for the fast simulation | **
5** | of a generic collider experiment | **
6** \------------- arXiv:0903.2225v1 ------------/ **
7** **
8** **
9** This package uses: **
10** ------------------ **
11** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 **
12** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
13** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
14** FROG: [hep-ex/0901.2718v1] **
15** HepMC: Comput. Phys. Commun.134 (2001) 41 **
16** **
17** ------------------------------------------------------------------ **
18** **
19** Main authors: **
20** ------------- **
21** **
22** Severine Ovyn Xavier Rouby **
23** severine.ovyn@uclouvain.be xavier.rouby@cern **
24** **
25** Center for Particle Physics and Phenomenology (CP3) **
26** Universite catholique de Louvain (UCL) **
27** Louvain-la-Neuve, Belgium **
28** **
29** Copyright (C) 2008-2009, **
30** All rights reserved. **
31** **
32***********************************************************************/
33
34#include <iostream>
35
36#include "TROOT.h"
37#include "TApplication.h"
38#include "TStyle.h"
39#include "TChain.h"
40#include "TClonesArray.h"
41
42#include "BlockClasses.h"
43#include "ExRootTreeReader.h"
44#include "FrogUtil.h"
45
46using namespace std;
47const float twopi = 6.283185307179586476925286766559;
48
49inline float EtaToTheta(float Eta){return 2*atan(exp(-Eta));}
50
51FrogDisplay::FrogDisplay() {
52 //Smearing information
53 DET = new RESOLution();
54 nEntryFrog = DET->NEvents_Frog;
55}
56
57FrogDisplay::FrogDisplay(const string& DetDatacard) {
58 //Smearing information
59 DET = new RESOLution();
60 DET->ReadDataCard(DetDatacard);
61 nEntryFrog = DET->NEvents_Frog;
62}
63
64FrogDisplay::FrogDisplay(const RESOLution* DetDatacard) {
65 //Smearing information
66 DET = new RESOLution(*DetDatacard);
67 nEntryFrog = DET->NEvents_Frog;
68}
69
70FrogDisplay::FrogDisplay(const FrogDisplay& frog) {
71 DET = new RESOLution(*(frog.DET));
72 nEntryFrog = DET->NEvents_Frog;
73}
74
75FrogDisplay& FrogDisplay::operator=(const FrogDisplay& frog) {
76 if (this==&frog) return *this;
77 DET = new RESOLution(*(frog.DET));
78 nEntryFrog = DET->NEvents_Frog;
79 return *this;
80}
81
82void FrogDisplay::BuildEvents(const string& outputfilename) {
83 const Font_t kExRootFont = 42;
84 const Float_t kExRootFontSize = 0.07;
85 gROOT->SetStyle("Plain");
86 gROOT->cd();
87 gStyle->SetCanvasColor(10);
88 gStyle->SetPadColor(10);
89 gStyle->SetFillColor(-1);
90 gStyle->SetPaperSize(20, 24);
91 gStyle->SetStatFont(kExRootFont);
92 gStyle->SetTextFont(kExRootFont);
93 gStyle->SetTextSize(kExRootFontSize);
94 gStyle->SetLegendBorderSize(0);
95 gStyle->SetOptStat(0);
96
97 TChain* chain = new TChain("Analysis");
98 TChain* chainGen = new TChain("GEN");
99 chain ->Add(outputfilename.c_str());
100 chainGen->Add(outputfilename.c_str());
101
102 ExRootTreeReader *treeReader = new ExRootTreeReader(chain);
103 ExRootTreeReader *treeReaderGen = new ExRootTreeReader(chainGen);
104
105 const TClonesArray* branchElectron = treeReader ->UseBranch("Electron");
106 const TClonesArray* branchMuon = treeReader ->UseBranch("Muon");
107 const TClonesArray* branchTau = treeReader ->UseBranch("TauJet");
108 const TClonesArray* branchPhoton = treeReader ->UseBranch("Photon");
109 const TClonesArray* branchJet = treeReader ->UseBranch("Jet");
110 const TClonesArray* branchMET = treeReader ->UseBranch("ETmis");
111
112 TRootElectron* elec;
113 TRootMuon* muon;
114 TRootTauJet* tau;
115 TRootPhoton* photon;
116 TRootJet* jet;
117 TRootETmis* met;
118
119 unsigned int allEntries=treeReader->GetEntries();
120
121 BaseColl* frog_events = new BaseColl();
122 if(nEntryFrog > allEntries) {
123 cerr <<"** ERROR: number of entries to display > available events **"<< endl;
124 nEntryFrog = allEntries;
125 }
126
127 for(unsigned int entry = 0; entry < nEntryFrog; ++entry){
128 //cout<<"Event n° "<<entry<<endl;
129 treeReader ->ReadEntry(entry);
130 treeReaderGen->ReadEntry(entry);
131
132 //Create a new event
133 Event* frog_event = new Event(1,entry);
134 frog_events->addDaughter(frog_event);
135
136 //Create a new branch in the event with name SIM and ID = EVTID_SIM
137 BaseColl_Name* frog_branchSIM = new BaseColl_Name(EVTID_SIM,"SIM");
138 frog_event->addDaughter(frog_branchSIM);
139
140
141 //SIM ELEC
142 //Create a new sub-branch in the SIM branch with name Electrons: this sub branch will contais all the electrons
143 BaseColl_Name* frog_branchElectrons = new BaseColl_Name(EVTID_SIM+1000,"Electrons");
144 frog_branchSIM->addDaughter(frog_branchElectrons);
145
146 for(int p=0;p<branchElectron->GetEntriesFast();p++){
147 elec = (TRootElectron*) branchElectron->At(p);
148 // cout<<"Elec nO "<<p<<" PT: "<<elec->PT<<" Eta "<<elec->Eta<<" Phi"<<elec->Phi<<endl;
149 Event_Candidate* frog_elec = new Event_Candidate(11,elec->E,elec->Eta,elec->Phi);
150 frog_branchElectrons->addDaughter(frog_elec);
151 }
152
153
154 //SIM MUONS
155 //Create a new sub-branch in the SIM branch with name Muons: this sub branch will contais all the muons
156 BaseColl_Name* frog_branchMuons = new BaseColl_Name(EVTID_SIM+2000,"Muons");
157 frog_branchSIM->addDaughter(frog_branchMuons);
158 for(int p=0;p<branchMuon->GetEntriesFast();p++){
159 muon = (TRootMuon*) branchMuon->At(p);
160 // cout<<"Muon nO"<<p<<" PT: "<<muon->PT<<"Eta "<<muon->Eta<<" Phi"<<muon->Phi<<endl;
161 Event_Candidate* frog_muon = new Event_Candidate(13,muon->E,muon->Eta,muon->Phi);
162 frog_branchMuons->addDaughter(frog_muon);
163 }
164
165
166 //SIM TAUS
167 //Create a new sub-branch in the SIM branch with name Taus: this sub branch will contais all the Taus
168 BaseColl_Name* frog_branchTaus = new BaseColl_Name(EVTID_SIM+3000,"Taus");
169 frog_branchSIM->addDaughter(frog_branchTaus);
170 for(int p=0;p<branchTau->GetEntriesFast();p++){
171 tau = (TRootTauJet*) branchTau->At(p);
172 // cout<<"Tau nO"<<p<<" PT: "<<tau->PT<<"Eta "<<tau->Eta<<" Phi"<<tau->Phi<<endl;
173 Event_Candidate* frog_tau = new Event_Candidate(15,tau->E,tau->Eta,tau->Phi);
174 frog_branchTaus->addDaughter(frog_tau);
175 }
176
177
178 //SIM PHOTONS
179 //Create a new sub-branch in the SIM branch with name Photons: this sub branch will contais all the Photons
180 BaseColl_Name* frog_branchPhotons = new BaseColl_Name(EVTID_SIM+4000,"Photons");
181 frog_branchSIM->addDaughter(frog_branchPhotons);
182 for(int p=0;p<branchPhoton->GetEntriesFast();p++){
183 photon = (TRootPhoton*) branchPhoton->At(p);
184 // cout<<"Photon nO"<<p<<" PT: "<<photon->PT<<"Eta "<<photon->Eta<<" Phi"<<photon->Phi<<endl;
185 Event_Candidate* frog_photon = new Event_Candidate(22,photon->E,photon->Eta,photon->Phi);
186 frog_branchPhotons->addDaughter(frog_photon);
187 }
188
189
190 //SIM JETS
191 //Create a new sub-branch in the SIM branch with name Jets: this sub branch will contais all the Jets
192 BaseColl_Name* frog_branchJets = new BaseColl_Name(EVTID_SIM+5000,"Jets");
193 frog_branchSIM->addDaughter(frog_branchJets);
194 for(int p=0;p<branchJet->GetEntriesFast();p++){
195 jet = (TRootJet*) branchJet->At(p);
196 // cout<<"Jet nO"<<p<<" PT: "<<jet->PT<<"Eta "<<jet->Eta<<" Phi"<<jet->Phi<<endl;
197 Event_Jet* frog_jet = new Event_Jet(jet->E,jet->Eta,jet->Phi);
198 frog_branchJets->addDaughter(frog_jet);
199 }
200
201
202 //SIM MET
203 //Create a new sub-branch in the SIM branch with name MET: this sub branch will contais all the METs
204 BaseColl_Name* frog_branchMET = new BaseColl_Name(EVTID_SIM+6000,"MET");
205 frog_branchSIM->addDaughter(frog_branchMET);
206 for(int p=0;p<branchMET->GetEntriesFast();p++){
207 met = (TRootETmis*) branchMET->At(p);
208 // cout<<"MET nO"<<p<<" ET: "<<met->ET<<"Eta "<<0<<" Phi"<<met->Phi<<endl;
209 Event_MET* frog_met = new Event_MET(0,met->ET,0,met->Phi, met->ET);
210 frog_branchMET->addDaughter(frog_met);
211 }
212
213 }
214 //Save events in the .vis file
215 frog_events->save("DelphesToFrog.vis");
216
217
218/* Pointer hierachy
219 frog_events
220 -frog_event
221 -frog_branchSIM
222 -frog_branchElectrons
223 -frog_elec
224 -frog_branchMuons
225 -frog_muon
226 -frog_branchTaus
227 -frog_tau
228 -frog_branchPhotons
229 -frog_photon
230 -frog_photon
231 -frog_jet
232 -frog_branchMET
233 -frog_met
234*/
235
236 delete treeReader;
237 delete treeReaderGen;
238 delete frog_events;
239 delete chain;
240 delete chainGen;
241}
242
243void FrogDisplay::BuildGeom() {
244
245 // This element is the root of the "file" tree. (don't change this line)
246 BaseColl* prim = new BaseColl();
247
248 BaseColl* mygeom = new BaseColl();
249 prim->addDaughter(mygeom);
250
251 BaseColl_Name* detector = new BaseColl_Name(900000000,"Delphes");
252 mygeom->addDaughter(detector);
253
254 double Rayon_Tracker=40;
255 double Rayon_Calo = Rayon_Tracker*1.5;
256 double Rayon_Muon = Rayon_Tracker*2;
257 double Lenght_Tracker=100;
258 double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2.5;
259 double Lenght_Muon=Lenght_Calo+Lenght_Calo/2.5;
260 double Lenght_CaloFwd=Lenght_Muon+Lenght_Muon/2.5;
261
262 int NumPhi=100;
263 float frac=1;
264
265 //************************************************Tracker*************************************************
266 //********************************************************************************************************
267
268 BaseColl_Name* Tracker = new BaseColl_Name(910000000,"Tracker");
269 detector->addDaughter(Tracker);
270 unsigned int DetIdCountTracker = 1;
271
272 double ray=Rayon_Tracker;
273 double rayCone = tan(EtaToTheta(DET->CEN_max_tracker))*Lenght_Tracker/2;
274 if(ray < rayCone)ray=rayCone;
275
276 double dphi = twopi /NumPhi;
277 for(double phi=0; phi<=twopi/frac;phi+=dphi){
278
279 Prim_CustomSurface* trackerCone1 = new Prim_CustomSurface(9100000+DetIdCountTracker*10,
280 rayCone*sin(phi) ,rayCone*cos(phi) ,-Lenght_Tracker/2,
281 rayCone*sin(phi+dphi) ,rayCone*cos(phi+dphi) ,-Lenght_Tracker/2,
282 0 , 0 , 0,
283 0 , 0 , 0);
284 Tracker->addDaughter(trackerCone1); DetIdCountTracker++;
285
286 Prim_CustomSurface* trackerCone2 = new Prim_CustomSurface(9100000+DetIdCountTracker*10,
287 0 , 0 ,0,
288 0 , 0 ,0,
289 rayCone*sin(phi) , rayCone*cos(phi) , Lenght_Tracker/2,
290 rayCone*sin(phi+dphi) , rayCone*sin(phi+dphi) , Lenght_Tracker/2);
291 Tracker->addDaughter(trackerCone2); DetIdCountTracker++;
292
293
294 Prim_CustomSurface* trackerB = new Prim_CustomSurface(9100000+DetIdCountTracker*10,
295 ray*sin(phi) ,ray*cos(phi) ,-Lenght_Tracker*0.5,
296 ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Tracker*0.5,
297 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Tracker*0.5,
298 ray*sin(phi) ,ray*cos(phi) , Lenght_Tracker*0.5);
299 Tracker->addDaughter(trackerB); DetIdCountTracker++;
300
301 Prim_CustomSurface* trackerEndCap1 = new Prim_CustomSurface(9100000+DetIdCountTracker*10,
302 rayCone*sin(phi) , rayCone*cos(phi) , -(Lenght_Tracker)/2,
303 rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , -(Lenght_Tracker)/2,
304 ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Tracker)/2,
305 ray*sin(phi) , ray*cos(phi) , -(Lenght_Tracker)/2);
306 Tracker->addDaughter(trackerEndCap1); DetIdCountTracker++;
307
308 Prim_CustomSurface* trackerEndCap2 = new Prim_CustomSurface(9100000+DetIdCountTracker*10,
309 rayCone*sin(phi) , rayCone*cos(phi) , (Lenght_Tracker)/2,
310 rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , (Lenght_Tracker)/2,
311 ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Tracker)/2,
312 ray*sin(phi) , ray*cos(phi) , (Lenght_Tracker)/2);
313 Tracker->addDaughter(trackerEndCap2); DetIdCountTracker++;
314
315 }
316
317 Rayon_Calo = ray*1.5;
318
319 //******************************************Central calorimeters******************************************
320 //********************************************************************************************************
321
322 BaseColl_Name* CALO = new BaseColl_Name(920000000,"Calo");
323 detector->addDaughter(CALO);
324 unsigned int DetIdCountCalo = 1;
325
326 //float rayConeD = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Tracker/2;
327 //float rayConeF = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Calo/2;
328 float rayConeD = tan(EtaToTheta(DET->CEN_max_calo_ec))*Lenght_Tracker/2;
329 float rayConeF = tan(EtaToTheta(DET->CEN_max_calo_ec))*Lenght_Calo/2;
330 ray=Rayon_Calo;
331 if(ray<rayConeF)ray=rayConeF;
332
333 for(double phi=0; phi<=twopi/frac;phi+=dphi){
334
335 //BARREL
336 Prim_CustomSurface* caloB = new Prim_CustomSurface(9100000+DetIdCountCalo*10,
337 ray*sin(phi) ,ray*cos(phi) ,-Lenght_Calo*0.5,
338 ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Calo*0.5,
339 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Calo*0.5,
340 ray*sin(phi) ,ray*cos(phi) , Lenght_Calo*0.5);
341 CALO->addDaughter(caloB); DetIdCountCalo++;
342
343 //Partial cone + side
344 Prim_CustomSurface* caloEndCap1a = new Prim_CustomSurface(9200000+DetIdCountCalo*10,
345 rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Tracker)/2,
346 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Tracker)/2,
347 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2,
348 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2);
349 CALO->addDaughter(caloEndCap1a); DetIdCountCalo++;
350
351 //Close Endcap + side
352 Prim_CustomSurface* caloEndCap1b = new Prim_CustomSurface(9200000+DetIdCountTracker*10,
353 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2,
354 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2,
355 ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Calo)/2,
356 ray*sin(phi) , ray*cos(phi) , (Lenght_Calo)/2);
357 CALO->addDaughter(caloEndCap1b); DetIdCountCalo++;
358
359 //Partial cone - side
360 Prim_CustomSurface* caloEndCap2a = new Prim_CustomSurface(9200000+DetIdCountCalo*10,
361 rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Tracker)/2,
362 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Tracker)/2,
363 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2,
364 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2);
365 CALO->addDaughter(caloEndCap2a); DetIdCountCalo++;
366
367 //Close Endcap - side
368 Prim_CustomSurface* caloEndCap2b = new Prim_CustomSurface(9200000+DetIdCountTracker*10,
369 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2,
370 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2,
371 ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Calo)/2,
372 ray*sin(phi) , ray*cos(phi) , -(Lenght_Calo)/2);
373 CALO->addDaughter(caloEndCap2b); DetIdCountCalo++;
374
375 }
376
377 Rayon_Muon = ray*1.2;
378
379 //***********************************************Muon chambers********************************************
380 //********************************************************************************************************
381
382 BaseColl_Name* MUON = new BaseColl_Name(930000000,"Muon");
383 detector->addDaughter(MUON);
384 unsigned int DetIdCountMuon = 1;
385
386 rayConeD = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Calo/2;
387 rayConeF = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Muon/2;
388 ray=Rayon_Muon;
389 if(ray<rayConeF)ray=rayConeF;
390
391 for(double phi=0; phi<=twopi/frac;phi+=dphi){
392
393 //BARREL
394 Prim_CustomSurface* muonB = new Prim_CustomSurface(9300000+DetIdCountMuon*10,
395 ray*sin(phi) ,ray*cos(phi) ,-Lenght_Muon*0.5,
396 ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Muon*0.5,
397 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Muon*0.5,
398 ray*sin(phi) ,ray*cos(phi) , Lenght_Muon*0.5);
399 MUON->addDaughter(muonB); DetIdCountMuon++;
400
401 //Partial cone + side
402 Prim_CustomSurface* muonEndCap1a = new Prim_CustomSurface(9300000+DetIdCountMuon*10,
403 rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Calo)/2,
404 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Calo)/2,
405 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2,
406 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2);
407 MUON->addDaughter(muonEndCap1a); DetIdCountMuon++;
408
409 //Close Endcap + side
410 Prim_CustomSurface* muonEndCap1b = new Prim_CustomSurface(9300000+DetIdCountMuon*10,
411 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2,
412 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2,
413 ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Muon)/2,
414 ray*sin(phi) , ray*cos(phi) , (Lenght_Muon)/2);
415 MUON->addDaughter(muonEndCap1b); DetIdCountMuon++;
416
417 //Partial cone - side
418 Prim_CustomSurface* muonEndCap2a = new Prim_CustomSurface(9300000+DetIdCountMuon*10,
419 rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Calo)/2,
420 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Calo)/2,
421 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2,
422 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2);
423 MUON->addDaughter(muonEndCap2a); DetIdCountMuon++;
424
425 //Close Endcap - side
426 Prim_CustomSurface* muonEndCap2b = new Prim_CustomSurface(9300000+DetIdCountMuon*10,
427 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2,
428 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2,
429 ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Muon)/2,
430 ray*sin(phi) , ray*cos(phi) , -(Lenght_Muon)/2);
431 MUON->addDaughter(muonEndCap2b); DetIdCountMuon++;
432 }
433
434
435 //******************************************Forward calorimeters******************************************
436 //********************************************************************************************************
437
438 BaseColl_Name* CALOFWD = new BaseColl_Name(940000000,"CaloFwd");
439 detector->addDaughter(CALOFWD);
440 unsigned int DetIdCountCaloFwd = 1;
441
442 rayConeD = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_Muon;
443 rayConeF = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_CaloFwd;
444 //ray=tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_CaloFwd;
445 ray=tan(EtaToTheta(DET->CEN_max_calo_ec))*Lenght_CaloFwd;
446
447 for(double phi=0; phi<=twopi/frac;phi+=dphi){
448
449 //Partial cone + side
450 Prim_CustomSurface* caloFWDEndCap1a = new Prim_CustomSurface(9400000+DetIdCountCaloFwd*10,
451 rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Muon)/2,
452 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Muon)/2,
453 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2,
454 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2);
455 CALOFWD->addDaughter(caloFWDEndCap1a); DetIdCountCaloFwd++;
456
457 //Close Endcap + side
458 Prim_CustomSurface* caloFWDEndCap1b = new Prim_CustomSurface(9400000+DetIdCountCaloFwd*10,
459 rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2,
460 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2,
461 ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_CaloFwd)/2,
462 ray*sin(phi) , ray*cos(phi) , (Lenght_CaloFwd)/2);
463 CALOFWD->addDaughter(caloFWDEndCap1b); DetIdCountCaloFwd++;
464
465 //BARREL
466 Prim_CustomSurface* caloFWDB1 = new Prim_CustomSurface(9400000+DetIdCountMuon*10,
467 ray*sin(phi) ,ray*cos(phi) , Lenght_Muon*0.5,
468 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Muon*0.5,
469 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_CaloFwd*0.5,
470 ray*sin(phi) ,ray*cos(phi) , Lenght_CaloFwd*0.5);
471 CALOFWD->addDaughter(caloFWDB1); DetIdCountCaloFwd++;
472
473 //Partial cone - side
474 Prim_CustomSurface* caloFWDEndCap2a = new Prim_CustomSurface(9400000+DetIdCountCaloFwd*10,
475 rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Muon)/2,
476 rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Muon)/2,
477 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
478 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2);
479 CALOFWD->addDaughter(caloFWDEndCap2a); DetIdCountCaloFwd++;
480
481 //Close Endcap - side
482 Prim_CustomSurface* caloFWDEndCap2b = new Prim_CustomSurface(9400000+DetIdCountCaloFwd*10,
483 rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2,
484 rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
485 ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
486 ray*sin(phi) , ray*cos(phi) , -(Lenght_CaloFwd)/2);
487 CALOFWD->addDaughter(caloFWDEndCap2b); DetIdCountCaloFwd++;
488
489 //BARREL
490 Prim_CustomSurface* caloFWDB2 = new Prim_CustomSurface(9400000+DetIdCountMuon*10,
491 ray*sin(phi) ,ray*cos(phi) , -Lenght_Muon*0.5,
492 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_Muon*0.5,
493 ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_CaloFwd*0.5,
494 ray*sin(phi) ,ray*cos(phi) , -Lenght_CaloFwd*0.5);
495 CALOFWD->addDaughter(caloFWDB2); DetIdCountCaloFwd++;
496 }
497 prim->save("DelphesToFrog.geom");
498
499 delete prim;
500
501/* pointer hierarchy
502prim
503 -> mygeom
504 -> detector
505 -> Tracker
506 -> CALO
507 -> MUON
508 -> CALOFWD
509pointers that have been added into others will be properly deleted by the destructor of their "mother"
510*/
511
512
513 return;
514
515}
Note: See TracBrowser for help on using the repository browser.