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->mSubCellNum = 64;
31  // 63x13.1mm "Pb cells" and the last 1x13.1mm "Fe cell";
32  gpar->mCellLength = gpar->mSubCellNum*gpar->mSubCellLength;
33  cout << "Cell length: " << gpar->mCellLength << " mm" << endl;
34 
35  // Otherwise no sense to store this stuff in the ROOT file;
36 #ifndef _NO_STRUCTURE_GEOMETRY_
37  gpar->mLeadPlateWidth = 96.0;
38  // So 98+2=100mm cell height;
39  gpar->mLeadPlateHeight = 98.0;
40  gpar->mSteelSpacerThickness = 2.0;
41  gpar->mLeadPlateThickness = 10.0;
42 
43  // Scintillator parameters;
44  gpar->mScintillatorPlateThickness = 2.5;
45  gpar->mScintillatorPlateWidth = 95.0;
46  gpar->mScintillatorPlateHeight = 97.0;
47 
48  // WLS parameters;
49  gpar->mWlsPlateThickness = 3.0;
50  // Assume other parameters match WLS;
51  gpar->mMylarThickness = 0.1;
52  // Does it actually match Oleg's drawings?;
53  gpar->mWlsPlateLength = gpar->mSubCellNum*gpar->mSubCellLength;
54  gpar->mWlsPlateHeight = 97.0;
55 
56  // Pin parameters; *full* pin length is given here; see fraction of pin
57  // contained in a given lead plate calculation below;
58  gpar->mPinLength = 20.0;
59  gpar->mPinDiameter = 5.0;
60  // Pin-to-pin distance in X-direction; see details below in the code;
61  gpar->mPinToPinDistance = 50.0;
62 #endif
63 
64  // Well, assume no-gap packing;
65  gpar->mInterCellGap = 0.0;
66 
67  return gpar;
68 } // define_basic_parameters()
69 
70 
71 TGeoVolume *make_single_tower(void *gpar)
72 {
73  // FIXME: do it better than passing "void*" later; in fact should not hurt as long
74  // as dereference the same class;
76  //EicGeoParDataHelper *helper = (EicGeoParDataHelper*)qelper;
77  const TString& cname = hcal->GetDetName()->Name();
78 
79  TGeoBBox *tower = new TGeoBBox(cname + "Tower",
80  0.1 * hcal->mCellFaceSizeX/2,
81  0.1 * hcal->mCellFaceSizeY/2,
82  0.1 * hcal->mCellLength/2);
83 
84  // _NO_STRUCTURE_GEOMETRY_ can be defined in the macro where from hcal-lib.C is included;
85 #ifdef _NO_STRUCTURE_GEOMETRY_
86  TGeoVolume *vtower = new TGeoVolume(cname + "Tower", tower, hcal->GetMedium("PbSciMix"));
87 #else
88  TGeoVolume *vtower = new TGeoVolume(cname + "Tower", tower, hcal->GetMedium("air"));
89 
90  // Fill the tower with the essential stuff;
91  {
92  // Lead absorber plates;
93  {
94  TGeoBBox *leadPlate = new TGeoBBox(cname + "LeadPlate",
95  0.1 * hcal->mLeadPlateWidth/2,
96  0.1 * hcal->mLeadPlateHeight/2,
97  0.1 * hcal->mLeadPlateThickness/2);
98  TGeoVolume *vleadPlate =
99  new TGeoVolume(cname + "LeadPlate", leadPlate, hcal->GetMedium("lead"));
100 
101  // 2x2 mounting pins in the lead absorber;
102  {
103  // Yes, subtract steel divider plate thickness and share between two
104  // plates which this pin connects;
105  double length = (hcal->mPinLength - hcal->mSteelSpacerThickness)/2;
106 
107  TGeoRotation *rpin = new TGeoRotation();
108  rpin->RotateX(90.0);
109 
110  TGeoTube *steelPin =
111  new TGeoTube(cname + "SteelPin", 0.0, 0.1 * hcal->mPinDiameter/2, 0.1 * length/2);
112  TGeoVolume *vsteelPin =
113  new TGeoVolume(cname + "SteelPin", steelPin, hcal->GetMedium("iron"));
114 
115  for(unsigned lr=0; lr<2; lr++) {
116  double x = (lr ? 1.0 : -1.0) * hcal->mPinToPinDistance / 2;
117 
118  for(unsigned tb=0; tb<2; tb++) {
119  double y = (tb ? 1.0 : -1.0) * (hcal->mLeadPlateHeight - length) / 2;
120 
121  vleadPlate->AddNode(vsteelPin, lr*2 + tb,
122  new TGeoCombiTrans(0.1 * x, 0.1 * y, 0.0, rpin));
123  } //for tb
124  } //for lr
125  }
126 
127  // Prefer to decouple single last (steel) plate completely; pins are obviously
128  // not needed here :-)
129  TGeoBBox *steelPlate = new TGeoBBox(cname + "RearSteelPlate",
130  0.1 * hcal->mLeadPlateWidth/2,
131  0.1 * hcal->mLeadPlateHeight/2,
132  0.1 * hcal->mLeadPlateThickness/2);
133  TGeoVolume *vsteelPlate =
134  new TGeoVolume(cname + "RearSteelPlate", steelPlate, hcal->GetMedium("iron"));
135 
136  // Assume shifts to-the-right and to-the-bottom;
137  double offsetX = -(hcal->mCellFaceSizeX - hcal->mLeadPlateWidth)/2.;
138  double offsetY = -(hcal->mCellFaceSizeY - hcal->mLeadPlateHeight)/2.;
139 
140  // There are N-1 lead plates (and the last one is made of steel);
141  for(unsigned pt=0; pt<hcal->mSubCellNum; pt++) {
142  double offsetZ = -hcal->mCellLength/2. +
143  (pt+1)*hcal->mSubCellLength - hcal->mLeadPlateThickness/2;
144 
145  if (pt == hcal->mSubCellNum-1)
146  vtower->AddNode(vsteelPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
147  0.1 * offsetZ, 0));
148  else
149  vtower->AddNode(vleadPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
150  0.1 * offsetZ, 0));
151  } //for pt
152  }
153 
154  // Scintillator plates;
155  {
156  TGeoBBox *sciPlate = new TGeoBBox(cname + "ScintillatorPlate",
157  0.1 * hcal->mScintillatorPlateWidth/2,
158  0.1 * hcal->mScintillatorPlateHeight/2,
159  0.1 * hcal->mScintillatorPlateThickness/2);
160  TGeoVolume *vsciPlate =
161  new TGeoVolume(cname + "ScintillatorPlate", sciPlate, hcal->GetMedium("polystyrene"));
162 
163  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
164  double offsetX = -(hcal->mCellFaceSizeX - hcal->mScintillatorPlateWidth)/2.;
165  double offsetY = -(hcal->mCellFaceSizeY - hcal->mScintillatorPlateHeight)/2.;
166 
167  // There are N-1 lead plates (and the last one is made of steel);
168  for(unsigned pt=0; pt<hcal->mSubCellNum; pt++) {
169  // Assume shifts to-the-center-gap (loose);
170  double offsetZ = -hcal->mCellLength/2. +
171  pt*hcal->mSubCellLength + (hcal->mSubCellLength - hcal->mLeadPlateThickness)/2;
172 
173  vtower->AddNode(vsciPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
174  0.1 * offsetZ, 0));
175  } //for pt
176  }
177 
178  // WLS plate, two mylar films and steel cover plate (long pieces with the same length);
179  {
180  TGeoBBox *wlsPlate = new TGeoBBox(cname + "WlsPlate",
181  0.1 * hcal->mWlsPlateThickness/2,
182  0.1 * hcal->mWlsPlateHeight/2,
183  0.1 * hcal->mWlsPlateLength/2);
184  TGeoVolume *vwlsPlate =
185  // Assume polystyrene for now?;
186  new TGeoVolume(cname + "WlsPlate", wlsPlate, hcal->GetMedium("polystyrene"));
187 
188  // Two mylar layers;
189  TGeoBBox *mylarFilm = new TGeoBBox("mylarFilm",
190  0.1 * hcal->mMylarThickness/2,
191  0.1 * hcal->mWlsPlateHeight/2,
192  0.1 * hcal->mWlsPlateLength/2);
193  TGeoVolume *vmylarFilm =
194  // Assume kapton for now?;
195  new TGeoVolume(cname + "MylarFilm", mylarFilm, hcal->GetMedium("kapton"));
196 
197  TGeoBBox *steelSpacer = new TGeoBBox(cname + "SteelSpacer",
198  0.1 * hcal->mCellFaceSizeX/2,
199  0.1 * hcal->mSteelSpacerThickness/2,
200  0.1 * hcal->mWlsPlateLength/2);
201  TGeoVolume *vsteelSpacer =
202  // Assume iron for now?;
203  new TGeoVolume(cname + "SteelSpacer", steelSpacer, hcal->GetMedium("iron"));
204 
205  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
206  double offsetX = hcal->mCellFaceSizeX/2. - (hcal->mCellFaceSizeX - hcal->mLeadPlateWidth)/2.;
207  double offsetY = -(hcal->mCellFaceSizeY - hcal->mWlsPlateHeight)/2.;
208  double offsetZ = (hcal->mCellLength - hcal->mWlsPlateLength)/2.;
209 
210  vtower->AddNode(vwlsPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
211  0.1 * offsetZ, 0));
212 
213  for(unsigned lr=0; lr<2; lr++) {
214  // Well, may want to introduce an air gap later;
215  double dx = (lr ? -1. : 1.)*(hcal->mWlsPlateThickness + hcal->mMylarThickness)/2;
216 
217  vtower->AddNode(vmylarFilm, lr, new TGeoCombiTrans(0.1 * (offsetX + dx),
218  0.1 *offsetY, 0.1 * offsetZ, 0));
219  } //for lr
220 
221  vtower->AddNode(vsteelSpacer, 0,
222  new TGeoCombiTrans(0.0,
223  0.1 * (hcal->mCellFaceSizeY/2 - hcal->mSteelSpacerThickness/2),
224  0.1 * offsetZ, 0));
225  }
226  }
227 #endif
228 
229  return vtower;
230 } // make_single_tower()