119{
121 TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
122
124 TGeoMedium *rohacell = gGeoManager->GetMedium("rohacell");
125
127 TGeoMedium *air = gGeoManager->GetMedium("air");
128
130 TGeoMedium *PlasticBase = gGeoManager->GetMedium("Polycarbonate");
131
133 TGeoMedium *Polystyrene = gGeoManager->GetMedium("Polystyrene");
134
136 TGeoMedium *PMMA = gGeoManager->GetMedium("PMMA");
137
139 TGeoMedium *PMMA2 = gGeoManager->GetMedium("PMMA2");
140
142 TGeoMedium *Epoxy = gGeoManager->GetMedium("Epoxy");
143
144 TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
145
147 TGeoMedium *Fe =gGeoManager->GetMedium("iron");
148
149
153
154 Double_t fWidthScifiMat =
conf_floats[
"Scifi/scifimat_width"];
155 Double_t fLengthScifiMat =
conf_floats[
"Scifi/scifimat_length"];
156 Double_t fZScifiMat =
conf_floats[
"Scifi/scifimat_z"];
157 Double_t fZEpoxyMat =
conf_floats[
"Scifi/epoxymat_z"];
158 Double_t fGapScifiMat =
conf_floats[
"Scifi/scifimat_gap"];
159
160 Double_t fFiberLength =
conf_floats[
"Scifi/fiber_length"];
161 Double_t fScintCore_rmax =
conf_floats[
"Scifi/scintcore_rmax"];
162 Double_t fClad1_rmin =
conf_floats[
"Scifi/clad1_rmin"];
163 Double_t fClad1_rmax =
conf_floats[
"Scifi/clad1_rmax"];
164 Double_t fClad2_rmin =
conf_floats[
"Scifi/clad2_rmin"];
165 Double_t fClad2_rmax =
conf_floats[
"Scifi/clad2_rmax"];
166
167 Double_t fHorPitch =
conf_floats[
"Scifi/horizontal_pitch"];
168 Double_t fVertPitch =
conf_floats[
"Scifi/vertical_pitch"];
169 Double_t fOffsetRowS =
conf_floats[
"Scifi/rowlong_offset"];
170 Double_t fOffsetRowL =
conf_floats[
"Scifi/rowshort_offset"];
171
172 Double_t fZCarbonFiber =
conf_floats[
"Scifi/carbonfiber_z"];
173 Double_t fZHoneycomb =
conf_floats[
"Scifi/honeycomb_z"];
174
175 Double_t fXPlastBar =
conf_floats[
"Scifi/plastbar_x"];
176 Double_t fYPlastBar =
conf_floats[
"Scifi/plastbar_y"];
177 Double_t fZPlastBar =
conf_floats[
"Scifi/plastbar_z"];
178
179 Int_t fNFibers_Srow =
conf_ints[
"Scifi/nfibers_shortrow"];
180 Int_t fNFibers_Lrow =
conf_ints[
"Scifi/nfibers_longrow"];
181 Int_t fNFibers_z =
conf_ints[
"Scifi/nfibers_z"];
182
183 Double_t fSeparationBrick =
conf_floats[
"Scifi/scifi_separation"];
186 Int_t fNScifi =
conf_ints[
"Scifi/nscifi"];
187 Int_t fNSiPMs =
conf_ints[
"Scifi/nsipm_mat"];
188
189 Double_t fWidthChannel =
conf_floats[
"Scifi/channel_width"];
190 Double_t fCharr =
conf_floats[
"Scifi/charr_width"];
192 Double_t fCharrGap =
conf_floats[
"Scifi/charr_gap"];
193 Double_t fBigGap =
conf_floats[
"Scifi/sipm_diegap"];
194 Int_t fNSiPMChan =
conf_ints[
"Scifi/nsipm_channels"];
196
197
198 std::map<int,TVector3> Vedges;
204
205
206
207
209
212
213
216
217 std::map<int,TVector3> DeltasH;
218 std::map<int,TVector3> DeltasV;
219 for (
int i=0;
i<5;
i++){
220 DeltasH[
i] = Vedges[
i] - LHfirst + SHfirst - Sedge;
221 DeltasV[
i] = Vedges[
i] - LVfirst + SVfirst - Sedge;
222 }
223
224
225 TGeoVolume *CarbonFiberVolume = gGeoManager->MakeBox("CarbonFiber", CarbonComposite, fXDimension/2, fYDimension/2, fZCarbonFiber/2);
226 CarbonFiberVolume->SetLineColor(kGray - 2);
227 CarbonFiberVolume->SetVisibility(1);
228
229
230 TGeoVolume *HoneycombVolume = gGeoManager->MakeBox("Honeycomb", rohacell, fXDimension/2, fYDimension/2, fZHoneycomb/2);
231 HoneycombVolume->SetLineColor(kYellow);
232 HoneycombVolume->SetVisibility(1);
233
234
235
236 TGeoVolume *PlasticAirVolume = gGeoManager->MakeBox("PlasticAir", air, fXDimension/2, fYDimension/2, fZPlastBar/2);
237 PlasticAirVolume->SetLineColor(kGray-1);
238 PlasticAirVolume->SetVisibility(1);
239 PlasticAirVolume->SetVisDaughters(1);
240
241
242 TGeoVolume *PlasticBarVolume = gGeoManager->MakeBox("PlasticBar", PlasticBase, fXPlastBar/2, fYPlastBar/2, fZPlastBar/2);
243 PlasticBarVolume->SetLineColor(kGray-4);
244 PlasticBarVolume->SetVisibility(1);
245
246 PlasticAirVolume->AddNode(PlasticBarVolume, 0, new TGeoTranslation(- fXDimension/2 + fXPlastBar/2, 0, 0));
247 PlasticAirVolume->AddNode(PlasticBarVolume, 1, new TGeoTranslation(+ fXDimension/2 - fXPlastBar/2, 0, 0));
248
249
250 TGeoVolumeAssembly *FiberVolume = new TGeoVolumeAssembly("FiberVolume");
251
252 TGeoVolume *ScintCoreVol = gGeoManager->MakeTube("ScintCoreVol", Polystyrene, 0, fScintCore_rmax, fFiberLength/2);
253 TGeoVolume *Clad1Vol = gGeoManager->MakeTube("Clad1Vol", PMMA, fClad1_rmin, fClad1_rmax, fFiberLength/2);
254 TGeoVolume *Clad2Vol = gGeoManager->MakeTube("Clad2Vol", PMMA2, fClad2_rmin, fClad2_rmax, fFiberLength/2);
255
256 FiberVolume->AddNode(ScintCoreVol, 0);
257 FiberVolume->AddNode(Clad1Vol, 0);
258 FiberVolume->AddNode(Clad2Vol, 0);
259 FiberVolume->SetVisDaughters(kFALSE);
260
261
262 AddSensitiveVolume(ScintCoreVol);
263
264
265 TGeoRotation *rothorfiber = new TGeoRotation("rothorfiber", 90, 90, 0);
266 TGeoRotation *rotvertfiber = new TGeoRotation("rotvertfiber", 0, 90, 0);
267 TGeoRotation *rot = new TGeoRotation("rot", 90, 180, 0);
268
269
270 TGeoVolume *HorMatVolume = gGeoManager->MakeBox("HorMatVolume", Epoxy, fLengthScifiMat/2, fWidthScifiMat/2, fZEpoxyMat/2);
271 TGeoVolume *VertMatVolume = gGeoManager->MakeBox("VertMatVolume", Epoxy, fWidthScifiMat/2, fLengthScifiMat/2, fZEpoxyMat/2);
272
273 Double_t zPosM;
274 Double_t offsetS = -fWidthScifiMat/2 + fOffsetRowS;
275 Double_t offsetL = -fWidthScifiMat/2 + fOffsetRowL;
276
277
278 int dummy_station = 1;
279 int dummy_mat = 1;
280
281
282 for (int irow = 0; irow < fNFibers_z; irow++){
283 zPosM = -fZScifiMat/2 + fClad2_rmax/2 + irow*fVertPitch;
284 if (irow%2 == 0){
285 for (int ifiber = 0; ifiber < fNFibers_Srow; ifiber++){
286 HorMatVolume->AddNode(FiberVolume, 1e6*dummy_station + 1e5*0 + 1e4*dummy_mat + 1e3*(irow + 1) + ifiber + 1, new TGeoCombiTrans("rottranshor0", 0, offsetS + ifiber*fHorPitch, zPosM, rothorfiber));
287 }
288 }
289 else{
290 for (int ifiber = 0; ifiber < fNFibers_Lrow; ifiber++){
291 HorMatVolume->AddNode(FiberVolume, 1e6*dummy_station + 1e5*0 + 1e4*dummy_mat + 1e3*(irow + 1) + ifiber + 1, new TGeoCombiTrans("rottranshor1", 0, offsetL + ifiber*fHorPitch, zPosM, rothorfiber));
292 }
293 }
294 }
295
296
297 for (int irow = 0; irow < fNFibers_z; irow++){
298 zPosM = -fZScifiMat/2 + fClad2_rmax/2 + irow*fVertPitch;
299 if (irow%2 == 0){
300 for (int ifiber = 0; ifiber < fNFibers_Srow; ifiber++){
301 VertMatVolume->AddNode(FiberVolume, 1e6*dummy_station + 1e5*1 + 1e4*dummy_mat + 1e3*(irow + 1) + ifiber + 1, new TGeoCombiTrans("rottransvert0", offsetS + ifiber*fHorPitch, 0, zPosM, rotvertfiber));
302 }
303 }
304 else{
305 for (int ifiber = 0; ifiber < fNFibers_Lrow; ifiber++){
306 VertMatVolume->AddNode(FiberVolume, 1e6*dummy_station + 1e5*1 + 1e4*dummy_mat + 1e3*(irow + 1) + ifiber + 1, new TGeoCombiTrans("rottransvert1", offsetL + ifiber*fHorPitch, 0, zPosM, rotvertfiber));
307 }
308 }
309 }
310
311
312
313 std::map<int, TGeoVolume*> volFeTarget;
314 std::map<int, float> fFeTargetX;
315 std::map<int, float> fFeTargetY;
316 std::map<int, float> fFeTargetZ;
317 for (
int i = 0;
i < fNScifi;
i++){
318 std::string station = std::to_string(i+1);
319 fFeTargetX[
i] =
conf_floats[TString(
"Scifi/FeTargetX"+station)];
320 fFeTargetY[
i] =
conf_floats[TString(
"Scifi/FeTargetZ"+station)];
321 fFeTargetZ[
i] =
conf_floats[TString(
"Scifi/FeTargetY"+station)];
322 }
323
324
325
326
327
328
329
330
331 for (int istation = 0; istation < fNScifi; istation++){
332 Int_t
node = 1e6*(istation+1);
333 std::string station = std::to_string(istation+1);
334 TGeoVolumeAssembly *ScifiVolume = new TGeoVolumeAssembly( TString("ScifiVolume"+station) );
335 TGeoVolumeAssembly *ScifiHorPlaneVol = new TGeoVolumeAssembly( TString("ScifiHorPlaneVol"+station) );
336 TGeoVolumeAssembly *ScifiVertPlaneVol = new TGeoVolumeAssembly( TString("ScifiVertPlaneVol"+station) );
337
338
339 ScifiVolume->AddNode(CarbonFiberVolume, 0, new TGeoTranslation(0, 0, fZCarbonFiber/2));
340 ScifiVolume->AddNode(HoneycombVolume, 0, new TGeoTranslation(0, 0, fZCarbonFiber + fZHoneycomb/2));
341 ScifiVolume->AddNode(CarbonFiberVolume, 1, new TGeoTranslation(0, 0, fZCarbonFiber + fZHoneycomb + fZCarbonFiber/2));
342 ScifiVolume->AddNode(ScifiHorPlaneVol, node, new TGeoTranslation(0, 0, 2*fZCarbonFiber + fZHoneycomb + fZEpoxyMat/2));
343 ScifiVolume->AddNode(PlasticAirVolume, 0, new TGeoTranslation(0, 0, 2*fZCarbonFiber + fZHoneycomb + fZEpoxyMat+ fZPlastBar/2));
344
345
346 ScifiVolume->AddNode(PlasticAirVolume, 1, new TGeoCombiTrans("rottrans0", 0, 0, 2*fZCarbonFiber + fZHoneycomb + fZEpoxyMat + 3*fZPlastBar/2, rot));
347 ScifiVolume->AddNode(ScifiVertPlaneVol, node, new TGeoTranslation(0, 0, 2*fZCarbonFiber + fZHoneycomb + fZEpoxyMat + 2*fZPlastBar + fZEpoxyMat/2));
348 ScifiVolume->AddNode(CarbonFiberVolume, 2, new TGeoTranslation(0, 0, 2*fZCarbonFiber + fZHoneycomb + fZEpoxyMat + 2*fZPlastBar + fZEpoxyMat +fZCarbonFiber/2));
349 ScifiVolume->AddNode(HoneycombVolume, 1, new TGeoTranslation(0, 0, 3*fZCarbonFiber + fZHoneycomb + fZEpoxyMat + 2*fZPlastBar + fZEpoxyMat + fZHoneycomb/2));
350 ScifiVolume->AddNode(CarbonFiberVolume, 3, new TGeoTranslation(0, 0, 3*fZCarbonFiber + 2*fZHoneycomb + fZEpoxyMat + 2*fZPlastBar + fZEpoxyMat + fZCarbonFiber/2));
351
352 Double_t totalThickness = 4*fZCarbonFiber + 2*fZHoneycomb + 2*fZEpoxyMat + 2*fZPlastBar;
353
354 volTarget->AddNode(ScifiVolume, node,
355 new TGeoTranslation(DeltasV[istation][0], DeltasH[istation][1], DeltasH[istation][2]));
356
357
358
359 if (fNScifi==4 && istation != 0) {
360 volFeTarget[istation] = gGeoManager->MakeBox(TString("volFeTarget"+station),Fe,fFeTargetX[istation]/2., fFeTargetY[istation]/2., fFeTargetZ[istation]/2.);
361 volFeTarget[istation]->SetLineColor(kGreen-4);
362 volTarget->AddNode(volFeTarget[istation],1,
363 new TGeoTranslation(DeltasV[istation][0] ,
364 DeltasH[istation][1] ,
365 DeltasH[istation][2] - fFeTargetZ[istation]/2.));
366 }
367
368
369 for (int imat = 0; imat < fNMats; imat++){
370 int N = fNMats==1 ? imat : imat-1;
371
372
373 ScifiHorPlaneVol->AddNode(HorMatVolume, 1e6*(istation+1) + 1e4*(imat + 1), new TGeoTranslation(0, N*(fWidthScifiMat+fGapScifiMat), 0));
374
375
376 ScifiVertPlaneVol->AddNode(VertMatVolume, 1e6*(istation+1) + 1e5 + 1e4*(imat + 1), new TGeoTranslation(N*(fWidthScifiMat+fGapScifiMat), 0, 0));
377 }
378 }
379
380}
std::map< TString, Int_t > conf_ints
std::map< TString, Float_t > conf_floats
Int_t InitMedium(const char *name)