SND@LHC Software
Loading...
Searching...
No Matches
Floor Class Reference

#include <Floor.h>

Inheritance diagram for Floor:
Collaboration diagram for Floor:

Public Member Functions

 Floor (const char *name, Bool_t Active)
 
 Floor ()
 
virtual ~Floor ()
 
void SetConfPar (TString name, Float_t value)
 
void SetConfPar (TString name, Int_t value)
 
void SetConfPar (TString name, TString value)
 
Float_t GetConfParF (TString name)
 
Int_t GetConfParI (TString name)
 
TString GetConfParS (TString name)
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Reset ()
 
void ConstructGeometry ()
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual void EndOfEvent ()
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 
vetoPointAddHit (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)
 
void SetEmin (float E)
 
void SetZmax (float Z)
 
void SetFastMuon ()
 
void MakeSensitive ()
 
Int_t InitMedium (const char *name)
 
TVector3 crossing (TVector3 H1, TVector3 H2, TVector3 H3, TVector3 P1, TVector3 P2, TVector3 P3)
 

Private Attributes

std::map< TString, Float_t > conf_floats
 
std::map< TString, Int_t > conf_ints
 
std::map< TString, TString > conf_strings
 
Int_t fTrackID
 
Int_t fVolumeID
 track index
 
TLorentzVector fPos
 volume id
 
TLorentzVector fMom
 position at entrance
 
Double_t fTime
 momentum at entrance
 
Double_t fLength
 time
 
Double_t fzPos
 length
 
Double_t fThick
 zPos
 
Double_t fELoss
 thickness
 
Double_t fTotalEloss
 
TString fMaterial
 
TClonesArray * fFloorPointCollection
 material
 
Double_t SND_Z
 
Bool_t fFastMuon
 
Float_t fEmin
 
Bool_t fMakeSensitive
 

Detailed Description

Definition at line 22 of file Floor.h.

Constructor & Destructor Documentation

◆ Floor() [1/2]

Floor::Floor ( const char *  name,
Bool_t  Active 
)

◆ Floor() [2/2]

Floor::Floor ( )

Definition at line 33 of file Floor.cxx.

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{}
@ kVETO
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
Double_t fTotalEloss
Definition Floor.h:94
Double_t fTime
momentum at entrance
Definition Floor.h:89
Bool_t fFastMuon
Definition Floor.h:99
Bool_t fMakeSensitive
Definition Floor.h:101
Int_t fVolumeID
track index
Definition Floor.h:86
Double_t fLength
time
Definition Floor.h:90
Double_t fThick
zPos
Definition Floor.h:92
TClonesArray * fFloorPointCollection
material
Definition Floor.h:97
TLorentzVector fPos
volume id
Definition Floor.h:87

◆ ~Floor()

Floor::~Floor ( )
virtual

Definition at line 50 of file Floor.cxx.

51{
53 fFloorPointCollection->Delete();
55 }
56}

Member Function Documentation

◆ AddHit()

vetoPoint * Floor::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 at line 1544 of file Floor.cxx.

1548{
1549 TClonesArray& clref = *fFloorPointCollection;
1550 Int_t size = clref.GetEntriesFast();
1551 LOG(DEBUG) << "add veto point "<<size<<" "<<trackID<<" "<<detID;
1552 return new(clref[size]) vetoPoint(trackID, detID, pos, mom,
1553 time, length, eLoss, pdgCode,Lpos,Lmom);
1554}

◆ BeginEvent()

virtual void Floor::BeginEvent ( )
inlinevirtual

Definition at line 63 of file Floor.h.

63{;}

◆ BeginPrimary()

virtual void Floor::BeginPrimary ( )
inlinevirtual

Definition at line 60 of file Floor.h.

60{;}

◆ ConstructGeometry()

void Floor::ConstructGeometry ( )

from geometer, with z pointing upwards, via localSND2CCS and then CCS2SNDPhysics Double_t M[9] = {0.999978, 0.0000821516, -0.006606, -0.00660651, -0.0124347, 0.999901, -4.69368*10^-15, 0.999923, 0.0124349}

Definition at line 165 of file Floor.cxx.

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 = { -552.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 220.0};
212 std::vector<double> tu011_o = { -552.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
330 Double_t dZ = (P3[2]-P1[2])/2.;
331 auto arb = new TGeoArb8(name+"_arb8",dZ);
332 arb->SetVertex(0, points[1][0], points[1][1]);
333 arb->SetVertex(1, points[5][0], points[5][1]);
334 arb->SetVertex(2, points[4][0], points[4][1]);
335 arb->SetVertex(3, points[0][0], points[0][1]);
336 arb->SetVertex(4, points[2][0], points[2][1]);
337 arb->SetVertex(5, points[6][0], points[6][1]);
338 arb->SetVertex(6, points[7][0], points[7][1]);
339 arb->SetVertex(7, points[3][0], points[3][1]);
340// to get the transformation
341 Double_t local[3] = {points[1][0],points[1][1],-dZ};
342 RF->LocalToMaster(local,master);
343 TVector3 Tf(GlobalPoints[1][0]-master[0],GlobalPoints[1][1]-master[1],GlobalPoints[1][2]-master[2]);
344 auto CombiTransF = new TGeoCombiTrans("T_floor_"+name,Tf[0],Tf[1],Tf[2],RF);
345 CombiTransF->RegisterYourself();
346 auto tube = gGeoManager->MakeTube(name+"_tube", concrete, geoParameters[name_i.Data()][6], geoParameters[name_o.Data()][6],H.Mag()/2.);
347 auto Fulltube = gGeoManager->MakeTube(name+"_fulltube", concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.);
348 LOG(DEBUG)<<name<<" "<<Tf[0]<<" "<<Tf[1]<<" "<<Tf[2];
349 auto CombiTransF1 = new TGeoCombiTrans("T_floorS1_"+name,Tf[0],Tf[1]-2*dZ,Tf[2],RF);
350 auto CombiTransF2 = new TGeoCombiTrans("T_floorS2_"+name,Tf[0],Tf[1]-2*dZ,Tf[2]-20,RF);
351 CombiTransF1->RegisterYourself();
352 CombiTransF2->RegisterYourself();
353 auto sunion = new TGeoCompositeShape(name+"_union","("+name+"_tube:T_"+name+"+"+name+"_arb8:T_floor_"+name+"-"+
354 name+"_arb8:T_floorS1_"+name+"-"+name+"_arb8:T_floorS2_"+name+")");
355 shapes.push_back(sunion);
356 auto Fsunion = new TGeoCompositeShape(name+"_Funion","("+name+"_fulltube:T_"+name+"+"+name+"_arb8:T_floor_"+name+"-"+
357 name+"_arb8:T_floorS1_"+name+"-"+name+"_arb8:T_floorS2_"+name+")");
358 shapes.push_back(Fsunion);
359
360 }
361 LOG(DEBUG) << "shapes "<<shapes[0]->GetName()<<" "<<shapes[1]->GetName()<<" "<<shapes[2]->GetName();
362
363 // Since 2024 there is a pit on the TI18 floor hosting the veto
364 // Unless defined in the geo config file, the pit dims are 0.
365 auto vetoPit = new TGeoBBox("vetoPit",
366 conf_floats["Floor/VetoPitXdim"]/2.,
367 conf_floats["Floor/VetoPitZdim"]/2.,
368 conf_floats["Floor/VetoPitYdim"]/2.);
369 auto VetoPit_transl = new TGeoTranslation("VetoPit_transl",
370 -conf_floats["Floor/VetoPitX"]-conf_floats["Floor/VetoPitXdim"]/2.,
371 conf_floats["Floor/VetoPitZ"]-conf_floats["Floor/VetoPitZdim"]/2.,
372 conf_floats["Floor/VetoPitY"]-conf_floats["Floor/VetoPitYdim"]/2.);
373 VetoPit_transl->RegisterYourself();
374
375 //UJ18 tunnel
376 // UJ18 translation and angle rotation
377 Double_t dx_0_UJ18 = -2302.0;
378 Double_t dy_0_UJ18 = -117.0;
379 Double_t dz_0_UJ18 = 7346.0;
380 Double_t rot_X = 0;
381 Double_t rot_Y = -13.63;
382 Double_t rot_Z = 0;
383
384 TGeoRotation *rotA = new TGeoRotation("rotA");
385 rotA->RotateX(rot_X);
386 rotA->RotateY(rot_Y);
387 rotA->RotateZ(rot_Z);
388 TGeoCombiTrans *matA = new TGeoCombiTrans("matA",dx_0_UJ18, dy_0_UJ18, dz_0_UJ18, rotA);
389
390 Double_t dx_UJ18, dy_UJ18, dz_UJ18;
391 Double_t dx_UJ181, dx_UJ182, dy_UJ181, dy_UJ182;
392 Double_t vert[20], par[20];
393 Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;
394 Double_t twist;
395 Double_t origin[3];
396 Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;
397 Double_t r, rlo, rhi;
398 Double_t a, b;
399 Double_t point[3], norm[3];
400 Double_t rin, stin, rout, stout;
401 Double_t thx, phx, thy, phy, thz, phz;
402 Double_t alpha, theta1, theta2, phi1, phi2, dphi;
403 Double_t tr[3], rot[9];
404 Double_t z, density, radl, absl, w;
405 Double_t lx, ly, lz, tx, ty, tz;
406 Double_t xvert[50], yvert[50];
407 Double_t zsect, x0, y0, scale0;
408 Int_t nel, numed, nz, nedges, nvert;
409 TGeoBoolNode *Boolean = nullptr;
410
411 // UJ18 construction: Sequential naming represents step-by-step Boolean operations (e.g., Cut_001, Add_001, trans_1).
412 rmin = 0;
413 rmax = 506.18;
414 dz_UJ18 = 30;
415 TGeoShape *GDMLTube_001 = new TGeoTube("GDMLTube_001",rmin,rmax,dz_UJ18);
416
417 dx_UJ18 = 600;
418 dy_UJ18 = 200;
419 dz_UJ18 = 40;
420 TGeoShape *GDMLBox_001 = new TGeoBBox("GDMLBox_001", dx_UJ18,dy_UJ18,dz_UJ18);
421
422 dx_UJ18 = 0;
423 dy_UJ18 = -524.94;
424 dz_UJ18 = 0;
425 auto trans_1 = new TGeoCombiTrans("trans_1"); // trans = translation
426 trans_1->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
427 Boolean = new TGeoSubtraction(GDMLTube_001,GDMLBox_001,0,trans_1);
428
429 TGeoShape *Cut_001 = new TGeoCompositeShape("Cut_001", Boolean); //Cut = sustraction in boolean operation
430
431 rmin = 0;
432 rmax = 506.18;
433 dz_UJ18 = 1799.5;
434 TGeoShape *GDMLTube_002 = new TGeoTube("GDMLTube_002",rmin,rmax,dz_UJ18);
435
436 rmin = 0;
437 rmax = 450;
438 dz_UJ18 = 1950;
439 TGeoShape *GDMLTube_003 = new TGeoTube("GDMLTube_003",rmin,rmax,dz_UJ18);
440
441 dx_UJ18 = 500;
442 dy_UJ18 = 200;
443 dz_UJ18 = 2000;
444 TGeoShape *GDMLBox_002 = new TGeoBBox("GDMLBox_002", dx_UJ18,dy_UJ18,dz_UJ18);
445
446 dx_UJ18 = 0;
447 dy_UJ18 = -257.94;
448 dz_UJ18 = 0;
449 auto trans_2 = new TGeoCombiTrans("trans_2");
450 trans_2->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
451 Boolean = new TGeoSubtraction(GDMLTube_003,GDMLBox_002,0,trans_2);
452
453 TGeoShape *Cut_002 = new TGeoCompositeShape("Cut_002", Boolean);
454 Boolean = new TGeoSubtraction(GDMLTube_002,Cut_002,0,0);
455
456 TGeoShape *Cut_003 = new TGeoCompositeShape("Cut_003", Boolean);
457
458 dx_UJ18 = 600;
459 dy_UJ18 = 200;
460 dz_UJ18 = 2000;
461 TGeoShape *GDMLBox_003 = new TGeoBBox("GDMLBox_003", dx_UJ18,dy_UJ18,dz_UJ18);
462
463 dx_UJ18 = 0;
464 dy_UJ18 = -524.94;
465 dz_UJ18 = 0;
466 auto trans_3 = new TGeoCombiTrans("trans_3");
467 trans_3->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
468 Boolean = new TGeoSubtraction(Cut_003,GDMLBox_003,0,trans_3);
469
470 TGeoShape *Cut_004 = new TGeoCompositeShape("Cut_004", Boolean);
471
472 rmin = 0;
473 rmax = 506.18;
474 dz_UJ18 = 30;
475 TGeoShape *GDMLTube_004 = new TGeoTube("GDMLTube_004",rmin,rmax,dz_UJ18);
476
477 dx_UJ18 = 600;
478 dy_UJ18 = 200;
479 dz_UJ18 = 40;
480 TGeoShape *GDMLBox_004 = new TGeoBBox("GDMLBox_004", dx_UJ18,dy_UJ18,dz_UJ18);
481
482 dx_UJ18 = 0;
483 dy_UJ18 = -524.94;
484 dz_UJ18 = 0;
485 auto trans_4 = new TGeoCombiTrans("trans_4");
486 trans_4->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
487 Boolean = new TGeoSubtraction(GDMLTube_004,GDMLBox_004,0,trans_4);
488
489 TGeoShape *Cut_005 = new TGeoCompositeShape("Cut_005", Boolean);
490
491 dx_UJ18 = 0;
492 dy_UJ18 = 0;
493 dz_UJ18 = -1829.5;
494 auto trans_5 = new TGeoCombiTrans("trans_5");
495 trans_5->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
496 Boolean = new TGeoUnion(Cut_004,Cut_005,0,trans_5);
497
498 TGeoShape *Add_001 = new TGeoCompositeShape("Add_001", Boolean); // Add = union in boolean operation
499
500 dx_UJ18 = 0;
501 dy_UJ18 = 0;
502 dz_UJ18 = -1829.5;
503 auto trans_6 = new TGeoCombiTrans("trans_6");
504 trans_6->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
505 Boolean = new TGeoUnion(Cut_001,Add_001,0,trans_6);
506
507 TGeoShape *Add_002 = new TGeoCompositeShape("Add_002", Boolean);
508
509 rmin = 0;
510 rmax = 175.65;
511 dz_UJ18 = 50;
512 TGeoShape *GDMLTube_005 = new TGeoTube("GDMLTube_005",rmin,rmax,dz_UJ18);
513
514 dx_UJ18 = 250;
515 dy_UJ18 = 100;
516 dz_UJ18 = 60;
517 TGeoShape *GDMLBox_005 = new TGeoBBox("GDMLBox_005", dx_UJ18,dy_UJ18,dz_UJ18);
518
519 dx_UJ18 = 0;
520 dy_UJ18 = -196.2;
521 dz_UJ18 = 0;
522 auto trans_7 = new TGeoCombiTrans("trans_7");
523 trans_7->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
524 Boolean = new TGeoSubtraction(GDMLTube_005,GDMLBox_005,0,trans_7);
525
526 TGeoShape *Cut_006 = new TGeoCompositeShape("Cut_006", Boolean);
527
528 dx_UJ18 = 245.426;
529 dy_UJ18 = 106.189;
530 dz_UJ18 = -3658.834;
531 auto trans_8 = new TGeoCombiTrans("trans_8");
532 trans_8->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
533 Boolean = new TGeoSubtraction(Add_002,Cut_006,0,trans_8);
534
535 TGeoShape *Cut_007 = new TGeoCompositeShape("Cut_007", Boolean);
536
537 rmin = 0;
538 rmax = 220.39;
539 dz_UJ18 = 1900;
540 TGeoShape *GDMLTube_006 = new TGeoTube("GDMLTube_006",rmin,rmax,dz_UJ18);
541
542 dx_UJ18 = 250;
543 dy_UJ18 = 100;
544 dz_UJ18 = 1925;
545 TGeoShape *GDMLBox_006 = new TGeoBBox("GDMLBox_006", dx_UJ18,dy_UJ18,dz_UJ18);
546
547 dx_UJ18 = 0;
548 dy_UJ18 = -224.647;
549 dz_UJ18 = 0;
550 auto trans_9 = new TGeoCombiTrans("trans_9");
551 trans_9->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
552 Boolean = new TGeoSubtraction(GDMLTube_006,GDMLBox_006,0,trans_9);
553
554 TGeoShape *Cut_008 = new TGeoCompositeShape("Cut_008", Boolean);
555
556 dx_UJ18 = -193.584;
557 dy_UJ18 = 55.7;
558 dz_UJ18 = -1829.5;
559 auto trans_10 = new TGeoCombiTrans("trans_10");
560 trans_10->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
561 Boolean = new TGeoSubtraction(Cut_007,Cut_008,0,trans_10);
562
563 TGeoShape *Cut_009 = new TGeoCompositeShape("Cut_009", Boolean);
564
565 dz_UJ18 = 473.8;
566 theta = 0;
567 phi = 0;
568 h1 = 37.375;
569 bl1 = 204.985;
570 tl1 = 204.985;
571 alpha1 = 0;
572 h2 = 0;
573 bl2 = 204.985;
574 tl2 = 204.985;
575 alpha2 = 0;
576 TGeoShape *GDMLTrap_1 = new TGeoTrap("GDMLTrap_1", dz_UJ18,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);
577
578 dx_UJ18 = 236.991;
579 dy_UJ18 = -45.068;
580 dz_UJ18 = -3156.224;
581
582 thx = 90; phx = 0;
583 thy = 87.92; phy = 90;
584 thz = 2.08; phz = 270;
585 TGeoRotation *rot_1 = new TGeoRotation("rot_1",thx,phx,thy,phy,thz,phz);
586 auto trans_11 = new TGeoCombiTrans("trans_11", dx_UJ18, dy_UJ18, dz_UJ18, rot_1);
587 Boolean = new TGeoUnion(Cut_009,GDMLTrap_1,0,trans_11);
588 TGeoShape *pUJ18_shape_25 = new TGeoCompositeShape("UJ18_shape", Boolean);
589
590 //get the new rotation and translation
591 TGeoHMatrix * Matrix_setup = new TGeoHMatrix("Matrix_setup");
592 Matrix_setup->Multiply(matA);
593 Matrix_setup->Multiply(trans_11);
594
595 //create the new translation for union(with TI18) subtraction(with rock)
596 const Double_t *tr1 = Matrix_setup->GetTranslation();
597 TGeoRotation *rot2 = new TGeoRotation();
598 rot2->SetMatrix(Matrix_setup->GetRotationMatrix());
599 //for registyourself
600 auto new_translation_for_UJ18 = new TGeoCombiTrans("new_translation_for_UJ18", tr1[0], tr1[1], tr1[2], rot2);
601 new_translation_for_UJ18->RegisterYourself();
602
603 // UJ18_solid (to be subtracted from Bigbox)
604 rmin = 0;
605 rmax = 506.18;
606 dz_UJ18 = 30;
607 TGeoShape *GDMLTube_007 = new TGeoTube("GDMLTube_007",rmin,rmax,dz_UJ18);
608
609 dx_UJ18 = 600;
610 dy_UJ18 = 200;
611 dz_UJ18 = 40;
612 TGeoShape *GDMLBox_007 = new TGeoBBox("GDMLBox_007", dx_UJ18,dy_UJ18,dz_UJ18);
613
614 dx_UJ18 = 0;
615 dy_UJ18 = -524.94;
616 dz_UJ18 = 0;
617 auto trans_12 = new TGeoCombiTrans("trans_12");
618 trans_12->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
619 Boolean = new TGeoSubtraction(GDMLTube_007,GDMLBox_007,0,trans_12);
620
621 TGeoShape *Cut_010 = new TGeoCompositeShape("Cut_010", Boolean);
622
623 rmin = 0;
624 rmax = 506.18;
625 dz_UJ18 = 1799.5;
626 TGeoShape *GDMLTube_008 = new TGeoTube("GDMLTube_8",rmin,rmax,dz_UJ18);
627
628 dx_UJ18 = 600;
629 dy_UJ18 = 200;
630 dz_UJ18 = 2000;
631 TGeoShape *GDMLBox_008 = new TGeoBBox("GDML_Box008", dx_UJ18,dy_UJ18,dz_UJ18);
632
633 dx_UJ18 = 0;
634 dy_UJ18 = -524.94;
635 dz_UJ18 = 0;
636 auto trans_13 = new TGeoCombiTrans("trans_13");
637 trans_13->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
638 Boolean = new TGeoSubtraction(GDMLTube_008,GDMLBox_008,0,trans_13);
639
640 TGeoShape *Cut_011 = new TGeoCompositeShape("Cut_011", Boolean);
641
642 rmin = 0;
643 rmax = 506.18;
644 dz_UJ18 = 30;
645 TGeoShape *GDMLTube_009 = new TGeoTube("GDMLTube_009",rmin,rmax,dz_UJ18);
646
647 dx_UJ18 = 600;
648 dy_UJ18 = 200;
649 dz_UJ18 = 40;
650 TGeoShape *GDMLBox_009 = new TGeoBBox("GDMLBox_009", dx_UJ18,dy_UJ18,dz_UJ18);
651
652 dx_UJ18 = 0;
653 dy_UJ18 = -524.94;
654 dz_UJ18 = 0;
655 auto trans_14 = new TGeoCombiTrans("trans_14");
656 trans_14->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
657 Boolean = new TGeoSubtraction(GDMLTube_009,GDMLBox_009,0,trans_14);
658
659 TGeoShape *Cut_012 = new TGeoCompositeShape("Cut_012", Boolean);
660
661 dx_UJ18 = 0;
662 dy_UJ18 = 0;
663 dz_UJ18 = -1829.5;
664 auto trans_15 = new TGeoCombiTrans("trans_15");
665 trans_15->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
666 Boolean = new TGeoUnion(Cut_011,Cut_012,0,trans_15);
667
668 TGeoShape *Add_003 = new TGeoCompositeShape("Add_003", Boolean);
669
670 dx_UJ18 = 0;
671 dy_UJ18 = 0;
672 dz_UJ18 = -1829.5;
673 auto trans_16 = new TGeoCombiTrans("trans_16");
674 trans_16->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
675 Boolean = new TGeoUnion(Cut_010,Add_003,0,trans_16);
676 TGeoShape *Solid_UJ18_shape = new TGeoCompositeShape("Solid_UJ18_shape", Boolean);
677
678 std::string tunnel_shape_name = "(UJ18_shape:new_translation_for_UJ18+TI18_1_union+TI18_2_union+TI18_3_union)";
679 if (conf_floats["Floor/VetoPitXdim"]!=0) {
680 tunnel_shape_name+="-vetoPit:VetoPit_transl";
681 }
682 auto total = new TGeoCompositeShape("Stotal",tunnel_shape_name.c_str());
683 auto volT = new TGeoVolume("VTI18",total,concrete);
684 volT->SetTransparency(0);
685 volT->SetLineColor(kGray);
686// make tunnel sensitive for debugging
687 if (fMakeSensitive) {AddSensitiveVolume(volT);}
688 tunnel->AddNode(volT, 1);
689
690 std::vector<TString> loop2 = {"UJ18_","tu010_","tu011_","tu012_"};
691 for(auto it = std::begin(loop2); it != std::end(loop2); ++it) {
692 TString name_i = TString(*it).ReplaceAll("_","_i");
693 TString name_o= TString(*it).ReplaceAll("_","_o");
694 TString name_F = "F"+TString(*it);
695 TVector3 P = TVector3(geoParameters[name_i.Data()][0],geoParameters[name_i.Data()][1],geoParameters[name_i.Data()][2] - SND_Z);
696 TVector3 H = TVector3(geoParameters[name_i.Data()][3],geoParameters[name_i.Data()][4],geoParameters[name_i.Data()][5]);
697 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
698 auto Fvol = gGeoManager->MakeTube(name_F, concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.-5.);
699 vol->SetTransparency(0);
700 vol->SetLineColor(kGray);
701 auto T = P + 0.5*H;
702 double rotBeta = TMath::ACos(H[2]/H.Mag());
703 double rotAlpha = TMath::ATan2(H[0]/H.Mag(), -H[1]/H.Mag());
704 double rotGamma = TMath::ACos(H[1]/H.Mag()/TMath::Sqrt(1-pow(H[2]/H.Mag(),2)));
705 TString name = "R_"+TString(*it);
706 auto R = new TGeoRotation(name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
707 auto CombiTrans = new TGeoCombiTrans("TS_"+TString(*it),T[0],T[1],T[2],R);
708 CombiTrans->RegisterYourself();
709 trans.push_back(CombiTrans);
710 }
711 // LHC Tunnel
712 // LHC translation and angle rotation
713 Double_t dx_0_LHC = -336.0;
714 Double_t dy_0_LHC = 258.0;
715 Double_t dz_0_LHC = -590.0;
716 Double_t rot_X_LHC = 0.0 ;
717 Double_t rot_Y_LHC = -13.63;
718 Double_t rot_Z_LHC = 0.0 ;
719
720 TGeoRotation *rotB = new TGeoRotation("rotB");
721 rotB->RotateX(rot_X_LHC);
722 rotB->RotateY(rot_Y_LHC);
723 rotB->RotateZ(rot_Z_LHC);
724 TGeoCombiTrans *matB = new TGeoCombiTrans("matB",dx_0_LHC, dy_0_LHC, dz_0_LHC, rotB);
725
726 Double_t dx_LHC, dy_LHC, dz_LHC;
727 Double_t dx_LHC1, dx_LHC2, dy_LHC1, dy_LHC2;
728 Double_t rmin_LHC, rmax_LHC, rmin_LHC1, rmax_LHC1, rmin_LHC2, rmax_LHC2;
729
730 rmin_LHC = 0;
731 rmax_LHC = 220;
732 dz_LHC = 4100;
733 TGeoShape *Tube_LHC_001 = new TGeoTube("Tube_LHC_001",rmin_LHC,rmax_LHC,dz_LHC);
734
735 dx_LHC = 300;
736 dy_LHC = 46;
737 dz_LHC = 4100;
738 TGeoShape *Box_LHC_001 = new TGeoBBox("Box_LHC_001", dx_LHC,dy_LHC,dz_LHC);
739
740 dx_LHC = 0;
741 dy_LHC = -174;
742 dz_LHC = 0;
743 auto LHC_trans_001 = new TGeoCombiTrans("LHC_trans_001");
744 LHC_trans_001->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
745 Boolean = new TGeoIntersection(Tube_LHC_001,Box_LHC_001,0,LHC_trans_001);
746 TGeoShape *Intersect_LHC_001 = new TGeoCompositeShape("Intersect_LHC_001", Boolean);
747
748 rmin_LHC = 220;
749 rmax_LHC = 250;
750 dz_LHC = 4100;
751 TGeoShape *Tube_LHC_002 = new TGeoTube("Tube_LHC_002",rmin_LHC,rmax_LHC,dz_LHC);
752 Boolean = new TGeoUnion(Intersect_LHC_001,Tube_LHC_002,0,0);
753 TGeoShape *Add_LHC_001 = new TGeoCompositeShape("Add_LHC_001", Boolean);
754
755 dx_LHC = 300;
756 dy_LHC = 50;
757 dz_LHC = 4100;
758 TGeoShape *Box_LHC_002 = new TGeoBBox("Box_LHC_002", dx_LHC,dy_LHC,dz_LHC);
759
760 dx_LHC = 0;
761 dy_LHC = -228;
762 dz_LHC = 0;
763 auto LHC_trans_002 = new TGeoCombiTrans("LHC_trans_002");
764 LHC_trans_002->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
765 Boolean = new TGeoSubtraction(Add_LHC_001,Box_LHC_002,0,LHC_trans_002);
766 TGeoShape *Cut_LHC_001 = new TGeoCompositeShape("Cut_LHC_001", Boolean);
767
768 //get the new rotation and translation
769 TGeoHMatrix * Matrix_setup_LHC = new TGeoHMatrix("Matrix_setup_LHC");
770 Matrix_setup_LHC->Multiply(matB);
771 Matrix_setup_LHC->Multiply(LHC_trans_002);
772 //for registyourself
773 Matrix_setup_LHC->RegisterYourself();
774
775 auto total2 = new TGeoCompositeShape("Stotal2","Cut_LHC_001:Matrix_setup_LHC-Solid_UJ18_shape:new_translation_for_UJ18");
776 auto volT2 = new TGeoVolume("VUJ",total2,concrete);
777 volT2->SetTransparency(0);
778 volT2->SetLineColor(kGray);
779 tunnel->AddNode(volT2, 1);
780
781 // LHC tunnel solid Geometry
782 rmin_LHC = 0;
783 rmax_LHC = 250;
784 dz_LHC = 4100;
785 TGeoShape *Tube_LHC_solid_001 = new TGeoTube("Tube_LHC_solid_001",rmin_LHC,rmax_LHC,dz_LHC);
786
787 dx_LHC = 300;
788 dy_LHC = 50;
789 dz_LHC = 4100;
790 TGeoShape *Box_LHC_solid_001 = new TGeoBBox("Box_LHC_solid_001", dx_LHC,dy_LHC,dz_LHC);
791
792 dx_LHC = 0;
793 dy_LHC = -228;
794 dz_LHC = 0;
795 auto LHC_solid_trans_001 = new TGeoCombiTrans("LHC_solid_trans_001");
796 LHC_solid_trans_001->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
797 Boolean = new TGeoSubtraction(Tube_LHC_solid_001,Box_LHC_solid_001,0,LHC_solid_trans_001);
798 TGeoShape *Cut_solid_LHC_001 = new TGeoCompositeShape("Cut_solid_LHC_001", Boolean);
799
800/*
801 std::vector<TString> loopr = {"tu010_","tu011_"};
802 for(auto it = std::begin(loopr); it != std::end(loopr); ++it) {
803 TString name_o= TString(*it).ReplaceAll("_","_o");
804 TString name_b = TString(*it).ReplaceAll("_","_cone");
805 TString name_c = TString(*it).ReplaceAll("_","_rock");
806 TString name = TString(*it);
807 TString name_x = TString(*it).ReplaceAll("_","_x");
808
809 TVector3 H = TVector3(geoParameters[name_o.Data()][3],geoParameters[name_o.Data()][4],geoParameters[name_o.Data()][5]);
810 auto tube = new TGeoTube(name_x,0., geoParameters[name_o.Data()][6]+10.,H.Mag()/2.+0.1);
811 auto cone = gGeoManager->MakeCone(name_b,rock,H.Mag()/2.,0.,geoParameters[name_o.Data()][8],0.,geoParameters[name_o.Data()][7]);
812 auto Srock = new TGeoCompositeShape(name_c, name_b+":TS_"+name+"-"+name_x+":TS_"+name);
813 }
814 auto total3 = new TGeoCompositeShape("Stotal3","tu010_rock+tu011_rock");
815 auto volT3 = new TGeoVolume("Vrock",total3,rock);
816 volT3->SetTransparency(75);
817 volT3->SetLineColor(kRed);
818 tunnel->AddNode(volT3, 1);
819
820// add rock up to Fluka scoring plane, 409 m from IP1.
821 double zs = 40900.;
822 double dz = (geoParameters["tu010_o"][2] - zs)/2.;
823 auto fluka = gGeoManager->MakeBox("FlukaScoringPlane",rock, geoParameters["tu010_o"][8],geoParameters["tu010_o"][8],dz);
824 fluka->SetLineColor(kRed);
825 tunnel->AddNode(fluka,1, new TGeoTranslation(-350.,0,dz+zs- SND_Z-50.)); // move 50cm upstream to avoid overlap
826*/
827
828 double zs = 40900.; // scoring plane
829 double dz = (geoParameters["TI18_o1"][2] - zs)/2.;
830 double extended_z = 1860; //extend the rock to cover the new added UJ18
831
832 auto bigBox = new TGeoBBox("BigBox", 2000.,1500. , dz+extended_z);
833 auto TR_1 = new TGeoTranslation("TR_1",0.,0.,-dz+extended_z+geoParameters["TI18_o1"][2]-SND_Z - 50.); // move a bit more upstream to have free view from the back
834 TR_1->RegisterYourself();
835
836 auto cutOut = new TGeoCompositeShape(
837 "cutOut",
838 "BigBox:TR_1-(Cut_solid_LHC_001:Matrix_setup_LHC)-(TI18_1_Funion+TI18_2_Funion+TI18_3_Funion+Solid_UJ18_shape:new_translation_for_UJ18)");
839
840 auto volT3 = new TGeoVolume("Vrock",cutOut,rock);
841 volT3->SetTransparency(75);
842 volT3->SetLineColor(kRed);
843 tunnel->AddNode(volT3, 1);
844
845 double z_dim_exitPlane = 1.;
846auto exitPlane = gGeoManager->MakeBox("exitScoringPlane",vacuum,1000.,1000. , z_dim_exitPlane);
847exitPlane->SetLineColor(kGreen);
848exitPlane->SetVisibility(kFALSE);
849if (fMakeSensitive) {AddSensitiveVolume(exitPlane);}
850tunnel->AddNode(exitPlane,1, new TGeoTranslation(-1500.0,0,((2*extended_z)+geoParameters["TI18_o1"][2]-SND_Z - 50 + z_dim_exitPlane)));
851
852 // COLDBOX GEOM
853 InitMedium("Borated30polyethylene");
854 TGeoMedium *Bor30Poly = gGeoManager->GetMedium("Borated30polyethylene");
855 InitMedium("PMMA");
856 TGeoMedium *Acrylic = gGeoManager->GetMedium("PMMA");
857 TVector3 displacement;
858
859 Double_t fAcrylicWidth = conf_floats["Floor/Acrylic_width"];
860 Double_t fBPolyWidth = conf_floats["Floor/BPoly_width"];
861 Double_t fCBFrontWallXDim = conf_floats["Floor/CBFrontWall_xdim"];
862 Double_t fCBFrontWallYDim = conf_floats["Floor/CBFrontWall_ydim"];
863 Double_t fCBLatWallZDim = conf_floats["Floor/CBLatWall_zdim"];
864 Double_t fCBTinyZDim = conf_floats["Floor/CBTiny_zdim"];
865 Double_t fCBExtraZDim = conf_floats["Floor/CBExtra_zdim"];
866 Double_t fCBExtraXDim = conf_floats["Floor/CBExtra_xdim"];
867 Double_t fSlopedWallZProj = conf_floats["Floor/SlopedWall_zproj"];
868 Double_t fCBRearWallXDim =
869 fCBFrontWallXDim - fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) - fCBExtraXDim + fAcrylicWidth;
870 Double_t fFeBlockX = conf_floats["Floor/MFeBlockX"];
871 Double_t fFeBlockY = conf_floats["Floor/MFeBlockY"];
872 Double_t fFeBlockZ = conf_floats["Floor/MFeBlockZ"];
873
874 // ************************ ACRYLIC
875 // Shapes definition
876 TGeoBBox *FeBlock_cb = new TGeoBBox("FeBlock_cb", fFeBlockX / 2, fFeBlockY / 2, fFeBlockZ / 2);
877 TGeoBBox *CBFrontWall_a =
878 new TGeoBBox("CBFrontWall_a", fCBFrontWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
879 TGeoBBox *CBLateral_a =
880 new TGeoBBox("CBLateral_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBLatWallZDim - 2 * fAcrylicWidth) / 2.);
881 TGeoBBox *CBExtraFront_a =
882 new TGeoBBox("CBExtraFront_a", fCBExtraXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
883 TGeoBBox *CBExtraLat_a =
884 new TGeoBBox("CBExtraLat_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
885 TGeoBBox *CBTiny1_a = new TGeoBBox("CBTiny1_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2.,
886 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
887 TGeoBBox *CBTiny2_a =
888 new TGeoBBox("CBTiny2_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
889 TGeoBBox *CBRearWall_a =
890 new TGeoBBox("CBRearWall_a", fCBRearWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
891
892 TGeoTranslation *CBWallpos = new TGeoTranslation("CBWallpos", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5,
893 (fCBFrontWallYDim - fFeBlockY) / 2. - 118., 0);
894 CBWallpos->RegisterYourself();
895
896 TGeoCompositeShape *CBWallDownstream =
897 new TGeoCompositeShape("CBWallDownstream", "CBRearWall_a-(FeBlock_cb:CBWallpos)");
898 TGeoPara *CBWallSlope_a =
899 new TGeoPara("CBWallSlope_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., fSlopedWallZProj / 2., 0, -15, 0);
900
901 // Coverings
902 Double_t LatCover1_averts[8][2];
903 LatCover1_averts[0][0] = 0.;
904 LatCover1_averts[0][1] = 0.;
905 LatCover1_averts[1][0] = fAcrylicWidth;
906 LatCover1_averts[1][1] = 0;
907 LatCover1_averts[2][0] = fAcrylicWidth;
908 LatCover1_averts[2][1] = -(176.71 - 170.72);
909 LatCover1_averts[3][0] = 0.;
910 LatCover1_averts[3][1] = -(176.71 - 170.72);
911
912 LatCover1_averts[4][0] = 0;
913 LatCover1_averts[4][1] = 0;
914 LatCover1_averts[5][0] = fAcrylicWidth;
915 LatCover1_averts[5][1] = 0;
916 LatCover1_averts[6][0] = fAcrylicWidth;
917 LatCover1_averts[6][1] = -(187.03 - 170.72);
918 LatCover1_averts[7][0] = 0;
919 LatCover1_averts[7][1] = -(187.03 - 170.72);
920 TGeoArb8 *LatCov1_a = new TGeoArb8("LatCov1_a", 176. / 2., (Double_t *)LatCover1_averts);
921
922 Double_t tanalpha = (183.26 - 170.72) / 144.;
923 Double_t LatCover21_averts[8][2];
924 LatCover21_averts[0][0] = 0.;
925 LatCover21_averts[0][1] = 0.;
926 LatCover21_averts[1][0] = fAcrylicWidth;
927 LatCover21_averts[1][1] = 0;
928 LatCover21_averts[2][0] = fAcrylicWidth;
929 LatCover21_averts[2][1] = 0;
930 LatCover21_averts[3][0] = 0.;
931 LatCover21_averts[3][1] = 0;
932
933 LatCover21_averts[4][0] = 0;
934 LatCover21_averts[4][1] = 0;
935 LatCover21_averts[5][0] = fAcrylicWidth;
936 LatCover21_averts[5][1] = 0;
937 LatCover21_averts[6][0] = fAcrylicWidth;
938 LatCover21_averts[6][1] = -fCBTinyZDim * tanalpha;
939 LatCover21_averts[7][0] = 0;
940 LatCover21_averts[7][1] = -fCBTinyZDim * tanalpha;
941 TGeoArb8 *LatCov21_a = new TGeoArb8("LatCov21_a", fCBTinyZDim / 2., (Double_t *)LatCover21_averts);
942
943 Double_t LatCover22_averts[8][2];
944 LatCover22_averts[0][0] = 0.;
945 LatCover22_averts[0][1] = 0.;
946 LatCover22_averts[1][0] = fAcrylicWidth;
947 LatCover22_averts[1][1] = 0;
948 LatCover22_averts[2][0] = fAcrylicWidth;
949 LatCover22_averts[2][1] = -fCBTinyZDim * tanalpha;
950 LatCover22_averts[3][0] = 0.;
951 LatCover22_averts[3][1] = -fCBTinyZDim * tanalpha;
952
953 LatCover22_averts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
954 LatCover22_averts[4][1] = 0;
955 LatCover22_averts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
956 LatCover22_averts[5][1] = 0;
957 LatCover22_averts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
958 LatCover22_averts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
959 LatCover22_averts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
960 LatCover22_averts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
961 TGeoArb8 *LatCov22_a = new TGeoArb8("LatCov22_a", fSlopedWallZProj / 2., (Double_t *)LatCover22_averts);
962
963 Double_t LatCover23_averts[8][2];
964 LatCover23_averts[0][0] = 0.;
965 LatCover23_averts[0][1] = 0.;
966 LatCover23_averts[1][0] = fAcrylicWidth;
967 LatCover23_averts[1][1] = 0;
968 LatCover23_averts[2][0] = fAcrylicWidth;
969 LatCover23_averts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
970 LatCover23_averts[3][0] = 0.;
971 LatCover23_averts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
972
973 LatCover23_averts[4][0] = 0;
974 LatCover23_averts[4][1] = 0;
975 LatCover23_averts[5][0] = fAcrylicWidth;
976 LatCover23_averts[5][1] = 0;
977 LatCover23_averts[6][0] = fAcrylicWidth;
978 LatCover23_averts[6][1] = -(183.26 - 170.72);
979 LatCover23_averts[7][0] = 0;
980 LatCover23_averts[7][1] = -(183.26 - 170.72);
981 TGeoArb8 *LatCov23_a = new TGeoArb8("LatCov23_a", (fCBTinyZDim - fBPolyWidth) / 2., (Double_t *)LatCover23_averts);
982
983 Double_t tanbeta = (176.74 - 170.72) / 219.0;
984 Double_t FrontCover1_averts[8][2];
985 FrontCover1_averts[0][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
986 FrontCover1_averts[0][1] = 0.;
987 FrontCover1_averts[1][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
988 FrontCover1_averts[1][1] = -(fAcrylicWidth)*tanbeta;
989 FrontCover1_averts[2][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
990 FrontCover1_averts[2][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
991 FrontCover1_averts[3][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
992 FrontCover1_averts[3][1] = 0;
993
994 FrontCover1_averts[4][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
995 FrontCover1_averts[4][1] = 0;
996 FrontCover1_averts[5][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
997 FrontCover1_averts[5][1] = -(fAcrylicWidth)*tanbeta;
998 FrontCover1_averts[6][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
999 FrontCover1_averts[6][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
1000 FrontCover1_averts[7][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
1001 FrontCover1_averts[7][1] = 0;
1002 TGeoArb8 *FrontCov1_a = new TGeoArb8("FrontCov1_a", fAcrylicWidth / 2., (Double_t *)FrontCover1_averts);
1003
1004 Double_t tangamma = (187.03 - 183.26) / (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
1005 Double_t xdim_projected = (187.03 - 170.72) / tangamma;
1006 Double_t extra = xdim_projected - (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
1007 Double_t RearCover_11_averts[8][2];
1008 RearCover_11_averts[0][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1009 RearCover_11_averts[0][1] = 0.;
1010 RearCover_11_averts[1][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1011 RearCover_11_averts[1][1] = -(183.26-170.72); // approx
1012 RearCover_11_averts[2][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1013 RearCover_11_averts[2][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1014 RearCover_11_averts[3][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1015 RearCover_11_averts[3][1] = 0;
1016
1017 RearCover_11_averts[4][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1018 RearCover_11_averts[4][1] = 0;
1019 RearCover_11_averts[5][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1020 RearCover_11_averts[5][1] = -(183.26-170.72); // approx
1021 RearCover_11_averts[6][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1022 RearCover_11_averts[6][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1023 RearCover_11_averts[7][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1024 RearCover_11_averts[7][1] = 0;
1025 TGeoArb8 *RearCov11_atot = new TGeoArb8("RearCov11_atot", fAcrylicWidth / 2., (Double_t *)RearCover_11_averts);
1026 TGeoTranslation *CBWallpos2 =
1027 new TGeoTranslation("CBWallpos2", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5, 0, -fAcrylicWidth / 2.);
1028 CBWallpos2->RegisterYourself();
1029 TGeoCompositeShape *RearCov11_a = new TGeoCompositeShape("RearCov11_a", "RearCov11_atot-(FeBlock_cb:CBWallpos2)");
1030
1031 Double_t RearCover_12_averts[8][2];
1032 RearCover_12_averts[0][0] = fAcrylicWidth/2.;
1033 RearCover_12_averts[0][1] = 0.;
1034 RearCover_12_averts[1][0] = fAcrylicWidth/2.;
1035 RearCover_12_averts[1][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1036 RearCover_12_averts[2][0] = -fAcrylicWidth/2.;
1037 RearCover_12_averts[2][1] = -(fCBRearWallXDim+extra)*tangamma;
1038 RearCover_12_averts[3][0] = -fAcrylicWidth/2.;
1039 RearCover_12_averts[3][1] = 0;
1040
1041 RearCover_12_averts[4][0] = fAcrylicWidth/2.;
1042 RearCover_12_averts[4][1] = 0;
1043 RearCover_12_averts[5][0] = fAcrylicWidth/2.;
1044 RearCover_12_averts[5][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1045 RearCover_12_averts[6][0] = -fAcrylicWidth/2.;
1046 RearCover_12_averts[6][1] = -(fCBRearWallXDim+extra)*tangamma;
1047 RearCover_12_averts[7][0] = -fAcrylicWidth/2.;
1048 RearCover_12_averts[7][1] = 0;
1049 TGeoArb8 *RearCov12_a = new TGeoArb8("RearCov12_a", fCBExtraZDim / 2., (Double_t *)RearCover_12_averts);
1050
1051 Double_t RearCover_13_averts[8][2];
1052 RearCover_13_averts[0][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1053 RearCover_13_averts[0][1] = 0.;
1054 RearCover_13_averts[1][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1055 RearCover_13_averts[1][1] = -(fCBRearWallXDim+extra)*tangamma;
1056 RearCover_13_averts[2][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1057 RearCover_13_averts[2][1] = -(187.03-170.72);
1058 RearCover_13_averts[3][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1059 RearCover_13_averts[3][1] = 0;
1060
1061 RearCover_13_averts[4][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1062 RearCover_13_averts[4][1] = 0;
1063 RearCover_13_averts[5][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1064 RearCover_13_averts[5][1] = -(fCBRearWallXDim+extra)*tangamma;
1065 RearCover_13_averts[6][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1066 RearCover_13_averts[6][1] = -(187.03-170.72);
1067 RearCover_13_averts[7][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1068 RearCover_13_averts[7][1] = 0;
1069 TGeoArb8 *RearCov13_a = new TGeoArb8("RearCov13_a", fAcrylicWidth / 2., (Double_t *)RearCover_13_averts);
1070
1071 // Acrylic mother shape definition
1072 TGeoTranslation *FrontWallpos =
1073 new TGeoTranslation("FrontWallpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
1074 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
1075 FrontWallpos->RegisterYourself();
1076 TGeoTranslation *Tiny1pos =
1077 new TGeoTranslation("Tiny1pos", (fCBRearWallXDim - fAcrylicWidth) / 2., 0, -fCBTinyZDim / 2. + fBPolyWidth / 2.);
1078 Tiny1pos->RegisterYourself();
1079 TGeoTranslation *SlopeWallpos =
1080 new TGeoTranslation("SlopeWallpos",
1081 (fCBRearWallXDim + fAcrylicWidth) / 2. + fAcrylicWidth +
1082 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)),
1083 0, -fCBTinyZDim - fSlopedWallZProj / 2. + fAcrylicWidth / 2. + fBPolyWidth);
1084 SlopeWallpos->RegisterYourself();
1085 TGeoTranslation *Tiny2pos = new TGeoTranslation(
1086 "Tiny2pos",
1087 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fAcrylicWidth / 2. +
1088 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1089 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth);
1090 Tiny2pos->RegisterYourself();
1091 TGeoTranslation *CBExtraLatpos = new TGeoTranslation("CBExtraLatpos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., 0,
1092 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1093 CBExtraLatpos->RegisterYourself();
1094 TGeoTranslation *CBExtraFrontpos = new TGeoTranslation(
1095 "CBExtraFrontpos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2., 0, fCBExtraZDim - fAcrylicWidth);
1096 CBExtraFrontpos->RegisterYourself();
1097 TGeoTranslation *CBLateralpos =
1098 new TGeoTranslation("CBLateralpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fAcrylicWidth / 2., 0,
1099 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1100 CBLateralpos->RegisterYourself();
1101 TGeoTranslation *CBLatCov1pos =
1102 new TGeoTranslation("CBLatCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth, -fCBFrontWallYDim / 2.,
1103 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1104 CBLatCov1pos->RegisterYourself();
1105 TGeoTranslation *CBLatCov21pos = new TGeoTranslation(
1106 "CBLatCov21pos",
1107 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1108 -fCBFrontWallYDim / 2.,
1109 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1110 fAcrylicWidth / 2.);
1111 CBLatCov21pos->RegisterYourself();
1112 TGeoTranslation *CBLatCov22pos = new TGeoTranslation(
1113 "CBLatCov22pos",
1114 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1115 -fCBFrontWallYDim / 2.,
1116 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1117 fAcrylicWidth / 2. + fCBTinyZDim / 2.);
1118 CBLatCov22pos->RegisterYourself();
1119 TGeoTranslation *CBLatCov23pos =
1120 new TGeoTranslation("CBLatCov23pos", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2.,
1121 -fCBFrontWallYDim / 2., -fCBTinyZDim / 2. + fBPolyWidth + 0.5);
1122 CBLatCov23pos->RegisterYourself();
1123 TGeoTranslation *CBFrontCov1pos = new TGeoTranslation(
1124 "CBFrontCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
1125 -fCBFrontWallYDim / 2., -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
1126 CBFrontCov1pos->RegisterYourself();
1127 TGeoTranslation *CBRearCov11pos = new TGeoTranslation("CBRearCov11pos", 0, -fCBFrontWallYDim / 2., 0);
1128 CBRearCov11pos->RegisterYourself();
1129 TGeoTranslation *CBRearCov12pos =
1130 new TGeoTranslation("CBRearCov12pos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., -fCBFrontWallYDim / 2.,
1131 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1132 CBRearCov12pos->RegisterYourself();
1133 TGeoTranslation *CBRearCov13pos =
1134 new TGeoTranslation("CBRearCov13pos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2.,
1135 -fCBFrontWallYDim / 2., fCBExtraZDim - fAcrylicWidth);
1136 CBRearCov13pos->RegisterYourself();
1137
1138 // Acrylic mother volume definition
1139 TGeoCompositeShape *COLDBOXA = new TGeoCompositeShape(
1140 "COLDBOXA",
1141 "CBWallDownstream+(CBFrontWall_a:FrontWallpos)+(CBTiny1_a:Tiny1pos)+(CBWallSlope_a:SlopeWallpos)+(CBTiny2_a:"
1142 "Tiny2pos)+(CBExtraLat_a:CBExtraLatpos)+(CBExtraFront_a:CBExtraFrontpos)+(CBLateral_a:CBLateralpos)+(LatCov1_a:"
1143 "CBLatCov1pos)+(LatCov21_a:CBLatCov21pos)+(LatCov22_a:CBLatCov22pos)+(LatCov23_a:CBLatCov23pos)+(FrontCov1_a:"
1144 "CBFrontCov1pos)+(RearCov11_a:CBRearCov11pos)+(RearCov12_a:CBRearCov12pos)+(RearCov13_a:CBRearCov13pos)");
1145 TGeoVolume *volCOLDBOXA = new TGeoVolume("volCOLDBOXA", COLDBOXA, Acrylic);
1146
1147 // ************************ BORATED POLYETHYLENE
1148 Double_t fCBFrontWallXDim_b = fCBFrontWallXDim - 2 * fAcrylicWidth - fBPolyWidth; // cm
1149 Double_t fCBFrontWallYDim_b = fCBFrontWallYDim - fBPolyWidth;
1150 Double_t fCBLatWallZDim_b = fCBLatWallZDim - 2 * fAcrylicWidth; // cm
1151 Double_t fCBExtraXDim_b = fCBExtraXDim - 2 * fAcrylicWidth; // cm
1152 Double_t fCBRearWallXDim_b = fCBRearWallXDim - fAcrylicWidth;
1153 // Shapes definition
1154 TGeoBBox *CBFrontWall_b = new TGeoBBox(
1155 "CBFrontWall_b", fCBFrontWallXDim_b / 2. + (fAcrylicWidth - fBPolyWidth) / 10., fCBFrontWallYDim_b / 2.,
1156 fBPolyWidth / 2.); // (fAcrylicWidth-fBPolyWidth)/10. is due to approximations, I guess
1157 TGeoBBox *CBLateral_b = new TGeoBBox("CBLateral_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1158 (fCBLatWallZDim - 2 * fBPolyWidth) / 2. - fAcrylicWidth);
1159 TGeoBBox *CBExtraFront_b =
1160 new TGeoBBox("CBExtraFront_b", fCBExtraXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1161 TGeoBBox *CBExtraLat_b = new TGeoBBox("CBExtraLat_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1162 (fCBExtraZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1163 TGeoBBox *CBTiny1_b = new TGeoBBox("CBTiny1_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1164 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1165 TGeoBBox *CBTiny2_b =
1166 new TGeoBBox("CBTiny2_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1167 TGeoBBox *CBRearWall_b =
1168 new TGeoBBox("CBRearWall_b", fCBRearWallXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1169 TGeoPara *CBWallSlope_b =
1170 new TGeoPara("CBWallSlope_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., fSlopedWallZProj / 2., 0, -15, 0);
1171
1172 // Coverings
1173 Double_t tanomega = (187.03 - 176.71) / 176.;
1174 Double_t LatCover1_bverts[8][2];
1175 LatCover1_bverts[0][0] = 0.;
1176 LatCover1_bverts[0][1] = 0.;
1177 LatCover1_bverts[1][0] = fBPolyWidth;
1178 LatCover1_bverts[1][1] = 0;
1179 LatCover1_bverts[2][0] = fBPolyWidth;
1180 LatCover1_bverts[2][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1181 LatCover1_bverts[3][0] = 0.;
1182 LatCover1_bverts[3][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1183
1184 LatCover1_bverts[4][0] = 0;
1185 LatCover1_bverts[4][1] = 0;
1186 LatCover1_bverts[5][0] = fBPolyWidth;
1187 LatCover1_bverts[5][1] = 0;
1188 LatCover1_bverts[6][0] = fBPolyWidth;
1189 LatCover1_bverts[6][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1190 LatCover1_bverts[7][0] = 0;
1191 LatCover1_bverts[7][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1192 TGeoArb8 *LatCov1_b = new TGeoArb8("LatCov1_b", 176. / 2. - fAcrylicWidth, (Double_t *)LatCover1_bverts);
1193
1194 Double_t LatCover21_bverts[8][2];
1195 LatCover21_bverts[0][0] = 0.;
1196 LatCover21_bverts[0][1] = 0.;
1197 LatCover21_bverts[1][0] = fBPolyWidth;
1198 LatCover21_bverts[1][1] = 0;
1199 LatCover21_bverts[2][0] = fBPolyWidth;
1200 LatCover21_bverts[2][1] = 0.; //-fAcrylicWidth*tanalpha;
1201 LatCover21_bverts[3][0] = 0.;
1202 LatCover21_bverts[3][1] = 0.; //-fAcrylicWidth*tanalpha;
1203
1204 LatCover21_bverts[4][0] = 0;
1205 LatCover21_bverts[4][1] = 0;
1206 LatCover21_bverts[5][0] = fBPolyWidth;
1207 LatCover21_bverts[5][1] = 0;
1208 LatCover21_bverts[6][0] = fBPolyWidth;
1209 LatCover21_bverts[6][1] = -fCBTinyZDim * tanalpha;
1210 LatCover21_bverts[7][0] = 0;
1211 LatCover21_bverts[7][1] = -fCBTinyZDim * tanalpha;
1212 TGeoArb8 *LatCov21_b = new TGeoArb8("LatCov21_b", (fCBTinyZDim - fAcrylicWidth) / 2., (Double_t *)LatCover21_bverts);
1213
1214 Double_t LatCover22_bverts[8][2];
1215 LatCover22_bverts[0][0] = 0.;
1216 LatCover22_bverts[0][1] = 0.;
1217 LatCover22_bverts[1][0] = fBPolyWidth;
1218 LatCover22_bverts[1][1] = 0;
1219 LatCover22_bverts[2][0] = fBPolyWidth;
1220 LatCover22_bverts[2][1] = -fCBTinyZDim * tanalpha;
1221 LatCover22_bverts[3][0] = 0.;
1222 LatCover22_bverts[3][1] = -fCBTinyZDim * tanalpha;
1223
1224 LatCover22_bverts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1225 LatCover22_bverts[4][1] = 0;
1226 LatCover22_bverts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1227 LatCover22_bverts[5][1] = 0;
1228 LatCover22_bverts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1229 LatCover22_bverts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1230 LatCover22_bverts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1231 LatCover22_bverts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1232 TGeoArb8 *LatCov22_b = new TGeoArb8("LatCov22_b", fSlopedWallZProj / 2., (Double_t *)LatCover22_bverts);
1233
1234 Double_t LatCover23_bverts[8][2];
1235 LatCover23_bverts[0][0] = 0.;
1236 LatCover23_bverts[0][1] = 0.;
1237 LatCover23_bverts[1][0] = fBPolyWidth;
1238 LatCover23_bverts[1][1] = 0;
1239 LatCover23_bverts[2][0] = fBPolyWidth;
1240 LatCover23_bverts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1241 LatCover23_bverts[3][0] = 0.;
1242 LatCover23_bverts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1243
1244 LatCover23_bverts[4][0] = 0;
1245 LatCover23_bverts[4][1] = 0;
1246 LatCover23_bverts[5][0] = fBPolyWidth;
1247 LatCover23_bverts[5][1] = 0;
1248 LatCover23_bverts[6][0] = fBPolyWidth;
1249 LatCover23_bverts[6][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1250 LatCover23_bverts[7][0] = 0;
1251 LatCover23_bverts[7][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1252 TGeoArb8 *LatCov23_b =
1253 new TGeoArb8("LatCov23_b", (fCBTinyZDim - fBPolyWidth - fAcrylicWidth) / 2., (Double_t *)LatCover23_bverts);
1254
1255 Double_t FrontCover1_bverts[8][2];
1256 FrontCover1_bverts[0][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1257 FrontCover1_bverts[0][1] = 0.;
1258 FrontCover1_bverts[1][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1259 FrontCover1_bverts[1][1] = -(fBPolyWidth)*tanbeta;
1260 FrontCover1_bverts[2][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1261 FrontCover1_bverts[2][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1262 FrontCover1_bverts[3][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1263 FrontCover1_bverts[3][1] = 0;
1264
1265 FrontCover1_bverts[4][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1266 FrontCover1_bverts[4][1] = 0;
1267 FrontCover1_bverts[5][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1268 FrontCover1_bverts[5][1] = -(fBPolyWidth)*tanbeta;
1269 FrontCover1_bverts[6][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1270 FrontCover1_bverts[6][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1271 FrontCover1_bverts[7][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1272 FrontCover1_bverts[7][1] = 0;
1273 TGeoArb8 *FrontCov1_b = new TGeoArb8("FrontCov1_b", fBPolyWidth / 2., (Double_t *)FrontCover1_bverts);
1274
1275 Double_t RearCover_11_bverts[8][2];
1276 RearCover_11_bverts[0][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1277 RearCover_11_bverts[0][1] = 0.;
1278 RearCover_11_bverts[1][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1279 RearCover_11_bverts[1][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha; // approx
1280 RearCover_11_bverts[2][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1281 RearCover_11_bverts[2][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1282 RearCover_11_bverts[3][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1283 RearCover_11_bverts[3][1] = 0;
1284
1285 RearCover_11_bverts[4][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1286 RearCover_11_bverts[4][1] = 0;
1287 RearCover_11_bverts[5][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1288 RearCover_11_bverts[5][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha; // approx
1289 RearCover_11_bverts[6][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1290 RearCover_11_bverts[6][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1291 RearCover_11_bverts[7][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1292 RearCover_11_bverts[7][1] = 0;
1293 TGeoArb8 *RearCov11_b = new TGeoArb8("RearCov11_b", fBPolyWidth / 2., (Double_t *)RearCover_11_bverts);
1294
1295 Double_t RearCover_12_bverts[8][2];
1296 RearCover_12_bverts[0][0] = fBPolyWidth/2.;
1297 RearCover_12_bverts[0][1] = 0.;
1298 RearCover_12_bverts[1][0] = fBPolyWidth/2.;
1299 RearCover_12_bverts[1][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1300 RearCover_12_bverts[2][0] = -fBPolyWidth/2.;
1301 RearCover_12_bverts[2][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1302 RearCover_12_bverts[3][0] = -fBPolyWidth/2.;
1303 RearCover_12_bverts[3][1] = 0;
1304
1305 RearCover_12_bverts[4][0] = fBPolyWidth/2.;
1306 RearCover_12_bverts[4][1] = 0;
1307 RearCover_12_bverts[5][0] = fBPolyWidth/2.;
1308 RearCover_12_bverts[5][1] = -(fCBRearWallXDim_b-fAcrylicWidth+extra)*tangamma;
1309 RearCover_12_bverts[6][0] = -fBPolyWidth/2.;
1310 RearCover_12_bverts[6][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1311 RearCover_12_bverts[7][0] = -fBPolyWidth/2.;
1312 RearCover_12_bverts[7][1] = 0;
1313 TGeoArb8 *RearCov12_b =
1314 new TGeoArb8("RearCov12_b", (fCBExtraZDim - fAcrylicWidth + fBPolyWidth) / 2., (Double_t *)RearCover_12_bverts);
1315
1316 Double_t RearCover_13_bverts[8][2];
1317 RearCover_13_bverts[0][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1318 RearCover_13_bverts[0][1] = 0.;
1319 RearCover_13_bverts[1][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1320 RearCover_13_bverts[1][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1321 RearCover_13_bverts[2][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1322 RearCover_13_bverts[2][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1323 RearCover_13_bverts[3][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1324 RearCover_13_bverts[3][1] = 0;
1325
1326 RearCover_13_bverts[4][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1327 RearCover_13_bverts[4][1] = 0;
1328 RearCover_13_bverts[5][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1329 RearCover_13_bverts[5][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1330 RearCover_13_bverts[6][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1331 RearCover_13_bverts[6][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1332 RearCover_13_bverts[7][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1333 RearCover_13_bverts[7][1] = 0;
1334 TGeoArb8 *RearCov13_b = new TGeoArb8("RearCov13_b", fBPolyWidth / 2., (Double_t *)RearCover_13_bverts);
1335
1336 // Borated Polyethylene mother shape definition
1337 TGeoTranslation *FrontWallpos_b = new TGeoTranslation(
1338 "FrontWallpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2. + 0.1, 0,
1339 -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth)); // +0.1 is due to approximations, I guess
1340 FrontWallpos_b->RegisterYourself();
1341 TGeoTranslation *Tiny1pos_b =
1342 new TGeoTranslation("Tiny1pos_b", fCBRearWallXDim_b / 2. + fBPolyWidth / 2., 0, -fBPolyWidth / 2.);
1343 Tiny1pos_b->RegisterYourself();
1344 TGeoTranslation *SlopeWallpos_b = new TGeoTranslation(
1345 "SlopeWallpos_b",
1346 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)) + fCBRearWallXDim_b / 2. + 3 * fBPolyWidth, 0,
1347 -fBPolyWidth / 2. - fSlopedWallZProj / 2. - (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1348 SlopeWallpos_b->RegisterYourself();
1349 TGeoTranslation *Tiny2pos_b = new TGeoTranslation("Tiny2pos_b",
1350 5 * fBPolyWidth + fCBRearWallXDim / 2. +
1351 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) -
1352 (fAcrylicWidth - fBPolyWidth) / 2.,
1353 0, -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth));
1354 Tiny2pos_b->RegisterYourself();
1355 TGeoTranslation *CBExtraLatpos_b = new TGeoTranslation("CBExtraLatpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth / 2.,
1356 0, (fCBExtraZDim - fAcrylicWidth) / 2.);
1357 CBExtraLatpos_b->RegisterYourself();
1358 TGeoTranslation *CBExtraFrontpos_b =
1359 new TGeoTranslation("CBExtraFrontpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth - fCBExtraXDim_b / 2., 0,
1360 fCBExtraZDim - fAcrylicWidth);
1361 CBExtraFrontpos_b->RegisterYourself();
1362 TGeoTranslation *CBLateralpos_b =
1363 new TGeoTranslation("CBLateralpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fBPolyWidth / 2.,
1364 0, fCBExtraZDim - fCBLatWallZDim_b / 2. + fBPolyWidth / 2. - fAcrylicWidth);
1365 CBLateralpos_b->RegisterYourself();
1366 TGeoTranslation *CBLatCov1pos_b = new TGeoTranslation(
1367 "CBLatCov1pos_b", -fCBRearWallXDim / 2. - fCBExtraXDim + 2 * fAcrylicWidth + fBPolyWidth + fAcrylicWidth / 2.,
1368 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fCBLatWallZDim / 2. + fAcrylicWidth / 2 - 0.5);
1369 CBLatCov1pos_b->RegisterYourself();
1370 TGeoTranslation *CBLatCov21pos_b =
1371 new TGeoTranslation("CBLatCov21pos_b",
1372 3 * fAcrylicWidth + fCBRearWallXDim / 2. +
1373 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) + fBPolyWidth / 2. + 0.4,
1374 -fCBFrontWallYDim_b / 2.,
1375 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. +
1376 fBPolyWidth + fAcrylicWidth - 0.5);
1377 CBLatCov21pos_b->RegisterYourself();
1378 TGeoTranslation *CBLatCov22pos_b = new TGeoTranslation(
1379 "CBLatCov22pos_b",
1380 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) +
1381 fBPolyWidth / 2. + 0.4,
1382 -fCBFrontWallYDim_b / 2.,
1383 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1384 fAcrylicWidth / 2. + fCBTinyZDim / 2. + fAcrylicWidth - 0.5);
1385 CBLatCov22pos_b->RegisterYourself();
1386 TGeoTranslation *CBLatCov23pos_b = new TGeoTranslation(
1387 "CBLatCov23pos_b", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2. + fBPolyWidth / 2. + 0.5,
1388 -fCBFrontWallYDim_b / 2., -fCBTinyZDim / 2. + fBPolyWidth + fBPolyWidth / 2. + 0.5);
1389 CBLatCov23pos_b->RegisterYourself();
1390 TGeoTranslation *CBFrontCov1pos_b = new TGeoTranslation(
1391 "CBFrontCov1pos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2.,
1392 -fCBFrontWallYDim_b / 2., -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
1393 CBFrontCov1pos_b->RegisterYourself();
1394 TGeoTranslation *CBRearCov11pos_b =
1395 new TGeoTranslation("CBRearCov11pos_b", +fBPolyWidth / 2., -fCBFrontWallYDim_b / 2., 0);
1396 CBRearCov11pos_b->RegisterYourself();
1397 TGeoTranslation *CBRearCov12pos_b =
1398 new TGeoTranslation("CBRearCov12pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth / 2. - 0.5,
1399 -fCBFrontWallYDim_b / 2., fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1400 CBRearCov12pos_b->RegisterYourself();
1401 TGeoTranslation *CBRearCov13pos_b =
1402 new TGeoTranslation("CBRearCov13pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth - fCBExtraXDim / 2 + fBPolyWidth,
1403 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fAcrylicWidth);
1404 CBRearCov13pos_b->RegisterYourself();
1405
1406 // Borated Polyethylene mother volume definition
1407 TGeoCompositeShape *COLDBOXB = new TGeoCompositeShape(
1408 "COLDBOXB", "CBRearWall_b+(CBTiny1_b:Tiny1pos_b)+(CBExtraLat_b:CBExtraLatpos_b)+(CBWallSlope_b:SlopeWallpos_b)+("
1409 "CBTiny2_b:Tiny2pos_b)+(CBExtraFront_b:CBExtraFrontpos_b)+(CBLateral_b:CBLateralpos_b)+(CBFrontWall_"
1410 "b:FrontWallpos_b)+(LatCov1_b:CBLatCov1pos_b)+(LatCov21_b:CBLatCov21pos_b)+(LatCov22_b:CBLatCov22pos_"
1411 "b)+(LatCov23_b:CBLatCov23pos_b)+(FrontCov1_b:CBFrontCov1pos_b)+(RearCov11_b:CBRearCov11pos_b)+("
1412 "RearCov12_b:CBRearCov12pos_b)+(RearCov13_b:CBRearCov13pos_b)");
1413 TGeoVolume *volCOLDBOXB = new TGeoVolume("volCOLDBOXB", COLDBOXB, Bor30Poly);
1414
1415 // Acrylic Roof shape definition
1416 Double_t Roof4_averts[8][2];
1417 Roof4_averts[0][0] = 0.;
1418 Roof4_averts[0][1] = 0.;
1419 Roof4_averts[1][0] = 0.;
1420 Roof4_averts[1][1] = fAcrylicWidth;
1421 Roof4_averts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1422 Roof4_averts[2][1] = fAcrylicWidth;
1423 Roof4_averts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1424 Roof4_averts[3][1] = 0;
1425 Roof4_averts[4][0] = 0;
1426 Roof4_averts[4][1] = 0;
1427 Roof4_averts[5][0] = 0;
1428 Roof4_averts[5][1] = fAcrylicWidth;
1429 Roof4_averts[6][0] = 0;
1430 Roof4_averts[6][1] = fAcrylicWidth;
1431 Roof4_averts[7][0] = 0;
1432 Roof4_averts[7][1] = 0;
1433
1434 TGeoBBox *CBRoof1_a = new TGeoBBox("CBRoof1_a", fCBExtraXDim / 2., fAcrylicWidth / 2., fCBLatWallZDim / 2.);
1435 TGeoBBox *CBRoof2_a = new TGeoBBox("CBRoof2_a", (fCBRearWallXDim - fAcrylicWidth) / 2., fAcrylicWidth / 2.,
1436 (fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2.);
1437 TGeoBBox *CBRoof3_a = new TGeoBBox("CBRoof3_a", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1438 fAcrylicWidth / 2., fCBTinyZDim / 2.);
1439 TGeoArb8 *CBRoof4_a = new TGeoArb8("CBRoof4_a", fSlopedWallZProj / 2., (Double_t *)Roof4_averts);
1440
1441 TGeoTranslation *Roof1_apos =
1442 new TGeoTranslation("Roof1_apos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim / 2., 0,
1443 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1444 Roof1_apos->RegisterYourself();
1445 TGeoTranslation *Roof3_apos = new TGeoTranslation(
1446 "Roof3_apos",
1447 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1448 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim / 2.);
1449 Roof3_apos->RegisterYourself();
1450 TGeoTranslation *Roof4_apos =
1451 new TGeoTranslation("Roof4_apos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fAcrylicWidth / 2.,
1452 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim + fSlopedWallZProj / 2.);
1453 Roof4_apos->RegisterYourself();
1454
1455 // Acrylic roof volume definition
1456 TGeoCompositeShape *CBRoof_a = new TGeoCompositeShape(
1457 "CBRoof_a", "CBRoof2_a+(CBRoof1_a:Roof1_apos)+(CBRoof3_a:Roof3_apos)+(CBRoof4_a:Roof4_apos)");
1458 TGeoVolume *volCBRoof_a = new TGeoVolume("volCBRoof_a", CBRoof_a, Acrylic);
1459
1460 // Borated Polythylene Roof shape definition
1461 Double_t Roof4_bverts[8][2];
1462 Roof4_bverts[0][0] = 0.;
1463 Roof4_bverts[0][1] = 0.;
1464 Roof4_bverts[1][0] = 0.;
1465 Roof4_bverts[1][1] = fBPolyWidth;
1466 Roof4_bverts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1467 Roof4_bverts[2][1] = fBPolyWidth;
1468 Roof4_bverts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1469 Roof4_bverts[3][1] = 0;
1470 Roof4_bverts[4][0] = 0;
1471 Roof4_bverts[4][1] = 0;
1472 Roof4_bverts[5][0] = 0;
1473 Roof4_bverts[5][1] = fBPolyWidth;
1474 Roof4_bverts[6][0] = 0;
1475 Roof4_bverts[6][1] = fBPolyWidth;
1476 Roof4_bverts[7][0] = 0;
1477 Roof4_bverts[7][1] = 0;
1478
1479 TGeoBBox *CBRoof1_b = new TGeoBBox("CBRoof1_b", fCBExtraXDim_b / 2., fBPolyWidth / 2., fCBLatWallZDim_b / 2.);
1480 TGeoBBox *CBRoof2_b = new TGeoBBox("CBRoof2_b", (fCBRearWallXDim_b - fBPolyWidth) / 2. + fBPolyWidth / 2.,
1481 fBPolyWidth / 2., (fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2.);
1482 TGeoBBox *CBRoof3_b = new TGeoBBox("CBRoof3_b", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1483 fBPolyWidth / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1484 TGeoArb8 *CBRoof4_b = new TGeoArb8("CBRoof4_b", fSlopedWallZProj / 2., (Double_t *)Roof4_bverts);
1485
1486 TGeoTranslation *Roof1_bpos =
1487 new TGeoTranslation("Roof1_bpos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim_b / 2., 0,
1488 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1489 Roof1_bpos->RegisterYourself();
1490 TGeoTranslation *Roof3_bpos = new TGeoTranslation(
1491 "Roof3_bpos",
1492 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1493 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + (fCBTinyZDim - fAcrylicWidth) / 2.);
1494 Roof3_bpos->RegisterYourself();
1495 TGeoTranslation *Roof4_bpos = new TGeoTranslation(
1496 "Roof4_bpos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fBPolyWidth / 2.,
1497 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim - fAcrylicWidth + fSlopedWallZProj / 2.);
1498 Roof4_bpos->RegisterYourself();
1499
1500 // Borated Polyethylene volume definition
1501 TGeoCompositeShape *CBRoof_b = new TGeoCompositeShape(
1502 "CBRoof_b", "CBRoof2_b+(CBRoof1_b:Roof1_bpos)+(CBRoof3_b:Roof3_bpos)+(CBRoof4_b:Roof4_bpos)");
1503 TGeoVolume *volCBRoof_b = new TGeoVolume("volCBRoof_b", CBRoof_b, Bor30Poly);
1504
1505 // Volumes positioning
1506 TGeoVolumeAssembly *volColdBox = new TGeoVolumeAssembly("volColdBox");
1507 volCOLDBOXA->SetLineColor(kGray - 1);
1508 volCOLDBOXA->SetTransparency(60);
1509 volCOLDBOXB->SetLineColor(kGray - 1);
1510 volCOLDBOXB->SetTransparency(60);
1511 volCBRoof_a->SetLineColor(kGray - 1);
1512 volCBRoof_a->SetTransparency(60);
1513 volCBRoof_b->SetLineColor(kGray - 1);
1514 volCBRoof_b->SetTransparency(60);
1515
1516 volColdBox->AddNode(volCOLDBOXA, 0, 0);
1517 volColdBox->AddNode(volCOLDBOXB, 0,
1518 new TGeoTranslation(-fBPolyWidth - fAcrylicWidth / 2., -fBPolyWidth / 2.,
1519 -fAcrylicWidth / 2. - fBPolyWidth / 2.));
1520 volColdBox->AddNode(volCBRoof_a, 0,
1521 new TGeoTranslation(fAcrylicWidth / 2., fCBFrontWallYDim / 2. + fAcrylicWidth / 2.,
1522 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1523 volColdBox->AddNode(volCBRoof_b, 0,
1524 new TGeoTranslation(-fAcrylicWidth / 2., fCBFrontWallYDim / 2. - fBPolyWidth / 2.,
1525 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1526
1527 displacement =
1528 TVector3(-37.79 - 1.40082, 44.66,
1529 368.11); // taken from MuFilter.cxx "edge_Iron[1]-TVector3(FeX, FeY, FeZ)" EDIT: 1.40082 for overlap fix
1530 tunnel->AddNode(volColdBox, 0,
1531 new TGeoTranslation(displacement.X() - (fCBRearWallXDim - fFeBlockX) / 2. + 28.5,
1532 displacement.Y() - (fCBFrontWallYDim - fFeBlockY) / 2. + 121,
1533 displacement.Z() + fAcrylicWidth - fFeBlockZ / 2. - fBPolyWidth + 1.));
1534
1535if (SND_Z<0.1){ // for H6 and H8 testbeam setup
1536 top->AddNode(detector, 0);
1537 }else{
1538 top->AddNode(detector, 0,localSND_physCS_comb);
1539 top->AddNode(tunnel , 1,new TGeoTranslation(fTunnelDX,fTunnelDY,fTunnelDZ));
1540 }
1541
1542}
std::map< TString, Float_t > conf_floats
Definition Floor.h:81
TVector3 crossing(TVector3 H1, TVector3 H2, TVector3 H3, TVector3 P1, TVector3 P2, TVector3 P3)
Definition Floor.cxx:143
Double_t SND_Z
Definition Floor.h:98
Int_t InitMedium(const char *name)
Definition Floor.cxx:123
int i
Definition ShipAna.py:86
origin(sTree, it)
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

◆ CopyClones()

virtual void Floor::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
inlinevirtual

Definition at line 54 of file Floor.h.

55 {;}

◆ crossing()

TVector3 Floor::crossing ( TVector3  H1,
TVector3  H2,
TVector3  H3,
TVector3  P1,
TVector3  P2,
TVector3  P3 
)

Definition at line 143 of file Floor.cxx.

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}

◆ EndOfEvent()

void Floor::EndOfEvent ( )
virtual

Definition at line 98 of file Floor.cxx.

99{
100 fFloorPointCollection->Clear();
101 fTotalEloss=0;
102}

◆ FinishPrimary()

virtual void Floor::FinishPrimary ( )
inlinevirtual

Definition at line 58 of file Floor.h.

58{;}

◆ FinishRun()

virtual void Floor::FinishRun ( )
inlinevirtual

Definition at line 59 of file Floor.h.

59{;}

◆ GetCollection()

TClonesArray * Floor::GetCollection ( Int_t  iColl) const
virtual

Gets the produced collections

Definition at line 1563 of file Floor.cxx.

1564{
1565 if (iColl == 0) { return fFloorPointCollection; }
1566 else { return NULL; }
1567}

◆ GetConfParF()

Float_t Floor::GetConfParF ( TString  name)
inline

Definition at line 31 of file Floor.h.

31{return conf_floats[name];}

◆ GetConfParI()

Int_t Floor::GetConfParI ( TString  name)
inline

Definition at line 32 of file Floor.h.

32{return conf_ints[name];}
std::map< TString, Int_t > conf_ints
Definition Floor.h:82

◆ GetConfParS()

TString Floor::GetConfParS ( TString  name)
inline

Definition at line 33 of file Floor.h.

33{return conf_strings[name];}
std::map< TString, TString > conf_strings
Definition Floor.h:83

◆ Initialize()

void Floor::Initialize ( )
virtual

Initialization of the detector is done here

Definition at line 118 of file Floor.cxx.

119{
120 FairDetector::Initialize();
121}

◆ InitMedium()

Int_t Floor::InitMedium ( const char *  name)

Definition at line 123 of file Floor.cxx.

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}

◆ MakeSensitive()

void Floor::MakeSensitive ( )
inline

Definition at line 73 of file Floor.h.

73{fMakeSensitive=true;} // make Tunnel sensitive

◆ PostTrack()

virtual void Floor::PostTrack ( )
inlinevirtual

Definition at line 61 of file Floor.h.

61{;}

◆ PreTrack()

void Floor::PreTrack ( )
virtual

Definition at line 104 of file Floor.cxx.

104 {
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}

◆ ProcessHits()

Bool_t Floor::ProcessHits ( FairVolume *  v = 0)
virtual

this method is called for each step during simulation (see FairMCApplication::Stepping())

This method is called from the MC stepping

Definition at line 58 of file Floor.cxx.

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}
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:1544
Double_t fELoss
thickness
Definition Floor.h:93

◆ Register()

void Floor::Register ( )
virtual

Registers the produced collections in FAIRRootManager.

Definition at line 1556 of file Floor.cxx.

1557{
1558
1559 FairRootManager::Instance()->Register("vetoPoint", "veto",
1560 fFloorPointCollection, kTRUE);
1561}

◆ Reset()

void Floor::Reset ( )
virtual

has to be called after each event to reset the containers

Definition at line 1568 of file Floor.cxx.

1569{
1570 fFloorPointCollection->Clear();
1571}

◆ SetConfPar() [1/3]

void Floor::SetConfPar ( TString  name,
Float_t  value 
)
inline

Definition at line 28 of file Floor.h.

28{conf_floats[name]=value;}

◆ SetConfPar() [2/3]

void Floor::SetConfPar ( TString  name,
Int_t  value 
)
inline

Definition at line 29 of file Floor.h.

29{conf_ints[name]=value;}

◆ SetConfPar() [3/3]

void Floor::SetConfPar ( TString  name,
TString  value 
)
inline

Definition at line 30 of file Floor.h.

30{conf_strings[name]=value;}

◆ SetEmin()

void Floor::SetEmin ( float  E)
inline

Definition at line 70 of file Floor.h.

70{fEmin = E;} // set min kin energy for tracking

◆ SetFastMuon()

void Floor::SetFastMuon ( )
inline

Definition at line 72 of file Floor.h.

72{fFastMuon=true;} // kill all tracks except of muons

◆ SetSpecialPhysicsCuts()

virtual void Floor::SetSpecialPhysicsCuts ( )
inlinevirtual

Definition at line 56 of file Floor.h.

56{;}

◆ SetZmax()

void Floor::SetZmax ( float  Z)
inline

Definition at line 71 of file Floor.h.

71{fzPos = Z;} // set max z position for which energy cut is applied.

Member Data Documentation

◆ conf_floats

std::map<TString,Float_t> Floor::conf_floats
private

configuration parameters

Definition at line 81 of file Floor.h.

◆ conf_ints

std::map<TString,Int_t> Floor::conf_ints
private

Definition at line 82 of file Floor.h.

◆ conf_strings

std::map<TString,TString> Floor::conf_strings
private

Definition at line 83 of file Floor.h.

◆ fELoss

Double_t Floor::fELoss
private

thickness

Definition at line 93 of file Floor.h.

◆ fEmin

Float_t Floor::fEmin
private

Definition at line 100 of file Floor.h.

◆ fFastMuon

Bool_t Floor::fFastMuon
private

Definition at line 99 of file Floor.h.

◆ fFloorPointCollection

TClonesArray* Floor::fFloorPointCollection
private

material

container for data points

Definition at line 97 of file Floor.h.

◆ fLength

Double_t Floor::fLength
private

time

Definition at line 90 of file Floor.h.

◆ fMakeSensitive

Bool_t Floor::fMakeSensitive
private

Definition at line 101 of file Floor.h.

◆ fMaterial

TString Floor::fMaterial
private

Definition at line 95 of file Floor.h.

◆ fMom

TLorentzVector Floor::fMom
private

position at entrance

Definition at line 88 of file Floor.h.

◆ fPos

TLorentzVector Floor::fPos
private

volume id

Definition at line 87 of file Floor.h.

◆ fThick

Double_t Floor::fThick
private

zPos

Definition at line 92 of file Floor.h.

◆ fTime

Double_t Floor::fTime
private

momentum at entrance

Definition at line 89 of file Floor.h.

◆ fTotalEloss

Double_t Floor::fTotalEloss
private

Definition at line 94 of file Floor.h.

◆ fTrackID

Int_t Floor::fTrackID
private

Definition at line 85 of file Floor.h.

◆ fVolumeID

Int_t Floor::fVolumeID
private

track index

Definition at line 86 of file Floor.h.

◆ fzPos

Double_t Floor::fzPos
private

length

Definition at line 91 of file Floor.h.

◆ SND_Z

Double_t Floor::SND_Z
private

Definition at line 98 of file Floor.h.


The documentation for this class was generated from the following files: