Fork me on GitHub

source: git/examples/geometry.C@ df634866

ImprovedOutputFile Timing dual_readout llp
Last change on this file since df634866 was df634866, checked in by Christophe Delaere <christophe.delaere@…>, 10 years ago

Generalized for >1 calorimeters

Now works as expected with the FCC geometry.

  • Property mode set to 100644
File size: 19.9 KB
Line 
1#include <set>
2#include <map>
3#include <utility>
4#include <vector>
5#include <algorithm>
6#include "TGeoManager.h"
7#include "TGeoVolume.h"
8#include "TGeoMedium.h"
9#include "TGeoNode.h"
10#include "TGeoCompositeShape.h"
11#include "TGeoMatrix.h"
12#include "TGeoTube.h"
13#include "TGeoCone.h"
14#include "TGeoArb8.h"
15//#include "../external/ExRootAnalysis/ExRootConfReader.h"
16#include "TF2.h"
17#include "TH1F.h"
18#include "TMath.h"
19#include "TSystem.h"
20
21using namespace std;
22
23// TODO: asymmetric detector
24class Delphes3DGeometry {
25 public:
26 Delphes3DGeometry(TGeoManager *geom = NULL);
27 ~Delphes3DGeometry() {}
28
29 void readFile(const char* filename, const char* ParticlePropagator="ParticlePropagator",
30 const char* TrackingEfficiency="ChargedHadronTrackingEfficiency",
31 const char* MuonEfficiency="MuonEfficiency",
32 const char* Calorimeters="Calorimeter");
33
34 void setContingency(Double_t contingency) { contingency_ = contingency; }
35 void setCaloBarrelThickness(Double_t thickness) { calo_barrel_thickness_ = thickness; }
36 void setCaloEndcapThickness(Double_t thickness) { calo_endcap_thickness_ = thickness; }
37 void setMuonSystemThickness(Double_t thickness) { muonSystem_thickn_ = thickness; }
38
39 TGeoVolume* getDetector(bool withTowers = true);
40
41 private:
42 std::pair<Double_t, Double_t> addTracker(TGeoVolume *top);
43 std::pair<Double_t, Double_t> addCalorimeter(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning);
44 std::pair<Double_t, Double_t> addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength);
45 void addCaloTowers(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning);
46
47 private:
48
49 TGeoManager *geom_;
50
51 TGeoMedium *vacuum_;
52 TGeoMedium *tkmed_;
53 TGeoMedium *calomed_;
54 TGeoMedium *mudetmed_;
55
56 Double_t contingency_;
57 Double_t calo_barrel_thickness_;
58 Double_t calo_endcap_thickness_;
59 Double_t muonSystem_thickn_;
60 Double_t tk_radius_;
61 Double_t tk_length_;
62 Double_t tk_etamax_;
63
64 std::vector<std::string> calorimeters_;
65 std::vector<std::string> muondets_;
66
67 std::map<std::string, Double_t> muonSystem_etamax_;
68 std::map<std::string, set< pair<Double_t, Int_t> > > caloBinning_;
69
70};
71
72Delphes3DGeometry::Delphes3DGeometry(TGeoManager *geom) {
73
74 //--- the geometry manager
75 geom_ = geom==NULL? gGeoManager : geom;
76
77 //--- define some materials
78 TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0);
79 TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7); // placeholder
80
81 //--- define some media
82 TGeoMedium *Vacuum = new TGeoMedium("Vacuum",1, matVacuum);
83 TGeoMedium *Al = new TGeoMedium("Root Material",2, matAl);
84 vacuum_ = Vacuum;
85 tkmed_ = Vacuum; // placeholder
86 calomed_ = Al; // placeholder
87 mudetmed_ = Al; // placeholder
88
89 // custom parameters
90 contingency_ = 10.;
91 calo_barrel_thickness_ = 50.;
92 calo_endcap_thickness_ = 75.;
93 muonSystem_thickn_ = 10.;
94
95 // read these parameters from the Delphes Card (with default values)
96 tk_radius_ = 120.;
97 tk_length_ = 150.;
98 tk_etamax_ = 3.0;
99}
100
101void Delphes3DGeometry::readFile(const char *configFile,
102 const char* ParticlePropagator, const char* TrackingEfficiency,
103 const char* MuonEfficiency, const char* Calorimeters) {
104
105 ExRootConfReader *confReader = new ExRootConfReader;
106 confReader->ReadFile(configFile);
107
108 tk_radius_ = confReader->GetDouble(Form("%s::Radius",ParticlePropagator), 1.0)*100; // tk_radius
109 tk_length_ = confReader->GetDouble(Form("%s::HalfLength",ParticlePropagator), 3.0)*100; // tk_length
110
111 {
112 TString tkEffFormula = confReader->GetString(Form("%s::EfficiencyFormula",TrackingEfficiency),"abs(eta)<3.0");
113 tkEffFormula.ReplaceAll("pt","x");
114 tkEffFormula.ReplaceAll("eta","y");
115 tkEffFormula.ReplaceAll("phi","0.");
116 TF2* tkEffFunction = new TF2("tkEff",tkEffFormula,0,1000,-10,10);
117 TH1F etaHisto("eta","eta",100,5.,-5.);
118 Double_t pt,eta;
119 for(int i=0;i<1000;++i) {
120 tkEffFunction->GetRandom2(pt,eta);
121 etaHisto.Fill(eta);
122 }
123 Int_t bin = -1;
124 bin = etaHisto.FindFirstBinAbove(0.5);
125 Double_t etamin = (bin>-1) ? etaHisto.GetBinLowEdge(bin) : -10.;
126 bin = etaHisto.FindLastBinAbove(0.5);
127 Double_t etamax = (bin>-1) ? etaHisto.GetBinLowEdge(bin+1) : -10.;
128 tk_etamax_ = TMath::Max(fabs(etamin),fabs(etamax)); // tk_etamax
129 delete tkEffFunction;
130 }
131
132 {
133 muondets_.push_back("muons");
134 TString muonEffFormula = confReader->GetString(Form("%s::EfficiencyFormula",MuonEfficiency),"abs(eta)<2.0");
135 muonEffFormula.ReplaceAll("pt","x");
136 muonEffFormula.ReplaceAll("eta","y");
137 muonEffFormula.ReplaceAll("phi","0.");
138 TF2* muEffFunction = new TF2("muEff",muonEffFormula,0,1000,-10,10);
139 TH1F etaHisto("eta2","eta2",100,5.,-5.);
140 Double_t pt,eta;
141 for(int i=0;i<1000;++i) {
142 muEffFunction->GetRandom2(pt,eta);
143 etaHisto.Fill(eta);
144 }
145 Int_t bin = -1;
146 bin = etaHisto.FindFirstBinAbove(0.5);
147 Double_t etamin = (bin>-1) ? etaHisto.GetBinLowEdge(bin) : -10.;
148 bin = etaHisto.FindLastBinAbove(0.5);
149 Double_t etamax = (bin>-1) ? etaHisto.GetBinLowEdge(bin+1) : -10.;
150 muonSystem_etamax_["muons"] = TMath::Max(fabs(etamin),fabs(etamax)); // muonSystem_etamax
151 delete muEffFunction;
152 }
153
154 std::string s(Calorimeters);
155 std::replace( s.begin(), s.end(), ',', ' ' );
156 std::istringstream stream( s );
157 std::string word;
158 while (stream >> word) calorimeters_.push_back(word);
159
160 caloBinning_.clear(); // calo binning
161 for(std::vector<std::string>::const_iterator calo=calorimeters_.begin();calo!=calorimeters_.end(); ++calo) {
162 set< pair<Double_t, Int_t> > caloBinning;
163 ExRootConfParam paramEtaBins, paramPhiBins;
164 ExRootConfParam param = confReader->GetParam(Form("%s::EtaPhiBins",calo->c_str()));
165 Int_t size = param.GetSize();
166 for(int i = 0; i < size/2; ++i) {
167 paramEtaBins = param[i*2];
168 paramPhiBins = param[i*2+1];
169 assert(paramEtaBins.GetSize()==1);
170 caloBinning.insert(std::make_pair(paramEtaBins[0].GetDouble(),paramPhiBins.GetSize()-1));
171 }
172 caloBinning_[*calo] = caloBinning;
173 }
174
175 delete confReader;
176
177}
178
179TGeoVolume* Delphes3DGeometry::getDetector(bool withTowers) {
180 // compute the envelope
181 Double_t system_radius = tk_radius_+calo_barrel_thickness_+3*contingency_;
182 Double_t system_length = tk_length_+contingency_+(contingency_+calo_endcap_thickness_)*calorimeters_.size()+contingency_;
183 // the detector volume
184 TGeoVolume *top = geom_->MakeBox("Delphes3DGeometry", vacuum_, system_radius, system_radius, system_length);
185 // build the detector
186 std::pair<Double_t, Double_t> limits = addTracker(top);
187 Double_t radius = limits.first;
188 Double_t length = limits.second;
189 for(std::vector<std::string>::const_iterator calo = calorimeters_.begin(); calo != calorimeters_.end(); ++calo) {
190 limits = addCalorimeter(top,calo->c_str(),radius,length,caloBinning_[*calo]);
191 if (withTowers) {
192 addCaloTowers(top,calo->c_str(),radius,length,caloBinning_[*calo]);
193 }
194 radius = limits.first;
195 length = limits.second;
196 }
197 for(std::vector<std::string>::const_iterator muon = muondets_.begin(); muon != muondets_.end(); ++muon) {
198 limits = addMuonDets(top, muon->c_str(), radius, length);
199 radius = limits.first;
200 length = limits.second;
201 }
202 // return the result
203 return top;
204}
205
206std::pair<Double_t, Double_t> Delphes3DGeometry::addTracker(TGeoVolume *top) {
207 // tracker: a cylinder with two cones substracted
208 TGeoCone* forwardCone = new TGeoCone("forwardTkAcceptance",(tk_length_/2.+0.05),0.,tk_radius_,(tk_length_)*2.*exp(-tk_etamax_)/(1-exp(-2.*tk_etamax_)),tk_radius_);
209 TGeoTranslation *tr1 = new TGeoTranslation("tkacc1",0., 0., tk_length_/2.);
210 tr1->RegisterYourself();
211 TGeoRotation *negz = new TGeoRotation("tknegz",0,180,0);
212 negz->RegisterYourself();
213 TGeoCombiTrans *tr2 = new TGeoCombiTrans("tkacc2",0.,0.,-tk_length_/2.,negz);
214 tr2->RegisterYourself();
215 TGeoCompositeShape* tracker_cs = new TGeoCompositeShape("tracker_cs","forwardTkAcceptance:tkacc1+forwardTkAcceptance:tkacc2");
216 TGeoVolume *tracker = new TGeoVolume("tracker",tracker_cs,tkmed_);
217 tracker->SetLineColor(kYellow);
218 top->AddNode(tracker,1);
219 return std::make_pair(tk_radius_,tk_length_);
220}
221
222std::pair<Double_t, Double_t> Delphes3DGeometry::addCalorimeter(TGeoVolume *top, const char* name,
223 Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning) {
224 // parameters derived from the inputs
225 Double_t calo_endcap_etamax = TMath::Max(fabs(caloBinning.begin()->first),fabs(caloBinning.rbegin()->first));
226 Double_t calo_barrel_innerRadius = innerBarrelRadius+contingency_;
227 Double_t calo_barrel_length = innerBarrelLength + calo_barrel_thickness_;
228 Double_t calo_endcap_etamin = -log(innerBarrelRadius/(2*innerBarrelLength));
229 Double_t calo_endcap_innerRadius1 = innerBarrelLength*2.*exp(-calo_endcap_etamax)/(1-exp(-2.*calo_endcap_etamax));
230 Double_t calo_endcap_innerRadius2 = (innerBarrelLength+calo_endcap_thickness_)*2.*exp(-calo_endcap_etamax)/(1-exp(-2.*calo_endcap_etamax));
231 Double_t calo_endcap_outerRadius1 = innerBarrelRadius;
232 Double_t calo_endcap_outerRadius2 = innerBarrelRadius+calo_barrel_thickness_;
233 Double_t calo_endcap_coneThickness = TMath::Min(calo_barrel_thickness_ * (1-exp(-2.*calo_endcap_etamin)) / (2.*exp(-calo_endcap_etamin)), calo_endcap_thickness_);
234 Double_t calo_endcap_diskThickness = TMath::Max(0.,calo_endcap_thickness_-calo_endcap_coneThickness);
235
236 // calorimeters: tube truncated in eta + cones
237 new TGeoTube(Form("%s_barrel_cylinder",name),calo_barrel_innerRadius,calo_barrel_innerRadius+calo_barrel_thickness_,calo_barrel_length);
238 new TGeoCone(Form("%s_endcap_cone",name),calo_endcap_coneThickness/2.,calo_endcap_innerRadius1,calo_endcap_outerRadius1,calo_endcap_innerRadius2,calo_endcap_outerRadius2);
239 new TGeoTube(Form("%s_endcap_disk",name),calo_endcap_innerRadius2,tk_radius_+calo_barrel_thickness_,calo_endcap_diskThickness/2.);
240 TGeoTranslation *tr1 = new TGeoTranslation(Form("%s_tr1",name),0., 0., (calo_endcap_coneThickness+calo_endcap_diskThickness)/2.);
241 tr1->RegisterYourself();
242 TGeoCompositeShape *calo_endcap_cs = new TGeoCompositeShape(Form("%s_endcap_cs",name),Form("%s_endcap_cone+%s_endcap_disk:%s_tr1",name,name,name));
243 TGeoTranslation *trc1 = new TGeoTranslation(Form("%s_endcap1_position",name),0.,0., innerBarrelLength+calo_endcap_coneThickness/2.);
244 trc1->RegisterYourself();
245 TGeoRotation *negz = new TGeoRotation(Form("%s_negz",name),0,180,0);
246 TGeoCombiTrans *trc2 = new TGeoCombiTrans(Form("%s_endcap2_position",name),0.,0.,-(innerBarrelLength+calo_endcap_coneThickness/2.),negz);
247 trc2->RegisterYourself();
248 TGeoTranslation *trc1c = new TGeoTranslation(Form("%s_endcap1_position_cont",name),0.,0., innerBarrelLength+calo_endcap_coneThickness/2.+contingency_);
249 trc1c->RegisterYourself();
250 TGeoCombiTrans *trc2c = new TGeoCombiTrans(Form("%s_endcap2_position_cont",name),0.,0.,-(innerBarrelLength+calo_endcap_coneThickness/2.)-contingency_,negz);
251 trc2c->RegisterYourself();
252 TGeoVolume *calo_endcap = new TGeoVolume(Form("%s_endcap",name),calo_endcap_cs,calomed_);
253 TGeoCompositeShape *calo_barrel_cs = new TGeoCompositeShape(Form("%s_barrel_cs",name),
254 Form("%s_barrel_cylinder-%s_endcap_cs:%s_endcap1_position-%s_endcap_cs:%s_endcap2_position",name,name,name,name,name));
255 TGeoVolume *calo_barrel = new TGeoVolume(Form("%s_barrel",name),calo_barrel_cs,calomed_);
256 calo_endcap->SetLineColor(kViolet);
257 calo_endcap->SetFillColor(kViolet);
258 calo_barrel->SetLineColor(kRed);
259 top->AddNode(calo_endcap,1,trc1c);
260 top->AddNode(calo_endcap,2,trc2c);
261 top->AddNode(calo_barrel,1);
262 return std::make_pair(calo_barrel_innerRadius+calo_barrel_thickness_,innerBarrelLength+calo_endcap_thickness_+contingency_);
263}
264
265std::pair<Double_t, Double_t> Delphes3DGeometry::addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength) {
266 // muon system: tube + disks
267 Double_t muonSystem_radius = innerBarrelRadius + contingency_;
268 Double_t muonSystem_length = innerBarrelLength + contingency_;
269 Double_t muonSystem_rmin = muonSystem_length*2.*exp(-muonSystem_etamax_[name])/(1-exp(-2.*muonSystem_etamax_[name]));
270 TGeoVolume *muon_barrel = geom_->MakeTube(Form("%s_barrel",name),mudetmed_,muonSystem_radius,muonSystem_radius+muonSystem_thickn_,muonSystem_length);
271 muon_barrel->SetLineColor(kBlue);
272 top->AddNode(muon_barrel,1);
273 TGeoVolume *muon_endcap = geom_->MakeTube(Form("%s_endcap",name),mudetmed_,muonSystem_rmin,muonSystem_radius+muonSystem_thickn_,muonSystem_thickn_/2.);
274 muon_endcap->SetLineColor(kBlue);
275 TGeoTranslation *trm1 = new TGeoTranslation(Form("%sEndcap1_position",name),0.,0.,muonSystem_length);
276 trm1->RegisterYourself();
277 TGeoTranslation *trm2 = new TGeoTranslation(Form("%sEndcap2_position",name),0.,0.,-muonSystem_length);
278 trm1->RegisterYourself();
279 top->AddNode(muon_endcap,1,trm1);
280 top->AddNode(muon_endcap,1,trm2);
281 return std::make_pair(muonSystem_radius,muonSystem_length);
282}
283
284void Delphes3DGeometry::addCaloTowers(TGeoVolume *top, const char* name,
285 Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning) {
286
287 TGeoVolume* calo_endcap = top->GetNode(Form("%s_endcap_1",name))->GetVolume();
288 TGeoVolume* calo_barrel = top->GetNode(Form("%s_barrel_1",name))->GetVolume();
289 Double_t calo_endcap_etamin = -log(innerBarrelRadius/(2*innerBarrelLength));
290 Double_t calo_endcap_coneThickness = TMath::Min(calo_barrel_thickness_ * (1-exp(-2.*calo_endcap_etamin)) / (2.*exp(-calo_endcap_etamin)), calo_endcap_thickness_);
291
292 // calo towers in the barrel
293 Double_t vertices[16] = {0.,0.,0.,0.,0.,0.,0.,0.}; // summit of the pyramid
294 Double_t R = tk_radius_ + contingency_+(contingency_+calo_barrel_thickness_)*calorimeters_.size(); // radius of the muons system = height of the pyramid
295 Int_t nEtaBins = caloBinning.size();
296 // this rotation is to make the tower point "up"
297 TGeoRotation* initTowerRot = new TGeoRotation(Form("%s_initTowerRot",name),0.,90.,0.);
298 TGeoCombiTrans* initTower = new TGeoCombiTrans(Form("%s_initTower",name),0.,-R/2.,0.,initTowerRot);
299 initTower->RegisterYourself();
300 // eta bins... we build one pyramid per eta slice and then translate it nphi times.
301 // phi bins represented by rotations around z
302 Double_t *y = new Double_t[nEtaBins];
303 Double_t *dx = new Double_t[nEtaBins];
304 Int_t *nphi = new Int_t[nEtaBins];
305 Int_t etaslice = 0;
306 std::map<std::pair<int,int>, TGeoRotation*> phirotations;
307 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning.begin(); bin!=caloBinning.end();++bin) {
308 if(abs(bin->first)>calo_endcap_etamin) continue; // only in the barrel
309 nphi[etaslice] = bin->second;
310 y[etaslice] = 0.5*R*(1-exp(-2*bin->first))/exp(-bin->first);
311 Double_t phiRotationAngle = 360./nphi[etaslice];
312 dx[etaslice] = R*tan(TMath::Pi()*phiRotationAngle/360.);
313 for(int phislice=0;phislice<nphi[etaslice];++phislice) {
314 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form("%s_phi%d_%d",name,etaslice,phislice),phiRotationAngle*phislice,0.,0.);
315 phirotations[make_pair(etaslice,phislice)]->RegisterYourself();
316 }
317 ++etaslice;
318 }
319 nEtaBins = ++etaslice;
320 for(int i=0;i<nEtaBins-1;++i) { // loop on the eta slices
321 vertices[8] = -dx[i]; vertices[9] = y[i];
322 vertices[10] = -dx[i]; vertices[11] = y[i+1];
323 vertices[12] = dx[i]; vertices[13] = y[i+1];
324 vertices[14] = dx[i]; vertices[15] = y[i];
325 new TGeoArb8(Form("%s_tower%d",name,i),R/2., vertices); // tower in the proper eta slice, at phi=0
326 // intersection between the tower and the calo_barrel
327 TGeoCompositeShape *finaltower_cs = new TGeoCompositeShape(Form("%s_ftower%d_cs",name,i),Form("%s_tower%d:%s_initTower*%s_barrel_cs",name,i,name,name));
328 TGeoVolume *finaltower = new TGeoVolume(Form("%s_ftower%d",name,i),finaltower_cs,calomed_);
329 finaltower->SetLineColor(kRed);
330 for(int j=0;j<nphi[i];++j) { // loop on the phi slices
331 calo_barrel->AddNode(finaltower,j,phirotations[make_pair(i,j)]);
332 }
333 }
334 delete[] y;
335 delete[] dx;
336 delete[] nphi;
337 //the towers in the forward region
338 R = tk_length_+contingency_+(contingency_+calo_endcap_thickness_)*calorimeters_.size(); // Z of the muons system = height of the pyramid
339 nEtaBins = caloBinning.size();
340 // translation to bring the origin of the tower to (0,0,0) (well, not really as the endcap is not yet in place)
341 TGeoTranslation* towerdz = new TGeoTranslation(Form("%s_towerdz",name),0.,0.,R/2.-(innerBarrelLength+calo_endcap_coneThickness/2.));
342 towerdz->RegisterYourself();
343 // eta bins... we build one pyramid per eta slice and then translate it nphi times.
344 Double_t *r = new Double_t[nEtaBins];
345 nphi = new Int_t[nEtaBins];
346 etaslice = 0;
347 phirotations.clear();
348 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning.begin(); bin!=caloBinning.end();++bin) {
349 if(bin->first<calo_endcap_etamin) continue; // only in the + endcap
350 r[etaslice] = R*2*exp(-bin->first)/(1-exp(-2*bin->first));
351 nphi[etaslice] = bin->second;
352 Double_t phiRotationAngle = 360./nphi[etaslice];
353 for(int phislice=0;phislice<nphi[etaslice];++phislice) {
354 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form("%s_forward_phi%d_%d",name,etaslice,phislice),phiRotationAngle*phislice,0.,0.);
355 phirotations[make_pair(etaslice,phislice)]->RegisterYourself();
356 }
357 ++etaslice;
358 }
359 nEtaBins = etaslice;
360 for(int i=0;i<nEtaBins;++i) { // loop on the eta slices
361 vertices[8] = -r[i+1]*sin(TMath::Pi()/20.); vertices[9] = r[i+1]*cos(TMath::Pi()/20.);
362 vertices[10] = -r[i]*sin(TMath::Pi()/20.); vertices[11] = r[i]*cos(TMath::Pi()/20.);
363 vertices[12] = r[i]*sin(TMath::Pi()/20.); vertices[13] = r[i]*cos(TMath::Pi()/20.);
364 vertices[14] = r[i+1]*sin(TMath::Pi()/20.); vertices[15] = r[i+1]*cos(TMath::Pi()/20.);
365 new TGeoArb8(Form("%sfwdtower%d",name,i),R/2., vertices); // tower in the proper eta slice, at phi=0
366 // intersection between the tower and the calo_endcap
367 TGeoCompositeShape *finalfwdtower_cs = new TGeoCompositeShape(Form("%sffwdtower%d_cs",name,i),Form("%sfwdtower%d:%s_towerdz*%s_endcap_cs",name,i,name,name));
368 TGeoVolume *finalfwdtower = new TGeoVolume(Form("%sffwdtower%d",name,i),finalfwdtower_cs,calomed_);
369 finalfwdtower->SetLineColor(kViolet);
370 for(int j=0;j<nphi[i];++j) { // loop on the phi slices
371 calo_endcap->AddNode(finalfwdtower,j,phirotations[make_pair(i,j)]);
372 }
373 }
374 delete[] r;
375 delete[] nphi;
376}
377
378void geometry(const char* filename = "delphes_card_CMS.tcl", const char* ParticlePropagator="ParticlePropagator",
379 const char* TrackingEfficiency="ChargedHadronTrackingEfficiency",
380 const char* MuonEfficiency="MuonEfficiency",
381 const char* Calorimeters="Calorimeter")
382{
383 gSystem->Load("libGeom");
384 gSystem->Load("../libDelphes");
385 TGeoManager *geom = new TGeoManager("delphes", "Delphes geometry");
386
387 // make the top container volume -> designed to contain a "big" detector (ATLAS)
388 TGeoVolume *top = geom->MakeBox("TOP", 0, 1500, 1500, 2300);
389 geom->SetTopVolume(top);
390
391 // build the detector
392 Delphes3DGeometry det3D;
393 det3D.readFile(filename,ParticlePropagator, TrackingEfficiency, MuonEfficiency, Calorimeters);
394 top->AddNode(det3D.getDetector(true),1);
395
396 // draw it
397 geom->CloseGeometry();
398 top->Draw();
399}
400
Note: See TracBrowser for help on using the repository browser.