EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hcal.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file hcal.C
1 
2 // Meaningless number for now; fine;
3 #define _VERSION_ 0
4 #define _SUBVERSION_ 0
5 
6 hcal()
7 {
8  // Load basic libraries;
9  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10 
12  const TString& cname = hcal->GetDetName()->Name();
13 
14  //hcal->SetGeometryType(EicGeoParData::FullStructure);
15 
16  // Take present design numbers; so 100x100mm^2 square volume of sufficient
17  // length to hold all the stuff;
18  double CellFaceSizeX = 100.0;
19  // Yes, assume square section;
20  double CellFaceSizeY = CellFaceSizeX;
21 
22  // 36 Fe+Sci "cells" + 10mm rear steel plate;
23  double SubCellLength = 23.4;
24  double SubCellNum = 36;
25  double RearPlateThickness = 10.0;
26  double CellLength = SubCellNum*SubCellLength + RearPlateThickness;
27  cout << "Cell length: " << CellLength << " mm" << endl;
28 
29  double AbsorberPlateWidth = 96.0;
30  // So 98+2=100mm cell height;
31  double AbsorberPlateHeight = 98.0;
32  double SteelSpacerThickness = 2.0;
33  double AbsorberPlateThickness = 20.0;
34 
35  // Scintillator parameters;
36  double ScintillatorPlateThickness = 3.0;
37  double ScintillatorPlateWidth = 95.0;
38  double ScintillatorPlateHeight = 97.0;
39 
40  // WLS parameters;
41  double WlsPlateThickness = 2.9;
42  double WlsPlateLength = CellLength;
43  double WlsPlateHeight = 97.0;
44  // Assume other parameters match WLS;
45  double MylarThickness = 0.1;
46 
47  // Air container volume;
48  TGeoBBox *tower = new TGeoBBox(cname + "Tower",
49  0.1 * CellFaceSizeX/2,
50  0.1 * CellFaceSizeY/2,
51  0.1 * CellLength/2);
52  TGeoVolume *vtower = new TGeoVolume(cname + "Tower", tower, hcal->GetMedium("air"));
53 
54  // Absorber plates;
55  {
56  TGeoBBox *absPlate = new TGeoBBox(cname + "AbsorberPlate",
57  0.1 * AbsorberPlateWidth/2,
58  0.1 * AbsorberPlateHeight/2,
59  0.1 * AbsorberPlateThickness/2);
60  TGeoVolume *vabsPlate =
61  // Assume pure iron for now?;
62  new TGeoVolume(cname + "AbsorberPlate", absPlate, hcal->GetMedium("iron"));
63 
64  // Assume shifts to-the-right and to-the-bottom;
65  double offsetX = -(CellFaceSizeX - AbsorberPlateWidth)/2.;
66  double offsetY = -(CellFaceSizeY - AbsorberPlateHeight)/2.;
67 
68  for(unsigned pt=0; pt<SubCellNum; pt++) {
69  double offsetZ = -CellLength/2. + AbsorberPlateThickness/2 + pt*SubCellLength;
70 
71  vtower->AddNode(vabsPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
72  0.1 * offsetZ, 0));
73  } //for pt
74 
75  // Prefer to decouple single last (thin) plate completely;
76  TGeoBBox *rearPlate = new TGeoBBox(cname + "RearSteelPlate",
77  0.1 * AbsorberPlateWidth/2,
78  0.1 * AbsorberPlateHeight/2,
79  0.1 * RearPlateThickness/2);
80  TGeoVolume *vrearPlate =
81  // Assume pure iron for now?;
82  new TGeoVolume(cname + "RearSteelPlate", rearPlate, hcal->GetMedium("iron"));
83  {
84  double offsetZ = CellLength/2. - RearPlateThickness/2;
85 
86  vtower->AddNode(vrearPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
87  0.1 * offsetZ, 0));
88  }
89  }
90 
91  // Scintillator plates;
92  {
93  TGeoBBox *sciPlate = new TGeoBBox(cname + "ScintillatorPlate",
94  0.1 * ScintillatorPlateWidth/2,
95  0.1 * ScintillatorPlateHeight/2,
96  0.1 * ScintillatorPlateThickness/2);
97  TGeoVolume *vsciPlate =
98  new TGeoVolume(cname + "ScintillatorPlate", sciPlate, hcal->GetMedium("polystyrene"));
99 
100  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
101  double offsetX = -(CellFaceSizeX - ScintillatorPlateWidth)/2.;
102  double offsetY = -(CellFaceSizeY - ScintillatorPlateHeight)/2.;
103 
104  for(unsigned pt=0; pt<SubCellNum; pt++) {
105  // Assume shifts to-the-center-gap (loose);
106  double offsetZ = -CellLength/2. +
107  (pt+1)*SubCellLength - (SubCellLength - AbsorberPlateThickness)/2;
108 
109  vtower->AddNode(vsciPlate, pt, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
110  0.1 * offsetZ, 0));
111  } //for pt
112  }
113 
114  // WLS plate, two mylar films and steel cover plate (long pieces with the same length);
115  {
116  TGeoBBox *wlsPlate = new TGeoBBox(cname + "WlsPlate",
117  0.1 * WlsPlateThickness/2,
118  0.1 * WlsPlateHeight/2,
119  0.1 * WlsPlateLength/2);
120  TGeoVolume *vwlsPlate =
121  // Assume polystyrene for now?;
122  new TGeoVolume(cname + "WlsPlate", wlsPlate, hcal->GetMedium("polystyrene"));
123 
124  // Two mylar layers;
125  TGeoBBox *mylarFilm = new TGeoBBox("mylarFilm",
126  0.1 * MylarThickness/2,
127  0.1 * WlsPlateHeight/2,
128  0.1 * WlsPlateLength/2);
129  TGeoVolume *vmylarFilm =
130  // Assume kapton for now?;
131  new TGeoVolume(cname + "MylarFilm", mylarFilm, hcal->GetMedium("kapton"));
132 
133  TGeoBBox *steelSpacer = new TGeoBBox(cname + "SteelSpacer",
134  0.1 * CellFaceSizeX/2,
135  0.1 * SteelSpacerThickness/2,
136  0.1 * WlsPlateLength/2);
137  TGeoVolume *vsteelSpacer =
138  // Assume pure iron for now?;
139  new TGeoVolume(cname + "SteelSpacer", steelSpacer, hcal->GetMedium("iron"));
140 
141  // Assume shifts to-the-center-gap (loose) and to-the-bottom;
142  double offsetX = CellFaceSizeX/2. - (CellFaceSizeX - AbsorberPlateWidth)/2.;
143  double offsetY = -(CellFaceSizeY - WlsPlateHeight)/2.;
144  double offsetZ = (CellLength - WlsPlateLength)/2.;
145 
146  vtower->AddNode(vwlsPlate, 0, new TGeoCombiTrans(0.1 * offsetX, 0.1 *offsetY,
147  0.1 * offsetZ, 0));
148 
149  for(unsigned lr=0; lr<2; lr++) {
150  // Well, may want to introduce an air gap later;
151  double dx = (lr ? -1. : 1.)*(WlsPlateThickness + MylarThickness)/2;
152 
153  vtower->AddNode(vmylarFilm, lr, new TGeoCombiTrans(0.1 * (offsetX + dx),
154  0.1 *offsetY, 0.1 * offsetZ, 0));
155  } //for lr
156 
157  vtower->AddNode(vsteelSpacer, 0,
158  new TGeoCombiTrans(0.0,
159  0.1 * (CellFaceSizeY/2 - SteelSpacerThickness/2),
160  0.1 * offsetZ, 0));
161  }
162 
163  // Place this singletower into the top volume;
164  hcal->GetTopVolume()->AddNode(vtower, 0, new TGeoCombiTrans());
165 
166  // Define colors;
167  hcal->GetColorTable()->AddPatternMatch(cname + "Tower", kGray +1);
168  hcal->GetColorTable()->AddPatternMatch(cname + "Wls", kGreen +1);
169  hcal->GetColorTable()->AddPatternMatch(cname + "Scint", kBlue +1);
170  hcal->GetColorTable()->AddPatternMatch(cname + "Steel", kYellow +1);
171  hcal->GetColorTable()->AddPatternMatch(cname + "Abso", kYellow +1);
172 
173  hcal->FinalizeOutput();
174 
175  // Yes, always exit;
176  exit(0);
177 }
178