BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofConstruction Class Reference

#include <BesTofConstruction.hh>

Inheritance diagram for BesTofConstruction:

Public Member Functions

 BesTofConstruction ()
virtual ~BesTofConstruction ()
void Construct (G4LogicalVolume *logicalBes)
void ConstructBr1Tof ()
void ConstructBr2Tof ()
void ConstructEcTof ()
void ConstructEcTof_mrpc ()
void DefineMaterial ()
void getXYZ (const G4RotationMatrix r, double &a, double &b, double &c) const
 BesTofConstruction ()
virtual ~BesTofConstruction ()
void Construct (G4LogicalVolume *logicalBes)
void ConstructBr1Tof ()
void ConstructBr2Tof ()
void ConstructEcTof ()
void ConstructEcTof_mrpc ()
void DefineMaterial ()
void getXYZ (const G4RotationMatrix r, double &a, double &b, double &c) const
 BesTofConstruction ()
virtual ~BesTofConstruction ()
void Construct (G4LogicalVolume *logicalBes)
void ConstructBr1Tof ()
void ConstructBr2Tof ()
void ConstructEcTof ()
void ConstructEcTof_mrpc ()
void DefineMaterial ()
void getXYZ (const G4RotationMatrix r, double &a, double &b, double &c) const
Public Member Functions inherited from BesSubdetector
 BesSubdetector ()
virtual ~BesSubdetector ()
G4LogicalVolume * FindLogicalVolume (const G4String &vn)
 BesSubdetector ()
virtual ~BesSubdetector ()
G4LogicalVolume * FindLogicalVolume (const G4String &vn)
 BesSubdetector ()
virtual ~BesSubdetector ()
G4LogicalVolume * FindLogicalVolume (const G4String &vn)

Additional Inherited Members

Protected Attributes inherited from BesSubdetector
SAXProcessor m_sxp
ProcessingConfigurator m_config

Detailed Description

Constructor & Destructor Documentation

◆ BesTofConstruction() [1/3]

BesTofConstruction::BesTofConstruction ( )

Definition at line 54 of file BesTofConstruction.cc.

56{
57 auto opt_svc = Gaudi::svcLocator()->service<IOptionsSvc>( "JobOptionsSvc" );
58 Gaudi::Parsers::parse( m_userLimits,
59 opt_svc->get( "BesTofConstruction.UserLimits", "0.03" ) );
60 Gaudi::Parsers::parse( m_ionE, opt_svc->get( "BesTofConstruction.IonE", "20" ) );
61
62 cout << "BesTofConstruction Property:" << endl
63 << " UserLimits= " << m_userLimits << " IonE= " << m_ionE << endl;
64
65 logicalTof = 0;
66 physicalTof = 0;
67
68 logicalBrTof = 0;
69 logicalEcTofWest = 0;
70 logicalEcTofEast = 0;
71
72 logicalScinBr1 = 0;
73 logicalScinBr2 = 0;
74 physicalScinBr1 = 0;
75 physicalScinBr2 = 0;
76
77 logicalAlBr1 = 0;
78 logicalAlBr2 = 0;
79 physicalAlBr1 = 0;
80 physicalAlBr2 = 0;
81
82 logicalPVFBr1 = 0;
83 logicalPVFBr2 = 0;
84 physicalPVFBr1 = 0;
85 physicalPVFBr2 = 0;
86
87 logicalBucketBr1 = 0;
88 logicalBucketBr2 = 0;
89
90 physicalBucket1Br1 = 0;
91 physicalBucket2Br1 = 0;
92 physicalBucket1Br2 = 0;
93 physicalBucket2Br2 = 0;
94
95 logicalScinEcWest = 0;
96 logicalScinEcEast = 0;
97 physicalScinEcWest = 0;
98 physicalScinEcEast = 0;
99
100 logicalAlEcWest = 0;
101 logicalAlEcEast = 0;
102 physicalAlEcWest = 0;
103 physicalAlEcEast = 0;
104
105 logicalPVFEcWest = 0;
106 logicalPVFEcEast = 0;
107 physicalPVFEcWest = 0;
108 physicalPVFEcEast = 0;
109
110 logicalBucketEc = 0;
111 physicalBucketEc = 0;
112
113 BC404 = 0;
114 BC408 = 0;
115 PVF = 0;
116 PMTmaterial = 0;
117
118 // MRPC
119 logical_gasLayer = 0;
120}

◆ ~BesTofConstruction() [1/3]

BesTofConstruction::~BesTofConstruction ( )
virtual

Definition at line 122 of file BesTofConstruction.cc.

122{}

◆ BesTofConstruction() [2/3]

BesTofConstruction::BesTofConstruction ( )

◆ ~BesTofConstruction() [2/3]

virtual BesTofConstruction::~BesTofConstruction ( )
virtual

◆ BesTofConstruction() [3/3]

BesTofConstruction::BesTofConstruction ( )

◆ ~BesTofConstruction() [3/3]

virtual BesTofConstruction::~BesTofConstruction ( )
virtual

Member Function Documentation

◆ Construct() [1/3]

void BesTofConstruction::Construct ( G4LogicalVolume * logicalBes)
virtual

Implements BesSubdetector.

Definition at line 124 of file BesTofConstruction.cc.

124 {
125 DefineMaterial(); // This function just defines my material, used for the TOF
126
127 if ( ReadBoostRoot::GetTof() == 2 )
128 {
129 TofG4Geo* aTofG4Geo = new TofG4Geo();
130 logicalTof = aTofG4Geo->GetTopVolume();
131 if ( !logicalTof )
132 G4cout << "BesTofConstruction::Construct(), logicalTof not found" << G4endl;
133 else
134 {
135 // produce the logical Tof
136 physicalTof = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof, "physicalTof",
137 logicalBes, false,
138 0 ); // Class representing a single volume positioned
139 // within and relative to a mother volume.
140
141 // for visual attributes
142 logicalScinBr1 = FindLogicalVolume( "logicalScinBr1" );
143 logicalScinBr2 = FindLogicalVolume( "logicalScinBr2" );
144
145 logicalAlBr1 = FindLogicalVolume( "logicalAlBr1" );
146 logicalAlBr2 = FindLogicalVolume( "logicalAlBr2" );
147 logicalPVFBr1 = FindLogicalVolume( "logicalPVFBr1" );
148 logicalPVFBr2 = FindLogicalVolume( "logicalPVFBr2" );
149 logicalBucketBr1 = FindLogicalVolume( "logicalBucketBr1" );
150 logicalBucketBr2 = FindLogicalVolume( "logicalBucketBr2" );
151
152 logicalScinEcWest = FindLogicalVolume( "logicalScinEcWest" );
153 logicalScinEcEast = FindLogicalVolume( "logicalScinEcEast" );
154 logicalBucketEc = FindLogicalVolume( "logicalBucketEc" );
155 }
156 // m_sxp.Finalize();
157 delete aTofG4Geo;
158 } // close (ReadBoostRoot::GetTof() == 2)
159
160 else if ( ReadBoostRoot::GetTof() == 3 ) // start TOF with MRPC Endcaps
161 {
162 // This part intialize a function where the Parameter of the TOF are saved!
163 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
164
165 // Get the coordinates of the TOF
166 G4double r1 = 380; // Newly changed from 399 for MRPC to avoid overlap
167 G4double r2 = tofPara->GetBucketPosR() + 0.5 * tofPara->GetBucketDEc() + 1; //=474
168 G4double r3 = 810;
169 G4double r4 = 925;
170 G4double a1 = 1382 + tofPara->GetBucketLEc() + 1; // 1463
171 G4double a2 = 1381; // Changed from 1382 to avoid overlapping with EMC
172 // to make the center of tub6 is tofPara.GetzPosEastEc()=1356
173 G4double a3 = 1330;
174 G4cout << "Tof Volume: " << r1 << " " << r2 << " " << r3 << " " << r4 << " " << a1 << " "
175 << a2 << " " << a3 << G4endl;
176
177 // Tof: produce a cylinder with inner radius r1 and outer radius r2, z height: 2a1,
178 // starting angle 0 untill 360
179 G4Tubs* tub1 = new G4Tubs( "tub1", r1, r2, a1, 0, 360 );
180 G4Tubs* tub2 = new G4Tubs( "tub2", r2 - 4, r4, a2, 0, 360 );
181 G4Tubs* tub3 = new G4Tubs( "tub3", 0, r3, a3, 0, 360 );
182 G4UnionSolid* tub4 = new G4UnionSolid(
183 "tub4", tub1, tub2, 0, G4ThreeVector( 0, 0, 0 ) ); // Vereinigt tub 1 und 2 in tub4
184 G4SubtractionSolid* solidTof = new G4SubtractionSolid(
185 "solidTof", tub4, tub3, 0, G4ThreeVector( 0, 0, 0 ) ); // Subtracts tub4 - tub3
186 logicalTof = new G4LogicalVolume( solidTof, G4Material::GetMaterial( "Air" ),
187 "logicalTof" ); // book logical Tof VOlume
188 physicalTof = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof, "physicalTof",
189 logicalBes, false, 0 );
190
191 // Logical + Physical volumes for the barrel
192 G4Tubs* tub5 = new G4Tubs( "tub5", r3, r4, a3, 0, 360 );
193 logicalBrTof = new G4LogicalVolume( tub5, G4Material::GetMaterial( "Air" ),
194 "logicalBrTof" ); // book logical Barrel TOF
195 G4VPhysicalVolume* physicalBrTof = new G4PVPlacement(
196 0, G4ThreeVector( 0, 0, 0 ), logicalBrTof, "physicalBrTof", logicalTof, false, 0 );
197
198 // Logical + Physical volumes for the endcaps
199 G4Tubs* tub6 =
200 new G4Tubs( "tub6", r1, r4, ( a2 - a3 ) / 2, 0, 360 ); // ring: dz/2=2.55cm, xy=52.6 cm
201 G4Tubs* tub7 =
202 new G4Tubs( "tub7", r1, r2, ( a1 - a2 ) / 2, 0, 360 ); // ring: dz/2=0.1cm, xy=7.5 cm
203 G4UnionSolid* tub8 = new G4UnionSolid(
204 "tub8", tub6, tub7, 0,
205 G4ThreeVector( 0, 0, ( a3 - a1 ) / 2 ) ); // Unify both tubes,translate z-axes -6.15 cm
206 // to the originally one
207 logicalEcTofWest =
208 new G4LogicalVolume( tub8, G4Material::GetMaterial( "Air" ), "logicalEcTofWest" );
209 G4VPhysicalVolume* physicalEcTofWest =
210 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosWestEc() ),
211 logicalEcTofWest, "physicalEcTofWest", logicalTof, false, 0 );
212
213 G4UnionSolid* tub9 = new G4UnionSolid(
214 "tub9", tub6, tub7, 0,
215 G4ThreeVector( 0, 0, ( a1 - a3 ) / 2 ) ); // Unify both tubes,translate z-axes +6.15 cm
216 // to the originally one
217 logicalEcTofEast =
218 new G4LogicalVolume( tub9, G4Material::GetMaterial( "Air" ), "logicalEcTofEast" );
219 G4VPhysicalVolume* physicalEcTofEast =
220 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosEastEc() ),
221 logicalEcTofEast, "physicalEcTofEast", logicalTof, false, 0 );
222
223 // Functions which construct the different parts of the TOF -->See below
224 // Construct Tape
225 // put these lines before ConstructBr1Tof();
226 // so in BesTofSD.cc, no need to change the tofid caculation method
227 G4Tubs* tubTape = new G4Tubs( "tubTape", 866, 866.3, 1150, 0, 360 );
228 G4LogicalVolume* logicalTape =
229 new G4LogicalVolume( tubTape, G4Material::GetMaterial( "tape" ), "logicalTape" );
230 G4VPhysicalVolume* physicalTape = new G4PVPlacement(
231 0, G4ThreeVector( 0, 0, 0 ), logicalTape, "physicalTape", logicalBrTof, false, 0 );
232 logicalTape->SetVisAttributes( G4VisAttributes::Invisible );
233
237 }
238
239 else if ( ReadBoostRoot::GetTof() == 4 ) // start TOF with MRPC Endcaps GDML Construction
240 {
241 MRPCG4Geo* aTofG4Geo = new MRPCG4Geo();
242 logicalTof = aTofG4Geo->GetTopVolume();
243 if ( !logicalTof )
244 G4cout << "BesTofConstruction::Construct(), logicalTof not found" << G4endl;
245 else
246 {
247 physicalTof = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof, "physicalTof",
248 logicalBes, false, 0 );
249
250 logicalScinBr1 = FindLogicalVolume( "logicalScinBr1" );
251 logicalScinBr2 = FindLogicalVolume( "logicalScinBr2" );
252
253 logicalAlBr1 = FindLogicalVolume( "logicalAlBr1" );
254 logicalAlBr2 = FindLogicalVolume( "logicalAlBr2" );
255 logicalPVFBr1 = FindLogicalVolume( "logicalPVFBr1" );
256 logicalPVFBr2 = FindLogicalVolume( "logicalPVFBr2" );
257 logicalBucketBr1 = FindLogicalVolume( "logicalBucketBr1" );
258 logicalBucketBr2 = FindLogicalVolume( "logicalBucketBr2" );
259
260 logical_gasLayer = FindLogicalVolume( "logical_gasLayer" );
261 }
262 delete aTofG4Geo;
263 } // close else if(==4)
264
265 else
266 {
267 //-----------------logicalTof added here
268 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
269
270 // Get the coordinates of the TOF
271 G4double r1 = tofPara->GetEcR1() - 1; //=399
272 G4double r2 = tofPara->GetBucketPosR() + 0.5 * tofPara->GetBucketDEc() + 1; //=474
273 G4double r3 = 810;
274 ;
275 G4double r4 = 925;
276 G4double a1 = 1382 + tofPara->GetBucketLEc() + 1; // 1463
277 G4double a2 = 1381; // Changed from 1382 to avoid overlapping with EMC
278 // to make the center of tub6 is tofPara.GetzPosEastEc()=1356
279 G4double a3 = 1330;
280 G4cout << "Tof Volume: " << r1 << " " << r2 << " " << r3 << " " << r4 << " " << a1 << " "
281 << a2 << " " << a3 << G4endl;
282
283 G4Tubs* tub1 = new G4Tubs( "tub1", r1, r2, a1, 0,
284 360 ); // Just produce a cylinder with inner radius r1 and outer
285 // radius r2, z height: 2a1, starting angle 0 untill 360
286 G4Tubs* tub2 = new G4Tubs( "tub2", r2 - 4, r4, a2, 0, 360 );
287 G4Tubs* tub3 = new G4Tubs( "tub3", 0, r3, a3, 0, 360 );
288 G4UnionSolid* tub4 = new G4UnionSolid(
289 "tub4", tub1, tub2, 0, G4ThreeVector( 0, 0, 0 ) ); // Vereinigt tub 1 und 2 in tub4
290 G4SubtractionSolid* solidTof = new G4SubtractionSolid(
291 "solidTof", tub4, tub3, 0, G4ThreeVector( 0, 0, 0 ) ); // Subtracts tub4 - tub3
292 logicalTof = new G4LogicalVolume( solidTof, G4Material::GetMaterial( "Air" ),
293 "logicalTof" ); // book logical Tof VOlume
294 physicalTof = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalTof, "physicalTof",
295 logicalBes, false, 0 );
296
297 G4Tubs* tub5 = new G4Tubs( "tub5", r3, r4, a3, 0, 360 );
298 logicalBrTof = new G4LogicalVolume( tub5, G4Material::GetMaterial( "Air" ),
299 "logicalBrTof" ); // book logical Barrel TOF
300 G4VPhysicalVolume* physicalBrTof = new G4PVPlacement(
301 0, G4ThreeVector( 0, 0, 0 ), logicalBrTof, "physicalBrTof", logicalTof, false, 0 );
302
303 // Logical + Physical volumes for the endcaps
304 G4Tubs* tub6 = new G4Tubs( "tub6", r1, r4, ( a2 - a3 ) / 2, 0,
305 360 ); // r1=39.9cm, r4=92.5cm, zlength=2.55 cm
306 G4Tubs* tub7 = new G4Tubs( "tub7", r1, r2, ( a1 - a2 ) / 2, 0,
307 360 ); // r1=39.9cm, r2=47.4cm, zlength=4.05 cm
308 G4UnionSolid* tub8 = new G4UnionSolid( "tub8", tub6, tub7, 0,
309 G4ThreeVector( 0, 0, ( a3 - a1 ) / 2 ) ); // -6.65cm
310 logicalEcTofWest =
311 new G4LogicalVolume( tub8, G4Material::GetMaterial( "Air" ), "logicalEcTofWest" );
312 G4VPhysicalVolume* physicalEcTofWest =
313 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosWestEc() ),
314 logicalEcTofWest, "physicalEcTofWest", logicalTof, false, 0 );
315
316 G4UnionSolid* tub9 =
317 new G4UnionSolid( "tub9", tub6, tub7, 0, G4ThreeVector( 0, 0, ( a1 - a3 ) / 2 ) );
318 logicalEcTofEast =
319 new G4LogicalVolume( tub9, G4Material::GetMaterial( "Air" ), "logicalEcTofEast" );
320 G4VPhysicalVolume* physicalEcTofEast =
321 new G4PVPlacement( 0, G4ThreeVector( 0, 0, tofPara->GetzPosEastEc() ),
322 logicalEcTofEast, "physicalEcTofEast", logicalTof, false, 0 );
323
324 // Construct Tape
325 // put these lines before ConstructBr1Tof();
326 // so in BesTofSD.cc, no need to change the tofid caculation method
327 G4Tubs* tubTape = new G4Tubs( "tubTape", 866, 866.3, 1150, 0, 360 );
328 G4LogicalVolume* logicalTape =
329 new G4LogicalVolume( tubTape, G4Material::GetMaterial( "tape" ), "logicalTape" );
330 G4VPhysicalVolume* physicalTape = new G4PVPlacement(
331 0, G4ThreeVector( 0, 0, 0 ), logicalTape, "physicalTape", logicalBrTof, false, 0 );
332 logicalTape->SetVisAttributes( G4VisAttributes::Invisible );
333
334 // Functions which construct the different parts of the TOF -->See below
338 }
339
340 // sensitive detector
341 G4SDManager* SDman = G4SDManager::GetSDMpointer();
342 BesTofSD* tofSD = new BesTofSD( "BesTofSD" );
343 SDman->AddNewDetector( tofSD );
344
345 if ( logicalScinBr1 ) logicalScinBr1->SetSensitiveDetector( tofSD );
346 if ( logicalScinBr2 ) logicalScinBr2->SetSensitiveDetector( tofSD );
347 if ( logicalScinEcWest ) logicalScinEcWest->SetSensitiveDetector( tofSD );
348 if ( logicalScinEcEast ) logicalScinEcEast->SetSensitiveDetector( tofSD );
349 if ( logical_gasLayer )
350 {
351 logical_gasLayer->SetSensitiveDetector( tofSD );
352 G4cout << "!!! Find logical_gasLayer !!!" << G4endl;
353
354 // For limits smaller than 0.02 one has to use the PAI-Model for ionisation!
355 logical_gasLayer->SetUserLimits( new G4UserLimits( m_userLimits * mm ) );
356 // logical_gasLayer->SetUserLimits (new G4UserLimits(0.03*mm));
357 }
358
359 G4VisAttributes* visBrTof = new G4VisAttributes( G4Colour( 1., 0., 0. ) );
360 G4VisAttributes* visEcTof = new G4VisAttributes( G4Colour( 0., 1., 0. ) );
361
362 if ( logicalTof ) logicalTof->SetVisAttributes( G4VisAttributes::Invisible );
363 if ( logicalBrTof ) logicalBrTof->SetVisAttributes( G4VisAttributes::Invisible );
364 // logicalBrTof->SetVisAttributes(visBrTof);
365 if ( logicalEcTofWest ) logicalEcTofWest->SetVisAttributes( G4VisAttributes::Invisible );
366 // logicalEcTofWest->SetVisAttributes(visEcTof);
367 if ( logicalEcTofEast ) logicalEcTofEast->SetVisAttributes( G4VisAttributes::Invisible );
368 // logicalEcTofEast->SetVisAttributes(visEcTof);
369
370 if ( logicalScinBr1 ) logicalScinBr1->SetVisAttributes( G4VisAttributes::Invisible );
371 if ( logicalScinBr2 ) logicalScinBr2->SetVisAttributes( G4VisAttributes::Invisible );
372
373 if ( logicalAlBr1 ) logicalAlBr1->SetVisAttributes( G4VisAttributes::Invisible );
374 if ( logicalAlBr2 ) logicalAlBr2->SetVisAttributes( G4VisAttributes::Invisible );
375
376 if ( logicalPVFBr1 ) logicalPVFBr1->SetVisAttributes( G4VisAttributes::Invisible );
377 if ( logicalPVFBr2 ) logicalPVFBr2->SetVisAttributes( G4VisAttributes::Invisible );
378
379 G4VisAttributes* visAttBrBuck = new G4VisAttributes( G4Colour( 1., 1., 0. ) );
380 if ( logicalBucketBr1 ) logicalBucketBr1->SetVisAttributes( visAttBrBuck );
381 // logicalBucketBr1->SetVisAttributes(G4VisAttributes::Invisible);
382 if ( logicalBucketBr2 ) logicalBucketBr2->SetVisAttributes( visAttBrBuck );
383 // logicalBucketBr2->SetVisAttributes(G4VisAttributes::Invisible);
384
385 G4VisAttributes* visAttEcTof = new G4VisAttributes( G4Colour( 0., 1., 1. ) );
386 if ( logicalScinEcWest ) logicalScinEcWest->SetVisAttributes( visAttEcTof );
387 // logicalScinEc->SetVisAttributes(G4VisAttributes::Invisible);
388 if ( logicalScinEcEast ) logicalScinEcEast->SetVisAttributes( visAttEcTof );
389
390 G4VisAttributes* visAttEcBuck = new G4VisAttributes( G4Colour( 1., 1., 0. ) );
391 if ( logicalBucketEc ) logicalBucketEc->SetVisAttributes( visAttEcBuck );
392 // logicalBucketEc->SetVisAttributes(G4VisAttributes::Invisible);
393
394 if ( logicalAlEcWest ) logicalAlEcWest->SetVisAttributes( G4VisAttributes::Invisible );
395 if ( logicalAlEcEast ) logicalAlEcEast->SetVisAttributes( G4VisAttributes::Invisible );
396 if ( logicalPVFEcWest ) logicalPVFEcWest->SetVisAttributes( G4VisAttributes::Invisible );
397 if ( logicalPVFEcEast ) logicalPVFEcEast->SetVisAttributes( G4VisAttributes::Invisible );
398}
static BesTofGeoParameter * GetInstance()
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.

◆ Construct() [2/3]

void BesTofConstruction::Construct ( G4LogicalVolume * logicalBes)
virtual

Implements BesSubdetector.

◆ Construct() [3/3]

void BesTofConstruction::Construct ( G4LogicalVolume * logicalBes)
virtual

Implements BesSubdetector.

◆ ConstructBr1Tof() [1/3]

void BesTofConstruction::ConstructBr1Tof ( )

Definition at line 400 of file BesTofConstruction.cc.

400 {
401 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
402
403 // Get barrel tof layer1 geometry data
404 G4int nScinBr = tofPara->GetnScinBr(); // number of barrel scintillators
405 G4double br1L = tofPara->GetBr1L();
406 G4double br1TrapW1 = tofPara->GetBr1TrapW1();
407 G4double br1TrapW2 = tofPara->GetBr1TrapW2();
408 G4double br1TrapH = tofPara->GetBr1TrapH();
409 G4double br1R1 = tofPara->GetBr1R1();
410 G4double AlThickness = tofPara->GetAlThickness();
411 G4double PVFThickness = tofPara->GetPVFThickness();
412 // barrel PMT bucket geometry data
413 G4double bucketDBr = tofPara->GetBucketDBr(); // diameter of barrel PMT bucket
414 G4double bucketLBr = tofPara->GetBucketLBr(); // length of barrel PMT bucket
415
416 // computer from the original data
417 G4double angleBr = 360. / nScinBr * deg;
418 G4double scinTrapdx1, scinTrapdx2, scinTrapdx3, scinTrapdx4;
419 scinTrapdx1 = scinTrapdx3 = br1TrapW1 / 2.;
420 scinTrapdx2 = scinTrapdx4 = br1TrapW2 / 2.;
421 G4double scinTrapdy1, scinTrapdy2;
422 scinTrapdy1 = scinTrapdy2 = 0.5 * br1TrapH;
423 G4double scinTrapdz = br1L / 2.;
424 G4double scinPosR = br1R1 + scinTrapdy1;
425 G4double theta = atan( ( br1TrapW2 / 2. - br1TrapW1 / 2. ) / br1TrapH );
426 G4double delta13 = AlThickness * ( 1 / cos( theta ) - tan( theta ) );
427 G4double delta24 = AlThickness * ( 1 / cos( theta ) + tan( theta ) );
428 G4double delta13P = ( PVFThickness + AlThickness ) * ( 1 / cos( theta ) - tan( theta ) );
429 G4double delta24P = ( PVFThickness + AlThickness ) * ( 1 / cos( theta ) + tan( theta ) );
430
431 // construct barrel tof scintillator
432 G4Trap* solidScinBr1 =
433 new G4Trap( "solidScinBr1", scinTrapdz, 0 * deg, 0 * deg, scinTrapdy1, scinTrapdx1,
434 scinTrapdx2, 0 * deg, scinTrapdy2, scinTrapdx3, scinTrapdx4, 0 * deg );
435 logicalScinBr1 = new G4LogicalVolume( solidScinBr1, BC408, "logicalScinBr1" );
436
437 // construct barrel Al film and PVF film
438 G4Trap* solidAlBr1 = new G4Trap( "solidAlBr1", scinTrapdz + 0.001, 0 * deg, 0 * deg,
439 scinTrapdy1 + AlThickness, scinTrapdx1 + delta13,
440 scinTrapdx2 + delta24, 0 * deg, scinTrapdy2 + AlThickness,
441 scinTrapdx3 + delta13, scinTrapdx4 + delta24, 0 * deg );
442
443 logicalAlBr1 = new G4LogicalVolume( solidAlBr1, G4Material::GetMaterial( "Aluminium" ),
444 "logicalAlBr1" );
445 G4Trap* solidPVFBr1 =
446 new G4Trap( "solidPVFBr1", scinTrapdz + 0.002, 0 * deg, 0 * deg,
447 scinTrapdy1 + AlThickness + PVFThickness, scinTrapdx1 + delta13P,
448 scinTrapdx2 + delta24P, 0 * deg, scinTrapdy2 + AlThickness + PVFThickness,
449 scinTrapdx3 + delta13P, scinTrapdx4 + delta24P, 0 * deg );
450
451 logicalPVFBr1 = new G4LogicalVolume( solidPVFBr1, PVF, "logicalPVFBr1" );
452 // put daughter in mother logical volume
453 physicalAlBr1 = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlBr1,
454 "physicalAlBr1", logicalPVFBr1, false, 0 );
455 physicalScinBr1 = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinBr1,
456 "physicalScinBr1", logicalAlBr1, false, 0 );
457
458 // construct barrel PMT bucket (bucket=Behaelter)
459 G4Tubs* solidBucketBr1 =
460 new G4Tubs( "solidBucketBr1", 0, bucketDBr / 2., bucketLBr / 2., 0, 360. * deg );
461 logicalBucketBr1 = new G4LogicalVolume( solidBucketBr1, PMTmaterial, "logicalBucketBr1" );
462
463 // Rotate the crystalls:
464 G4RotationMatrix trapRot;
465 trapRot.rotateZ( 0.5 * angleBr - 90. * deg );
466 // /| y
467 //------- / | |
468 //\ / | | rotate->(0.5*angleBr-90.*deg): |
469 // \ / ->>>> | | -----x
470 // --- \ |
471 // \|
472 G4ThreeVector pos( 0, 0, 0 );
473 G4double x, y;
474 for ( int i = 0; i < nScinBr; i++ )
475 {
476 ostringstream osnamePVFBr1;
477 osnamePVFBr1 << "physicalPVFBr1_" << i;
478 ostringstream osnameBucket1Br1;
479 osnameBucket1Br1 << "physicalBucket1Br1_" << i;
480 ostringstream osnameBucket2Br1;
481 osnameBucket2Br1 << "physicalBucket2Br1_" << i;
482
483 // scintillator and casing
484 x = scinPosR * cos( ( i + 0.5 ) * angleBr ); //+0.5: start from phi=0
485 y = scinPosR * sin( ( i + 0.5 ) * angleBr );
486 pos.setX( x );
487 pos.setY( y );
488 pos.setZ( 0 );
489
490 // to make code consistent with gdml
491 double a, b, c;
492 getXYZ( trapRot, a, b, c ); // Function is defined below
493 G4RotationMatrix trapRotTemp;
494 trapRotTemp.rotateZ( c );
495 G4Transform3D transform( trapRotTemp, pos );
496
497 // G4PVPlacement: Class representing a single volume positioned within and relative to a
498 // mother volume. G4Transform3D transform(trapRot,pos);
499 physicalPVFBr1 = new G4PVPlacement( transform, logicalPVFBr1, osnamePVFBr1.str(),
500 logicalBrTof, false, i );
501 // bucket --> Two PMT, one on each side
502 pos.setZ( -( bucketLBr + br1L ) / 2. - 0.01 );
503 physicalBucket1Br1 = new G4PVPlacement( 0, pos, logicalBucketBr1, osnameBucket1Br1.str(),
504 logicalBrTof, false, 0 );
505 pos.setZ( ( bucketLBr + br1L ) / 2. + 0.01 );
506 physicalBucket2Br1 = new G4PVPlacement( 0, pos, logicalBucketBr1, osnameBucket2Br1.str(),
507 logicalBrTof, false, 0 );
508
509 // rotate for next scintillator
510 trapRot.rotateZ( angleBr );
511 }
512}
Double_t x[10]
void getXYZ(const G4RotationMatrix r, double &a, double &b, double &c) const

Referenced by Construct().

◆ ConstructBr1Tof() [2/3]

void BesTofConstruction::ConstructBr1Tof ( )

◆ ConstructBr1Tof() [3/3]

void BesTofConstruction::ConstructBr1Tof ( )

◆ ConstructBr2Tof() [1/3]

void BesTofConstruction::ConstructBr2Tof ( )

Definition at line 514 of file BesTofConstruction.cc.

514 {
515 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
516
517 // barrel tof layer2 geometry data
518 G4int nScinBr = tofPara->GetnScinBr(); // number of barrel scintillators
519 G4double br2L = tofPara->GetBr2L();
520 G4double br2TrapW1 = tofPara->GetBr2TrapW1();
521 G4double br2TrapW2 = tofPara->GetBr2TrapW2();
522 G4double br2TrapH = tofPara->GetBr2TrapH();
523 G4double br2R1 = tofPara->GetBr2R1();
524 G4double AlThickness = tofPara->GetAlThickness();
525 G4double PVFThickness = tofPara->GetPVFThickness();
526 // barrel PMT bucket geometry data
527 G4double bucketDBr = tofPara->GetBucketDBr(); // diameter of barrel PMT bucket
528 G4double bucketLBr = tofPara->GetBucketLBr(); // length of barrel PMT bucket
529
530 // computer from the original data
531 G4double angleBr = 360. / nScinBr * deg;
532 G4double scinTrapdx1, scinTrapdx2, scinTrapdx3, scinTrapdx4;
533 scinTrapdx1 = scinTrapdx3 = br2TrapW1 / 2.;
534 scinTrapdx2 = scinTrapdx4 = br2TrapW2 / 2.;
535 G4double scinTrapdy1, scinTrapdy2;
536 scinTrapdy1 = scinTrapdy2 = 0.5 * br2TrapH;
537 G4double scinTrapdz = br2L / 2.;
538 G4double scinPosR = br2R1 + scinTrapdy1;
539 G4double theta = atan( ( br2TrapW2 / 2. - br2TrapW1 / 2. ) / br2TrapH );
540 G4double delta13 = AlThickness * ( 1 / cos( theta ) - tan( theta ) );
541 G4double delta24 = AlThickness * ( 1 / cos( theta ) + tan( theta ) );
542 G4double delta13P = ( PVFThickness + AlThickness ) * ( 1 / cos( theta ) - tan( theta ) );
543 G4double delta24P = ( PVFThickness + AlThickness ) * ( 1 / cos( theta ) + tan( theta ) );
544
545 // construct barrel tof scintillator
546 G4Trap* solidScinBr2 =
547 new G4Trap( "solidScinBr2", scinTrapdz, 0 * deg, 0 * deg, scinTrapdy1, scinTrapdx1,
548 scinTrapdx2, 0 * deg, scinTrapdy2, scinTrapdx3, scinTrapdx4, 0 * deg );
549 logicalScinBr2 = new G4LogicalVolume( solidScinBr2, BC408, "logicalScinBr2" );
550
551 // construct barrel Al film and PVF film
552 G4Trap* solidAlBr2 = new G4Trap( "solidAlBr2", scinTrapdz + 0.001, 0 * deg, 0 * deg,
553 scinTrapdy1 + AlThickness, scinTrapdx1 + delta13,
554 scinTrapdx2 + delta24, 0 * deg, scinTrapdy2 + AlThickness,
555 scinTrapdx3 + delta13, scinTrapdx4 + delta24, 0 * deg );
556
557 logicalAlBr2 = new G4LogicalVolume( solidAlBr2, G4Material::GetMaterial( "Aluminium" ),
558 "logicalAlBr2" );
559 G4Trap* solidPVFBr2 =
560 new G4Trap( "solidPVFBr2", scinTrapdz + 0.002, 0 * deg, 0 * deg,
561 scinTrapdy1 + AlThickness + PVFThickness, scinTrapdx1 + delta13P,
562 scinTrapdx2 + delta24P, 0 * deg, scinTrapdy2 + AlThickness + PVFThickness,
563 scinTrapdx3 + delta13P, scinTrapdx4 + delta24P, 0 * deg );
564
565 logicalPVFBr2 = new G4LogicalVolume( solidPVFBr2, PVF, "logicalPVFBr2" );
566 // put daughter in mother logical volume
567 physicalAlBr2 = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlBr2,
568 "physicalAlBr2", logicalPVFBr2, false, 0 );
569 physicalScinBr2 = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinBr2,
570 "physicalScinBr2", logicalAlBr2, false, 0 );
571
572 // construct barrel PMT bucket
573 G4Tubs* solidBucketBr2 =
574 new G4Tubs( "solidBucketBr2", 0, bucketDBr / 2., bucketLBr / 2., 0, 360. * deg );
575 logicalBucketBr2 = new G4LogicalVolume( solidBucketBr2, PMTmaterial, "logicalBucketBr2" );
576
577 G4RotationMatrix trapRot;
578 trapRot.rotateZ( -90. * deg );
579 // /| y
580 //------- / | |
581 //\ / | | rotate->(-90.*deg): |
582 // \ / ->>>> | | -----x
583 // --- \ |
584 // \|
585 G4ThreeVector pos( 0, 0, 0 );
586 G4double x, y;
587 for ( int i = 0; i < nScinBr; i++ )
588 {
589 ostringstream osnamePVFBr2;
590 osnamePVFBr2 << "physicalPVFBr2_" << i;
591 ostringstream osnameBucket1Br2;
592 osnameBucket1Br2 << "physicalBucket1Br2_" << i;
593 ostringstream osnameBucket2Br2;
594 osnameBucket2Br2 << "physicalBucket2Br2_" << i;
595
596 // scintillator and casing
597 x = scinPosR * cos( i * angleBr ); //+0.5: start from phi=0
598 y = scinPosR * sin( i * angleBr );
599 pos.setX( x );
600 pos.setY( y );
601 pos.setZ( 0 );
602 // to make code consistent with gdml
603 double a, b, c;
604 getXYZ( trapRot, a, b, c );
605 G4RotationMatrix trapRotTemp;
606 trapRotTemp.rotateZ( c );
607 G4Transform3D transform( trapRotTemp, pos );
608 // G4Transform3D transform(trapRot,pos);
609 physicalPVFBr2 = new G4PVPlacement( transform, logicalPVFBr2, osnamePVFBr2.str(),
610 logicalBrTof, false, i );
611 // bucket
612 pos.setZ( -( bucketLBr + br2L ) / 2. - 0.01 );
613 physicalBucket1Br2 = new G4PVPlacement( 0, pos, logicalBucketBr2, osnameBucket1Br2.str(),
614 logicalBrTof, false, 0 );
615 pos.setZ( ( bucketLBr + br2L ) / 2. + 0.01 );
616 physicalBucket2Br2 = new G4PVPlacement( 0, pos, logicalBucketBr2, osnameBucket2Br2.str(),
617 logicalBrTof, false, 0 );
618
619 // rotate for next scintillator
620 trapRot.rotateZ( angleBr );
621 }
622}

Referenced by Construct().

◆ ConstructBr2Tof() [2/3]

void BesTofConstruction::ConstructBr2Tof ( )

◆ ConstructBr2Tof() [3/3]

void BesTofConstruction::ConstructBr2Tof ( )

◆ ConstructEcTof() [1/3]

void BesTofConstruction::ConstructEcTof ( )

Definition at line 624 of file BesTofConstruction.cc.

624 {
625 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
626
627 // Get all interesting parameters for the TOF construction
628 // endcap geometry data
629 G4int nScinEc = tofPara->GetnScinEc(); // number of endcap scintillators
630 G4double ecL = tofPara->GetEcL();
631 G4double ecTrapW1 = tofPara->GetEcTrapW1();
632 G4double ecTrapW2 = tofPara->GetEcTrapW2();
633 G4double ecTrapH = tofPara->GetEcTrapH();
634 G4double ecTrapH1 = tofPara->GetEcTrapH1();
635 G4double zPosEastEc = tofPara->GetzPosEastEc(); // z position of east endcap
636 G4double zPosWestEc = tofPara->GetzPosWestEc(); // z position of west endcap
637 G4double ecR1 = tofPara->GetEcR1();
638 // G4double ecR2 = tofPara.GetEcR2();
639
640 // endcap PMT bucket geometry data
641 G4double bucketDEc = tofPara->GetBucketDEc(); // diameter of endcap PMT bucket
642 G4double bucketLEc = tofPara->GetBucketLEc(); // length of endcap PMT bucket
643 G4double bucketPosR = tofPara->GetBucketPosR(); // R of bucket center
644
645 G4double AlThickness = tofPara->GetAlThickness();
646 G4double PVFThickness = tofPara->GetPVFThickness();
647
648 G4double angleEc = 360. / nScinEc * deg;
649 G4double ecTrapW3 = ecTrapW1 + ( ecTrapW2 - ecTrapW1 ) * ecTrapH1 / ecTrapH;
650 G4double ecTrapH2 = ecTrapH - ecTrapH1;
651 G4double pdz = ecL / 2;
652 G4double ptheta = atan( ecTrapH1 / ( 2 * ecL ) );
653 G4double pdy1 = ecTrapH2 / 2;
654 G4double pdx1 = ecTrapW3 / 2;
655 G4double pdx2 = ecTrapW2 / 2;
656 G4double pdy2 = ecTrapH / 2;
657 G4double pdx3 = ecTrapW1 / 2;
658 G4double pdx4 = ecTrapW2 / 2;
659
660 // because of removing a heighth of H1,
661 // plus initial center position ecR=ecR1+ecTrapH/2 with ecTrapH1/4
662 G4double ecR = ecR1 + ecTrapH / 2 + ecTrapH1 / 4;
663
664 // construct endcap scintillator
665 G4Trap* solidScinEc = new G4Trap( "solidScinEc", pdz, ptheta, 270 * deg, pdy1, pdx1, pdx2,
666 0 * deg, pdy2, pdx3, pdx4, 0 * deg );
667
668 logicalScinEcWest = new G4LogicalVolume( solidScinEc, BC404, "logicalScinEcWest" );
669 logicalScinEcEast = new G4LogicalVolume( solidScinEc, BC404, "logicalScinEcEast" );
670
671 // construct endcap PMT bucket
672 G4Tubs* solidBucketEc =
673 new G4Tubs( "solidBucketEc", 0, bucketDEc / 2., bucketLEc / 2., 0, 360. * deg );
674 logicalBucketEc = new G4LogicalVolume( solidBucketEc, PMTmaterial, "logicalBucketEc" );
675
676 // construct Al and PVF film
677 G4double pthetaAl = atan( ecTrapH1 / ( 2 * ( ecL + AlThickness * 2 ) ) );
678 G4double theta1 = atan( ( ecTrapW2 / 2. - ecTrapW3 / 2. ) / ecTrapH2 );
679 G4double theta2 = atan( ( ecTrapW2 / 2. - ecTrapW1 / 2. ) / ecTrapH );
680
681 G4double delta1 = AlThickness * ( 1 / cos( theta1 ) - tan( theta1 ) );
682 G4double delta2 = AlThickness * ( 1 / cos( theta1 ) + tan( theta1 ) );
683 G4double delta3 = AlThickness * ( 1 / cos( theta2 ) - tan( theta2 ) );
684 G4double delta4 = AlThickness * ( 1 / cos( theta2 ) + tan( theta2 ) );
685
686 G4double thick = AlThickness + PVFThickness;
687 G4double pthetaPVF = atan( ecTrapH1 / ( 2 * ( ecL + thick * 2 ) ) );
688 G4double delta1P = thick * ( 1 / cos( theta1 ) - tan( theta1 ) );
689 G4double delta2P = thick * ( 1 / cos( theta1 ) + tan( theta1 ) );
690 G4double delta3P = thick * ( 1 / cos( theta2 ) - tan( theta2 ) );
691 G4double delta4P = thick * ( 1 / cos( theta2 ) + tan( theta2 ) );
692
693 G4Trap* solidAlEc = new G4Trap( "solidAlEc", pdz + AlThickness, pthetaAl, 270 * deg,
694 pdy1 + AlThickness, pdx1 + delta1, pdx2 + delta2, 0 * deg,
695 pdy2 + AlThickness, pdx3 + delta3, pdx4 + delta4, 0 * deg );
696
697 logicalAlEcWest = new G4LogicalVolume( solidAlEc, G4Material::GetMaterial( "Aluminium" ),
698 "logicalAlEcWest" );
699 logicalAlEcEast = new G4LogicalVolume( solidAlEc, G4Material::GetMaterial( "Aluminium" ),
700 "logicalAlEcEast" );
701
702 G4Trap* solidPVFEc = new G4Trap( "solidPVFEc", pdz + thick, pthetaPVF, 270 * deg,
703 pdy1 + thick, pdx1 + delta1P, pdx2 + delta2P, 0 * deg,
704 pdy2 + thick, pdx3 + delta3P, pdx4 + delta4P, 0 * deg );
705
706 logicalPVFEcWest = new G4LogicalVolume( solidPVFEc, PVF, "logicalPVFEcWest" );
707 logicalPVFEcEast = new G4LogicalVolume( solidPVFEc, PVF, "logicalPVFEcEast" );
708
709 // put scintilator in Al, then put Al in PVF
710 physicalAlEcWest = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlEcWest,
711 "physicalAlEcWest", logicalPVFEcWest, false, 0 );
712 physicalScinEcWest = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinEcWest,
713 "physicalScinEcWest", logicalAlEcWest, false, 0 );
714
715 // put scintilator in Al, then put Al in PVF
716 physicalAlEcEast = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalAlEcEast,
717 "physicalAlEcEast", logicalPVFEcEast, false, 0 );
718 physicalScinEcEast = new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logicalScinEcEast,
719 "physicalScinEcEast", logicalAlEcEast, false, 0 );
720
721 // zPosWestEc<0, zPosEastEc>0, direction of axis z: west--->east
722 // construct west endcap first
723 // when no rotation, the first tub is start from phi=90
724 // after rotation, the first tub is start from 0, rotate angle = 0.5*angleEc
725 G4ThreeVector posW( 0, 0, 0 );
726 G4ThreeVector posE( 0, 0, 0 );
727 G4RotationMatrix trapRot;
728 trapRot.rotateY( 180. * deg );
729 trapRot.rotateZ( 0.5 * angleEc - 90 * deg );
730 for ( int i = 0; i < nScinEc; i++ )
731 {
732 ostringstream osnamePVFEc;
733 osnamePVFEc << "physicalPVFEcWest_" << i;
734 ostringstream osnameBucketEc;
735 osnameBucketEc << "physicalBucketEcWest_" << i;
736
737 posW.setX( ecR * cos( ( 0.5 + i ) * angleEc ) );
738 posW.setY( ecR * sin( ( 0.5 + i ) * angleEc ) );
739 // posW.setZ( zPosWestEc );
740 posW.setZ( 0 );
741
742 // to make code consistent with gdml
743 double a, b, c;
744 getXYZ( trapRot, a, b, c );
745 G4RotationMatrix trapRotTemp;
746 trapRotTemp.rotateX( a );
747 trapRotTemp.rotateY( b );
748 trapRotTemp.rotateZ( c );
749 G4Transform3D transform( trapRotTemp, posW );
750 // G4Transform3D transform(trapRot,posW);
751 physicalPVFEcWest = new G4PVPlacement( transform, logicalPVFEcWest, osnamePVFEc.str(),
752 logicalEcTofWest, false, i );
753 posW.setX( bucketPosR * cos( ( 0.5 + i ) * angleEc ) );
754 posW.setY( bucketPosR * sin( ( 0.5 + i ) * angleEc ) );
755 // posW.setZ( zPosWestEc-ecL/2-thick-bucketLEc/2-0.01 );
756 posW.setZ( -ecL / 2 - thick - bucketLEc / 2 - 0.01 );
757 physicalBucketEc = new G4PVPlacement( 0, posW, logicalBucketEc, osnameBucketEc.str(),
758 logicalEcTofWest, false, 0 );
759 trapRot.rotateZ( angleEc ); // pay attention: not i*angleEc
760 }
761 // to make east scintillator start from phi=0
762 // _ _
763 // _ - _ -
764 // - - - - ====> - - - - ====> - - - -
765 // ~ - _
766 //
767 trapRot.rotateZ( -angleEc );
768 trapRot.rotateX( 180. * deg ); // make east bucket point to the center
769 for ( int i = 0; i < nScinEc; i++ )
770 {
771 ostringstream osnamePVFEc;
772 osnamePVFEc << "physicalPVFEcEast_" << i;
773 ostringstream osnameBucketEc;
774 osnameBucketEc << "physicalBucketEcEast_" << i;
775
776 posE.setX( ecR * cos( ( 0.5 + i ) * angleEc ) );
777 posE.setY( ecR * sin( ( 0.5 + i ) * angleEc ) );
778 // posE.setZ( zPosEastEc );
779 posE.setZ( 0 );
780
781 // to make code consistent with gdml
782 double a, b, c;
783 getXYZ( trapRot, a, b, c );
784 G4RotationMatrix trapRotTemp;
785 trapRotTemp.rotateX( a );
786 trapRotTemp.rotateY( b );
787 trapRotTemp.rotateZ( c );
788 G4Transform3D transform( trapRotTemp, posE );
789 // G4Transform3D transform(trapRot,posE);
790 physicalPVFEcEast = new G4PVPlacement( transform, logicalPVFEcEast, osnamePVFEc.str(),
791 logicalEcTofEast, false, i );
792 posE.setX( bucketPosR * cos( ( 0.5 + i ) * angleEc ) );
793 posE.setY( bucketPosR * sin( ( 0.5 + i ) * angleEc ) );
794 // posE.setZ( zPosEastEc+ecL/2+thick+bucketLEc/2+0.01 );
795 posE.setZ( ecL / 2 + thick + bucketLEc / 2 + 0.01 );
796 physicalBucketEc = new G4PVPlacement( 0, posE, logicalBucketEc, osnameBucketEc.str(),
797 logicalEcTofEast, false, 0 );
798 trapRot.rotateZ( angleEc ); // pay attention: not i*angleEc
799 }
800}

Referenced by Construct().

◆ ConstructEcTof() [2/3]

void BesTofConstruction::ConstructEcTof ( )

◆ ConstructEcTof() [3/3]

void BesTofConstruction::ConstructEcTof ( )

◆ ConstructEcTof_mrpc() [1/3]

void BesTofConstruction::ConstructEcTof_mrpc ( )

Definition at line 803 of file BesTofConstruction.cc.

803 {
804 // I construct my detector in the Geant4 coordinate system. It will be rotated into the BES
805 // coordinatesystem later!
806 // |z ___________
807 // | /y \ /
808 // | / \ /
809 // |/______x \_____/
810
811 G4double smallL = 0.01 * mm;
812 G4RotationMatrix rot_dummy( 0 * deg, 0 * deg, 0 * deg );
813 IniParam_mrpc();
814 PartProduce* partProduce = new PartProduce();
815 partProduce->IniParam();
816 bool checkOverlap = false;
817
818 // Get the parts and place them in the container
819 // container
820 std::ostringstream name;
821 // Create 4 containers and gasContainers
822 // 0: top module, closer to IP, longer bottom cover;
823 // 1: same to [0], with gas sensitive detector overturned;
824 // 2: bottom module, next to EMC, shorter bottom cover;
825 // 3: same to [2], with gas sensitive detector overturned
826 G4LogicalVolume* logical_container[4];
827 G4LogicalVolume* logical_gasContainer[4];
828 for ( int kk = 0; kk < 4; kk++ )
829 {
830 name.str( "" );
831 name << "logical_container_m" << kk;
832 logical_container[kk] = partProduce->lg_container( (int)kk / 2, name.str() );
833
834 name.str( "" );
835 name << "logical_gasContainer_m" << kk;
836 logical_gasContainer[kk] = partProduce->lg_gasContainer( name.str() );
837 }
838
839 // The parts that compose the container
840 G4LogicalVolume* logical_containerFrame =
841 partProduce->lg_containerFrame( "logical_containerFrame" );
842 G4LogicalVolume* logical_upCover = partProduce->lg_upCover( "logical_upCover" );
843 G4LogicalVolume* logical_lowCover1 = partProduce->lg_lowCover1( "logical_lowCover1" );
844 G4LogicalVolume* logical_lowCover2 = partProduce->lg_lowCover2( "logical_lowCover2" );
845 G4LogicalVolume* logical_upFEE = partProduce->lg_upFEE( "logical_upFEE" );
846 G4LogicalVolume* logical_sideFEE = partProduce->lg_sideFEE( "logical_sideFEE" );
847 G4LogicalVolume* logical_castingDie = partProduce->lg_castingDie( "logical_castingDie" );
848 G4LogicalVolume* logical_bareChamber = partProduce->lg_bareChamber( "logical_bareChamber" );
849 G4LogicalVolume* logical_bracket = partProduce->lg_bracket( "logical_bracket" );
850 G4LogicalVolume* logical_sideStopBlock =
851 partProduce->lg_sideStopBlock( "logical_sideStopBlock" );
852 G4LogicalVolume* logical_upStopBlock = partProduce->lg_upStopBlock( "logical_upStopBlock" );
853
854 // Place the parts in the container
855 for ( int kk = 0; kk < 4; kk++ )
856 {
857 // container frame
858 name.str( "" );
859 name << "physical_containerFrame_m" << kk;
860 new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logical_containerFrame, name.str(),
861 logical_container[kk], false, 0, checkOverlap );
862
863 // top cover
864 G4ThreeVector translation_upCover( 0, ( containerOut_y + upCover_y ) / 2 + smallL,
865 ( upCover_z - containerOut_z ) / 2 - upCover_posz );
866 name.str( "" );
867 name << "physical_upCover_m" << kk;
868 new G4PVPlacement( 0, translation_upCover, logical_upCover, name.str(),
869 logical_container[kk], false, 0, checkOverlap );
870
871 // bottom cover
872 name.str( "" );
873 name << "physical_lowCover_m" << kk;
874 if ( kk < 2 )
875 {
876 G4ThreeVector translation_lowCover( 0, -1 * ( containerOut_y + upCover_y ) / 2,
877 ( lowCover1_z - containerOut_z ) / 2 -
878 lowCover1_posz );
879 new G4PVPlacement( 0, translation_lowCover, logical_lowCover1, name.str(),
880 logical_container[kk], false, 0, checkOverlap );
881 }
882 else
883 {
884 G4ThreeVector translation_lowCover( 0, -1 * ( containerOut_y + upCover_y ) / 2,
885 ( lowCover2_z - containerOut_z ) / 2 -
886 lowCover2_posz );
887 new G4PVPlacement( 0, translation_lowCover, logical_lowCover2, name.str(),
888 logical_container[kk], false, 0, checkOverlap );
889 }
890
891 // FEE on the top cover
892 G4ThreeVector translation_upFEE( 0, containerOut_y / 2 + upCover_y + upFEE_y / 2 + smallL,
893 upCover_z - upFEE_posz - upFEE_z / 2 - upCover_posz -
894 containerOut_z / 2 );
895 name.str( "" );
896 name << "physical_upFEE_m" << kk;
897 new G4PVPlacement( 0, translation_upFEE, logical_upFEE, name.str(), logical_container[kk],
898 false, 0, checkOverlap );
899
900 // FEE at the side
901 double angle_containerFrameSide =
902 atan( ( containerOut_xup - containerOut_xdown ) / 2 / containerOut_z ) * rad;
903 double l_containerFrameSide = containerOut_z / cos( angle_containerFrameSide );
904 double x_sideFEE =
905 ( l_containerFrameSide / 2 - sideFEE_posl ) * sin( angle_containerFrameSide ) +
906 ( containerOut_xup + containerOut_xdown ) / 4 +
907 sideFEE_x / 2 * cos( angle_containerFrameSide );
908 double z_sideFEE =
909 ( l_containerFrameSide / 2 - sideFEE_posl ) * cos( angle_containerFrameSide ) -
910 sideFEE_x / 2 * sin( angle_containerFrameSide );
911 G4ThreeVector translation_sideFEE_left( -x_sideFEE, 0, z_sideFEE );
912 G4RotationMatrix rot_sideFEE_left;
913 rot_sideFEE_left.rotateY( -angle_containerFrameSide );
914 G4Transform3D transform_sideFEE_left( rot_sideFEE_left, translation_sideFEE_left );
915 name.str( "" );
916 name << "physical_sideFEE_left_m" << kk;
917 new G4PVPlacement( transform_sideFEE_left, logical_sideFEE, name.str(),
918 logical_container[kk], false, 0, checkOverlap );
919
920 G4ThreeVector translation_sideFEE_right( x_sideFEE, 0, z_sideFEE );
921 G4RotationMatrix rot_sideFEE_right;
922 rot_sideFEE_right.rotateZ( 180 * deg );
923 rot_sideFEE_right.rotateY( angle_containerFrameSide );
924 G4Transform3D transform_sideFEE_right( rot_sideFEE_right, translation_sideFEE_right );
925 name.str( "" );
926 name << "physical_sideFEE_right_m" << kk;
927 new G4PVPlacement( transform_sideFEE_right, logical_sideFEE, name.str(),
928 logical_container[kk], false, 0, checkOverlap );
929
930 // casting die
931 G4RotationMatrix rot_castingDie;
932 rot_castingDie.rotateX( -90 * deg );
933 G4ThreeVector translation_castingDie_1(
934 0, containerOut_y / 2 + upCover_y + castingDie_z / 2 + smallL,
935 -containerOut_z / 2 + upCover_posz + castingDie_posz1 );
936 G4Transform3D transform_castingDie_1( rot_castingDie, translation_castingDie_1 );
937 name.str( "" );
938 name << "physical_castingDie_1_m" << kk;
939 new G4PVPlacement( transform_castingDie_1, logical_castingDie, name.str(),
940 logical_container[kk], false, 0, checkOverlap );
941
942 G4ThreeVector translation_castingDie_2(
943 0, containerOut_y / 2 + upCover_y + castingDie_z / 2 + smallL,
944 -containerOut_z / 2 + upCover_posz + castingDie_posz2 );
945 G4Transform3D transform_castingDie_2( rot_castingDie, translation_castingDie_2 );
946 name.str( "" );
947 name << "physical_castingDie_2_m" << kk;
948 new G4PVPlacement( transform_castingDie_2, logical_castingDie, name.str(),
949 logical_container[kk], false, 0, checkOverlap );
950
951 // gas container
952 G4ThreeVector translation_gasContainer(
953 0, 0, ( container_lowBorder - container_thickness ) / 2 );
954 name.str( "" );
955 name << "physical_gasContainer_m" << kk;
956 new G4PVPlacement( 0, translation_gasContainer, logical_gasContainer[kk], name.str(),
957 logical_container[kk], false, 0, checkOverlap );
958 }
959
960 // Fill in the inside of the container
961 // 1mm from the bottom cover in design. Considering the modules's position are not real,
962 // change this number to make the bare chamber in the right place
963 double l_chamber = honeyComb_y * 2 + tape_mrpc_y * 2 + pcbBoard_y0 * 2 + pcbBoard_y1 +
964 mylar_y * 4 + glass0_y * 4 + glass1_y * 10 + gasLayer_y * 12;
965 double y_chamber;
966 double z_chamber = ( containerIn_z - pcbBoard_z ) / 2 - smallL;
967 for ( int kk = 0; kk < 4; kk++ )
968 {
969 if ( kk < 2 ) y_chamber = -( containerIn_y - l_chamber ) / 2 + chamber_in_posy;
970 else y_chamber = -( containerIn_y - l_chamber ) / 2 + chamber_out_posy;
971 G4Transform3D transform_bareChamber;
972 if ( kk == 0 || kk == 2 )
973 {
974 transform_bareChamber =
975 G4Transform3D( rot_dummy, G4ThreeVector( 0, y_chamber, z_chamber ) );
976 }
977 else
978 {
979 G4RotationMatrix rot_bareChamber;
980 rot_bareChamber.rotateZ( 180 * deg );
981 transform_bareChamber =
982 G4Transform3D( rot_bareChamber, G4ThreeVector( 0, y_chamber, z_chamber ) );
983 }
984 new G4PVPlacement( transform_bareChamber, logical_bareChamber, "physical_bareChamber",
985 logical_gasContainer[kk], false, 0, checkOverlap );
986
987 // lower bracket
988 G4double z_bracket = -( containerIn_z - bracket_z ) / 2 + smallL;
989 new G4PVPlacement( 0, G4ThreeVector( -bracket_posx, 0, z_bracket ), logical_bracket,
990 "physical_bracket_0", logical_gasContainer[kk], false, 0,
991 checkOverlap );
992 new G4PVPlacement( 0, G4ThreeVector( bracket_posx, 0, z_bracket ), logical_bracket,
993 "physical_bracket_1", logical_gasContainer[kk], false, 0,
994 checkOverlap );
995
996 // side stop block
997 G4Transform3D transform_sideStopBlock;
998 G4double angle_gasContainerSide =
999 ( atan( ( containerIn_xup - containerIn_xdown ) / 2 / ( containerIn_z ) ) ) * rad;
1000 G4double x_sideStopBlock = ( containerIn_xup + containerIn_xdown ) / 4 +
1001 sideStopBlock_posz0 * tan( angle_gasContainerSide ) -
1002 sideStopBlock_x / 2 * cos( angle_gasContainerSide );
1003 G4double z_sideStopBlock =
1004 sideStopBlock_posz0 + sideStopBlock_x / 2 * sin( angle_gasContainerSide );
1005
1006 G4RotationMatrix rot_sideStopBlock;
1007 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1008 rot_sideStopBlock.rotateZ( 180 * deg );
1009 transform_sideStopBlock = G4Transform3D(
1010 rot_sideStopBlock, G4ThreeVector( -x_sideStopBlock, 0, z_sideStopBlock ) );
1011 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1012 "physical_sideStopBlock_0", logical_gasContainer[kk], false, 0,
1013 checkOverlap );
1014
1015 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1016 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1017 transform_sideStopBlock = G4Transform3D(
1018 rot_sideStopBlock, G4ThreeVector( x_sideStopBlock, 0, z_sideStopBlock ) );
1019 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1020 "physical_sideStopBlock_1", logical_gasContainer[kk], false, 0,
1021 checkOverlap );
1022
1023 x_sideStopBlock = ( containerIn_xup + containerIn_xdown ) / 4 +
1024 sideStopBlock_posz1 * tan( angle_gasContainerSide ) -
1025 sideStopBlock_x / 2 * cos( angle_gasContainerSide );
1026 z_sideStopBlock =
1027 sideStopBlock_posz1 + sideStopBlock_x / 2 * sin( angle_gasContainerSide );
1028 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1029 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1030 rot_sideStopBlock.rotateZ( 180 * deg );
1031 transform_sideStopBlock = G4Transform3D(
1032 rot_sideStopBlock, G4ThreeVector( -x_sideStopBlock, 0, z_sideStopBlock ) );
1033 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1034 "physical_sideStopBlock_2", logical_gasContainer[kk], false, 0,
1035 checkOverlap );
1036
1037 rot_sideStopBlock = G4RotationMatrix( 0, 0, 0 );
1038 rot_sideStopBlock.rotateY( angle_gasContainerSide );
1039 transform_sideStopBlock = G4Transform3D(
1040 rot_sideStopBlock, G4ThreeVector( x_sideStopBlock, 0, z_sideStopBlock ) );
1041 new G4PVPlacement( transform_sideStopBlock, logical_sideStopBlock,
1042 "physical_sideStopBlock_3", logical_gasContainer[kk], false, 0,
1043 checkOverlap );
1044 }
1045
1046 // stop block
1047 // upper stop block
1048 G4double x_upStopBlock = containerIn_xup / 4;
1049 G4double y_upStopBlock =
1050 pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * 2.5 + gasLayer_y * 3;
1051 G4double z_upStopBlock = ( pcbBoard_z - upStopBlock_z ) / 2 - smallL;
1052 new G4PVPlacement( 0, G4ThreeVector( -x_upStopBlock, -y_upStopBlock, z_upStopBlock ),
1053 logical_upStopBlock, "physical_upStopBlock_0", logical_bareChamber, false,
1054 0, checkOverlap );
1055 new G4PVPlacement( 0, G4ThreeVector( -x_upStopBlock, y_upStopBlock, z_upStopBlock ),
1056 logical_upStopBlock, "physical_upStopBlock_1", logical_bareChamber, false,
1057 0, checkOverlap );
1058 new G4PVPlacement( 0, G4ThreeVector( x_upStopBlock, -y_upStopBlock, z_upStopBlock ),
1059 logical_upStopBlock, "physical_upStopBlock_2", logical_bareChamber, false,
1060 0, checkOverlap );
1061 new G4PVPlacement( 0, G4ThreeVector( x_upStopBlock, y_upStopBlock, z_upStopBlock ),
1062 logical_upStopBlock, "physical_upStopBlock_3", logical_bareChamber, false,
1063 0, checkOverlap );
1064
1065 // honeyComb
1066 G4LogicalVolume* logical_honeyComb = partProduce->lg_honeyComb( "logical_honeyComb" );
1067 G4double y_honeyComb = ( honeyComb_y + pcbBoard_y1 ) / 2 + tape_mrpc_y + pcbBoard_y0 +
1068 mylar_y * 2 + glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1069 G4double z_honeyComb = ( pcbBoard_z - honeyComb_z ) / 2 - honeyComb_posz;
1070 new G4PVPlacement( 0, G4ThreeVector( 0, y_honeyComb, z_honeyComb ), logical_honeyComb,
1071 "physical_honeyComb_0", logical_bareChamber, false, 0, checkOverlap );
1072 new G4PVPlacement( 0, G4ThreeVector( 0, -1 * y_honeyComb, z_honeyComb ), logical_honeyComb,
1073 "physical_honeyComb_1", logical_bareChamber, false, 1, checkOverlap );
1074
1075 // tape_mrpc
1076 G4LogicalVolume* logical_tape_mrpc = partProduce->lg_tape_mrpc( "logical_tape_mrpc" );
1077 G4double y_tape_mrpc = ( tape_mrpc_y + pcbBoard_y1 ) / 2 + pcbBoard_y0 + mylar_y * 2 +
1078 glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1079 G4double z_tape_mrpc = ( pcbBoard_z - tape_mrpc_z ) / 2 - tape_mrpc_posz;
1080 new G4PVPlacement( 0, G4ThreeVector( 0, y_tape_mrpc, z_tape_mrpc ), logical_tape_mrpc,
1081 "physical_tape_mrpc_0", logical_bareChamber, false, 0, checkOverlap );
1082 new G4PVPlacement( 0, G4ThreeVector( 0, -1 * y_tape_mrpc, z_tape_mrpc ), logical_tape_mrpc,
1083 "physical_tape_mrpc_1", logical_bareChamber, false, 1, checkOverlap );
1084
1085 // pcbBoard
1086 G4LogicalVolume* logical_pcbBoard0 = partProduce->lg_pcbBoard( 0, "logical_pcbBoard0" );
1087 G4double y_pcbBoard = ( pcbBoard_y0 + pcbBoard_y1 ) / 2 + mylar_y * 2 + glass0_y * 2 +
1088 glass1_y * 5 + gasLayer_y * 6;
1089 new G4PVPlacement( 0, G4ThreeVector( 0, y_pcbBoard, 0 ), logical_pcbBoard0,
1090 "physical_pcbBoard0_0", logical_bareChamber, false, 0, checkOverlap );
1091 // Notice!!! I rotate 180 deg in order to make the strips near the PCB surface,
1092 // but keep in mind that this will make the readout strips not mirror symmetry, but Z axial
1093 // symmetry
1094 G4RotationMatrix* rot_pcbBoard = new G4RotationMatrix();
1095 rot_pcbBoard->rotateZ( 180 * degree );
1096 new G4PVPlacement( rot_pcbBoard, G4ThreeVector( 0, -1 * y_pcbBoard, 0 ), logical_pcbBoard0,
1097 "physical_pcbBoard0_1", logical_bareChamber, false, 1, checkOverlap );
1098
1099 G4LogicalVolume* logical_pcbBoard1 = partProduce->lg_pcbBoard( 1, "logical_pcbBoard1" );
1100 new G4PVPlacement( 0, G4ThreeVector( 0, 0, 0 ), logical_pcbBoard1, "physical_pcbBoard1",
1101 logical_bareChamber, false, 0, checkOverlap );
1102
1103 // readout strip
1104 G4AssemblyVolume* logical_strip = partProduce->lg_strip( "logical_strip" );
1105 G4double z_strip = ( pcbBoard_z - 12 * strip_z - 11 * strip_gap ) / 2 - strip_posz;
1106 G4Transform3D transform_strip(
1107 rot_dummy, G4ThreeVector( 0, pcbBoard_y0 / 2. - strip_y / 2 - smallL, z_strip ) );
1108 logical_strip->MakeImprint( logical_pcbBoard0, transform_strip );
1109 transform_strip = G4Transform3D( rot_dummy, G4ThreeVector( 0, 0, z_strip ) );
1110 logical_strip->MakeImprint( logical_pcbBoard1, transform_strip );
1111
1112 // mylar
1113 G4LogicalVolume* logical_mylar = partProduce->lg_mylar( "logical_mylar" );
1114 G4double y_mylar =
1115 ( mylar_y + pcbBoard_y1 ) / 2 + mylar_y + glass0_y * 2 + glass1_y * 5 + gasLayer_y * 6;
1116 G4double z_mylar = ( pcbBoard_z - mylar_z ) / 2 - mylar_posz;
1117 new G4PVPlacement( 0, G4ThreeVector( 0, y_mylar, z_mylar ), logical_mylar,
1118 "physical_mylar_0", logical_bareChamber, false, 0, checkOverlap );
1119 new G4PVPlacement( 0, G4ThreeVector( 0, -y_mylar, z_mylar ), logical_mylar,
1120 "physical_mylar_3", logical_bareChamber, false, 3, checkOverlap );
1121
1122 y_mylar = ( mylar_y + pcbBoard_y1 ) / 2;
1123 new G4PVPlacement( 0, G4ThreeVector( 0, y_mylar, z_mylar ), logical_mylar,
1124 "physical_mylar_1", logical_bareChamber, false, 1, checkOverlap );
1125 new G4PVPlacement( 0, G4ThreeVector( 0, -y_mylar, z_mylar ), logical_mylar,
1126 "physical_mylar_2", logical_bareChamber, false, 2, checkOverlap );
1127
1128 // glass
1129 G4LogicalVolume* logical_glass0 = partProduce->lg_glass( 0, "logical_glass0" );
1130 G4double y_glass =
1131 ( glass0_y + pcbBoard_y1 ) / 2. + mylar_y + glass0_y + glass1_y * 5 + gasLayer_y * 6;
1132 G4double z_glass = ( pcbBoard_z - glass0_z ) / 2. - glass0_posz;
1133 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass0,
1134 "physical_glass0_0", logical_bareChamber, false, 0, checkOverlap );
1135 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass0,
1136 "physical_glass0_3", logical_bareChamber, false, 3, checkOverlap );
1137 y_glass = pcbBoard_y1 / 2. + mylar_y + glass0_y / 2.;
1138 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass0,
1139 "physical_glass0_1", logical_bareChamber, false, 1, checkOverlap );
1140 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass0,
1141 "physical_glass0_2", logical_bareChamber, false, 2, checkOverlap );
1142
1143 G4LogicalVolume* logical_glass1 = partProduce->lg_glass( 1, "logical_glass1" );
1144 z_glass = ( pcbBoard_z - glass1_z ) / 2. - glass1_posz;
1145 for ( G4int i = 0; i < 5; i++ )
1146 {
1147 y_glass = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( 4.5 - i ) +
1148 gasLayer_y * ( 5 - i );
1149 name.str( "" );
1150 name << "physical_glass1_" << i;
1151 new G4PVPlacement( 0, G4ThreeVector( 0, y_glass, z_glass ), logical_glass1, name.str(),
1152 logical_bareChamber, false, i, checkOverlap );
1153 name.str( "" );
1154 name << "physical_glass1_" << 9 - i;
1155 new G4PVPlacement( 0, G4ThreeVector( 0, -y_glass, z_glass ), logical_glass1, name.str(),
1156 logical_bareChamber, false, 9 - i, checkOverlap );
1157 }
1158
1159 // gas
1160 logical_gasLayer = partProduce->lg_gasLayer( "logical_gasLayer" );
1161 G4double y_gasLayer;
1162 G4double z_gasLayer = ( pcbBoard_z - gasLayer_z ) / 2. - gasLayer_posz;
1163 G4VPhysicalVolume* physical_gasLayer[12];
1164 for ( G4int i = 0; i < 6; i++ ) // y->larger, gasNp->larger
1165 {
1166 y_gasLayer = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( 5 - i ) +
1167 gasLayer_y * ( 5.5 - i );
1168 name.str( "" );
1169 name << "physical_gasLayer_" << 11 - i;
1170 physical_gasLayer[i] =
1171 new G4PVPlacement( 0, G4ThreeVector( 0, -y_gasLayer, z_gasLayer ), logical_gasLayer,
1172 name.str(), logical_bareChamber, false, 11 - i, checkOverlap );
1173 }
1174 for ( G4int i = 6; i < 12; i++ )
1175 {
1176 y_gasLayer = pcbBoard_y1 / 2. + mylar_y + glass0_y + glass1_y * ( i - 6 ) +
1177 gasLayer_y * ( -5.5 + i );
1178 name.str( "" );
1179 name << "physical_gasLayer_" << 11 - i;
1180 physical_gasLayer[i] =
1181 new G4PVPlacement( 0, G4ThreeVector( 0, y_gasLayer, z_gasLayer ), logical_gasLayer,
1182 name.str(), logical_bareChamber, false, 11 - i, checkOverlap );
1183 }
1184
1185 // arrange the 72 modules in the endcap, it's assumed to form two semicircles with a gap of
1186 // about 2mm
1187
1188 // Z: East; y: Up; x: North
1189 // /y |z y y|/|
1190 // |z/ ___________ rotateX | / rotateZ /| |
1191 // |/_____x \ / ___|_/_ ||_|____x
1192 // \ / ->>>> / |/__\___x ->>>> | |
1193 // small end \_____/ bigger end /_________\ \ |
1194 // \|
1195
1196 const G4int n_module = 36;
1197 G4double angle = 360.0 * deg / n_module;
1198 G4double z_layerIn = endcap_length / 2 - containerOut_y / 2 - lowCover1_y - layer_posz;
1199 G4double z_layerOut = endcap_length / 2 - containerOut_y / 2 - lowCover2_y - layer_posz;
1200 // Adjusting parameters
1201 // rOffset_east: along R direction
1202 // angle_east: along phi direction
1203 // angleOffset_east: along self asymmetric axis
1204 rOffset_east = tofPara->GetVec( "rOffset_east" );
1205 angle_east = tofPara->GetVec( "angle_east" );
1206 angleOffset_east = tofPara->GetVec( "angleOffset_east" );
1207 rOffset_west = tofPara->GetVec( "rOffset_west" );
1208 angle_west = tofPara->GetVec( "angle_west" );
1209 angleOffset_west = tofPara->GetVec( "angleOffset_west" );
1210
1211 // arrange east endcap
1212 for ( int i = 0; i < n_module; i++ )
1213 {
1214 G4double angle_module = startAngle_east + angle_east[i] + i * angle;
1215 G4double r_module = endcap_r + rOffset_east[i];
1216
1217 G4RotationMatrix rot_layerIn_east;
1218 rot_layerIn_east.rotateX( 90. * deg );
1219 rot_layerIn_east.rotateZ( 90. * deg );
1220 rot_layerIn_east.rotateZ( angle_module + angleOffset_east[i] );
1221
1222 G4ThreeVector translation_layerIn_east = G4ThreeVector(
1223 r_module * cos( angle_module ), r_module * sin( angle_module ), -z_layerIn );
1224 G4Transform3D transform_layerIn_east =
1225 G4Transform3D( rot_layerIn_east, translation_layerIn_east );
1226
1227 G4RotationMatrix rot_layerOut_east;
1228 rot_layerOut_east.rotateZ( 180. * deg );
1229 rot_layerOut_east.rotateX( 90. * deg );
1230 rot_layerOut_east.rotateZ( 90. * deg );
1231 rot_layerOut_east.rotateZ( angle_module + angleOffset_east[i] );
1232
1233 G4ThreeVector translation_layerOut_east = G4ThreeVector(
1234 r_module * cos( angle_module ), r_module * sin( angle_module ), z_layerOut );
1235 G4Transform3D transform_layerOut_east =
1236 G4Transform3D( rot_layerOut_east, translation_layerOut_east );
1237
1238 name.str( "" );
1239 name << "physical_mrpc_east_" << i;
1240 if ( i % 2 == 0 )
1241 {
1242 new G4PVPlacement( transform_layerOut_east, logical_container[3], name.str(),
1243 logicalEcTofEast, false, i, checkOverlap );
1244 }
1245 else
1246 {
1247 new G4PVPlacement( transform_layerIn_east, logical_container[0], name.str(),
1248 logicalEcTofEast, false, i, checkOverlap );
1249 }
1250 }
1251
1252 // arrange west endcap
1253 for ( int i = 0; i < n_module; i++ )
1254 {
1255 G4double angle_module = startAngle_west + angle_west[i] + i * angle;
1256 G4double r_module = endcap_r + rOffset_west[i];
1257
1258 G4RotationMatrix rot_layerIn_west;
1259 rot_layerIn_west.rotateZ( 180. * deg );
1260 rot_layerIn_west.rotateX( 90. * deg );
1261 rot_layerIn_west.rotateZ( 90. * deg );
1262 rot_layerIn_west.rotateZ( angle_module + angleOffset_west[i] );
1263
1264 G4ThreeVector translation_layerIn_west = G4ThreeVector(
1265 r_module * cos( angle_module ), r_module * sin( angle_module ), z_layerIn );
1266 G4Transform3D transform_layerIn_west =
1267 G4Transform3D( rot_layerIn_west, translation_layerIn_west );
1268
1269 G4RotationMatrix rot_layerOut_west;
1270 rot_layerOut_west.rotateX( 90. * deg );
1271 rot_layerOut_west.rotateZ( 90. * deg );
1272 rot_layerOut_west.rotateZ( angle_module + angleOffset_west[i] );
1273
1274 G4ThreeVector translation_layerOut_west = G4ThreeVector(
1275 r_module * cos( angle_module ), r_module * sin( angle_module ), -z_layerOut );
1276 G4Transform3D transform_layerOut_west =
1277 G4Transform3D( rot_layerOut_west, translation_layerOut_west );
1278
1279 name.str( "" );
1280 name << "physical_mrpc_west_" << i;
1281 if ( i % 2 == 0 )
1282 {
1283 new G4PVPlacement( transform_layerOut_west, logical_container[2], name.str(),
1284 logicalEcTofWest, false, i, checkOverlap );
1285 }
1286 else
1287 {
1288 new G4PVPlacement( transform_layerIn_west, logical_container[1], name.str(),
1289 logicalEcTofWest, false, i, checkOverlap );
1290 }
1291 }
1292}
G4double smallL
G4RotationMatrix rot_dummy(0 *deg, 0 *deg, 0 *deg)
bool checkOverlap
G4LogicalVolume * lg_sideFEE(string name="")
void IniParam()
G4LogicalVolume * lg_mylar(string name="")
G4LogicalVolume * lg_lowCover1(string name="")
G4LogicalVolume * lg_glass(G4int flag, string name="")
G4LogicalVolume * lg_container(int flag, string name="")
G4LogicalVolume * lg_gasContainer(string name="")
G4LogicalVolume * lg_sideStopBlock(string name="")
G4AssemblyVolume * lg_strip(string name="")
G4LogicalVolume * lg_honeyComb(string name="")
G4LogicalVolume * lg_containerFrame(string name="")
G4LogicalVolume * lg_lowCover2(string name="")
G4LogicalVolume * lg_pcbBoard(G4int flag, string name="")
G4LogicalVolume * lg_bracket(string name="")
G4LogicalVolume * lg_bareChamber(string name="")
G4LogicalVolume * lg_upStopBlock(string name="")
G4LogicalVolume * lg_tape_mrpc(string name="")
G4LogicalVolume * lg_gasLayer(string name="")
G4LogicalVolume * lg_castingDie(string name="")
G4LogicalVolume * lg_upFEE(string name="")
G4LogicalVolume * lg_upCover(string name="")

Referenced by Construct().

◆ ConstructEcTof_mrpc() [2/3]

void BesTofConstruction::ConstructEcTof_mrpc ( )

◆ ConstructEcTof_mrpc() [3/3]

void BesTofConstruction::ConstructEcTof_mrpc ( )

◆ DefineMaterial() [1/3]

void BesTofConstruction::DefineMaterial ( )

Definition at line 1294 of file BesTofConstruction.cc.

1295{
1296 G4double a, z, density, fraction;
1297 G4int nel, natoms, ncomponents;
1298 G4String name, symbol;
1299
1300 G4Element* H = G4Element::GetElement( "Hydrogen" );
1301 if ( !H ) H = new G4Element( name = "Hydrogen", symbol = "H", z = 1., a = 1.01 * g / mole );
1302
1303 G4Element* C = G4Element::GetElement( "Carbon" );
1304 if ( !C ) C = new G4Element( name = "Carbon", symbol = "C", z = 6., a = 12.01 * g / mole );
1305
1306 G4Element* F = G4Element::GetElement( "Fluorin" );
1307 if ( !F ) F = new G4Element( name = "Fluorin", symbol = "F", z = 9., a = 18.01 * g / mole );
1308
1309 G4Element* O = G4Element::GetElement( "Oxygen" );
1310 if ( !O ) O = new G4Element( name = "Oxygen", symbol = "O", z = 8., a = 16.00 * g / mole );
1311
1312 G4Element* N = G4Element::GetElement( "Nitrogen" );
1313 if ( !N ) N = new G4Element( name = "Nitrogen", symbol = "N", z = 7., a = 14.01 * g / mole );
1314
1315 G4Element* S = G4Element::GetElement( "Sulfur" );
1316 if ( !S ) S = new G4Element( name = "Sulfur", symbol = "S", z = 16., a = 32.06 * g / mole );
1317
1318 BC404 = new G4Material( "BC404", density = 1.032 * g / cm3, nel = 2 );
1319 BC404->AddElement( C, 10 );
1320 BC404->AddElement( H, 11 );
1321
1322 BC408 = new G4Material( "BC408", density = 1.032 * g / cm3, nel = 2 );
1323 BC408->AddElement( C, 1000 );
1324 BC408->AddElement( H, 1104 );
1325
1326 PVF = new G4Material( "PVF", density = 1.45 * g / cm3, nel = 3 );
1327 PVF->AddElement( C, 2 );
1328 PVF->AddElement( H, 3 );
1329 PVF->AddElement( F, 1 );
1330
1331 // PMT mixed material
1332 G4Material* Cu = G4Material::GetMaterial( "Copper" );
1333 G4Material* Al = G4Material::GetMaterial( "Aluminium" );
1334
1335 // vacuum
1336 // G4Material* Vacuum = new G4Material("Galactic", z=1., a=1.01*g/mole,
1337 // density= universe_mean_density, kStateGas, 3.e-18*pascal, 2.73*kelvin);
1338
1339 density = 1.4618815 * g / cm3;
1340 PMTmaterial = new G4Material( name = "PMTmaterial", density, 4 );
1341 PMTmaterial->AddMaterial( Al, 0.4495 );
1342 PMTmaterial->AddMaterial( Cu, 0.35 );
1343 PMTmaterial->AddMaterial( G4Material::GetMaterial( "SiO2" ), 0.2 );
1344 PMTmaterial->AddMaterial( G4Material::GetMaterial( "Air" ), 0.0005 );
1345 // PMTmaterial->AddMaterial(Vacuum,0.1);
1346 G4cout << PMTmaterial;
1347
1348 density = 1.002 * g / cm3;
1349 G4Material* tape = new G4Material( name = "tape", density, nel = 2 );
1350 tape->AddElement( C, 2 );
1351 tape->AddElement( H, 5 );
1352
1353 // MRPC material
1354 // The stop block in the gas container
1355 G4Material* Nylon = new G4Material( "Nylon", density = 1.15 * g / cm3, ncomponents = 4 );
1356 Nylon->AddElement( C, natoms = 2 );
1357 Nylon->AddElement( H, natoms = 3 );
1358 Nylon->AddElement( O, natoms = 1 );
1359 Nylon->AddElement( N, natoms = 1 );
1360 G4cout << Nylon << G4endl;
1361
1362 // The core of honeyComb is thought to be cellulose
1363 G4Material* honeycombCore =
1364 new G4Material( "honeycombCore", density = 0.024 * g / cm3, ncomponents = 3 );
1365 honeycombCore->AddElement( C, natoms = 6 );
1366 honeycombCore->AddElement( H, natoms = 10 );
1367 honeycombCore->AddElement( O, natoms = 5 );
1368 G4cout << honeycombCore << G4endl;
1369
1370 // The honeyComb surface and the PCB board are thought to be composed of SiO2(60%) and epoxy
1371 // resins(40%)
1372 G4Material* epoxy = new G4Material( "epoxy", density = 1.2 * g / cm3, ncomponents = 3 );
1373 epoxy->AddElement( C, natoms = 11 );
1374 epoxy->AddElement( H, natoms = 12 );
1375 epoxy->AddElement( O, natoms = 3 );
1376 G4cout << epoxy << G4endl;
1377
1378 G4Material* insulationBoard =
1379 new G4Material( "insulationBoard", density = 1.85 * g / cm3, 2 );
1380 insulationBoard->AddMaterial( G4Material::GetMaterial( "SiO2" ), 0.6 );
1381 insulationBoard->AddMaterial( epoxy, 0.4 );
1382 G4cout << insulationBoard << G4endl;
1383
1384 // Mylar and tape are thought to be PET
1385 G4Material* PET = new G4Material( "PET", density = 1.39 * g / cm3, ncomponents = 3 );
1386 PET->AddElement( C, natoms = 10 );
1387 PET->AddElement( H, natoms = 8 );
1388 PET->AddElement( O, natoms = 4 );
1389 G4cout << PET << G4endl;
1390
1391 // MRPC gas: 90% r134a, 5% isobutan, 5% SF6
1392 G4Material* FreonR134A =
1393 new G4Material( "FreonR134A", density = 4.241 * mg / cm3, ncomponents = 3 );
1394 FreonR134A->AddElement( C, natoms = 2 );
1395 FreonR134A->AddElement( H, natoms = 2 );
1396 FreonR134A->AddElement( F, natoms = 4 );
1397 G4cout << FreonR134A << G4endl;
1398
1399 G4Material* SF6 = new G4Material( "SF6", density = 6.14 * mg / cm3, ncomponents = 2 );
1400 SF6->AddElement( S, natoms = 1 );
1401 SF6->AddElement( F, natoms = 6 );
1402 G4cout << SF6 << G4endl;
1403
1404 G4Material* Isobutan =
1405 new G4Material( "Isobutan", density = 2.487 * mg / cm3, ncomponents = 2 );
1406 Isobutan->AddElement( C, natoms = 4 );
1407 Isobutan->AddElement( H, natoms = 10 );
1408 G4cout << Isobutan << G4endl;
1409
1410 G4Material* MRPCGas =
1411 new G4Material( name = "MRPCGas", density = 4.17 * mg / cm3, ncomponents = 3 );
1412 MRPCGas->AddMaterial( FreonR134A, fraction = 89.69 * perCent );
1413 MRPCGas->AddMaterial( SF6, fraction = 7.34 * perCent );
1414 MRPCGas->AddMaterial( Isobutan, fraction = 2.97 * perCent );
1415
1416 // This setting is to produce ion pairs, default is 0
1417 if ( 0.0 == MRPCGas->GetIonisation()->GetMeanEnergyPerIonPair() )
1418 {
1419 // MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair(20*eV);
1420 MRPCGas->GetIonisation()->SetMeanEnergyPerIonPair( m_ionE * eV );
1421 }
1422 G4cout << MRPCGas << G4endl;
1423}
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition RRes.h:29
IMPLICIT REAL *A H
Definition myXsection.h:1

Referenced by Construct().

◆ DefineMaterial() [2/3]

void BesTofConstruction::DefineMaterial ( )

◆ DefineMaterial() [3/3]

void BesTofConstruction::DefineMaterial ( )

◆ getXYZ() [1/3]

void BesTofConstruction::getXYZ ( const G4RotationMatrix r,
double & a,
double & b,
double & c ) const

Definition at line 1425 of file BesTofConstruction.cc.

1426 {
1427 double cosb = sqrt( r.xx() * r.xx() + r.yx() * r.yx() );
1428
1429 if ( cosb > 16 * FLT_EPSILON )
1430 {
1431 a = atan2( r.zy(), r.zz() );
1432 b = atan2( -r.zx(), cosb );
1433 c = atan2( r.yx(), r.xx() );
1434 }
1435 else
1436 {
1437 a = atan2( -r.yz(), r.yy() );
1438 b = atan2( -r.zx(), cosb );
1439 c = 0.;
1440 }
1441 // std::cout.precision(20);
1442 // std::cout<<"in getXYZ :( "<<r.xx()<<" "<<r.xy()<<" "<<r.xz()<<std::endl;
1443 // std::cout<<" "<<r.yx()<<" "<<r.yy()<<" "<<r.yz()<<std::endl;
1444 // std::cout<<" "<<r.zx()<<" "<<r.zy()<<" "<<r.zz()<<std::endl;
1445 // std::cout<<"details: cosb="<<cosb<<" a="<<a<<" b="<<b<<" c="<<c<<"
1446 // min="<<16*FLT_EPSILON<<std::endl;
1447
1448 G4RotationMatrix temp;
1449 temp.rotateZ( ( c / deg ) * deg );
1450 // std::cout.precision(20);
1451 // std::cout<<"in detail temp2:( "<<temp.xx()<<" "<<temp.xy()<<" "<<temp.xz()<<std::endl;
1452 // std::cout<<" "<<temp.yx()<<" "<<temp.yy()<<" "<<temp.yz()<<std::endl;
1453 // std::cout<<" "<<temp.zx()<<" "<<temp.zy()<<" "<<temp.zz()<<std::endl;
1454}

Referenced by ConstructBr1Tof(), ConstructBr2Tof(), and ConstructEcTof().

◆ getXYZ() [2/3]

void BesTofConstruction::getXYZ ( const G4RotationMatrix r,
double & a,
double & b,
double & c ) const

◆ getXYZ() [3/3]

void BesTofConstruction::getXYZ ( const G4RotationMatrix r,
double & a,
double & b,
double & c ) const

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