EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hcal-lib.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file hcal-lib.C
1 //
2 // Trivial routines which are shared between T1018 test run geometry builder and
3 // complete EIC model detector builder;
4 //
5 
6 // Again, do this pointer passing better later;
7 void *define_basic_parameters(const char *detName, int version, int subVersion)
8 {
9  // '1': yes, need only one map for now; may want to crete the other ones
10  // if ever want to paerform a complete energy deposit analysis;
11  HcalGeoParData *gpar = new HcalGeoParData(detName, version, subVersion);
12 
13  // Let it be qSandwich even if no internal structure is wanted;
15 
16  //
17  // Declare basic parameters; ignore parameters relevant for a full-scale configuration;
18  //
19 
20  // Take present design numbers; so 100x100mm^2 square volume of sufficient
21  // length to hold all the stuff;
22  gpar->mCellFaceSizeX = 100.0;
23  // Yes, assume square section and just use gpar->mCellFaceSizeX in all 'critical'
24  // places like radius calculation; NB: code modifications will be needed if XY-sizes
25  // ever become different!;
26  gpar->mCellFaceSizeY = gpar->mCellFaceSizeX;
27 
28  // This stuff is needed no matter internal tower geometry is defined or not;
29  //gpar->mSubCellLength = 13.1;
30  gpar->mSubCellLength = 23.4;
31  gpar->mSubCellNum = 64;
32  // 63x13.1mm "Pb cells" and the last 1x13.1mm "Fe cell";
33  gpar->mCellLength = gpar->mSubCellNum*gpar->mSubCellLength;
34  cout << "Cell length: " << gpar->mCellLength << " mm" << endl;
35 
36  // Otherwise no sense to store this stuff in the ROOT file;
37 #ifndef _NO_STRUCTURE_GEOMETRY_
38  gpar->mLeadPlateWidth = 96.0;
39  // So 98+2=100mm cell height;
40  gpar->mLeadPlateHeight = 98.0;
41  gpar->mSteelSpacerThickness = 2.0;
42  gpar->mLeadPlateThickness = 10.0;
43 
44  // Scintillator parameters;
45  gpar->mScintillatorPlateThickness = 2.5;
46  gpar->mScintillatorPlateWidth = 95.0;
47  gpar->mScintillatorPlateHeight = 97.0;
48 
49  // WLS parameters;
50  gpar->mWlsPlateThickness = 3.0;
51  // Assume other parameters match WLS;
52  gpar->mMylarThickness = 0.1;
53  // Does it actually match Oleg's drawings?;
54  gpar->mWlsPlateLength = gpar->mSubCellNum*gpar->mSubCellLength;
55  gpar->mWlsPlateHeight = 97.0;
56 
57  // Pin parameters; *full* pin length is given here; see fraction of pin
58  // contained in a given lead plate calculation below;
59  gpar->mPinLength = 20.0;
60  gpar->mPinDiameter = 5.0;
61  // Pin-to-pin distance in X-direction; see details below in the code;
62  gpar->mPinToPinDistance = 50.0;
63 #endif
64 
65  // Well, assume no-gap packing;
66  gpar->mInterCellGap = 0.0;
67 
68  return gpar;
69 } // define_basic_parameters()
70 
71 
72 TGeoVolume *make_single_tower(void *gpar)
73 {
74  // FIXME: do it better than passing "void*" later; in fact should not hurt as long
75  // as dereference the same class;
77  //EicGeoParDataHelper *helper = (EicGeoParDataHelper*)qelper;
78  const TString& cname = hcal->GetDetName()->Name();
79 
80  TGeoBBox *tower = new TGeoBBox(cname + "Tower",
81  0.1 * hcal->mCellFaceSizeX/2,
82  0.1 * hcal->mCellFaceSizeY/2,
83  0.1 * hcal->mCellLength/2);
84 
85  // _NO_STRUCTURE_GEOMETRY_ can be defined in the macro where from hcal-lib.C is included;
86 #ifdef _NO_STRUCTURE_GEOMETRY_
87  TGeoVolume *vtower = new TGeoVolume(cname + "Tower", tower, hcal->GetMedium("PbSciMix"));
88 #else
89  TGeoVolume *vtower = new TGeoVolume(cname + "Tower", tower, hcal->GetMedium("air"));
90 
91  // Fill the tower with the essential stuff;
92  {
93  // Lead absorber plates;
94  {
95  TGeoBBox *leadPlate = new TGeoBBox(cname + "LeadPlate",
96  0.1 * hcal->mLeadPlateWidth/2,
97  0.1 * hcal->mLeadPlateHeight/2,
98  0.1 * hcal->mLeadPlateThickness/2);
99  TGeoVolume *vleadPlate =
100  new TGeoVolume(cname + "LeadPlate", leadPlate, hcal->GetMedium("lead"));
101 
102  // 2x2 mounting pins in the lead absorber;
103  {
104  // Yes, subtract steel divider plate thickness and share between two
105  // plates which this pin connects;
106  double length = (hcal->mPinLength - hcal->mSteelSpacerThickness)/2;
107 
108  TGeoRotation *rpin = new TGeoRotation();
109  rpin->RotateX(90.0);
110 
111  TGeoTube *steelPin =
112  new TGeoTube(cname + "SteelPin", 0.0, 0.1 * hcal->mPinDiameter/2, 0.1 * length/2);
113  TGeoVolume *vsteelPin =
114  new TGeoVolume(cname + "SteelPin", steelPin, hcal->GetMedium("iron"));
115 
116  for(unsigned lr=0; lr<2; lr++) {
117  double x = (lr ? 1.0 : -1.0) * hcal->mPinToPinDistance / 2;
118 
119  for(unsigned tb=0; tb<2; tb++) {
120  double y = (tb ? 1.0 : -1.0) * (hcal->mLeadPlateHeight - length) / 2;
121 
122  vleadPlate->AddNode(vsteelPin, lr*2 + tb,
123  new TGeoCombiTrans(0.1 * x, 0.1 * y, 0.0, rpin));
124  } //for tb
125  } //for lr
126  }
127 
128  // Prefer to decouple single last (steel) plate completely; pins are obviously
129  // not needed here :-)
130  TGeoBBox *steelPlate = new TGeoBBox(cname + "RearSteelPlate",
131  0.1 * hcal->mLeadPlateWidth/2,
132  0.1 * hcal->mLeadPlateHeight/2,
133  0.1 * hcal->mLeadPlateThickness/2);
134  TGeoVolume *vsteelPlate =
135  new TGeoVolume(cname + "RearSteelPlate", steelPlate, hcal->GetMedium("iron"));
136 
137  // Assume shifts to-the-right and to-the-bottom;
138  double offsetX = -(hcal->mCellFaceSizeX - hcal->mLeadPlateWidth)/2.;
139  double offsetY = -(hcal->mCellFaceSizeY - hcal->mLeadPlateHeight)/2.;
140 
141  // There are N-1 lead plates (and the last one is made of steel);
142  for(unsigned pt=0; pt<hcal->mSubCellNum; pt++) {
143  double offsetZ = -hcal->mCellLength/2. +
144  (pt+1)*hcal->mSubCellLength - hcal->mLeadPlateThickness/2;
145 
146  if (pt == hcal->mSubCellNum-1)
147  vtower->AddNode(vsteelPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
148  0.1 * offsetZ, 0));
149  else
150  vtower->AddNode(vleadPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
151  0.1 * offsetZ, 0));
152  } //for pt
153  }
154 
155  // Scintillator plates;
156  {
157  TGeoBBox *sciPlate = new TGeoBBox(cname + "ScintillatorPlate",
158  0.1 * hcal->mScintillatorPlateWidth/2,
159  0.1 * hcal->mScintillatorPlateHeight/2,
160  0.1 * hcal->mScintillatorPlateThickness/2);
161  TGeoVolume *vsciPlate =
162  new TGeoVolume(cname + "ScintillatorPlate", sciPlate, hcal->GetMedium("polystyrene"));
163 
164  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
165  double offsetX = -(hcal->mCellFaceSizeX - hcal->mScintillatorPlateWidth)/2.;
166  double offsetY = -(hcal->mCellFaceSizeY - hcal->mScintillatorPlateHeight)/2.;
167 
168  // There are N-1 lead plates (and the last one is made of steel);
169  for(unsigned pt=0; pt<hcal->mSubCellNum; pt++) {
170  // Assume shifts to-the-center-gap (loose);
171  double offsetZ = -hcal->mCellLength/2. +
172  pt*hcal->mSubCellLength + (hcal->mSubCellLength - hcal->mLeadPlateThickness)/2;
173 
174  vtower->AddNode(vsciPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
175  0.1 * offsetZ, 0));
176  } //for pt
177  }
178 
179  // WLS plate, two mylar films and steel cover plate (long pieces with the same length);
180  {
181  TGeoBBox *wlsPlate = new TGeoBBox(cname + "WlsPlate",
182  0.1 * hcal->mWlsPlateThickness/2,
183  0.1 * hcal->mWlsPlateHeight/2,
184  0.1 * hcal->mWlsPlateLength/2);
185  TGeoVolume *vwlsPlate =
186  // Assume polystyrene for now?;
187  new TGeoVolume(cname + "WlsPlate", wlsPlate, hcal->GetMedium("polystyrene"));
188 
189  // Two mylar layers;
190  TGeoBBox *mylarFilm = new TGeoBBox("mylarFilm",
191  0.1 * hcal->mMylarThickness/2,
192  0.1 * hcal->mWlsPlateHeight/2,
193  0.1 * hcal->mWlsPlateLength/2);
194  TGeoVolume *vmylarFilm =
195  // Assume kapton for now?;
196  new TGeoVolume(cname + "MylarFilm", mylarFilm, hcal->GetMedium("kapton"));
197 
198  TGeoBBox *steelSpacer = new TGeoBBox(cname + "SteelSpacer",
199  0.1 * hcal->mCellFaceSizeX/2,
200  0.1 * hcal->mSteelSpacerThickness/2,
201  0.1 * hcal->mWlsPlateLength/2);
202  TGeoVolume *vsteelSpacer =
203  // Assume iron for now?;
204  new TGeoVolume(cname + "SteelSpacer", steelSpacer, hcal->GetMedium("iron"));
205 
206  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
207  double offsetX = hcal->mCellFaceSizeX/2. - (hcal->mCellFaceSizeX - hcal->mLeadPlateWidth)/2.;
208  double offsetY = -(hcal->mCellFaceSizeY - hcal->mWlsPlateHeight)/2.;
209  double offsetZ = (hcal->mCellLength - hcal->mWlsPlateLength)/2.;
210 
211  vtower->AddNode(vwlsPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
212  0.1 * offsetZ, 0));
213 
214  for(unsigned lr=0; lr<2; lr++) {
215  // Well, may want to introduce an air gap later;
216  double dx = (lr ? -1. : 1.)*(hcal->mWlsPlateThickness + hcal->mMylarThickness)/2;
217 
218  vtower->AddNode(vmylarFilm, lr, new TGeoCombiTrans(0.1 * (offsetX + dx),
219  0.1 *offsetY, 0.1 * offsetZ, 0));
220  } //for lr
221 
222  vtower->AddNode(vsteelSpacer, 0,
223  new TGeoCombiTrans(0.0,
224  0.1 * (hcal->mCellFaceSizeY/2 - hcal->mSteelSpacerThickness/2),
225  0.1 * offsetZ, 0));
226  }
227  }
228 #endif
229 
230  return vtower;
231 } // make_single_tower()