121 TGeoMedium *CarbonComposite = gGeoManager->GetMedium(
"CarbonComposite");
124 TGeoMedium *rohacell = gGeoManager->GetMedium(
"rohacell");
127 TGeoMedium *air = gGeoManager->GetMedium(
"air");
130 TGeoMedium *PlasticBase = gGeoManager->GetMedium(
"Polycarbonate");
133 TGeoMedium *Polystyrene = gGeoManager->GetMedium(
"Polystyrene");
136 TGeoMedium *PMMA = gGeoManager->GetMedium(
"PMMA");
139 TGeoMedium *PMMA2 = gGeoManager->GetMedium(
"PMMA2");
142 TGeoMedium *Epoxy = gGeoManager->GetMedium(
"Epoxy");
144 TGeoVolume *volTarget = gGeoManager->GetVolume(
"volTarget");
147 TGeoMedium *Fe =gGeoManager->GetMedium(
"iron");
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"];
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"];
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"];
172 Double_t fZCarbonFiber =
conf_floats[
"Scifi/carbonfiber_z"];
173 Double_t fZHoneycomb =
conf_floats[
"Scifi/honeycomb_z"];
177 Double_t fXPlastBar =
conf_floats[
"Scifi/plastbar_x"];
178 Double_t fYPlastBar =
conf_floats[
"Scifi/plastbar_y"];
179 Double_t fZPlastBar =
conf_floats[
"Scifi/plastbar_z"];
182 Double_t fZBabyPlaneGap =
conf_floats[
"Scifi/plane_gap"];
183 Double_t fZBabyTedlarToPlaneGap =
conf_floats[
"Scifi/tedlar_to_plane"];
186 Double_t fStationOffset[4] = {0,
conf_floats[
"Scifi/station_offset1"],
190 Int_t fNFibers_Srow =
conf_ints[
"Scifi/nfibers_shortrow"];
191 Int_t fNFibers_Lrow =
conf_ints[
"Scifi/nfibers_longrow"];
192 Int_t fNFibers_z =
conf_ints[
"Scifi/nfibers_z"];
194 Double_t fSeparationBrick =
conf_floats[
"Scifi/scifi_separation"];
197 Int_t fNScifi =
conf_ints[
"Scifi/nscifi"];
198 Int_t fNSiPMs =
conf_ints[
"Scifi/nsipm_mat"];
200 Double_t fWidthChannel =
conf_floats[
"Scifi/channel_width"];
201 Double_t fHeightChannel =
conf_floats[
"Scifi/channel_height"];
202 Double_t fCharr =
conf_floats[
"Scifi/charr_width"];
204 Double_t fCharrGap =
conf_floats[
"Scifi/charr_gap"];
205 Double_t fBigGap =
conf_floats[
"Scifi/sipm_diegap"];
206 Int_t fNSiPMChan =
conf_ints[
"Scifi/nsipm_channels"];
207 Double_t firstChannelX =
conf_floats[
"Scifi/firstChannelX"];
209 Int_t PassiveBlockNotCenterred =
conf_ints[
"Scifi/PassiveBlocknotCenterred"];
212 std::map<int,TVector3> Vedges;
231 std::map<int,TVector3> DeltasH;
232 std::map<int,TVector3> DeltasV;
233 for (
int i=0;i<5;i++){
234 DeltasH[i] = Vedges[i] - LHfirst + SHfirst - Sedge;
235 DeltasV[i] = Vedges[i] - LVfirst + SVfirst - Sedge;
237 Double_t totalThickness{};
240 TGeoVolume *CarbonFiberVolume = gGeoManager->MakeBox(
"CarbonFiber", CarbonComposite, fXDimension/2, fYDimension/2, fZCarbonFiber/2);
241 CarbonFiberVolume->SetLineColor(kGray - 2);
242 CarbonFiberVolume->SetVisibility(1);
245 TGeoVolume *HoneycombVolume = gGeoManager->MakeBox(
"Honeycomb", rohacell, fXDimension/2, fYDimension/2, fZHoneycomb/2);
246 HoneycombVolume->SetLineColor(kYellow);
247 HoneycombVolume->SetVisibility(1);
250 TGeoVolume *GlueVolume = gGeoManager->MakeBox(
"Glue", Epoxy, fXDimension/2, fYDimension/2, fZGlue/2);
251 GlueVolume->SetLineColor(kYellow-1);
252 GlueVolume->SetVisibility(1);
255 TGeoVolume *AirGapVolume = gGeoManager->MakeBox(
"Airgap", air, fXDimension/2, fYDimension/2, fZAirgap/2);
256 AirGapVolume->SetLineColor(kGray-1);
257 AirGapVolume->SetVisibility(1);
261 TGeoVolume *PlasticAirVolume = gGeoManager->MakeBox(
"PlasticAir", air, fXDimension/2, fYDimension/2, fZPlastBar/2);
262 PlasticAirVolume->SetLineColor(kGray-1);
263 PlasticAirVolume->SetVisibility(1);
264 PlasticAirVolume->SetVisDaughters(1);
267 TGeoVolume *PlasticBarVolume = gGeoManager->MakeBox(
"PlasticBar", PlasticBase, fXPlastBar/2, fYPlastBar/2, fZPlastBar/2);
268 PlasticBarVolume->SetLineColor(kGray-4);
269 PlasticBarVolume->SetVisibility(1);
271 PlasticAirVolume->AddNode(PlasticBarVolume, 0,
new TGeoTranslation(- fXDimension/2 + fXPlastBar/2, 0, 0));
272 PlasticAirVolume->AddNode(PlasticBarVolume, 1,
new TGeoTranslation(+ fXDimension/2 - fXPlastBar/2, 0, 0));
276 TGeoVolume *PlasticGlueAirVolume = gGeoManager->MakeBox(
"PlasticGlueAir", air, fXDimension/2, fYDimension/2, fZGlue/2);
277 PlasticGlueAirVolume->SetLineColor(kGray-1);
278 PlasticGlueAirVolume->SetVisibility(1);
279 PlasticGlueAirVolume->SetVisDaughters(1);
282 TGeoVolume *PlasticGlueBarVolume = gGeoManager->MakeBox(
"PlasticGlueBar", Epoxy, fXPlastBar/2, fYPlastBar/2, fZGlue/2);
283 PlasticGlueBarVolume->SetLineColor(kYellow-1);
284 PlasticGlueBarVolume->SetVisibility(1);
286 PlasticGlueAirVolume->AddNode(PlasticGlueBarVolume, 0,
new TGeoTranslation(- fXDimension/2 + fXPlastBar/2, 0, 0));
287 PlasticGlueAirVolume->AddNode(PlasticGlueBarVolume, 1,
new TGeoTranslation(+ fXDimension/2 - fXPlastBar/2, 0, 0));
290 TGeoVolume *PlaneGapVolume = gGeoManager->MakeBox(
"PlaneGap", air, fXDimension/2, fYDimension/2, fZBabyPlaneGap/2);
291 PlaneGapVolume->SetLineColor(kOrange-4);
292 PlaneGapVolume->SetTransparency(50);
293 PlaneGapVolume->SetVisibility(1);
294 TGeoVolume *TedlarToPlaneGapVolume = gGeoManager->MakeBox(
"TedlarToPlaneGap", air, fXDimension/2, fYDimension/2, fZBabyTedlarToPlaneGap/2);
295 TedlarToPlaneGapVolume->SetLineColor(kOrange-4);
296 TedlarToPlaneGapVolume->SetTransparency(50);
297 TedlarToPlaneGapVolume->SetVisibility(1);
300 TGeoVolumeAssembly *FiberVolume =
new TGeoVolumeAssembly(
"FiberVolume");
302 TGeoVolume *ScintCoreVol = gGeoManager->MakeTube(
"ScintCoreVol", Polystyrene, 0, fScintCore_rmax, fFiberLength/2);
303 TGeoVolume *Clad1Vol = gGeoManager->MakeTube(
"Clad1Vol", PMMA, fClad1_rmin, fClad1_rmax, fFiberLength/2);
304 TGeoVolume *Clad2Vol = gGeoManager->MakeTube(
"Clad2Vol", PMMA2, fClad2_rmin, fClad2_rmax, fFiberLength/2);
306 FiberVolume->AddNode(ScintCoreVol, 0);
307 FiberVolume->AddNode(Clad1Vol, 0);
308 FiberVolume->AddNode(Clad2Vol, 0);
309 FiberVolume->SetVisDaughters(kFALSE);
312 AddSensitiveVolume(ScintCoreVol);
315 TGeoRotation *rothorfiber =
new TGeoRotation(
"rothorfiber", 90, 90, 0);
316 TGeoRotation *rotvertfiber =
new TGeoRotation(
"rotvertfiber", 0, 90, 0);
317 TGeoRotation *rot =
new TGeoRotation(
"rot", 90, 180, 0);
320 Double_t MatThickness{};
321 TGeoMedium *MatMaterial;
324 MatThickness = fZEpoxyMat;
328 MatThickness = fZScifiMat;
330 TGeoVolume *HorMatVolume = gGeoManager->MakeBox(
"HorMatVolume", MatMaterial, fLengthScifiMat/2, fWidthScifiMat/2, MatThickness/2);
331 TGeoVolume *VertMatVolume = gGeoManager->MakeBox(
"VertMatVolume", MatMaterial, fWidthScifiMat/2, fLengthScifiMat/2, MatThickness/2);
334 Double_t offsetS = -fWidthScifiMat/2 + fOffsetRowS;
335 Double_t offsetL = -fWidthScifiMat/2 + fOffsetRowL;
338 int dummy_station = 1;
342 for (
int irow = 0; irow < fNFibers_z; irow++){
343 zPosM = -fZScifiMat/2 + fClad2_rmax + irow*fVertPitch;
345 for (
int ifiber = 0; ifiber < fNFibers_Srow; ifiber++){
346 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));
350 for (
int ifiber = 0; ifiber < fNFibers_Lrow; ifiber++){
351 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));
357 for (
int irow = 0; irow < fNFibers_z; irow++){
358 zPosM = -fZScifiMat/2 + fClad2_rmax + irow*fVertPitch;
360 for (
int ifiber = 0; ifiber < fNFibers_Srow; ifiber++){
361 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));
365 for (
int ifiber = 0; ifiber < fNFibers_Lrow; ifiber++){
366 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));
373 std::map<int, TGeoVolume*> volFeTarget;
374 std::map<int, float> fFeTargetX;
375 std::map<int, float> fFeTargetY;
376 std::map<int, float> fFeTargetZ;
377 for (
int i = 0; i < fNScifi; i++){
378 std::string station = std::to_string(i+1);
379 fFeTargetX[i] =
conf_floats[TString(
"Scifi/FeTargetX"+station)];
380 fFeTargetY[i] =
conf_floats[TString(
"Scifi/FeTargetZ"+station)];
381 fFeTargetZ[i] =
conf_floats[TString(
"Scifi/FeTargetY"+station)];
391 for (
int istation = 0; istation < fNScifi; istation++){
392 Int_t node = 1e6*(istation+1);
393 std::string station = std::to_string(istation+1);
394 TGeoVolumeAssembly *ScifiVolume =
new TGeoVolumeAssembly( TString(
"ScifiVolume"+station) );
395 TGeoVolumeAssembly *ScifiHorPlaneVol =
new TGeoVolumeAssembly( TString(
"ScifiHorPlaneVol"+station) );
396 TGeoVolumeAssembly *ScifiVertPlaneVol =
new TGeoVolumeAssembly( TString(
"ScifiVertPlaneVol"+station) );
401 ScifiVolume->AddNode(CarbonFiberVolume, 0,
new TGeoTranslation(0, 0, fZCarbonFiber/2));
402 ScifiVolume->AddNode(GlueVolume, 0,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue/2));
403 ScifiVolume->AddNode(HoneycombVolume, 0,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb/2));
404 ScifiVolume->AddNode(GlueVolume, 1,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue/2));
405 ScifiVolume->AddNode(CarbonFiberVolume, 1,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber/2));
406 ScifiVolume->AddNode(GlueVolume, 2,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber + fZGlue/2));
407 ScifiVolume->AddNode(ScifiHorPlaneVol, node,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber + fZGlue + fZEpoxyMat/2));
408 ScifiVolume->AddNode(PlasticGlueAirVolume, 0,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber + fZGlue + fZEpoxyMat + fZGlue/2));
409 ScifiVolume->AddNode(PlasticAirVolume, 0,
new TGeoTranslation(0, 0, fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber + fZGlue + fZEpoxyMat + fZGlue + fZPlastBar/2));
411 Double_t first_half_z = fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber + fZGlue + fZEpoxyMat + fZGlue + fZPlastBar;
412 ScifiVolume->AddNode(AirGapVolume, 0,
new TGeoTranslation(0, 0, first_half_z + fZAirgap/2));
415 ScifiVolume->AddNode(PlasticAirVolume, 1,
new TGeoCombiTrans(
"rottrans0", 0, 0, first_half_z + fZAirgap + fZPlastBar/2, rot));
416 ScifiVolume->AddNode(PlasticGlueAirVolume, 1,
new TGeoCombiTrans(
"rottrans0",0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue/2, rot));
417 ScifiVolume->AddNode(ScifiVertPlaneVol, node,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat/2));
418 ScifiVolume->AddNode(GlueVolume, 3,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue/2));
419 ScifiVolume->AddNode(CarbonFiberVolume, 2,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber/2));
420 ScifiVolume->AddNode(GlueVolume, 4,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber + fZGlue/2));
421 ScifiVolume->AddNode(HoneycombVolume, 0,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber + fZGlue + fZHoneycomb/2));
422 ScifiVolume->AddNode(GlueVolume, 5,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue/2));
423 ScifiVolume->AddNode(CarbonFiberVolume, 3,
new TGeoTranslation(0, 0, first_half_z + fZAirgap + fZPlastBar + fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber/2));
426 totalThickness = fZCarbonFiber + fZGlue + fZHoneycomb + fZGlue + fZCarbonFiber +
427 fZGlue + fZEpoxyMat + fZGlue + fZPlastBar + fZAirgap + fZPlastBar +
428 fZGlue + fZEpoxyMat + fZGlue + fZCarbonFiber + fZGlue + fZHoneycomb +
429 fZGlue + fZCarbonFiber;
436 ScifiVolume->AddNode(TedlarToPlaneGapVolume, 1,
new TGeoTranslation(0, 0, fZBabyTedlarToPlaneGap/2));
437 ScifiVolume->AddNode(ScifiHorPlaneVol, node,
new TGeoTranslation(0, 0, fZBabyTedlarToPlaneGap + fZScifiMat/2));
440 ScifiVolume->AddNode(PlaneGapVolume, 0,
new TGeoTranslation(0, 0, fZBabyTedlarToPlaneGap + fZScifiMat + fZBabyPlaneGap/2));
443 ScifiVolume->AddNode(ScifiVertPlaneVol, node,
new TGeoTranslation(0, 0, fZBabyTedlarToPlaneGap + 3*fZScifiMat/2 + fZBabyPlaneGap));
444 ScifiVolume->AddNode(TedlarToPlaneGapVolume, 2,
new TGeoTranslation(0, 0, 3*fZBabyTedlarToPlaneGap/2 + 2*fZScifiMat + fZBabyPlaneGap));
446 totalThickness = 2*fZBabyTedlarToPlaneGap + 2*fZScifiMat + fZBabyPlaneGap;
449 volTarget->AddNode(ScifiVolume, node,
450 new TGeoTranslation(DeltasV[istation][0], DeltasH[istation][1], DeltasH[istation][2]));
455 if (fNScifi==4 && istation != 0) {
456 volFeTarget[istation] = gGeoManager->MakeBox(TString(
"volFeTarget"+station),Fe,fFeTargetX[istation]/2., fFeTargetY[istation]/2., fFeTargetZ[istation]/2.);
457 volFeTarget[istation]->SetLineColor(kGreen-4);
458 volTarget->AddNode(volFeTarget[istation],1,
459 new TGeoTranslation(DeltasV[istation][0] - PassiveBlockNotCenterred*fabs(fXDimension-fFeTargetX[istation])/2.,
460 DeltasH[istation][1] + PassiveBlockNotCenterred*(DeltasH[0][1]-DeltasH[istation][1]
461 +fabs(fYDimension-fFeTargetY[istation])/2.),
462 DeltasH[istation][2] - fStationOffset[istation] - fFeTargetZ[istation]/2.));
466 for (
int imat = 0; imat < fNMats; imat++){
467 int N = fNMats==1 ? imat : imat-1;
470 ScifiHorPlaneVol->AddNode(HorMatVolume, 1e6*(istation+1) + 1e4*(imat + 1),
new TGeoTranslation(0, N*(fWidthScifiMat+fGapScifiMat), 0));
473 ScifiVertPlaneVol->AddNode(VertMatVolume, 1e6*(istation+1) + 1e5 + 1e4*(imat + 1),
new TGeoTranslation(N*(fWidthScifiMat+fGapScifiMat), 0, 0));