1 | /*
|
---|
2 | * Delphes: a framework for fast simulation of a generic collider experiment
|
---|
3 | * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
|
---|
4 | *
|
---|
5 | * This program is free software: you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation, either version 3 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef Delphes3DGeometry_h
|
---|
20 | #define Delphes3DGeometry_h
|
---|
21 |
|
---|
22 | #include <set>
|
---|
23 | #include <map>
|
---|
24 | #include <utility>
|
---|
25 | #include <vector>
|
---|
26 | #include <algorithm>
|
---|
27 | #include <sstream>
|
---|
28 | #include "TAxis.h"
|
---|
29 | #include "TGeoManager.h"
|
---|
30 | #include "TGeoVolume.h"
|
---|
31 | #include "TGeoMedium.h"
|
---|
32 |
|
---|
33 | // TODO: asymmetric detector
|
---|
34 |
|
---|
35 | class Delphes3DGeometry {
|
---|
36 | public:
|
---|
37 | Delphes3DGeometry(TGeoManager *geom = NULL);
|
---|
38 | ~Delphes3DGeometry() {}
|
---|
39 |
|
---|
40 | void readFile(const char* filename, const char* ParticlePropagator="ParticlePropagator",
|
---|
41 | const char* TrackingEfficiency="ChargedHadronTrackingEfficiency",
|
---|
42 | const char* MuonEfficiency="MuonEfficiency",
|
---|
43 | const char* Calorimeters="Calorimeter");
|
---|
44 |
|
---|
45 | void loadFromFile(const char* filename, const char* name="DelphesGeometry");
|
---|
46 | void save(const char* filename, const char* name="DelphesGeometry");
|
---|
47 |
|
---|
48 | void setContingency(Double_t contingency) { contingency_ = contingency; }
|
---|
49 | void setCaloBarrelThickness(Double_t thickness) { calo_barrel_thickness_ = thickness; }
|
---|
50 | void setCaloEndcapThickness(Double_t thickness) { calo_endcap_thickness_ = thickness; }
|
---|
51 | void setMuonSystemThickness(Double_t thickness) { muonSystem_thickn_ = thickness; }
|
---|
52 |
|
---|
53 | TGeoVolume* getDetector(bool withTowers = true);
|
---|
54 |
|
---|
55 | Double_t getTrackerRadius() const { return tk_radius_; }
|
---|
56 | Double_t getDetectorRadius() const { return muonSystem_radius_; }
|
---|
57 | Double_t getTrackerHalfLength() const { return tk_length_; }
|
---|
58 | Double_t getDetectorHalfLength() const { return muonSystem_length_; }
|
---|
59 | Double_t getBField() const { return tk_Bz_; }
|
---|
60 | std::pair<TAxis*, TAxis*> getCaloAxes() { return std::make_pair(etaAxis_,phiAxis_); }
|
---|
61 |
|
---|
62 | private:
|
---|
63 | std::pair<Double_t, Double_t> addTracker(TGeoVolume *top);
|
---|
64 | std::pair<Double_t, Double_t> addCalorimeter(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning);
|
---|
65 | std::pair<Double_t, Double_t> addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength);
|
---|
66 | void addCaloTowers(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning);
|
---|
67 |
|
---|
68 | private:
|
---|
69 |
|
---|
70 | TGeoManager *geom_;
|
---|
71 |
|
---|
72 | TGeoMedium *vacuum_;
|
---|
73 | TGeoMedium *tkmed_;
|
---|
74 | TGeoMedium *calomed_;
|
---|
75 | TGeoMedium *mudetmed_;
|
---|
76 |
|
---|
77 | TAxis* etaAxis_;
|
---|
78 | TAxis* phiAxis_;
|
---|
79 |
|
---|
80 | Double_t contingency_;
|
---|
81 | Double_t calo_barrel_thickness_;
|
---|
82 | Double_t calo_endcap_thickness_;
|
---|
83 | Double_t muonSystem_thickn_;
|
---|
84 | Double_t muonSystem_radius_;
|
---|
85 | Double_t muonSystem_length_;
|
---|
86 | Double_t tk_radius_;
|
---|
87 | Double_t tk_length_;
|
---|
88 | Double_t tk_etamax_;
|
---|
89 | Double_t tk_Bz_;
|
---|
90 |
|
---|
91 | std::vector<std::string> calorimeters_;
|
---|
92 | std::vector<std::string> muondets_;
|
---|
93 |
|
---|
94 | std::map<std::string, Double_t> muonSystem_etamax_;
|
---|
95 | std::map<std::string, std::set< std::pair<Double_t, Int_t> > > caloBinning_;
|
---|
96 |
|
---|
97 | };
|
---|
98 |
|
---|
99 | #endif
|
---|