SND@LHC Software
Loading...
Searching...
No Matches
Floor.cxx
Go to the documentation of this file.
1#include "Floor.h"
2#include "vetoPoint.h"
3
4#include "TGeoManager.h"
5#include "FairRun.h" // for FairRun
6#include "FairRuntimeDb.h" // for FairRuntimeDb
7#include "FairRootManager.h" // for FairRun
8#include "TVirtualMC.h" // for gMC
9#include "TList.h" // for TListIter, TList (ptr only)
10#include "TObjArray.h" // for TObjArray
11#include "TString.h" // for TString
12#include "TGeoBBox.h"
13#include "TGeoCompositeShape.h"
14#include "TGeoBoolNode.h"
15#include "FairGeoMedia.h"
16#include "FairGeoBuilder.h"
17#include "TGeoTube.h"
18#include "TVector3.h"
19#include "TMatrixD.h"
20#include "TGeoMaterial.h"
21#include "TGeoMedium.h"
22#include "ShipDetectorList.h"
23#include "ShipStack.h"
24#include "TParticle.h"
25
26#include "TGeoPara.h"
27#include "TGeoArb8.h"
28
29#include "TClonesArray.h"
30#include <stddef.h> // for NULL
31#include <iostream> // for operator<<, basic_ostream, etc
32
34 : FairDetector("Floor", kTRUE, kVETO),
35 fFastMuon(kFALSE),
36 fMakeSensitive(kFALSE),
37 fEmin(0),
38 fTrackID(-1),
39 fVolumeID(-1),
40 fPos(),
41 fMom(),
42 fTime(-1.),
43 fLength(-1.),
44 fThick(-1.),
45 fzPos(3E8),
46 fTotalEloss(0),
47 fFloorPointCollection(new TClonesArray("vetoPoint"))
48{}
49
51{
53 fFloorPointCollection->Delete();
55 }
56}
57
58Bool_t Floor::ProcessHits(FairVolume* vol)
59{
61 //Set parameters at entrance of volume. Reset ELoss.
62 if ( gMC->IsTrackEntering() ) {
63 fELoss = 0.;
64 fTime = gMC->TrackTime() * 1.0e09;
65 fLength = gMC->TrackLength();
66 gMC->TrackPosition(fPos);
67 gMC->TrackMomentum(fMom);
68 }
69 // Sum energy loss for all steps in the active volume
70 fELoss += gMC->Edep();
71
72 // Create vetoPoint at exit of active volume
73 if ( gMC->IsTrackExiting() ||
74 gMC->IsTrackStop() ||
75 gMC->IsTrackDisappeared() ) {
76 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
77
78 Int_t veto_uniqueId = 47.;
79
80 TParticle* p=gMC->GetStack()->GetCurrentTrack();
81 Int_t pdgCode = p->GetPdgCode();
82 TLorentzVector Pos;
83 gMC->TrackPosition(Pos);
84 TLorentzVector Mom;
85 gMC->TrackMomentum(Mom);
86 Double_t xmean = (fPos.X()+Pos.X())/2. ;
87 Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
88 Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
89 LOG(DEBUG)<< veto_uniqueId << " :(" << xmean << ", " << ymean << ", " << zmean << "): " << fELoss;
90 AddHit(fTrackID, veto_uniqueId, TVector3(xmean, ymean, zmean),
91 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
92 fELoss,pdgCode,TVector3(Pos.X(), Pos.Y(), Pos.Z()),TVector3(Mom.Px(), Mom.Py(), Mom.Pz()) );
93 }
94
95 return kTRUE;
96}
97
99{
100 fFloorPointCollection->Clear();
101 fTotalEloss=0;
102}
103
105 TLorentzVector pos;
106 gMC->TrackPosition(pos);
107 if (fFastMuon && pos.Z()<fzPos && TMath::Abs(gMC->TrackPid())!=13){
108 gMC->StopTrack();
109 }
110 TLorentzVector mom;
111 gMC->TrackMomentum(mom);
112 if ( (mom.E()-mom.M() )<fEmin && pos.Z()<fzPos){
113 gMC->StopTrack();
114 return;
115 }
116}
117
119{
120 FairDetector::Initialize();
121}
122
123Int_t Floor::InitMedium(const char* name)
124{
125 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
126 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
127 static FairGeoMedia *media=geoFace->getMedia();
128 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
129
130 FairGeoMedium *ShipMedium=media->getMedium(name);
131
132 if (!ShipMedium)
133 {
134 Fatal("InitMedium","Material %s not defined in media file.", name);
135 return -1111;
136 }
137 TGeoMedium* medium=gGeoManager->GetMedium(name);
138 if (medium!=NULL)
139 return ShipMedium->getMediumIndex();
140 return geoBuild->createMedium(ShipMedium);
141}
142
143TVector3 Floor::crossing(TVector3 H1,TVector3 H2,TVector3 H3,TVector3 P1,TVector3 P2,TVector3 P3)
144{
145 TMatrixD M(3,3);
146 TMatrixD P(3,1);
147 TMatrixD X(3,1);
148 std::map<int,TVector3> Row = {
149 {0,H1},{1,H2},{2,H3}
150 };
151 std::map<int,TVector3> P123 = {
152 {0,P1},{1,P2},{2,P3}
153 };
154 for( int j = 0;j<3;j+=1) {
155 P[j][0] = Row[j].Dot(P123[j]);
156 for( int k = 0;k<3;k+=1) {
157 M[j][k] = Row[j][k];
158 }
159 }
160 auto Minv = M.Invert();
161 X.Mult(Minv,P);
162 TVector3 Crossing(X[0][0],X[1][0],X[2][0]);
163 return Crossing;
164}
166{
167 SND_Z = conf_floats["Floor/z"];
168
169 TGeoVolume *top = gGeoManager->GetTopVolume();
170 InitMedium("Concrete");
171 TGeoMedium *concrete = gGeoManager->GetMedium("Concrete");
172 InitMedium("Rock");
173 TGeoMedium *rock = gGeoManager->GetMedium("Rock");
174 InitMedium("vacuum");
175 TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
176
177 TGeoVolume *tunnel= new TGeoVolumeAssembly("Tunnel");
178
179 TGeoVolume *detector = new TGeoVolumeAssembly("Detector"); // assembly to place detetector elements in local coordinates
185 // with y-axis upwards, R = ((-1,0,0),(0,0,1),(0,1,0)), M = M R^-1
186 Double_t M[9] = {0.999978, -0.006606, 0.0000821516,
187 0.00660651, 0.999901, -0.0124347,
188 4.69368E-15, 0.0124349, 0.999923};
189
190 auto localSND_physCS_rot = new TGeoRotation("localSND_physCS_rot");
191 localSND_physCS_rot ->SetMatrix(M);
192 auto localSND_physCS_comb = new TGeoCombiTrans("localSND_physCS",0.,0.,0.,localSND_physCS_rot); // origin is 480m downstream of IP1
193 localSND_physCS_comb->RegisterYourself();
194
195 Double_t fTunnelDX = conf_floats["Floor/DX"];
196 Double_t fTunnelDY = conf_floats["Floor/DY"];
197 Double_t fTunnelDZ = conf_floats["Floor/DZ"];
198
199// from Fluka, geo4SND.inp, 25.12.2020
200 std::vector<double> TI18_o1 = {-221.4191473578 , 76.66172460057, 48820.152816717, 131.72892289383, 33.003800302801, -543.2846767937, 200.28612174928};
201 std::vector<double> TI18_i1 = {-221.4191473578 , 76.66172460057, 48820.152816717, 131.72892289383, 33.003800302801, -543.2846767937, 175.0};
202 std::vector<double> TI18_o2 = {-92.57914735775, 108.94172460057, 48288.782816717, 130.14367334394, 56.877589206698, -479.4033418058, 200.0};
203 std::vector<double> TI18_i2 = {-92.57914735775, 108.94172460057, 48288.782816717, 130.14367334394, 56.877589206698, -479.4033418058, 175.0};
204 std::vector<double> TI18_o3 = {14.66085264225, 155.81172460057, 47893.742816717, 1387.8506462618, 818.72395745673, -4733.240081082, 200.0};
205 std::vector<double> TI18_i3 = {14.66085264225, 155.81172460057, 47893.742816717, 1387.8506462618, 818.72395745673, -4733.240081082, 175.0};
206 std::vector<double> UJ18_o = {-471.0, 25.5, 48750.0, -201.8536100583633, 0.0, 3594.3365340638884, 495.0};
207 std::vector<double> UJ18_i = {-471.0,25.5, 48800.39, -201.8536100583633, 0.0, 3494.4938525621, 445.0};
208 std::vector<double> UJ18_x = {-92.57914735775,108.94172460057,48288.782816717,-141.138131672,-35.36121461014,582.09072513608,175.0};
209 std::vector<double> tu012_i = { -596.38194369, 30., 47654.730979, -155.10509191, 0.0,2761.9020453, 220.0};
210 std::vector<double> tu012_o = { -596.38194369, 30., 4.7654730979E+04, -155.10509191, 0.0,2761.9020453, 250.0};
211 std::vector<double> tu011_i = { -522.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 220.0};
212 std::vector<double> tu011_o = { -522.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 250.0,360.,850.};
213 std::vector<double> tu010_i = { -451.24339295, 30., 4.4607412772E+04, -89.817671994, 0.0,1955.4422017, 220.0};
214 std::vector<double> tu010_o = { -451.24339295, 30., 4.4607412772E+04, -89.817671994, 0.0,1955.4422017, 250.0,750.,1100.};
215// PLA TI18_01 and TI18_02
216 std::vector<double> TI18_1_bot = { 0.67644808637366, -74.85571453913, -4.530940169849, -221.4171473578, -18.33127539943,48818.967816717,
217 0.63027909276104 ,-74.86684394728, -4.35010639392, -221.4171473578, -93.32587539943,48818.036016717};
218// side PLA TI18_08 and PLA TI18_09
219 std::vector<double> TI18_1_sid = { -95.08832719702, 21.886725033285, -21.89021009926, -39.11837578468,3.7557255037298,48858.930618475,
220 -94.65075310463, -21.38126814052, -24.16767074894,-402.3825398293, 5.6093808446198,48770.79950338};
221// PLA TI18_04 and PLA TI18_03
222 std::vector<double> TI18_2_bot = { 1.590393176461, -74.48871190132, -8.55964069504, -92.6293750264, 13.94692460057, 48287.934643717,
223 1.12692975448, -74.65145228529, -7.089125547405, -92.57914735775, -61.04827539943, 48286.672816717};
224// side PLA TI18_81 and PLA TI18_91
225 std::vector<double> TI18_2_sid = { 9.5229226656561, -2.052234306283, 2.2588218587662, 119.6722824853, -43.26523379053, 48132.959403311,
226 0.9420958238706, 0.1874442034604, 0.2780649358884, -220.8962283082, 57.49004938073, 48051.134027534};
227// PLA TI18_05 and TI18_06
228 std::vector<double> TI18_3_bot = { 2.6719179804842, -74.62099192635, -12.16834081665, 237.27547988904, 188.51303030346, 47133.251503475,
229 2.2386457107868, -74.59695305235, -12.40093386351, 14.844992780245, -22.78799545647, 47890.126221505};
230// side PLA TI18_08x and PLA TI18_09x
231 std::vector<double> TI18_3_sid = { 9.4281652604622, -2.374007701455, 2.3396124281475, 399.46744859669, 116.81598987751, 47153.021981939,
232 9.332746336299, 1.9001431836442, 3.0478354225656, 88.79276895539223, 130.4393658272924, 47064.80229883217};
233 std::vector<double> PM18_ci = {50660.2873, -1256.8854,700.0,500.};
234 std::vector<double> PM18_co = {50660.2873, -1256.8854, 750.,500.};
235 std::map<TString,std::vector<double>> geoParameters = {
236 {"TI18_o1",TI18_o1},
237 {"TI18_i1",TI18_i1},
238 {"TI18_o2",TI18_o2},
239 {"TI18_i2",TI18_i2},
240 {"TI18_o3",TI18_o3},
241 {"TI18_i3",TI18_i3},
242 {"UJ18_o",UJ18_o},
243 {"UJ18_i",UJ18_i},
244 {"tu010_o",tu010_o},
245 {"tu010_i",tu010_i},
246 {"tu011_o",tu011_o},
247 {"tu011_i",tu011_i},
248 {"tu012_o",tu012_o},
249 {"tu012_i",tu012_i},
250 {"UJ18_x",UJ18_x},
251 {"PM18_ci",PM18_ci},
252 {"PM18_co",PM18_co},
253 {"TI18_1_bot",TI18_1_bot},
254 {"TI18_1_sid",TI18_1_sid},
255 {"TI18_2_bot",TI18_2_bot},
256 {"TI18_2_sid",TI18_2_sid},
257 {"TI18_3_bot",TI18_3_bot},
258 {"TI18_3_sid",TI18_3_sid}
259 };
260 std::vector<TString> loop1 = {"TI18_1","TI18_2","TI18_3"};
261 std::vector<TGeoCompositeShape*> shapes;
262 std::vector<TGeoCombiTrans*> trans;
263 for(auto it = std::begin(loop1); it != std::end(loop1); ++it) {
264 LOG(DEBUG)<<"Floor: DEBUG start" << *it;
265 auto name = TString(*it);
266 TString name_i = TString(*it).ReplaceAll("_","_i");
267 TString name_o = TString(*it).ReplaceAll("_","_o");
268 TString name_bot = name+"_bot";
269 TString name_sid = name+"_sid";
270 LOG(DEBUG)<<"Floor: " << geoParameters[name_i.Data()][0]<< " "<< geoParameters[name_i.Data()][1]<< " "<< geoParameters[name_i.Data()][2]<<" "<<name_i;
271 TVector3 P = TVector3(geoParameters[name_i.Data()][0],geoParameters[name_i.Data()][1],geoParameters[name_i.Data()][2] - SND_Z);
272 TVector3 H = TVector3(geoParameters[name_i.Data()][3],geoParameters[name_i.Data()][4],geoParameters[name_i.Data()][5]);
273 auto T = P + 0.5*H;
274 double rotBeta = TMath::ACos(H[2]/H.Mag());
275 double rotAlpha = TMath::ATan2(H[0]/H.Mag(), -H[1]/H.Mag());
276 double rotGamma = TMath::ACos(H[1]/H.Mag()/TMath::Sqrt(1-pow(H[2]/H.Mag(),2)));
277 auto R = new TGeoRotation("R_"+name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
278 auto CombiTrans = new TGeoCombiTrans("T_"+name,T[0],T[1],T[2],R);
279 CombiTrans->RegisterYourself();
280 auto X = geoParameters[name_bot.Data()];
281 TVector3 Ptop(X[3],X[4], X[5] -SND_Z);
282 TVector3 Pbot(X[9],X[10], X[11]-SND_Z);
283 TVector3 Htop(X[0], X[1],X[2]);
284 TVector3 Hbot(X[6], X[7],X[8]);
285 X = geoParameters[name_sid.Data()];
286 TVector3 Pleft(X[9],X[10], X[11] -SND_Z);
287 TVector3 Prigh(X[3],X[4], X[5]-SND_Z);
288 TVector3 Hleft(X[6], X[7],X[8]);
289 TVector3 Hrigh(X[0], X[1],X[2]);
290 std::map<TString,TVector3> face = {
291 {"front",P},{"back",P+H}
292 };
293 std::vector<TVector3> points;
294 std::vector<TVector3> GlobalPoints;
295 Double_t master[3], P1[3], P2[3], P3[3], P4[3];
296#
297 rotBeta = TMath::ACos(Htop[2]/Htop.Mag());
298 rotAlpha = TMath::ATan2(Htop[0]/H.Mag(), -Htop[1]/H.Mag()) ;
299 rotGamma = TMath::ACos(Htop[1]/Htop.Mag()/TMath::Sqrt(1-pow(Htop[2]/Htop.Mag(),2)));
300 auto RF = new TGeoRotation( "R_tube_"+name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
301 Double_t dY = (Htop.Dot(Ptop)-Htop.Dot(Pbot))/Htop.Mag();
302 std::vector<TString> loopF = {"front","back"};
303 for(auto il = std::begin(loopF); il != std::end(loopF); ++il) {
304 auto X0 = crossing(Hleft,Htop,H,Pleft,Ptop,face[*il]);
305 for( int i = 0;i<3;i+=1) { master[i]=X0[i];}
306 GlobalPoints .push_back(X0);
307 RF->MasterToLocal(master,P1);
308 points.push_back(TVector3(P1[0],P1[1],P1[2]));
309 LOG(DEBUG) << "top left "<<X0[0]<<","<<X0[1]<<","<<X0[2]<<"; "<<P1[0]<<","<<P1[1]<<","<<P1[2];
310 X0 = crossing(Hrigh,Htop,H,Prigh,Ptop,face[*il]);
311 for( int i = 0;i<3;i+=1) { master[i]=X0[i];}
312 GlobalPoints .push_back(X0);
313 RF->MasterToLocal(master,P2);
314 points.push_back(TVector3(P2[0],P2[1],P2[2]));
315 LOG(DEBUG) << "top right "<<X0[0]<<","<<X0[1]<<","<<X0[2]<<"; "<<P2[0]<<","<<P2[1]<<","<<P2[2];
316 X0 = crossing(Hrigh,Htop,H,Prigh,Pbot,face[*il]);
317 for( int i = 0;i<3;i+=1) { master[i]=X0[i];}
318 GlobalPoints .push_back(X0);
319 RF->MasterToLocal(master,P3);
320 points.push_back(TVector3(P3[0],P3[1],P3[2]));
321 LOG(DEBUG) << "bottom right "<<X0[0]<<","<<X0[1]<<","<<X0[2]<<"; "<<P3[0]<<","<<P3[1]<<","<<P3[2];
322 X0 = crossing(Hleft,Htop,H,Pleft,Pbot,face[*il]);
323 for( int i = 0;i<3;i+=1) { master[i]=X0[i];}
324 GlobalPoints .push_back(X0);
325 RF->MasterToLocal(master,P4);
326 points.push_back(TVector3(P4[0],P4[1],P4[2]));
327 LOG(DEBUG) << "bottom left "<<X0[0]<<","<<X0[1]<<","<<X0[2]<<"; "<<P4[0]<<","<<P4[1]<<","<<P4[2];
328 }
329 Double_t dZ = (P3[2]-P1[2])/2.;
330 auto arb = new TGeoArb8(name+"_arb8",dZ);
331 arb->SetVertex(0, points[1][0], points[1][1]);
332 arb->SetVertex(1, points[5][0], points[5][1]);
333 arb->SetVertex(2, points[4][0], points[4][1]);
334 arb->SetVertex(3, points[0][0], points[0][1]);
335 arb->SetVertex(4, points[2][0], points[2][1]);
336 arb->SetVertex(5, points[6][0], points[6][1]);
337 arb->SetVertex(6, points[7][0], points[7][1]);
338 arb->SetVertex(7, points[3][0], points[3][1]);
339// to get the transformation
340 Double_t local[3] = {points[1][0],points[1][1],-dZ};
341 RF->LocalToMaster(local,master);
342 TVector3 Tf(GlobalPoints[1][0]-master[0],GlobalPoints[1][1]-master[1],GlobalPoints[1][2]-master[2]);
343 auto CombiTransF = new TGeoCombiTrans("T_floor_"+name,Tf[0],Tf[1],Tf[2],RF);
344 CombiTransF->RegisterYourself();
345 auto tube = gGeoManager->MakeTube(name+"_tube", concrete, geoParameters[name_i.Data()][6], geoParameters[name_o.Data()][6],H.Mag()/2.);
346 auto Fulltube = gGeoManager->MakeTube(name+"_fulltube", concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.);
347 LOG(DEBUG)<<name<<" "<<Tf[0]<<" "<<Tf[1]<<" "<<Tf[2];
348 auto CombiTransF1 = new TGeoCombiTrans("T_floorS1_"+name,Tf[0],Tf[1]-2*dZ,Tf[2],RF);
349 auto CombiTransF2 = new TGeoCombiTrans("T_floorS2_"+name,Tf[0],Tf[1]-2*dZ,Tf[2]-20,RF);
350 CombiTransF1->RegisterYourself();
351 CombiTransF2->RegisterYourself();
352 auto sunion = new TGeoCompositeShape(name+"_union","("+name+"_tube:T_"+name+"+"+name+"_arb8:T_floor_"+name+"-"+
353 name+"_arb8:T_floorS1_"+name+"-"+name+"_arb8:T_floorS2_"+name+")");
354 shapes.push_back(sunion);
355 auto Fsunion = new TGeoCompositeShape(name+"_Funion","("+name+"_fulltube:T_"+name+"+"+name+"_arb8:T_floor_"+name+"-"+
356 name+"_arb8:T_floorS1_"+name+"-"+name+"_arb8:T_floorS2_"+name+")");
357 shapes.push_back(Fsunion);
358
359 }
360 LOG(DEBUG) << "shapes "<<shapes[0]->GetName()<<" "<<shapes[1]->GetName()<<" "<<shapes[2]->GetName();
361
362 // Since 2024 there is a pit on the TI18 floor hosting the veto
363 // Unless defined in the geo config file, the pit dims are 0.
364 auto vetoPit = new TGeoBBox("vetoPit",
365 conf_floats["Floor/VetoPitXdim"]/2.,
366 conf_floats["Floor/VetoPitZdim"]/2.,
367 conf_floats["Floor/VetoPitYdim"]/2.);
368 auto VetoPit_transl = new TGeoTranslation("VetoPit_transl",
369 -conf_floats["Floor/VetoPitX"]-conf_floats["Floor/VetoPitXdim"]/2.,
370 conf_floats["Floor/VetoPitZ"]-conf_floats["Floor/VetoPitZdim"]/2.,
371 conf_floats["Floor/VetoPitY"]-conf_floats["Floor/VetoPitYdim"]/2.);
372 VetoPit_transl->RegisterYourself();
373
374 auto total = new TGeoCompositeShape("Stotal","TI18_1_union+TI18_2_union+TI18_3_union-vetoPit:VetoPit_transl");
375 auto volT = new TGeoVolume("VTI18",total,concrete);
376 volT->SetTransparency(0);
377 volT->SetLineColor(kGray);
378// make tunnel sensitive for debugging
379 if (fMakeSensitive) {AddSensitiveVolume(volT);}
380 tunnel->AddNode(volT, 1);
381
382 std::vector<TString> loop2 = {"UJ18_","tu010_","tu011_","tu012_"};
383 for(auto it = std::begin(loop2); it != std::end(loop2); ++it) {
384 TString name_i = TString(*it).ReplaceAll("_","_i");
385 TString name_o= TString(*it).ReplaceAll("_","_o");
386 TString name_F = "F"+TString(*it);
387 TVector3 P = TVector3(geoParameters[name_i.Data()][0],geoParameters[name_i.Data()][1],geoParameters[name_i.Data()][2] - SND_Z);
388 TVector3 H = TVector3(geoParameters[name_i.Data()][3],geoParameters[name_i.Data()][4],geoParameters[name_i.Data()][5]);
389 auto vol = gGeoManager->MakeTube(*it, concrete, geoParameters[name_i.Data()][6], geoParameters[name_o.Data()][6],H.Mag()/2.-5.); // subtract 5cm to avoid overlap
390 auto Fvol = gGeoManager->MakeTube(name_F, concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.-5.);
391 vol->SetTransparency(0);
392 vol->SetLineColor(kGray);
393 auto T = P + 0.5*H;
394 double rotBeta = TMath::ACos(H[2]/H.Mag());
395 double rotAlpha = TMath::ATan2(H[0]/H.Mag(), -H[1]/H.Mag());
396 double rotGamma = TMath::ACos(H[1]/H.Mag()/TMath::Sqrt(1-pow(H[2]/H.Mag(),2)));
397 TString name = "R_"+TString(*it);
398 auto R = new TGeoRotation(name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
399 auto CombiTrans = new TGeoCombiTrans("TS_"+TString(*it),T[0],T[1],T[2],R);
400 CombiTrans->RegisterYourself();
401 trans.push_back(CombiTrans);
402 }
403 auto total2 = new TGeoCompositeShape("Stotal2","tu010_:TS_tu010_+tu011_:TS_tu011_");
404 auto Ftotal2 = new TGeoCompositeShape("Ftotal2","Ftu010_:TS_tu010_+Ftu011_:TS_tu011_");
405 auto volT2 = new TGeoVolume("VUJ",total2,concrete);
406 volT2->SetTransparency(0);
407 volT2->SetLineColor(kGray);
408 tunnel->AddNode(volT2, 1);
409
410/*
411 std::vector<TString> loopr = {"tu010_","tu011_"};
412 for(auto it = std::begin(loopr); it != std::end(loopr); ++it) {
413 TString name_o= TString(*it).ReplaceAll("_","_o");
414 TString name_b = TString(*it).ReplaceAll("_","_cone");
415 TString name_c = TString(*it).ReplaceAll("_","_rock");
416 TString name = TString(*it);
417 TString name_x = TString(*it).ReplaceAll("_","_x");
418
419 TVector3 H = TVector3(geoParameters[name_o.Data()][3],geoParameters[name_o.Data()][4],geoParameters[name_o.Data()][5]);
420 auto tube = new TGeoTube(name_x,0., geoParameters[name_o.Data()][6]+10.,H.Mag()/2.+0.1);
421 auto cone = gGeoManager->MakeCone(name_b,rock,H.Mag()/2.,0.,geoParameters[name_o.Data()][8],0.,geoParameters[name_o.Data()][7]);
422 auto Srock = new TGeoCompositeShape(name_c, name_b+":TS_"+name+"-"+name_x+":TS_"+name);
423 }
424 auto total3 = new TGeoCompositeShape("Stotal3","tu010_rock+tu011_rock");
425 auto volT3 = new TGeoVolume("Vrock",total3,rock);
426 volT3->SetTransparency(75);
427 volT3->SetLineColor(kRed);
428 tunnel->AddNode(volT3, 1);
429
430// add rock up to Fluka scoring plane, 409 m from IP1.
431 double zs = 40900.;
432 double dz = (geoParameters["tu010_o"][2] - zs)/2.;
433 auto fluka = gGeoManager->MakeBox("FlukaScoringPlane",rock, geoParameters["tu010_o"][8],geoParameters["tu010_o"][8],dz);
434 fluka->SetLineColor(kRed);
435 tunnel->AddNode(fluka,1, new TGeoTranslation(-350.,0,dz+zs- SND_Z-50.)); // move 50cm upstream to avoid overlap
436*/
437
438 double zs = 40900.; // scoring plane
439 double dz = (geoParameters["TI18_o1"][2] - zs)/2.;
440
441 auto bigBox = new TGeoBBox("BigBox", 1000.,1000. , dz);
442 auto TR_1 = new TGeoTranslation("TR_1",0.,0.,-dz+geoParameters["TI18_o1"][2]-SND_Z - 50.); // move a bit more upstream to have free view from the back
443 TR_1->RegisterYourself();
444
445 auto cutOut = new TGeoCompositeShape("cutOut", "BigBox:TR_1-Ftotal2-(TI18_1_Funion+TI18_2_Funion+TI18_3_Funion)");
446 auto volT3 = new TGeoVolume("Vrock",cutOut,rock);
447 volT3->SetTransparency(75);
448 volT3->SetLineColor(kRed);
449 tunnel->AddNode(volT3, 1);
450
451auto exitPlane = gGeoManager->MakeBox("exitScoringPlane",vacuum,1000.,1000. , 1.);
452exitPlane->SetLineColor(kGreen);
453exitPlane->SetVisibility(kFALSE);
454if (fMakeSensitive) {AddSensitiveVolume(exitPlane);}
455tunnel->AddNode(exitPlane,1, new TGeoTranslation(0,0,1000.));
456
457 // COLDBOX GEOM
458 InitMedium("Borated30polyethylene");
459 TGeoMedium *Bor30Poly = gGeoManager->GetMedium("Borated30polyethylene");
460 InitMedium("PMMA");
461 TGeoMedium *Acrylic = gGeoManager->GetMedium("PMMA");
462 TVector3 displacement;
463
464 Double_t fAcrylicWidth = conf_floats["Floor/Acrylic_width"];
465 Double_t fBPolyWidth = conf_floats["Floor/BPoly_width"];
466 Double_t fCBFrontWallXDim = conf_floats["Floor/CBFrontWall_xdim"];
467 Double_t fCBFrontWallYDim = conf_floats["Floor/CBFrontWall_ydim"];
468 Double_t fCBLatWallZDim = conf_floats["Floor/CBLatWall_zdim"];
469 Double_t fCBTinyZDim = conf_floats["Floor/CBTiny_zdim"];
470 Double_t fCBExtraZDim = conf_floats["Floor/CBExtra_zdim"];
471 Double_t fCBExtraXDim = conf_floats["Floor/CBExtra_xdim"];
472 Double_t fSlopedWallZProj = conf_floats["Floor/SlopedWall_zproj"];
473 Double_t fCBRearWallXDim =
474 fCBFrontWallXDim - fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) - fCBExtraXDim + fAcrylicWidth;
475 Double_t fFeBlockX = conf_floats["Floor/MFeBlockX"];
476 Double_t fFeBlockY = conf_floats["Floor/MFeBlockY"];
477 Double_t fFeBlockZ = conf_floats["Floor/MFeBlockZ"];
478
479 // ************************ ACRYLIC
480 // Shapes definition
481 TGeoBBox *FeBlock_cb = new TGeoBBox("FeBlock_cb", fFeBlockX / 2, fFeBlockY / 2, fFeBlockZ / 2);
482 TGeoBBox *CBFrontWall_a =
483 new TGeoBBox("CBFrontWall_a", fCBFrontWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
484 TGeoBBox *CBLateral_a =
485 new TGeoBBox("CBLateral_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBLatWallZDim - 2 * fAcrylicWidth) / 2.);
486 TGeoBBox *CBExtraFront_a =
487 new TGeoBBox("CBExtraFront_a", fCBExtraXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
488 TGeoBBox *CBExtraLat_a =
489 new TGeoBBox("CBExtraLat_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
490 TGeoBBox *CBTiny1_a = new TGeoBBox("CBTiny1_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2.,
491 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
492 TGeoBBox *CBTiny2_a =
493 new TGeoBBox("CBTiny2_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
494 TGeoBBox *CBRearWall_a =
495 new TGeoBBox("CBRearWall_a", fCBRearWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
496
497 TGeoTranslation *CBWallpos = new TGeoTranslation("CBWallpos", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5,
498 (fCBFrontWallYDim - fFeBlockY) / 2. - 118., 0);
499 CBWallpos->RegisterYourself();
500
501 TGeoCompositeShape *CBWallDownstream =
502 new TGeoCompositeShape("CBWallDownstream", "CBRearWall_a-(FeBlock_cb:CBWallpos)");
503 TGeoPara *CBWallSlope_a =
504 new TGeoPara("CBWallSlope_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., fSlopedWallZProj / 2., 0, -15, 0);
505
506 // Coverings
507 Double_t LatCover1_averts[8][2];
508 LatCover1_averts[0][0] = 0.;
509 LatCover1_averts[0][1] = 0.;
510 LatCover1_averts[1][0] = fAcrylicWidth;
511 LatCover1_averts[1][1] = 0;
512 LatCover1_averts[2][0] = fAcrylicWidth;
513 LatCover1_averts[2][1] = -(176.71 - 170.72);
514 LatCover1_averts[3][0] = 0.;
515 LatCover1_averts[3][1] = -(176.71 - 170.72);
516
517 LatCover1_averts[4][0] = 0;
518 LatCover1_averts[4][1] = 0;
519 LatCover1_averts[5][0] = fAcrylicWidth;
520 LatCover1_averts[5][1] = 0;
521 LatCover1_averts[6][0] = fAcrylicWidth;
522 LatCover1_averts[6][1] = -(187.03 - 170.72);
523 LatCover1_averts[7][0] = 0;
524 LatCover1_averts[7][1] = -(187.03 - 170.72);
525 TGeoArb8 *LatCov1_a = new TGeoArb8("LatCov1_a", 176. / 2., (Double_t *)LatCover1_averts);
526
527 Double_t tanalpha = (183.26 - 170.72) / 144.;
528 Double_t LatCover21_averts[8][2];
529 LatCover21_averts[0][0] = 0.;
530 LatCover21_averts[0][1] = 0.;
531 LatCover21_averts[1][0] = fAcrylicWidth;
532 LatCover21_averts[1][1] = 0;
533 LatCover21_averts[2][0] = fAcrylicWidth;
534 LatCover21_averts[2][1] = 0;
535 LatCover21_averts[3][0] = 0.;
536 LatCover21_averts[3][1] = 0;
537
538 LatCover21_averts[4][0] = 0;
539 LatCover21_averts[4][1] = 0;
540 LatCover21_averts[5][0] = fAcrylicWidth;
541 LatCover21_averts[5][1] = 0;
542 LatCover21_averts[6][0] = fAcrylicWidth;
543 LatCover21_averts[6][1] = -fCBTinyZDim * tanalpha;
544 LatCover21_averts[7][0] = 0;
545 LatCover21_averts[7][1] = -fCBTinyZDim * tanalpha;
546 TGeoArb8 *LatCov21_a = new TGeoArb8("LatCov21_a", fCBTinyZDim / 2., (Double_t *)LatCover21_averts);
547
548 Double_t LatCover22_averts[8][2];
549 LatCover22_averts[0][0] = 0.;
550 LatCover22_averts[0][1] = 0.;
551 LatCover22_averts[1][0] = fAcrylicWidth;
552 LatCover22_averts[1][1] = 0;
553 LatCover22_averts[2][0] = fAcrylicWidth;
554 LatCover22_averts[2][1] = -fCBTinyZDim * tanalpha;
555 LatCover22_averts[3][0] = 0.;
556 LatCover22_averts[3][1] = -fCBTinyZDim * tanalpha;
557
558 LatCover22_averts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
559 LatCover22_averts[4][1] = 0;
560 LatCover22_averts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
561 LatCover22_averts[5][1] = 0;
562 LatCover22_averts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
563 LatCover22_averts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
564 LatCover22_averts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
565 LatCover22_averts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
566 TGeoArb8 *LatCov22_a = new TGeoArb8("LatCov22_a", fSlopedWallZProj / 2., (Double_t *)LatCover22_averts);
567
568 Double_t LatCover23_averts[8][2];
569 LatCover23_averts[0][0] = 0.;
570 LatCover23_averts[0][1] = 0.;
571 LatCover23_averts[1][0] = fAcrylicWidth;
572 LatCover23_averts[1][1] = 0;
573 LatCover23_averts[2][0] = fAcrylicWidth;
574 LatCover23_averts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
575 LatCover23_averts[3][0] = 0.;
576 LatCover23_averts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
577
578 LatCover23_averts[4][0] = 0;
579 LatCover23_averts[4][1] = 0;
580 LatCover23_averts[5][0] = fAcrylicWidth;
581 LatCover23_averts[5][1] = 0;
582 LatCover23_averts[6][0] = fAcrylicWidth;
583 LatCover23_averts[6][1] = -(183.26 - 170.72);
584 LatCover23_averts[7][0] = 0;
585 LatCover23_averts[7][1] = -(183.26 - 170.72);
586 TGeoArb8 *LatCov23_a = new TGeoArb8("LatCov23_a", (fCBTinyZDim - fBPolyWidth) / 2., (Double_t *)LatCover23_averts);
587
588 Double_t tanbeta = (176.74 - 170.72) / 219.0;
589 Double_t FrontCover1_averts[8][2];
590 FrontCover1_averts[0][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
591 FrontCover1_averts[0][1] = 0.;
592 FrontCover1_averts[1][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
593 FrontCover1_averts[1][1] = -(fAcrylicWidth)*tanbeta;
594 FrontCover1_averts[2][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
595 FrontCover1_averts[2][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
596 FrontCover1_averts[3][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
597 FrontCover1_averts[3][1] = 0;
598
599 FrontCover1_averts[4][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
600 FrontCover1_averts[4][1] = 0;
601 FrontCover1_averts[5][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
602 FrontCover1_averts[5][1] = -(fAcrylicWidth)*tanbeta;
603 FrontCover1_averts[6][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
604 FrontCover1_averts[6][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
605 FrontCover1_averts[7][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
606 FrontCover1_averts[7][1] = 0;
607 TGeoArb8 *FrontCov1_a = new TGeoArb8("FrontCov1_a", fAcrylicWidth / 2., (Double_t *)FrontCover1_averts);
608
609 Double_t tangamma = (187.03 - 183.26) / (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
610 Double_t xdim_projected = (187.03 - 170.72) / tangamma;
611 Double_t extra = xdim_projected - (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
612 Double_t RearCover_11_averts[8][2];
613 RearCover_11_averts[0][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
614 RearCover_11_averts[0][1] = 0.;
615 RearCover_11_averts[1][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
616 RearCover_11_averts[1][1] = -(183.26-170.72); // approx
617 RearCover_11_averts[2][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
618 RearCover_11_averts[2][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
619 RearCover_11_averts[3][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
620 RearCover_11_averts[3][1] = 0;
621
622 RearCover_11_averts[4][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
623 RearCover_11_averts[4][1] = 0;
624 RearCover_11_averts[5][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
625 RearCover_11_averts[5][1] = -(183.26-170.72); // approx
626 RearCover_11_averts[6][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
627 RearCover_11_averts[6][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
628 RearCover_11_averts[7][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
629 RearCover_11_averts[7][1] = 0;
630 TGeoArb8 *RearCov11_atot = new TGeoArb8("RearCov11_atot", fAcrylicWidth / 2., (Double_t *)RearCover_11_averts);
631 TGeoTranslation *CBWallpos2 =
632 new TGeoTranslation("CBWallpos2", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5, 0, -fAcrylicWidth / 2.);
633 CBWallpos2->RegisterYourself();
634 TGeoCompositeShape *RearCov11_a = new TGeoCompositeShape("RearCov11_a", "RearCov11_atot-(FeBlock_cb:CBWallpos2)");
635
636 Double_t RearCover_12_averts[8][2];
637 RearCover_12_averts[0][0] = fAcrylicWidth/2.;
638 RearCover_12_averts[0][1] = 0.;
639 RearCover_12_averts[1][0] = fAcrylicWidth/2.;
640 RearCover_12_averts[1][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
641 RearCover_12_averts[2][0] = -fAcrylicWidth/2.;
642 RearCover_12_averts[2][1] = -(fCBRearWallXDim+extra)*tangamma;
643 RearCover_12_averts[3][0] = -fAcrylicWidth/2.;
644 RearCover_12_averts[3][1] = 0;
645
646 RearCover_12_averts[4][0] = fAcrylicWidth/2.;
647 RearCover_12_averts[4][1] = 0;
648 RearCover_12_averts[5][0] = fAcrylicWidth/2.;
649 RearCover_12_averts[5][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
650 RearCover_12_averts[6][0] = -fAcrylicWidth/2.;
651 RearCover_12_averts[6][1] = -(fCBRearWallXDim+extra)*tangamma;
652 RearCover_12_averts[7][0] = -fAcrylicWidth/2.;
653 RearCover_12_averts[7][1] = 0;
654 TGeoArb8 *RearCov12_a = new TGeoArb8("RearCov12_a", fCBExtraZDim / 2., (Double_t *)RearCover_12_averts);
655
656 Double_t RearCover_13_averts[8][2];
657 RearCover_13_averts[0][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
658 RearCover_13_averts[0][1] = 0.;
659 RearCover_13_averts[1][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
660 RearCover_13_averts[1][1] = -(fCBRearWallXDim+extra)*tangamma;
661 RearCover_13_averts[2][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
662 RearCover_13_averts[2][1] = -(187.03-170.72);
663 RearCover_13_averts[3][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
664 RearCover_13_averts[3][1] = 0;
665
666 RearCover_13_averts[4][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
667 RearCover_13_averts[4][1] = 0;
668 RearCover_13_averts[5][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
669 RearCover_13_averts[5][1] = -(fCBRearWallXDim+extra)*tangamma;
670 RearCover_13_averts[6][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
671 RearCover_13_averts[6][1] = -(187.03-170.72);
672 RearCover_13_averts[7][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
673 RearCover_13_averts[7][1] = 0;
674 TGeoArb8 *RearCov13_a = new TGeoArb8("RearCov13_a", fAcrylicWidth / 2., (Double_t *)RearCover_13_averts);
675
676 // Acrylic mother shape definition
677 TGeoTranslation *FrontWallpos =
678 new TGeoTranslation("FrontWallpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
679 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
680 FrontWallpos->RegisterYourself();
681 TGeoTranslation *Tiny1pos =
682 new TGeoTranslation("Tiny1pos", (fCBRearWallXDim - fAcrylicWidth) / 2., 0, -fCBTinyZDim / 2. + fBPolyWidth / 2.);
683 Tiny1pos->RegisterYourself();
684 TGeoTranslation *SlopeWallpos =
685 new TGeoTranslation("SlopeWallpos",
686 (fCBRearWallXDim + fAcrylicWidth) / 2. + fAcrylicWidth +
687 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)),
688 0, -fCBTinyZDim - fSlopedWallZProj / 2. + fAcrylicWidth / 2. + fBPolyWidth);
689 SlopeWallpos->RegisterYourself();
690 TGeoTranslation *Tiny2pos = new TGeoTranslation(
691 "Tiny2pos",
692 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fAcrylicWidth / 2. +
693 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
694 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth);
695 Tiny2pos->RegisterYourself();
696 TGeoTranslation *CBExtraLatpos = new TGeoTranslation("CBExtraLatpos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., 0,
697 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
698 CBExtraLatpos->RegisterYourself();
699 TGeoTranslation *CBExtraFrontpos = new TGeoTranslation(
700 "CBExtraFrontpos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2., 0, fCBExtraZDim - fAcrylicWidth);
701 CBExtraFrontpos->RegisterYourself();
702 TGeoTranslation *CBLateralpos =
703 new TGeoTranslation("CBLateralpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fAcrylicWidth / 2., 0,
704 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
705 CBLateralpos->RegisterYourself();
706 TGeoTranslation *CBLatCov1pos =
707 new TGeoTranslation("CBLatCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth, -fCBFrontWallYDim / 2.,
708 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
709 CBLatCov1pos->RegisterYourself();
710 TGeoTranslation *CBLatCov21pos = new TGeoTranslation(
711 "CBLatCov21pos",
712 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
713 -fCBFrontWallYDim / 2.,
714 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
715 fAcrylicWidth / 2.);
716 CBLatCov21pos->RegisterYourself();
717 TGeoTranslation *CBLatCov22pos = new TGeoTranslation(
718 "CBLatCov22pos",
719 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
720 -fCBFrontWallYDim / 2.,
721 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
722 fAcrylicWidth / 2. + fCBTinyZDim / 2.);
723 CBLatCov22pos->RegisterYourself();
724 TGeoTranslation *CBLatCov23pos =
725 new TGeoTranslation("CBLatCov23pos", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2.,
726 -fCBFrontWallYDim / 2., -fCBTinyZDim / 2. + fBPolyWidth + 0.5);
727 CBLatCov23pos->RegisterYourself();
728 TGeoTranslation *CBFrontCov1pos = new TGeoTranslation(
729 "CBFrontCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
730 -fCBFrontWallYDim / 2., -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
731 CBFrontCov1pos->RegisterYourself();
732 TGeoTranslation *CBRearCov11pos = new TGeoTranslation("CBRearCov11pos", 0, -fCBFrontWallYDim / 2., 0);
733 CBRearCov11pos->RegisterYourself();
734 TGeoTranslation *CBRearCov12pos =
735 new TGeoTranslation("CBRearCov12pos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., -fCBFrontWallYDim / 2.,
736 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
737 CBRearCov12pos->RegisterYourself();
738 TGeoTranslation *CBRearCov13pos =
739 new TGeoTranslation("CBRearCov13pos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2.,
740 -fCBFrontWallYDim / 2., fCBExtraZDim - fAcrylicWidth);
741 CBRearCov13pos->RegisterYourself();
742
743 // Acrylic mother volume definition
744 TGeoCompositeShape *COLDBOXA = new TGeoCompositeShape(
745 "COLDBOXA",
746 "CBWallDownstream+(CBFrontWall_a:FrontWallpos)+(CBTiny1_a:Tiny1pos)+(CBWallSlope_a:SlopeWallpos)+(CBTiny2_a:"
747 "Tiny2pos)+(CBExtraLat_a:CBExtraLatpos)+(CBExtraFront_a:CBExtraFrontpos)+(CBLateral_a:CBLateralpos)+(LatCov1_a:"
748 "CBLatCov1pos)+(LatCov21_a:CBLatCov21pos)+(LatCov22_a:CBLatCov22pos)+(LatCov23_a:CBLatCov23pos)+(FrontCov1_a:"
749 "CBFrontCov1pos)+(RearCov11_a:CBRearCov11pos)+(RearCov12_a:CBRearCov12pos)+(RearCov13_a:CBRearCov13pos)");
750 TGeoVolume *volCOLDBOXA = new TGeoVolume("volCOLDBOXA", COLDBOXA, Acrylic);
751
752 // ************************ BORATED POLYETHYLENE
753 Double_t fCBFrontWallXDim_b = fCBFrontWallXDim - 2 * fAcrylicWidth - fBPolyWidth; // cm
754 Double_t fCBFrontWallYDim_b = fCBFrontWallYDim - fBPolyWidth;
755 Double_t fCBLatWallZDim_b = fCBLatWallZDim - 2 * fAcrylicWidth; // cm
756 Double_t fCBExtraXDim_b = fCBExtraXDim - 2 * fAcrylicWidth; // cm
757 Double_t fCBRearWallXDim_b = fCBRearWallXDim - fAcrylicWidth;
758 // Shapes definition
759 TGeoBBox *CBFrontWall_b = new TGeoBBox(
760 "CBFrontWall_b", fCBFrontWallXDim_b / 2. + (fAcrylicWidth - fBPolyWidth) / 10., fCBFrontWallYDim_b / 2.,
761 fBPolyWidth / 2.); // (fAcrylicWidth-fBPolyWidth)/10. is due to approximations, I guess
762 TGeoBBox *CBLateral_b = new TGeoBBox("CBLateral_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
763 (fCBLatWallZDim - 2 * fBPolyWidth) / 2. - fAcrylicWidth);
764 TGeoBBox *CBExtraFront_b =
765 new TGeoBBox("CBExtraFront_b", fCBExtraXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
766 TGeoBBox *CBExtraLat_b = new TGeoBBox("CBExtraLat_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
767 (fCBExtraZDim - fAcrylicWidth - fBPolyWidth) / 2.);
768 TGeoBBox *CBTiny1_b = new TGeoBBox("CBTiny1_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
769 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
770 TGeoBBox *CBTiny2_b =
771 new TGeoBBox("CBTiny2_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
772 TGeoBBox *CBRearWall_b =
773 new TGeoBBox("CBRearWall_b", fCBRearWallXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
774 TGeoPara *CBWallSlope_b =
775 new TGeoPara("CBWallSlope_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., fSlopedWallZProj / 2., 0, -15, 0);
776
777 // Coverings
778 Double_t tanomega = (187.03 - 176.71) / 176.;
779 Double_t LatCover1_bverts[8][2];
780 LatCover1_bverts[0][0] = 0.;
781 LatCover1_bverts[0][1] = 0.;
782 LatCover1_bverts[1][0] = fBPolyWidth;
783 LatCover1_bverts[1][1] = 0;
784 LatCover1_bverts[2][0] = fBPolyWidth;
785 LatCover1_bverts[2][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
786 LatCover1_bverts[3][0] = 0.;
787 LatCover1_bverts[3][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
788
789 LatCover1_bverts[4][0] = 0;
790 LatCover1_bverts[4][1] = 0;
791 LatCover1_bverts[5][0] = fBPolyWidth;
792 LatCover1_bverts[5][1] = 0;
793 LatCover1_bverts[6][0] = fBPolyWidth;
794 LatCover1_bverts[6][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
795 LatCover1_bverts[7][0] = 0;
796 LatCover1_bverts[7][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
797 TGeoArb8 *LatCov1_b = new TGeoArb8("LatCov1_b", 176. / 2. - fAcrylicWidth, (Double_t *)LatCover1_bverts);
798
799 Double_t LatCover21_bverts[8][2];
800 LatCover21_bverts[0][0] = 0.;
801 LatCover21_bverts[0][1] = 0.;
802 LatCover21_bverts[1][0] = fBPolyWidth;
803 LatCover21_bverts[1][1] = 0;
804 LatCover21_bverts[2][0] = fBPolyWidth;
805 LatCover21_bverts[2][1] = 0.; //-fAcrylicWidth*tanalpha;
806 LatCover21_bverts[3][0] = 0.;
807 LatCover21_bverts[3][1] = 0.; //-fAcrylicWidth*tanalpha;
808
809 LatCover21_bverts[4][0] = 0;
810 LatCover21_bverts[4][1] = 0;
811 LatCover21_bverts[5][0] = fBPolyWidth;
812 LatCover21_bverts[5][1] = 0;
813 LatCover21_bverts[6][0] = fBPolyWidth;
814 LatCover21_bverts[6][1] = -fCBTinyZDim * tanalpha;
815 LatCover21_bverts[7][0] = 0;
816 LatCover21_bverts[7][1] = -fCBTinyZDim * tanalpha;
817 TGeoArb8 *LatCov21_b = new TGeoArb8("LatCov21_b", (fCBTinyZDim - fAcrylicWidth) / 2., (Double_t *)LatCover21_bverts);
818
819 Double_t LatCover22_bverts[8][2];
820 LatCover22_bverts[0][0] = 0.;
821 LatCover22_bverts[0][1] = 0.;
822 LatCover22_bverts[1][0] = fBPolyWidth;
823 LatCover22_bverts[1][1] = 0;
824 LatCover22_bverts[2][0] = fBPolyWidth;
825 LatCover22_bverts[2][1] = -fCBTinyZDim * tanalpha;
826 LatCover22_bverts[3][0] = 0.;
827 LatCover22_bverts[3][1] = -fCBTinyZDim * tanalpha;
828
829 LatCover22_bverts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
830 LatCover22_bverts[4][1] = 0;
831 LatCover22_bverts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
832 LatCover22_bverts[5][1] = 0;
833 LatCover22_bverts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
834 LatCover22_bverts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
835 LatCover22_bverts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
836 LatCover22_bverts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
837 TGeoArb8 *LatCov22_b = new TGeoArb8("LatCov22_b", fSlopedWallZProj / 2., (Double_t *)LatCover22_bverts);
838
839 Double_t LatCover23_bverts[8][2];
840 LatCover23_bverts[0][0] = 0.;
841 LatCover23_bverts[0][1] = 0.;
842 LatCover23_bverts[1][0] = fBPolyWidth;
843 LatCover23_bverts[1][1] = 0;
844 LatCover23_bverts[2][0] = fBPolyWidth;
845 LatCover23_bverts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
846 LatCover23_bverts[3][0] = 0.;
847 LatCover23_bverts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
848
849 LatCover23_bverts[4][0] = 0;
850 LatCover23_bverts[4][1] = 0;
851 LatCover23_bverts[5][0] = fBPolyWidth;
852 LatCover23_bverts[5][1] = 0;
853 LatCover23_bverts[6][0] = fBPolyWidth;
854 LatCover23_bverts[6][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
855 LatCover23_bverts[7][0] = 0;
856 LatCover23_bverts[7][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
857 TGeoArb8 *LatCov23_b =
858 new TGeoArb8("LatCov23_b", (fCBTinyZDim - fBPolyWidth - fAcrylicWidth) / 2., (Double_t *)LatCover23_bverts);
859
860 Double_t FrontCover1_bverts[8][2];
861 FrontCover1_bverts[0][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
862 FrontCover1_bverts[0][1] = 0.;
863 FrontCover1_bverts[1][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
864 FrontCover1_bverts[1][1] = -(fBPolyWidth)*tanbeta;
865 FrontCover1_bverts[2][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
866 FrontCover1_bverts[2][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
867 FrontCover1_bverts[3][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
868 FrontCover1_bverts[3][1] = 0;
869
870 FrontCover1_bverts[4][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
871 FrontCover1_bverts[4][1] = 0;
872 FrontCover1_bverts[5][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
873 FrontCover1_bverts[5][1] = -(fBPolyWidth)*tanbeta;
874 FrontCover1_bverts[6][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
875 FrontCover1_bverts[6][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
876 FrontCover1_bverts[7][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
877 FrontCover1_bverts[7][1] = 0;
878 TGeoArb8 *FrontCov1_b = new TGeoArb8("FrontCov1_b", fBPolyWidth / 2., (Double_t *)FrontCover1_bverts);
879
880 Double_t RearCover_11_bverts[8][2];
881 RearCover_11_bverts[0][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
882 RearCover_11_bverts[0][1] = 0.;
883 RearCover_11_bverts[1][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
884 RearCover_11_bverts[1][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha; // approx
885 RearCover_11_bverts[2][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
886 RearCover_11_bverts[2][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
887 RearCover_11_bverts[3][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
888 RearCover_11_bverts[3][1] = 0;
889
890 RearCover_11_bverts[4][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
891 RearCover_11_bverts[4][1] = 0;
892 RearCover_11_bverts[5][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
893 RearCover_11_bverts[5][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha; // approx
894 RearCover_11_bverts[6][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
895 RearCover_11_bverts[6][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
896 RearCover_11_bverts[7][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
897 RearCover_11_bverts[7][1] = 0;
898 TGeoArb8 *RearCov11_b = new TGeoArb8("RearCov11_b", fBPolyWidth / 2., (Double_t *)RearCover_11_bverts);
899
900 Double_t RearCover_12_bverts[8][2];
901 RearCover_12_bverts[0][0] = fBPolyWidth/2.;
902 RearCover_12_bverts[0][1] = 0.;
903 RearCover_12_bverts[1][0] = fBPolyWidth/2.;
904 RearCover_12_bverts[1][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
905 RearCover_12_bverts[2][0] = -fBPolyWidth/2.;
906 RearCover_12_bverts[2][1] = -(fCBRearWallXDim_b+extra)*tangamma;
907 RearCover_12_bverts[3][0] = -fBPolyWidth/2.;
908 RearCover_12_bverts[3][1] = 0;
909
910 RearCover_12_bverts[4][0] = fBPolyWidth/2.;
911 RearCover_12_bverts[4][1] = 0;
912 RearCover_12_bverts[5][0] = fBPolyWidth/2.;
913 RearCover_12_bverts[5][1] = -(fCBRearWallXDim_b-fAcrylicWidth+extra)*tangamma;
914 RearCover_12_bverts[6][0] = -fBPolyWidth/2.;
915 RearCover_12_bverts[6][1] = -(fCBRearWallXDim_b+extra)*tangamma;
916 RearCover_12_bverts[7][0] = -fBPolyWidth/2.;
917 RearCover_12_bverts[7][1] = 0;
918 TGeoArb8 *RearCov12_b =
919 new TGeoArb8("RearCov12_b", (fCBExtraZDim - fAcrylicWidth + fBPolyWidth) / 2., (Double_t *)RearCover_12_bverts);
920
921 Double_t RearCover_13_bverts[8][2];
922 RearCover_13_bverts[0][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
923 RearCover_13_bverts[0][1] = 0.;
924 RearCover_13_bverts[1][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
925 RearCover_13_bverts[1][1] = -(fCBRearWallXDim_b+extra)*tangamma;
926 RearCover_13_bverts[2][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
927 RearCover_13_bverts[2][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
928 RearCover_13_bverts[3][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
929 RearCover_13_bverts[3][1] = 0;
930
931 RearCover_13_bverts[4][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
932 RearCover_13_bverts[4][1] = 0;
933 RearCover_13_bverts[5][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
934 RearCover_13_bverts[5][1] = -(fCBRearWallXDim_b+extra)*tangamma;
935 RearCover_13_bverts[6][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
936 RearCover_13_bverts[6][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
937 RearCover_13_bverts[7][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
938 RearCover_13_bverts[7][1] = 0;
939 TGeoArb8 *RearCov13_b = new TGeoArb8("RearCov13_b", fBPolyWidth / 2., (Double_t *)RearCover_13_bverts);
940
941 // Borated Polyethylene mother shape definition
942 TGeoTranslation *FrontWallpos_b = new TGeoTranslation(
943 "FrontWallpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2. + 0.1, 0,
944 -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth)); // +0.1 is due to approximations, I guess
945 FrontWallpos_b->RegisterYourself();
946 TGeoTranslation *Tiny1pos_b =
947 new TGeoTranslation("Tiny1pos_b", fCBRearWallXDim_b / 2. + fBPolyWidth / 2., 0, -fBPolyWidth / 2.);
948 Tiny1pos_b->RegisterYourself();
949 TGeoTranslation *SlopeWallpos_b = new TGeoTranslation(
950 "SlopeWallpos_b",
951 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)) + fCBRearWallXDim_b / 2. + 3 * fBPolyWidth, 0,
952 -fBPolyWidth / 2. - fSlopedWallZProj / 2. - (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
953 SlopeWallpos_b->RegisterYourself();
954 TGeoTranslation *Tiny2pos_b = new TGeoTranslation("Tiny2pos_b",
955 5 * fBPolyWidth + fCBRearWallXDim / 2. +
956 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) -
957 (fAcrylicWidth - fBPolyWidth) / 2.,
958 0, -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth));
959 Tiny2pos_b->RegisterYourself();
960 TGeoTranslation *CBExtraLatpos_b = new TGeoTranslation("CBExtraLatpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth / 2.,
961 0, (fCBExtraZDim - fAcrylicWidth) / 2.);
962 CBExtraLatpos_b->RegisterYourself();
963 TGeoTranslation *CBExtraFrontpos_b =
964 new TGeoTranslation("CBExtraFrontpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth - fCBExtraXDim_b / 2., 0,
965 fCBExtraZDim - fAcrylicWidth);
966 CBExtraFrontpos_b->RegisterYourself();
967 TGeoTranslation *CBLateralpos_b =
968 new TGeoTranslation("CBLateralpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fBPolyWidth / 2.,
969 0, fCBExtraZDim - fCBLatWallZDim_b / 2. + fBPolyWidth / 2. - fAcrylicWidth);
970 CBLateralpos_b->RegisterYourself();
971 TGeoTranslation *CBLatCov1pos_b = new TGeoTranslation(
972 "CBLatCov1pos_b", -fCBRearWallXDim / 2. - fCBExtraXDim + 2 * fAcrylicWidth + fBPolyWidth + fAcrylicWidth / 2.,
973 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fCBLatWallZDim / 2. + fAcrylicWidth / 2 - 0.5);
974 CBLatCov1pos_b->RegisterYourself();
975 TGeoTranslation *CBLatCov21pos_b =
976 new TGeoTranslation("CBLatCov21pos_b",
977 3 * fAcrylicWidth + fCBRearWallXDim / 2. +
978 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) + fBPolyWidth / 2. + 0.4,
979 -fCBFrontWallYDim_b / 2.,
980 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. +
981 fBPolyWidth + fAcrylicWidth - 0.5);
982 CBLatCov21pos_b->RegisterYourself();
983 TGeoTranslation *CBLatCov22pos_b = new TGeoTranslation(
984 "CBLatCov22pos_b",
985 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) +
986 fBPolyWidth / 2. + 0.4,
987 -fCBFrontWallYDim_b / 2.,
988 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
989 fAcrylicWidth / 2. + fCBTinyZDim / 2. + fAcrylicWidth - 0.5);
990 CBLatCov22pos_b->RegisterYourself();
991 TGeoTranslation *CBLatCov23pos_b = new TGeoTranslation(
992 "CBLatCov23pos_b", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2. + fBPolyWidth / 2. + 0.5,
993 -fCBFrontWallYDim_b / 2., -fCBTinyZDim / 2. + fBPolyWidth + fBPolyWidth / 2. + 0.5);
994 CBLatCov23pos_b->RegisterYourself();
995 TGeoTranslation *CBFrontCov1pos_b = new TGeoTranslation(
996 "CBFrontCov1pos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2.,
997 -fCBFrontWallYDim_b / 2., -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
998 CBFrontCov1pos_b->RegisterYourself();
999 TGeoTranslation *CBRearCov11pos_b =
1000 new TGeoTranslation("CBRearCov11pos_b", +fBPolyWidth / 2., -fCBFrontWallYDim_b / 2., 0);
1001 CBRearCov11pos_b->RegisterYourself();
1002 TGeoTranslation *CBRearCov12pos_b =
1003 new TGeoTranslation("CBRearCov12pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth / 2. - 0.5,
1004 -fCBFrontWallYDim_b / 2., fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1005 CBRearCov12pos_b->RegisterYourself();
1006 TGeoTranslation *CBRearCov13pos_b =
1007 new TGeoTranslation("CBRearCov13pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth - fCBExtraXDim / 2 + fBPolyWidth,
1008 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fAcrylicWidth);
1009 CBRearCov13pos_b->RegisterYourself();
1010
1011 // Borated Polyethylene mother volume definition
1012 TGeoCompositeShape *COLDBOXB = new TGeoCompositeShape(
1013 "COLDBOXB", "CBRearWall_b+(CBTiny1_b:Tiny1pos_b)+(CBExtraLat_b:CBExtraLatpos_b)+(CBWallSlope_b:SlopeWallpos_b)+("
1014 "CBTiny2_b:Tiny2pos_b)+(CBExtraFront_b:CBExtraFrontpos_b)+(CBLateral_b:CBLateralpos_b)+(CBFrontWall_"
1015 "b:FrontWallpos_b)+(LatCov1_b:CBLatCov1pos_b)+(LatCov21_b:CBLatCov21pos_b)+(LatCov22_b:CBLatCov22pos_"
1016 "b)+(LatCov23_b:CBLatCov23pos_b)+(FrontCov1_b:CBFrontCov1pos_b)+(RearCov11_b:CBRearCov11pos_b)+("
1017 "RearCov12_b:CBRearCov12pos_b)+(RearCov13_b:CBRearCov13pos_b)");
1018 TGeoVolume *volCOLDBOXB = new TGeoVolume("volCOLDBOXB", COLDBOXB, Bor30Poly);
1019
1020 // Acrylic Roof shape definition
1021 Double_t Roof4_averts[8][2];
1022 Roof4_averts[0][0] = 0.;
1023 Roof4_averts[0][1] = 0.;
1024 Roof4_averts[1][0] = 0.;
1025 Roof4_averts[1][1] = fAcrylicWidth;
1026 Roof4_averts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1027 Roof4_averts[2][1] = fAcrylicWidth;
1028 Roof4_averts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1029 Roof4_averts[3][1] = 0;
1030 Roof4_averts[4][0] = 0;
1031 Roof4_averts[4][1] = 0;
1032 Roof4_averts[5][0] = 0;
1033 Roof4_averts[5][1] = fAcrylicWidth;
1034 Roof4_averts[6][0] = 0;
1035 Roof4_averts[6][1] = fAcrylicWidth;
1036 Roof4_averts[7][0] = 0;
1037 Roof4_averts[7][1] = 0;
1038
1039 TGeoBBox *CBRoof1_a = new TGeoBBox("CBRoof1_a", fCBExtraXDim / 2., fAcrylicWidth / 2., fCBLatWallZDim / 2.);
1040 TGeoBBox *CBRoof2_a = new TGeoBBox("CBRoof2_a", (fCBRearWallXDim - fAcrylicWidth) / 2., fAcrylicWidth / 2.,
1041 (fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2.);
1042 TGeoBBox *CBRoof3_a = new TGeoBBox("CBRoof3_a", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1043 fAcrylicWidth / 2., fCBTinyZDim / 2.);
1044 TGeoArb8 *CBRoof4_a = new TGeoArb8("CBRoof4_a", fSlopedWallZProj / 2., (Double_t *)Roof4_averts);
1045
1046 TGeoTranslation *Roof1_apos =
1047 new TGeoTranslation("Roof1_apos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim / 2., 0,
1048 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1049 Roof1_apos->RegisterYourself();
1050 TGeoTranslation *Roof3_apos = new TGeoTranslation(
1051 "Roof3_apos",
1052 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1053 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim / 2.);
1054 Roof3_apos->RegisterYourself();
1055 TGeoTranslation *Roof4_apos =
1056 new TGeoTranslation("Roof4_apos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fAcrylicWidth / 2.,
1057 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim + fSlopedWallZProj / 2.);
1058 Roof4_apos->RegisterYourself();
1059
1060 // Acrylic roof volume definition
1061 TGeoCompositeShape *CBRoof_a = new TGeoCompositeShape(
1062 "CBRoof_a", "CBRoof2_a+(CBRoof1_a:Roof1_apos)+(CBRoof3_a:Roof3_apos)+(CBRoof4_a:Roof4_apos)");
1063 TGeoVolume *volCBRoof_a = new TGeoVolume("volCBRoof_a", CBRoof_a, Acrylic);
1064
1065 // Borated Polythylene Roof shape definition
1066 Double_t Roof4_bverts[8][2];
1067 Roof4_bverts[0][0] = 0.;
1068 Roof4_bverts[0][1] = 0.;
1069 Roof4_bverts[1][0] = 0.;
1070 Roof4_bverts[1][1] = fBPolyWidth;
1071 Roof4_bverts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1072 Roof4_bverts[2][1] = fBPolyWidth;
1073 Roof4_bverts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1074 Roof4_bverts[3][1] = 0;
1075 Roof4_bverts[4][0] = 0;
1076 Roof4_bverts[4][1] = 0;
1077 Roof4_bverts[5][0] = 0;
1078 Roof4_bverts[5][1] = fBPolyWidth;
1079 Roof4_bverts[6][0] = 0;
1080 Roof4_bverts[6][1] = fBPolyWidth;
1081 Roof4_bverts[7][0] = 0;
1082 Roof4_bverts[7][1] = 0;
1083
1084 TGeoBBox *CBRoof1_b = new TGeoBBox("CBRoof1_b", fCBExtraXDim_b / 2., fBPolyWidth / 2., fCBLatWallZDim_b / 2.);
1085 TGeoBBox *CBRoof2_b = new TGeoBBox("CBRoof2_b", (fCBRearWallXDim_b - fBPolyWidth) / 2. + fBPolyWidth / 2.,
1086 fBPolyWidth / 2., (fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2.);
1087 TGeoBBox *CBRoof3_b = new TGeoBBox("CBRoof3_b", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1088 fBPolyWidth / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1089 TGeoArb8 *CBRoof4_b = new TGeoArb8("CBRoof4_b", fSlopedWallZProj / 2., (Double_t *)Roof4_bverts);
1090
1091 TGeoTranslation *Roof1_bpos =
1092 new TGeoTranslation("Roof1_bpos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim_b / 2., 0,
1093 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1094 Roof1_bpos->RegisterYourself();
1095 TGeoTranslation *Roof3_bpos = new TGeoTranslation(
1096 "Roof3_bpos",
1097 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1098 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + (fCBTinyZDim - fAcrylicWidth) / 2.);
1099 Roof3_bpos->RegisterYourself();
1100 TGeoTranslation *Roof4_bpos = new TGeoTranslation(
1101 "Roof4_bpos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fBPolyWidth / 2.,
1102 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim - fAcrylicWidth + fSlopedWallZProj / 2.);
1103 Roof4_bpos->RegisterYourself();
1104
1105 // Borated Polyethylene volume definition
1106 TGeoCompositeShape *CBRoof_b = new TGeoCompositeShape(
1107 "CBRoof_b", "CBRoof2_b+(CBRoof1_b:Roof1_bpos)+(CBRoof3_b:Roof3_bpos)+(CBRoof4_b:Roof4_bpos)");
1108 TGeoVolume *volCBRoof_b = new TGeoVolume("volCBRoof_b", CBRoof_b, Bor30Poly);
1109
1110 // Volumes positioning
1111 TGeoVolumeAssembly *volColdBox = new TGeoVolumeAssembly("volColdBox");
1112 volCOLDBOXA->SetLineColor(kGray - 1);
1113 volCOLDBOXA->SetTransparency(60);
1114 volCOLDBOXB->SetLineColor(kGray - 1);
1115 volCOLDBOXB->SetTransparency(60);
1116 volCBRoof_a->SetLineColor(kGray - 1);
1117 volCBRoof_a->SetTransparency(60);
1118 volCBRoof_b->SetLineColor(kGray - 1);
1119 volCBRoof_b->SetTransparency(60);
1120
1121 volColdBox->AddNode(volCOLDBOXA, 0, 0);
1122 volColdBox->AddNode(volCOLDBOXB, 0,
1123 new TGeoTranslation(-fBPolyWidth - fAcrylicWidth / 2., -fBPolyWidth / 2.,
1124 -fAcrylicWidth / 2. - fBPolyWidth / 2.));
1125 volColdBox->AddNode(volCBRoof_a, 0,
1126 new TGeoTranslation(fAcrylicWidth / 2., fCBFrontWallYDim / 2. + fAcrylicWidth / 2.,
1127 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1128 volColdBox->AddNode(volCBRoof_b, 0,
1129 new TGeoTranslation(-fAcrylicWidth / 2., fCBFrontWallYDim / 2. - fBPolyWidth / 2.,
1130 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1131
1132 displacement =
1133 TVector3(-37.79 - 1.40082, 44.66,
1134 367.96); // taken from MuFilter.cxx "edge_Iron[1]-TVector3(FeX, FeY, FeZ)" EDIT: 1.40082 for overlap fix
1135 tunnel->AddNode(volColdBox, 0,
1136 new TGeoTranslation(displacement.X() - (fCBRearWallXDim - fFeBlockX) / 2. + 28.5,
1137 displacement.Y() - (fCBFrontWallYDim - fFeBlockY) / 2. + 121,
1138 displacement.Z() + fAcrylicWidth - fFeBlockZ / 2. - fBPolyWidth + 1.));
1139
1140if (SND_Z<0.1){ // for H6 and H8 testbeam setup
1141 top->AddNode(detector, 0);
1142 }else{
1143 top->AddNode(detector, 0,localSND_physCS_comb);
1144 top->AddNode(tunnel , 1,new TGeoTranslation(fTunnelDX,fTunnelDY,fTunnelDZ));
1145 }
1146
1147}
1148
1149vetoPoint* Floor::AddHit(Int_t trackID, Int_t detID,
1150 TVector3 pos, TVector3 mom,
1151 Double_t time, Double_t length,
1152 Double_t eLoss, Int_t pdgCode,TVector3 Lpos, TVector3 Lmom)
1153{
1154 TClonesArray& clref = *fFloorPointCollection;
1155 Int_t size = clref.GetEntriesFast();
1156 LOG(DEBUG) << "add veto point "<<size<<" "<<trackID<<" "<<detID;
1157 return new(clref[size]) vetoPoint(trackID, detID, pos, mom,
1158 time, length, eLoss, pdgCode,Lpos,Lmom);
1159}
1160
1162{
1163
1164 FairRootManager::Instance()->Register("vetoPoint", "veto",
1165 fFloorPointCollection, kTRUE);
1166}
1167
1168TClonesArray* Floor::GetCollection(Int_t iColl) const
1169{
1170 if (iColl == 0) { return fFloorPointCollection; }
1171 else { return NULL; }
1172}
1174{
1175 fFloorPointCollection->Clear();
1176}
1177
@ kVETO
Definition Floor.h:23
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition Floor.cxx:58
virtual void Initialize()
Definition Floor.cxx:118
std::map< TString, Float_t > conf_floats
Definition Floor.h:81
Int_t fTrackID
Definition Floor.h:85
Double_t fzPos
length
Definition Floor.h:91
Float_t fEmin
Definition Floor.h:100
TLorentzVector fMom
position at entrance
Definition Floor.h:88
TVector3 crossing(TVector3 H1, TVector3 H2, TVector3 H3, TVector3 P1, TVector3 P2, TVector3 P3)
Definition Floor.cxx:143
vetoPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode, TVector3 Lpos, TVector3 Lmom)
Definition Floor.cxx:1149
Double_t fTotalEloss
Definition Floor.h:94
virtual void Register()
Definition Floor.cxx:1161
Double_t fELoss
thickness
Definition Floor.h:93
Double_t fTime
momentum at entrance
Definition Floor.h:89
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition Floor.cxx:1168
virtual void PreTrack()
Definition Floor.cxx:104
Double_t SND_Z
Definition Floor.h:98
Int_t InitMedium(const char *name)
Definition Floor.cxx:123
Bool_t fFastMuon
Definition Floor.h:99
virtual void EndOfEvent()
Definition Floor.cxx:98
virtual void Reset()
Definition Floor.cxx:1173
Bool_t fMakeSensitive
Definition Floor.h:101
virtual ~Floor()
Definition Floor.cxx:50
Double_t fLength
time
Definition Floor.h:90
void ConstructGeometry()
Definition Floor.cxx:165
Floor()
Definition Floor.cxx:33
TClonesArray * fFloorPointCollection
material
Definition Floor.h:97
TLorentzVector fPos
volume id
Definition Floor.h:87
ClassImp(ecalContFact) ecalContFact
subroutine loop1
First data loop (get global labels).
Definition pede.f90:4822
subroutine loop2
Second data loop (number of derivatives, global label pairs).
Definition pede.f90:5216