Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
FCALTestbeamSetup Class Reference

#include <FCALTestbeamSetup.hh>

Inheritance diagram for FCALTestbeamSetup:
G4VUserDetectorConstruction

Public Member Functions

 FCALTestbeamSetup ()
 
 ~FCALTestbeamSetup ()
 
G4VPhysicalVolumeConstruct ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 52 of file FCALTestbeamSetup.hh.

Constructor & Destructor Documentation

FCALTestbeamSetup::FCALTestbeamSetup ( )

Definition at line 65 of file FCALTestbeamSetup.cc.

65  : FCALTBSetupSD(0) {
66 #include "FCALTestbeamSetupParameters.input"
67 }
FCALTestbeamSetup::~FCALTestbeamSetup ( )

Definition at line 69 of file FCALTestbeamSetup.cc.

69 {}

Member Function Documentation

G4VPhysicalVolume * FCALTestbeamSetup::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 71 of file FCALTestbeamSetup.cc.

References G4SDManager::AddNewDetector(), FCALCryostatVolumes::Construct(), FCALMaterialConsultant::construct(), python.hepunit::deg, G4SDManager::GetSDMpointer(), G4VisAttributes::Invisible, FCALMaterialConsultant::Material(), CLHEP::HepRotation::rotateX(), G4LogicalVolume::SetSensitiveDetector(), and G4LogicalVolume::SetVisAttributes().

72 {
73  G4int i;
74 
75  //-----------------------------
76  // construction of materials
77  //-----------------------------
78 
79  FCALMaterialConsultant * FCALMaterials = new FCALMaterialConsultant();
80  FCALMaterials->construct();
81 
82  //-------------------
83  // Experimental Hall
84  //-------------------
85  G4Box * SolidMother = new G4Box("Mother",MotherSizeX,MotherSizeY,MotherSizeZ);
86  G4LogicalVolume * LogicalMother =
87  new G4LogicalVolume(SolidMother,FCALMaterials->Material("Air"),"Mother");
88  G4VPhysicalVolume * PhysicalMother =
89  new G4PVPlacement(0, G4ThreeVector(),"Mother", LogicalMother, NULL, 0,0);
90 
92 
93 
94  //-------------------------------
95  // Scintillators S1, S2 and S3
96  //-------------------------------
97  G4Box * SolidScintS1andS3 =
98  new G4Box("ScintS1andS3Solid",ScintS1andS3SizeX, ScintS1andS3SizeY, ScintS1andS3SizeZ);
99  G4Box * SolidScintS2 =
100  new G4Box("ScintS2Solid", ScintS2SizeX, ScintS2SizeY, ScintS2SizeZ);
101 
102  G4LogicalVolume * LogicalScintS1andS3 =
103  new G4LogicalVolume(SolidScintS1andS3,FCALMaterials->Material("Polystyrene"),
104  "ScintS1andS3Logical");
105  G4LogicalVolume * LogicalScintS2 =
106  new G4LogicalVolume(SolidScintS2, FCALMaterials->Material("Polystyrene"),
107  "ScintS2Logical");
108 
109  // G4VPhysicalVolume * PhysicalScintS1 =
110  new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS1PosZ),
111  "ScintS1Physical",LogicalScintS1andS3,PhysicalMother,0,0);
112  // G4VPhysicalVolume * PhysicalScintS3 =
113  new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS3PosZ),
114  "ScintS3Physical",LogicalScintS1andS3,PhysicalMother,0,0);
115  // G4VPhysicalVolume * PhysicalScintS2 =
116  new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS2PosZ),
117  "ScintS2Physical", LogicalScintS2, PhysicalMother,0,0);
118 
119  G4VisAttributes * ColorOfScintillator = new G4VisAttributes(G4Colour(0.,0.8,0.));
120  LogicalScintS1andS3->SetVisAttributes(ColorOfScintillator);
121  LogicalScintS2->SetVisAttributes(ColorOfScintillator);
122 
123 
124  //-------------------
125  // MWPC's
126  //-------------------
127  G4Box* SolidMWPC = new G4Box("MWPCSolid",MWPCSizeX,MWPCSizeY,MWPCSizeZ);
128  G4LogicalVolume * LogicalMWPC =
129  new G4LogicalVolume(SolidMWPC,FCALMaterials->Material("MWPCArCO2"),"MWPCLogical");
130  for(i=0; i<5; i++)
131  {
132  // G4VPhysicalVolume * PhysicalMWPC =
133  new G4PVPlacement(0,G4ThreeVector(MWPCPosX,MWPCPosY,MWPCPosZ[i]),
134  "MWPCPhysical", LogicalMWPC, PhysicalMother,0,i+1);
135  }
136  G4VisAttributes * ColorOfMWPC = new G4VisAttributes(G4Colour(0.,0.,0.5));
137  LogicalMWPC->SetVisAttributes(ColorOfMWPC);
138 
139  //---------------------------------------
140  // Hole Counter (scintillator + Pb + Al
141  //---------------------------------------
142  // Scintillator Counter
143  G4Box * SolidHoleCntrScint =
144  new G4Box("ScintSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrScintSizeZ);
145  G4LogicalVolume * LogicalHoleCntrScint =
146  new G4LogicalVolume(SolidHoleCntrScint, FCALMaterials->Material("Polystyrene"),
147  "HoleCntrScintLogical");
148  // Hole in scintillator Counter
149  G4Tubs * SolidHole =
150  new G4Tubs("HoleSolid", ScintHoleRmin, ScintHoleRmax, ScintHoleLenght,
151  HoleStartPhi, HoleDPhi);
152  G4LogicalVolume * LogicalHole =
153  new G4LogicalVolume(SolidHole, FCALMaterials->Material("Air"), "HoleLogical");
154  // G4VPhysicalVolume * PhysicalHoleScint =
155  new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHole,
156  "HolePhysicalScint", LogicalHoleCntrScint, 0, 0);
157  // Scintillator Hole counter placement
158  // G4VPhysicalVolume * PhysicalHoleCntrScint =
159  new G4PVPlacement(0,
160  G4ThreeVector(HoleCntrScintPosX, HoleCntrScintPosY, HoleCntrScintPosZ),
161  "HoleCntrScintPhysical", LogicalHoleCntrScint, PhysicalMother, 0, 0);
162 
163  // Absorber Lead
164  G4Box * SolidHoleCntrAbsrb =
165  new G4Box("AbsrbSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrAbsrbSizeZ);
166  G4LogicalVolume * LogicalHoleCntrPb =
167  new G4LogicalVolume(SolidHoleCntrAbsrb, FCALMaterials->Material("Lead"),
168  "HoleCntrPbLoghical");
169 
170  //hole in ABsorber, both Lead and Al.
171  G4Tubs * SolidHoleAbs =
172  new G4Tubs("HoleSolidAbs", AbsrbHoleRmin, AbsrbHoleRmax, AbsrbHoleLenght,
173  HoleStartPhi, HoleDPhi);
174  G4LogicalVolume * LogicalHoleAbs =
175  new G4LogicalVolume(SolidHoleAbs, FCALMaterials->Material("Air"),"HoleAbsLogical");
176  // G4VPhysicalVolume * PhysicalHolePb =
177  new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs,
178  "HolePbPhysical", LogicalHoleCntrPb, 0, 0);
179 
180  // Lead Placement
181  // G4VPhysicalVolume * PhysicalHoleCntrPb =
182  new G4PVPlacement(0, G4ThreeVector(HoleCntrPbPosX, HoleCntrPbPosY, HoleCntrPbPosZ),
183  "HoleCntrPbPhysical", LogicalHoleCntrPb, PhysicalMother, 0, 0);
184 
185  // Absorber Al.
186  G4LogicalVolume * LogicalHoleCntrAl =
187  new G4LogicalVolume(SolidHoleCntrAbsrb, FCALMaterials->Material("Aluminium"),
188  "HoleCntrAlLoghical");
189  // G4VPhysicalVolume * PhysicalHoleAl =
190  new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs,
191  "HoleAlPhysical", LogicalHoleCntrAl, 0, 0);
192  // G4VPhysicalVolume * PhysicalHoleCntrAl =
193  new G4PVPlacement(0, G4ThreeVector(HoleCntrAlPosX, HoleCntrAlPosY, HoleCntrAlPosZ),
194  "HoleCntrAlPhysical", LogicalHoleCntrAl, PhysicalMother, 0, 0);
195 
196  LogicalHoleCntrScint->SetVisAttributes(ColorOfScintillator);
197 
198  G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.8));
199  G4VisAttributes * ColorOfAlu = new G4VisAttributes(G4Colour(0.5,0.5,0.3));
200  LogicalHoleCntrPb->SetVisAttributes(ColorOfLead);
201  LogicalHoleCntrAl->SetVisAttributes(ColorOfAlu);
202 
203  G4VisAttributes * ColorOfAir = new G4VisAttributes(G4Colour(1.,1.,1.));
204  LogicalHole->SetVisAttributes(ColorOfAir);
205  LogicalHoleAbs->SetVisAttributes(ColorOfAir);
206 
207 
208  //-------------------
209  // Lead Wall
210  //-------------------
211  G4Box * SolidLeadWall =
212  new G4Box("LeadWallSolid", LeadWallSizeX, LeadWallSizeY, LeadWallSizeZ);
213  G4LogicalVolume * LogicalLeadWall =
214  new G4LogicalVolume(SolidLeadWall, FCALMaterials->Material("Lead"),
215  "LeadWallLogical");
216 
217  G4Box * SolidSlitPb = new G4Box("SlitPb", LeadWallSlitSizeX, LeadWallSlitSizeY,
218  LeadWallSlitSizeZ);
219  G4LogicalVolume * LogicalSlitPb =
220  new G4LogicalVolume(SolidSlitPb, FCALMaterials->Material("Air"), "SlitPbLogical");
221  // G4VPhysicalVolume * PhysicalSlitPb =
222  new G4PVPlacement(0, G4ThreeVector(), LogicalSlitPb, "SlitPbPhysical", LogicalLeadWall, 0, 0);
223 
224  // G4VPhysicalVolume * PhysicalLeadWall =
225  new G4PVPlacement(0, G4ThreeVector(LeadWallPosX,LeadWallPosY,LeadWallPosZ),
226  "LeadWallPhysical", LogicalLeadWall, PhysicalMother, 0, 0);
227 
228  LogicalLeadWall->SetVisAttributes(ColorOfLead);
229  LogicalSlitPb->SetVisAttributes(ColorOfAir);
230 
231 
232  //-------------------
233  // Iron Wall
234  //-------------------
235  G4Box * SolidIronWall =
236  new G4Box("IronWallSolid", IronWallSizeX, IronWallSizeY, IronWallSizeZ);
237  G4LogicalVolume * LogicalIronWall =
238  new G4LogicalVolume(SolidIronWall, FCALMaterials->Material("Iron"),
239  "IronWallLogical");
240 
241  G4Box * SolidSlitFe = new G4Box("SlitFe", IronWallSlitSizeX, IronWallSlitSizeY,
242  IronWallSlitSizeZ);
243  G4LogicalVolume * LogicalSlitFe =
244  new G4LogicalVolume(SolidSlitFe, FCALMaterials->Material("Air"), "SlitFeLogical");
245  // G4VPhysicalVolume * PhysicalSlitFe =
246  new G4PVPlacement(0, G4ThreeVector(), LogicalSlitFe, "SlitFePhysical", LogicalIronWall, 0, 0);
247 
248  // G4VPhysicalVolume * PhysicalIronWall =
249  new G4PVPlacement(0, G4ThreeVector(IronWallPosX,IronWallPosY,IronWallPosZ),
250  "IronWallPhysical", LogicalIronWall, PhysicalMother, 0, 0);
251 
252  G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.2,0.2,0.2));
253  LogicalIronWall->SetVisAttributes(ColorOfIron);
254  LogicalSlitFe->SetVisAttributes(ColorOfAir);
255 
256  //----------------
257  // Tail Catcher
258  //----------------
259  G4Box * SolidBigScint =
260  new G4Box("BigSolidScint",BigScintSizeX, BigScintSizeY, ScintSizeZ);
261  G4LogicalVolume * LogicalBigScint =
262  new G4LogicalVolume(SolidBigScint, FCALMaterials->Material("Polystyrene"),
263  "BigScintLogical");
264 
265  G4Box * SolidSmallScint =
266  new G4Box("SmallSolidScint",SmallScintSizeX, SmallScintSizeY, ScintSizeZ);
267  G4LogicalVolume * LogicalSmallScint =
268  new G4LogicalVolume(SolidSmallScint, FCALMaterials->Material("Polystyrene"),
269  "SmallScintLogical");
270 
271  for( i=0; i<(NBigScint+NSmallScint); i++)
272  {
273  if(i<NBigScint)
274  { // G4VPhysicalVolume * PhysicalBigScint =
275  new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]),
276  "BigScintPhysical", LogicalBigScint, PhysicalMother,
277  0, i+1);
278  }
279  else
280  { // G4VPhysicalVolume * PhysicalSmallScint =
281  new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]),
282  "SmallScintPhysical", LogicalSmallScint, PhysicalMother,
283  0, i+1);
284  }
285  }
286  LogicalBigScint->SetVisAttributes(ColorOfScintillator);
287  LogicalSmallScint->SetVisAttributes(ColorOfScintillator);
288 
289 
290  G4Box * SolidBigIron =
291  new G4Box("BigSolidIron",BigIronSizeX, BigIronSizeY, IronSizeZ);
292  G4LogicalVolume * LogicalBigIron =
293  new G4LogicalVolume(SolidBigIron, FCALMaterials->Material("Polystyrene"),
294  "BigIronLogical");
295 
296  G4Box * SolidSmallIron =
297  new G4Box("SmallSolidIron",SmallIronSizeX, SmallIronSizeY, IronSizeZ);
298  G4LogicalVolume * LogicalSmallIron =
299  new G4LogicalVolume(SolidSmallIron, FCALMaterials->Material("Iron"),
300  "SmallIronLogical");
301 
302  for( i=0; i<(NBigIron+NSmallIron); i++)
303  {
304  if(i<NBigIron)
305  { // G4VPhysicalVolume * PhysicalBigIron =
306  new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]),
307  "BigIronPhysical", LogicalBigIron, PhysicalMother,
308  0, i+1);
309  }
310  else
311  { // G4VPhysicalVolume * PhysicalSmallIron =
312  new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]),
313  "SmallIronPhysical", LogicalSmallIron, PhysicalMother,
314  0, i+1);
315  }
316  }
317  LogicalBigIron->SetVisAttributes(ColorOfIron);
318  LogicalSmallIron->SetVisAttributes(ColorOfIron);
319 
320  //-------------------------
321  // Concrete Walls A and B
322  //-------------------------
323  G4Box * SolidConcWall =
324  new G4Box("ConcWallSolid", ConcWallSizeX, ConcWallSizeY, ConcWallSizeZ);
325  G4LogicalVolume * LogicalConcWallA =
326  new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"),
327  "ConcWallALogical");
328  G4VPhysicalVolume * PhysicalConcWallA =
329  new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallAPosZ),
330  "ConcWallAPhysical", LogicalConcWallA, PhysicalMother, 0, 0);
331 
332  G4LogicalVolume * LogicalConcWallB =
333  new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"),
334  "ConcWallBLogical");
335  // G4VPhysicalVolume * PhysicalConcWallB =
336  new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallBPosZ),
337  "ConcWallBPhysical", LogicalConcWallB, PhysicalMother, 0, 0);
338 
339  G4Box * SolidConcWallIns =
340  new G4Box("ConcWallInsSolid", ConcWallInsSizeX,ConcWallInsSizeY,ConcWallInsSizeZ);
341  G4LogicalVolume * LogicalConcWallIns =
342  new G4LogicalVolume(SolidConcWallIns, FCALMaterials->Material("Iron"),
343  "LogicalConcWallIns");
344  // G4VPhysicalVolume * PhysicalConcWallIns =
345  new G4PVPlacement(0, G4ThreeVector(), "ConcWallInsPhysical", LogicalConcWallIns, PhysicalConcWallA, 0, 0);
346 
347  G4VisAttributes * ColorOfConcrete = new G4VisAttributes(G4Colour(0.,0.,0.));
348  LogicalConcWallA->SetVisAttributes(ColorOfConcrete);
349  LogicalConcWallB->SetVisAttributes(ColorOfConcrete);
350  LogicalConcWallIns->SetVisAttributes(ColorOfIron);
351 
352  //------------------
353  // Muon Counter
354  //-------------------
355  G4Box * SolidMuContr =
356  new G4Box("MuContrSolid", MuCntrSIzeX, MuCntrSIzeY, MuCntrSIzeZ);
357  G4LogicalVolume * LogicalMuContr =
358  new G4LogicalVolume(SolidMuContr, FCALMaterials->Material("Polystyrene"),
359  "MuContrLogical");
360  // G4VPhysicalVolume * PhysicalMuContr =
361  new G4PVPlacement(0, G4ThreeVector(MuCntrPosX, MuCntrPosY, MuCntrPosZ),
362  "MuContrPhyiscal", LogicalMuContr, PhysicalMother, 0, 0);
363 
364  LogicalMuContr->SetVisAttributes(ColorOfScintillator);
365 
366  //-----------------
367  // cryostat
368  //-----------------
369 
370 
371  G4RotationMatrix* CryostatRotationMatrix =
372  new G4RotationMatrix();
373 
374  // new G4RotationMatrix(1.,0.,0.,0.,0.,-1.,0.,1.,0.);
375 
376  // Theta(...) 90.0000 180.0000 90.0000
377  // Phi(...) 0.0000 0.0000 90.0000
378  //
379  // Matrix(...) | 1.0000 0.0000 0.0000 |
380  // | 0.0000 0.0000 -1.0000 |
381  // | 0.0000 1.0000 0.0000 |
382  //
383  // How to input?
384 
385  CryostatRotationMatrix->rotateX(90*deg);
386 
387  FCALCryostatVolumes * CryostatVolumes = new FCALCryostatVolumes();
388 
389  G4LogicalVolume * theCryostatVolumes = CryostatVolumes->Construct();
390 
391  // G4VPhysicalVolume * PhysiCryostatVolumes =
392  new G4PVPlacement(CryostatRotationMatrix,
393  G4ThreeVector(CryostatPosX,CryostatPosY,CryostatPosZ),"CryostatVolumes"
394  , theCryostatVolumes, PhysicalMother, 0,0);
395 
396 
397  //-----------------------
398  // Senstive detectors
399  //-----------------------
401 
402  if(!FCALTBSetupSD)
403  {
404  FCALTBSetupSD = new FCALTestbeamSetupSD("FCALTB/TBSetupSD");
405  SDman->AddNewDetector(FCALTBSetupSD);
406  }
407  LogicalScintS1andS3->SetSensitiveDetector(FCALTBSetupSD);
408  LogicalScintS2->SetSensitiveDetector(FCALTBSetupSD);
409  LogicalMWPC->SetSensitiveDetector(FCALTBSetupSD);
410  LogicalHoleCntrScint->SetSensitiveDetector(FCALTBSetupSD);
411  LogicalHoleCntrPb->SetSensitiveDetector(FCALTBSetupSD);
412  LogicalHoleCntrAl->SetSensitiveDetector(FCALTBSetupSD);
413 
414 
415  // theCryostatVolumes->SetSensitiveDetector(FCALTBSetupSD);
416 
417  LogicalLeadWall->SetSensitiveDetector(FCALTBSetupSD);
418  LogicalIronWall->SetSensitiveDetector(FCALTBSetupSD);
419  LogicalBigScint->SetSensitiveDetector(FCALTBSetupSD);
420  LogicalSmallScint->SetSensitiveDetector(FCALTBSetupSD);
421 
422  LogicalBigIron->SetSensitiveDetector(FCALTBSetupSD);
423  LogicalSmallIron->SetSensitiveDetector(FCALTBSetupSD);
424  LogicalConcWallA->SetSensitiveDetector(FCALTBSetupSD);
425  LogicalConcWallB->SetSensitiveDetector(FCALTBSetupSD);
426  LogicalConcWallIns->SetSensitiveDetector(FCALTBSetupSD);
427 
428  LogicalMuContr->SetSensitiveDetector(FCALTBSetupSD);
429 
430 
431 
432  return PhysicalMother;
433 
434 }
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
Definition: Rotation.cc:66
CLHEP::HepRotation G4RotationMatrix
Definition: G4Box.hh:63
static FCALMaterialConsultant * construct()
Definition: G4Tubs.hh:84
G4LogicalVolume * Construct()
int G4int
Definition: G4Types.hh:78
G4Material * Material(G4String)
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
static const G4VisAttributes Invisible
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)

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