EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MuMegasGeoParData.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MuMegasGeoParData.h
1 //
2 // AYK (ayk@bnl.gov), 2015/01/28
3 //
4 // MuMegas geometry description file;
5 //
6 
7 #include <TMath.h>
8 
9 #include <EicPOD.h>
10 //#include <EtmOrphans.h>
11 #include <EicGeoParData.h>
12 
13 #ifndef _MUMEGAS_GEO_PAR_DATA_
14 #define _MUMEGAS_GEO_PAR_DATA_
15 
16 // FIXME: unify with the other codes later;
17 #define _AIR_ ("air")
18 
19 class MuMegasLayer: public EicPOD {
20  friend class MuMegasGeoParData;
21 
22  public:
23  MuMegasLayer();
24  MuMegasLayer(const MuMegasLayer *sample) { *this = *sample; };
26 
27  //
28  // POD; access through EicPOD methods only;
29  //
30 
31  private:
32  // FIXME: need FR4 here; 200um thick;
33  TString mReadoutPcbMaterial; // readout PCB material; should be FR4?
34  Double_t mReadoutPcbThickness; // PCB thickness -> eventually should be FR4?
35 
36  // FIXMR: this is effective thickness I guess?;
37  Double_t mCopperStripThickness; // effective copper strips thickness -> copper
38 
39  // Let's say, Ar(70)/CO2(30), see Maxence' muMegas.C; 120um amplification region;
40  TString mGasMixture; // gas mixture
41  double mAmplificationRegionLength; // short amplification region length -> gas mixture
42 
43  // FIXME: will need 'steel' in media.geo;
44  Double_t mSteelMeshThickness; // effective steel mesh thickness -> steel
45 
46  // 3mm conversion gap for now;
47  Double_t mConversionRegionLength; // conversion region length -> gas mixture
48 
49  // Basically a placeholder for now; assume 25um kapton as entrance window;
50  TString mExitWindowMaterial; // exit window material
51  Double_t mExitWindowThickness; // exit window thickness -> kapton
52 
53  // FIXME: these parameters need to be checked and made real;
54  Double_t mInnerFrameWidth; // inner frame width (wedge shape in fact)
55  Double_t mInnerFrameThickness; // inner frame thickness
56  Double_t mOuterFrameWidth; // outer frame width in beam direction
57  Double_t mOuterFrameThickness; // outer frame thickness
58 
60 };
61 
62 class MuMegasBarrel: public TObject {
63  public:
65  MuMegasBarrel(MuMegasLayer *layer, double length, unsigned beamLineSectionNum,
66  double radius, unsigned sectorNum, TGeoMatrix *transformation):
67  mLayer(layer), mLength(length), mBeamLineSectionNum(beamLineSectionNum),
68  mRadius(radius), mAsimuthalSectorNum(sectorNum), mTransformation(transformation) {};
69 
70  MuMegasBarrel(MuMegasLayer *layer, double length, unsigned beamLineSectionNum,
71  double radius, unsigned sectorNum, double beamLineOffset,
72  double beamLineRotation):
73  mLayer(layer), mLength(length), mBeamLineSectionNum(beamLineSectionNum),
74  mRadius(radius), mAsimuthalSectorNum(sectorNum) {
75  // FIXME: unify with MAPS codes;
76  TGeoRotation *rw = beamLineRotation ? new TGeoRotation() : 0;
77  if (beamLineRotation) rw->RotateZ(beamLineRotation);
78 
79  mTransformation = new TGeoCombiTrans(0.0, 0.0, beamLineOffset, rw);
80  };
82 
83  void ResetVars() {
84  mLayer = 0;
85 
86  mLength = mRadius = 0.0;
88 
89  mTransformation = 0;
90  };
91 
92  MuMegasLayer *mLayer; // layer construction details;
93 
94  Double_t mLength; // overall length along the beam line
95  UInt_t mBeamLineSectionNum; // segmentation along the beam line (de-facto 1 or 2)
96 
97  Double_t mRadius; // inner radius (PCB starts here)
98  UInt_t mAsimuthalSectorNum; // segmentation in phi
99 
100  TGeoMatrix *mTransformation; // 3D transformation
101 
103 };
104 
105 class MuMegasGeoParData: public EicGeoParData
106 {
107  public:
108  MuMegasGeoParData(const char *detName = 0, int version = -1, int subVersion = 0):
109  EicGeoParData(detName, version, subVersion) {};
111 
112  // - layer construction;
113  // - length;
114  // - segmentation in Z;
115  // - radius;
116  // - segmentation in phi;
117  // - Z offset from 0.0 (default);
118  // - azimuthal offset from 0.0 (default);
119  void AddBarrel(MuMegasLayer *layer, double length, unsigned beamLineSectionNum,
120  double radius, unsigned sectorNum,
121  double beamLineOffset = 0.0, double beamLineRotation = 0.0) {
122  mBarrels.push_back(new MuMegasBarrel(layer, length, beamLineSectionNum,
123  radius, sectorNum, beamLineOffset, beamLineRotation));
124  };
125  // The same, but a generic 3D transformation given as parameter;
126  void AddBarrel(MuMegasLayer *layer, double length, unsigned beamLineSectionNum,
127  double radius, unsigned sectorNum, TGeoMatrix *transformation) {
128  mBarrels.push_back(new MuMegasBarrel(layer, length, beamLineSectionNum,
129  radius, sectorNum, transformation));
130  };
131 
132  int ConstructGeometry(bool root = true, bool gdml = false, bool check = false);
133 
134  private:
135  void PlaceMaterialLayer(const char *detName, const char *namePrefix, unsigned barrelID,
136  TGeoVolume *sectorContainer, const char *material,
137  double length, double angle,
138  double thickness, double *yOffset);
139 
140  std::vector <MuMegasBarrel*> mBarrels; // MuMegas barrel assemblies
141 
143 };
144 
145 #endif