Skip to content

Commit a0f0a79

Browse files
authored
Merge pull request #29 from olantwin/floor_definition
Define floor using geometry_config.py
2 parents 56eff92 + 93bb049 commit a0f0a79

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

passive/ShipMuonShield.cxx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ ShipMuonShield::ShipMuonShield()
3939

4040
ShipMuonShield::ShipMuonShield(const char* name, const Int_t Design, const char* Title,
4141
Double_t Z, Double_t L0, Double_t L1, Double_t L2, Double_t L3, Double_t L4, Double_t L5, Double_t L6,
42-
Double_t L7, Double_t L8, Double_t gap, Double_t LE, Double_t y, Double_t fl)
42+
Double_t L7, Double_t L8, Double_t gap, Double_t LE, Double_t y, Double_t floor, Double_t field)
4343
: FairModule(name ,Title)
4444
{
4545
fDesign = Design;
46-
fField = fl;
46+
fField = field;
4747
if (fDesign==1){
4848
fMuonShieldLength = L1;
4949
}
@@ -77,6 +77,8 @@ ShipMuonShield::ShipMuonShield(const char* name, const Int_t Design, const char*
7777
2 * (dZ1 + dZ2 + dZ3 + dZ4 + dZ5 + dZ6 + dZ7 + dZ8) + LE;
7878
}
7979

80+
fFloor = (fDesign == 7) ? floor : 0;
81+
8082
zEndOfAbsorb = Z + dZ0 - fMuonShieldLength/2.;
8183
if(fDesign==6||fDesign==7){zEndOfAbsorb = Z - fMuonShieldLength/2.;}
8284
fY = y;
@@ -475,14 +477,13 @@ void ShipMuonShield::ConstructGeometry()
475477
// TODO split out into function/method?
476478
Double_t dymax = std::max(dYIn[nM] + dXIn[nM], dYOut[nM] + dXOut[nM]);
477479
Double_t dymin = std::min(dYIn[nM] + dXIn[nM], dYOut[nM] + dXOut[nM]);
478-
Double_t floor = -5. * m; // TODO use same variable for floor definition
479480
Double_t slope =
480481
(dYIn[nM] + dXIn[nM] - dYOut[nM] - dXOut[nM]) / (2 * dZf[nM]);
481482
Double_t w1 = 2 * dXIn[nM] + std::max(20., gapIn[nM]);
482483
Double_t w2 = 2 * dXOut[nM] + std::max(20., gapOut[nM]);
483484
Double_t anti_overlap = 0.1;
484-
Double_t h1 = 0.5 * (floor + dYIn[nM] + dXIn[nM] + anti_overlap);
485-
Double_t h2 = 0.5 * (floor + dYOut[nM] + dXOut[nM] + anti_overlap);
485+
Double_t h1 = 0.5 * (dYIn[nM] + dXIn[nM] + anti_overlap - fFloor);
486+
Double_t h2 = 0.5 * (dYOut[nM] + dXOut[nM] + anti_overlap - fFloor);
486487
std::vector<Double_t> verticesIn = {
487488
-w1, -h1,
488489
+w1, -h1,
@@ -512,10 +513,10 @@ void ShipMuonShield::ConstructGeometry()
512513
pillar1->SetLineColor(kGreen-5);
513514
pillar2->SetLineColor(kGreen-5);
514515
tShield->AddNode(pillar1, 1, new TGeoTranslation(
515-
0, -0.5 * (dYIn[nM] + dXIn[nM] - floor),
516+
0, -0.5 * (dYIn[nM] + dXIn[nM] + fFloor),
516517
Z[nM] - dZf[nM] + 0.5 * m));
517518
tShield->AddNode(pillar2, 1, new TGeoTranslation(
518-
0, -0.5 * (dYOut[nM] + dXOut[nM] - floor),
519+
0, -0.5 * (dYOut[nM] + dXOut[nM] + fFloor),
519520
Z[nM] + dZf[nM] - 0.5 * m));
520521
}
521522

@@ -552,15 +553,16 @@ void ShipMuonShield::ConstructGeometry()
552553
Double_t dZD = 100*m + fMuonShieldLength;
553554
TGeoBBox *box3 = new TGeoBBox("box3", 15*m, 15*m,dZD/2.);
554555
TGeoBBox *box4 = new TGeoBBox("box4", 10*m, 10*m,dZD/2.);
555-
// cover also Tau nu area
556+
556557
if (fDesign == 7) {
557-
TGeoBBox *box5 = new TGeoBBox("shield_floor", 10 * m, 2.5 * m,
558+
// Only add floor for new shield
559+
TGeoBBox *box5 = new TGeoBBox("shield_floor", 10 * m, fFloor / 2.,
558560
fMuonShieldLength / 2.);
559561
TGeoVolume *floor = new TGeoVolume("floorM", box5, concrete);
560562
floor->SetLineColor(11); // grey
561-
top->AddNode(floor, 1,
562-
new TGeoTranslation(
563-
0, -7.5 * m, zEndOfAbsorb + fMuonShieldLength / 2.));
563+
top->AddNode(floor, 1, new TGeoTranslation(0, -10 * m + fFloor / 2.,
564+
zEndOfAbsorb +
565+
fMuonShieldLength / 2.));
564566
}
565567
TGeoCompositeShape *compRockD =
566568
new TGeoCompositeShape("compRockD", "(box3-box4)");

passive/ShipMuonShield.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ class ShipMuonShield : public FairModule
1717
public:
1818
ShipMuonShield(const char* name, const Int_t Design=1, const char* Title="ShipMuonShield",
1919
Double_t Z=0, Double_t L0=0, Double_t L1=0, Double_t L2=0, Double_t L3=0, Double_t L4=0, Double_t L5=0, Double_t L6=0,
20-
Double_t L7=0, Double_t L8=0,Double_t gap=0,Double_t LE=0,Double_t y=400,Double_t fl=1.8);
20+
Double_t L7=0, Double_t L8=0,Double_t gap=0,Double_t LE=0,Double_t y=400, Double_t floor=500, Double_t field=1.8);
21+
2122
ShipMuonShield();
2223
virtual ~ShipMuonShield();
2324
void ConstructGeometry();
24-
ClassDef(ShipMuonShield,3)
25+
ClassDef(ShipMuonShield,4)
2526

2627
protected:
2728

2829
Int_t fDesign; // design of muon shield, 1=passive, active = ...
29-
Double_t fMuonShieldLength,fY,fField ;
30+
Double_t fMuonShieldLength,fY,fField;
31+
Double_t fFloor;
3032
Double_t dZ0,dZ1,dZ2,dZ3,dZ4,dZ5,dZ6,dZ7,dZ8,dXgap,zEndOfAbsorb,mag4Gap,midGapOut7,midGapOut8;
3133
Int_t InitMedium(const char* name);
3234

python/shipDet_conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def configure(run,ship_geo):
7676
if not hasattr(ship_geo.Bfield,'x') : ship_geo.Bfield.x = 3.*u.m
7777
if not hasattr(ship_geo,'cave') :
7878
ship_geo.cave = AttrDict(z=0*u.cm)
79+
ship_geo.cave.floorHeightMuonShield = 5*u.m
7980
ship_geo.cave.floorHeightTankA = 4.5*u.m
8081
ship_geo.cave.floorHeightTankB = 2.*u.m
8182
latestShipGeo = ConfigRegistry.loadpy("$FAIRSHIP/geometry/geometry_config.py",Yheight = ship_geo.Yheight/u.m, tankDesign = ship_geo.tankDesign, muShieldDesign = ship_geo.muShieldDesign)
@@ -114,7 +115,7 @@ def configure(run,ship_geo):
114115
elif ship_geo.muShieldDesign==3 or ship_geo.muShieldDesign==4 or ship_geo.muShieldDesign==5 or ship_geo.muShieldDesign==6 or ship_geo.muShieldDesign==7 :
115116
MuonShield = ROOT.ShipMuonShield("MuonShield",ship_geo.muShieldDesign,"ShipMuonShield",ship_geo.muShield.z,ship_geo.muShield.dZ0,ship_geo.muShield.dZ1,\
116117
ship_geo.muShield.dZ2,ship_geo.muShield.dZ3,ship_geo.muShield.dZ4,ship_geo.muShield.dZ5,ship_geo.muShield.dZ6,\
117-
ship_geo.muShield.dZ7,ship_geo.muShield.dZ8,ship_geo.muShield.dXgap,ship_geo.muShield.LE,ship_geo.Yheight*4./10.)
118+
ship_geo.muShield.dZ7,ship_geo.muShield.dZ8,ship_geo.muShield.dXgap,ship_geo.muShield.LE,ship_geo.Yheight*4./10., ship_geo.cave.floorHeightMuonShield)
118119

119120
detectorList.append(MuonShield)
120121

0 commit comments

Comments
 (0)