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

#include <ShipTargetStation.h>

Inheritance diagram for ShipTargetStation:
Collaboration diagram for ShipTargetStation:

Public Member Functions

 ShipTargetStation (const char *name, const Double_t tl, const Double_t al, const Double_t tz, const Double_t az, const int nS, const Double_t sl, const char *Title="ShipTargetStation")
 
 ShipTargetStation (const char *name, const Double_t tl, const Double_t tz, const int nS, const Double_t sl, const char *Title="ShipTargetStation")
 
 ShipTargetStation ()
 
virtual ~ShipTargetStation ()
 
void ConstructGeometry ()
 
void SetLayerPosMat (Float_t d, std::vector< float > L, std::vector< std::string > M)
 
Int_t InitMedium (const char *name)
 

Public Attributes

ClassDef(ShipTargetStation, 4) protected Double_t fAbsorberLength
 
Double_t fAbsorberZ
 
Double_t fTargetZ
 
Double_t fDiameter
 
std::vector< float > fL
 
std::vector< std::string > fM
 
Int_t fnS
 
Double_t fsl
 

Detailed Description

Definition at line 9 of file ShipTargetStation.h.

Constructor & Destructor Documentation

◆ ShipTargetStation() [1/3]

ShipTargetStation::ShipTargetStation ( const char *  name,
const Double_t  tl,
const Double_t  al,
const Double_t  tz,
const Double_t  az,
const int  nS,
const Double_t  sl,
const char *  Title = "ShipTargetStation" 
)

Definition at line 33 of file ShipTargetStation.cxx.

35 : FairModule(name ,Title)
36{
37 fTargetLength = tl;
38 fAbsorberLength = al;
39 fAbsorberZ = az;
40 fTargetZ = tz;
41 fnS = nS;
42 fsl = sl;
43}
ClassDef(ShipTargetStation, 4) protected Double_t fAbsorberLength

◆ ShipTargetStation() [2/3]

ShipTargetStation::ShipTargetStation ( const char *  name,
const Double_t  tl,
const Double_t  tz,
const int  nS,
const Double_t  sl,
const char *  Title = "ShipTargetStation" 
)

Definition at line 45 of file ShipTargetStation.cxx.

47 : FairModule(name ,Title)
48{
49 fTargetLength = tl;
50 fAbsorberLength = 0;
51 fAbsorberZ = 0;
52 fTargetZ = tz;
53 fnS = nS;
54 fsl = sl;
55}

◆ ShipTargetStation() [3/3]

ShipTargetStation::ShipTargetStation ( )

Definition at line 28 of file ShipTargetStation.cxx.

29 : FairModule("ShipTargetStation", "")
30{
31}

◆ ~ShipTargetStation()

ShipTargetStation::~ShipTargetStation ( )
virtual

Definition at line 25 of file ShipTargetStation.cxx.

26{
27}

Member Function Documentation

◆ ConstructGeometry()

void ShipTargetStation::ConstructGeometry ( )

Definition at line 78 of file ShipTargetStation.cxx.

79{
80 TGeoVolume *top=gGeoManager->GetTopVolume();
81 InitMedium("tungsten");
82 TGeoMedium *tungsten =gGeoManager->GetMedium("tungsten");
83
84 InitMedium("iron");
85 TGeoMedium *iron =gGeoManager->GetMedium("iron");
86 InitMedium("H2O");
87 TGeoMedium *water =gGeoManager->GetMedium("H2O");
88 InitMedium("molybdenum");
89 TGeoMedium *mo =gGeoManager->GetMedium("molybdenum");
90 TGeoVolume *tTarget = new TGeoVolumeAssembly("TargetArea");
91
92 Double_t zPos = 0.;
93 Int_t slots = fnS;
94 slots = slots-1;
95
96 if (fnS > 10){
97 TGeoVolume *target;
98 TGeoVolume *slit;
99 //Double_t zPos = fTargetZ - fTargetLength/2.;
100 for (Int_t i=0; i<fnS; i++) {
101 TString nmi = "Target_"; nmi += i+1;
102 TString sm = "Slit_"; sm += i+1;
103 TGeoMedium *material;
104 if (fM.at(i)=="molybdenum") {material = mo;};
105 if (fM.at(i)=="tungsten") {material = tungsten;};
106
107
108 if (fnS == 18) { // new target layout
109 target = gGeoManager->MakeTube(nmi, material, 0., fDiameter/2., fL.at(i)/2.);
110 }
111 else {
112 target = gGeoManager->MakeBox(nmi, material, fDiameter/2., fDiameter/2., fL.at(i)/2.);
113 }
114 if (fM.at(i)=="molybdenum") {
115 target->SetLineColor(28);
116 } else {target->SetLineColor(38);}; // silver/blue
117 tTarget->AddNode(target, 1, new TGeoTranslation(0, 0, zPos + fL.at(i)/2.) );
118 if (i < slots){
119 if(fnS == 18) {
120 slit = gGeoManager->MakeTube(sm, water, 0., fDiameter/2., fsl/2.);
121 }
122 else {
123 slit = gGeoManager->MakeBox(sm, water, fDiameter/2., fDiameter/2., fsl/2.);
124 }
125 slit->SetLineColor(7); // cyan
126 tTarget->AddNode(slit, 1, new TGeoTranslation(0, 0, zPos+fL.at(i)+fsl/2.) );
127 zPos+=fL.at(i)+fsl;
128 } else {
129 zPos+=fL.at(i);
130 }
131 }
132 }else if(fnS > 0){
133 Double_t dZ = (fTargetLength - (fnS-1)*fsl)/float(fnS);
134 // target made of tungsten and air slits
135 for (Int_t i=0; i<fnS-1; i++) {
136 TString nmi = "Target_"; nmi += i;
137 TString sm = "Slit_"; sm += i;
138 TGeoVolume *target = gGeoManager->MakeTube(nmi, tungsten, 0, 25, dZ/2.);
139 target->SetLineColor(38); // silver/blue
140 tTarget->AddNode(target, 1, new TGeoTranslation(0, 0, zPos+dZ/2.));
141 TGeoVolume *slit = gGeoManager->MakeTube(sm, water, 0, 25, fsl/2.);
142 slit->SetLineColor(7); // cyan
143 tTarget->AddNode(slit, 1, new TGeoTranslation(0, 0, zPos+dZ+fsl/2.));
144 zPos+=dZ+fsl;
145 }
146 TString nmi = "Target_"; nmi += fnS;
147 TGeoVolume *target = gGeoManager->MakeTube(nmi, tungsten, 0, 25, dZ/2.);
148 target->SetLineColor(38); // silver/blue
149 tTarget->AddNode(target, 1, new TGeoTranslation(0, 0, zPos+dZ/2.));
150 }
151 else{
152 // target made of solid tungsten
153 TGeoVolume *target = gGeoManager->MakeTube("Target", tungsten, 0, 25, fTargetLength/2.);
154 target->SetLineColor(38); // silver/blue
155 tTarget->AddNode(target, 1, new TGeoTranslation(0, 0, fTargetZ));
156 }
157
158 if (fAbsorberLength>0){ // otherwise, magnetized hadron absorber defined in ShipMuonShield.cxx
159 zPos = fTargetZ - fTargetLength/2.;
160 // Absorber made of iron
161 TGeoVolume *absorber;
162 absorber = gGeoManager->MakeTube("Absorber", iron, 0, 400, fAbsorberLength/2.); // 1890
163 absorber->SetLineColor(42); // brown / light red
164 tTarget->AddNode(absorber, 1, new TGeoTranslation(0, 0, fAbsorberZ-zPos));
165 }
166 // put iron shielding around target
167 if (fnS > 10){
168 Float_t xTot = 400./2.; // all in cm
169 Float_t yTot = 400./2.;
170 Float_t spaceTopBot = 10.;
171 Float_t spaceSide = 5.;
172 TGeoVolume *moreShieldingTopBot = gGeoManager->MakeBox("moreShieldingTopBot", iron, xTot, yTot/2., fTargetLength/2.);
173 moreShieldingTopBot->SetLineColor(33);
174 tTarget->AddNode(moreShieldingTopBot, 1, new TGeoTranslation(0., fDiameter/2. +spaceTopBot+yTot/2.,fTargetLength/2.));
175 tTarget->AddNode(moreShieldingTopBot, 2, new TGeoTranslation(0.,-fDiameter/2. -spaceTopBot-yTot/2.,fTargetLength/2.));
176 TGeoVolume *moreShieldingSide = gGeoManager->MakeBox("moreShieldingSide", iron, xTot/2., (fDiameter+1.9*spaceTopBot)/2., fTargetLength/2.);
177 moreShieldingSide->SetLineColor(33);
178 tTarget->AddNode(moreShieldingSide, 1, new TGeoTranslation(fDiameter/2.+spaceSide+xTot/2.,0.,fTargetLength/2.));
179 tTarget->AddNode(moreShieldingSide, 2, new TGeoTranslation(-fDiameter/2.-spaceSide-xTot/2.,0.,fTargetLength/2.));
180 }else{
181 TGeoVolume *moreShielding = gGeoManager->MakeTube("MoreShielding", iron, 30, 400, fTargetLength/2.);
182 moreShielding->SetLineColor(43); //
183 tTarget->AddNode(moreShielding, 1, new TGeoTranslation(0, 0, fTargetLength/2.));
184 }
185 top->AddNode(tTarget, 1, new TGeoTranslation(0, 0,fTargetZ - fTargetLength/2.));
186
187 if (fAbsorberLength>0){
188 cout << "target and absorber positioned at " << fTargetZ <<" "<< fAbsorberZ << " m"<< endl;
189 }else{
190 cout << "target at " << fTargetZ/100. <<"m "<< endl;
191 }
192}
Int_t InitMedium(const char *name)
std::vector< std::string > fM
std::vector< float > fL
int i
Definition ShipAna.py:86

◆ InitMedium()

Int_t ShipTargetStation::InitMedium ( const char *  name)

Definition at line 58 of file ShipTargetStation.cxx.

59{
60 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
61 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
62 static FairGeoMedia *media=geoFace->getMedia();
63 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
64
65 FairGeoMedium *ShipMedium=media->getMedium(name);
66
67 if (!ShipMedium)
68 {
69 Fatal("InitMedium","Material %s not defined in media file.", name);
70 return -1111;
71 }
72 TGeoMedium* medium=gGeoManager->GetMedium(name);
73 if (medium!=NULL)
74 return ShipMedium->getMediumIndex();
75 return geoBuild->createMedium(ShipMedium);
76}

◆ SetLayerPosMat()

void ShipTargetStation::SetLayerPosMat ( Float_t  d,
std::vector< float >  L,
std::vector< std::string >  M 
)
inline

Definition at line 19 of file ShipTargetStation.h.

Member Data Documentation

◆ fAbsorberLength

ClassDef (ShipTargetStation,4) protected Double_t ShipTargetStation::fAbsorberLength

Definition at line 28 of file ShipTargetStation.h.

◆ fAbsorberZ

Double_t ShipTargetStation::fAbsorberZ

Definition at line 29 of file ShipTargetStation.h.

◆ fDiameter

Double_t ShipTargetStation::fDiameter

Definition at line 31 of file ShipTargetStation.h.

◆ fL

std::vector<float> ShipTargetStation::fL

Definition at line 32 of file ShipTargetStation.h.

◆ fM

std::vector<std::string> ShipTargetStation::fM

Definition at line 33 of file ShipTargetStation.h.

◆ fnS

Int_t ShipTargetStation::fnS

Definition at line 35 of file ShipTargetStation.h.

◆ fsl

Double_t ShipTargetStation::fsl

Definition at line 36 of file ShipTargetStation.h.

◆ fTargetZ

Double_t ShipTargetStation::fTargetZ

Definition at line 30 of file ShipTargetStation.h.


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