EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GemGeoParData.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GemGeoParData.h
1 //
2 // AYK (ayk@bnl.gov), 2014/08/06
3 //
4 // GEM geometry description file;
5 //
6 
7 #include <TMath.h>
8 
9 #include <EicPOD.h>
10 #include <EicGeoParData.h>
11 
12 #ifndef _GEM_GEO_PAR_DATA_
13 #define _GEM_GEO_PAR_DATA_
14 
15 // FIXME: unify with the other codes later;
16 #define _AIR_ ("air")
17 #define _ALUMINUM_ ("aluminum")
18 #define _COPPER_ ("copper")
19 
20 class GemModule: public EicPOD {
21  friend class GemGeoParData;
22  public:
23  GemModule();
24  GemModule(const GemModule *sample) { *this = *sample; };
25  ~GemModule() {};
26 
27  //
28  // POD; access through EicPOD methods only;
29  //
30  private:
31  Double_t mActiveWindowBottomWidth; // bottom side width of the active window
32  Double_t mActiveWindowTopWidth; // top side width of the active window
33  Double_t mActiveWindowHeight; // height of the active window
34 
35  Double_t mFrameThickness; // frame thickness along the beam line --> G10
36  Double_t mFrameBottomEdgeWidth; // frame bottom edge width
37  Double_t mFrameTopEdgeWidth; // frame top edge width
38  Double_t mFrameSideEdgeWidth; // frame side edge width
39 
40  // FIXME: assume mylar, hmm; may want to add aluminum (copper) layer later;
41  TString mEntranceWindowMaterial; // entrance window material
42  Double_t mEntranceWindowThickness; // entrance window thickness --> parameter
43 
44  Double_t mDriftFoilKaptonThickness; // drift foil main material thickness --> kapton
45  Double_t mDriftFoilCopperThickness; // drift foil metallization thickness --> copper
46 
47  Double_t mGemFoilAreaFraction; // well, there are holes in this foil
48  Double_t mGemFoilKaptonThickness; // GEM foil main material thickness --> kapton
49  Double_t mGemFoilCopperThickness; // GEM foil metallization thickness --> copper
50 
51  Double_t mReadoutG10Thickness; // overall thickness of readout G10 --> G10
52  Double_t mReadoutCopperThickness; // thickness of readout copper --> copper
53  Double_t mReadoutKaptonThickness; // thickness of readout kapton --> kapton
54  TString mReadoutSupportMaterial; // readout support material
55  Double_t mReadoutSupportThickness; // thickness of readout support --> parameter
56 
57  TString mGasMixture; // gas mixture
58 
59  // NB: the difference between mFrameThickness and these region lengths will
60  // be filled by air; NB: these numbers DO NOT include respective foil thickness;
61  Double_t mEntranceRegionLength; // length between entrance window and drift foil
62  Double_t mDriftRegionLength; // length of drift region
63  // Assume triple GEM layout;
64  Double_t mFirstTransferRegionLength; // length of the first transfer region
65  Double_t mSecondTransferRegionLength;// length of the second transfer region
66  Double_t mInductionRegionLength; // length of induction region
67 
69 };
70 
71 class GemWheel: public TObject {
72  public:
73  GemWheel() { ResetVars(); };
74  GemWheel(GemModule *module, unsigned moduleNum, double radius,
75  TGeoMatrix *transformation):
76  mModule(module), mModuleNum(moduleNum), mRadius(radius),
77  mTransformation(transformation) {};
78  GemWheel(GemModule *module, unsigned moduleNum, double radius, double beamLineOffset,
79  double beamLineRotation):
80  mModule(module), mModuleNum(moduleNum), mRadius(radius) {
81  // FIXME: unify with MAPS codes;
82  TGeoRotation *rw = beamLineRotation ? new TGeoRotation() : 0;
83  if (beamLineRotation) rw->RotateZ(beamLineRotation);
84 
85  mTransformation = new TGeoCombiTrans(0.0, 0.0, beamLineOffset, rw);
86  };
87  ~GemWheel() {};
88 
89  void ResetVars() {
90  mModule = 0;
91  mModuleNum = 0;
92  mRadius = 0.0;
93 
94  mTransformation = 0;
95  };
96 
97  UInt_t mModuleNum; // number of moduless
98  GemModule *mModule; // internals of single module design
99 
100  // This is basically the distance between active window center and the
101  // geometrical center of the wheel (so beam line axis in EIC full configuration);
102  Double_t mRadius; // active window *center* installation radius
103  TGeoMatrix *mTransformation; // 3D transformation
104 
105  ClassDef(GemWheel,9);
106 };
107 
108 class GemGeoParData: public EicGeoParData
109 {
110  public:
111  GemGeoParData(const char *detName = 0, int version = -1, int subVersion = 0):
112  EicGeoParData(detName, version, subVersion),
114  mWithMountingRings(false), mKaptonMaterial("GemKapton"),
115  //mMylarMaterial("GemMylar"),
116  //mRohacellMaterial("GemRohacell"), mNomexMaterial("GemNomex"),
117  mG10Material("GemG10")/*, mGasMaterial("GemArCO2")*/ {};
119 
120  void AddWheel(GemModule *module, unsigned moduleNum, double radius,
121  double beamLineOffset, double beamLineRotation = 0.0) {
122  mWheels.push_back(new GemWheel(module, moduleNum, radius,
123  beamLineOffset, beamLineRotation));
124  };
125  void AddWheel(GemModule *module, unsigned moduleNum, double radius,
126  TGeoMatrix *transformation) {
127  mWheels.push_back(new GemWheel(module, moduleNum, radius, transformation));
128  };
129 
130  // This should be sufficient for FLYSUB;
131  void AddSingleModule(GemModule *module, double beamLineOffset,
132  double beamLineRotation = 0.0) {
133  AddWheel(module, 1, 0.0, beamLineOffset, beamLineRotation);
134  };
135  void AddSingleModule(GemModule *module, TGeoMatrix *transformation) {
136  AddWheel(module, 1, 0.0, transformation);
137  };
138 
140  bool WithMountingRings() const { return mWithMountingRings; };
141 
142  void SetKaptonMaterial (const char *material) { mKaptonMaterial = TString(material); };
143  //void SetRohacellMaterial(const char *material) { mRohacellMaterial = TString(material); };
144  //void SetNomexMaterial (const char *material) { mNomexMaterial = TString(material); };
145  //void SetMylarMaterial (const char *material) { mMylarMaterial = TString(material); };
146  void SetG10Material (const char *material) { mG10Material = TString(material); };
147  //void SetGasMixture (const char *material) { mGasMixture = TString(material); };
148 
149  //const GemWheel *GetWheel(unsigned wheelID) const {
150  //return wheelID <= mWheels.size() ? mWheels[wheelID] : 0;
151  //};
152 
153  int ConstructGeometry(bool root = true, bool gdml = false, bool check = false);
154 
155  // Add sort of mounting rings on both sides of each barrel layer; assume they are
156  // the same construction for all discs;
157  Double_t mMountingRingBeamLineThickness; // mounting ring thickness in beam direction
158  Double_t mMountingRingRadialThickness; // mounting ring thickness in radial direction
159 
160  Bool_t mWithMountingRings; // either create or not mounting rings
161 
162  private:
163  // Default values are hardcoded in the ctor; everything should be tuned once in terms
164  // of radiation length thickness and not touched any longer;
165  TString mKaptonMaterial; // may want to specify a different kapton in media.geo
166  //TString mRohacellMaterial; // ... as well as Rohacell ...
167  //TString mNomexMaterial; // ... as well as honeycomb Nomex ...
168  TString mG10Material; // ... as well as G10 ...
169  //TString mMylarMaterial; // ... as well as mylar ...
170  //TString mGasMaterial; // ... as well as Ar/CO2 gas mixture
171 
172  std::vector <GemWheel*> mWheels; // GEM wheel assemblies
173 
174  void PlaceMaterialLayer(const char *detName, const char *namePrefix, unsigned wheelID,
175  TGeoVolume *moduleContainer, const char *material,
176  //GemModule *module, //double *vert,
177  double thickness, double *yOffset);
178 
180 };
181 
182 #endif