21 #include "G4Material.hh" 25 #include "G4LogicalVolume.hh" 26 #include "G4PVPlacement.hh" 27 #include "G4RotationMatrix.hh" 28 #include "G4VisAttributes.hh" 29 #include "G4Colour.hh" 30 #include "G4RunManager.hh" 31 #include "G4Transform3D.hh" 33 #include "G4PhysicalConstants.hh" 34 #include "G4SystemOfUnits.hh" 42 : sciBulkMaterial(0),detConstruction(det) {
98 G4double sciBulk_x = 12.0*mm;
99 G4double sciBulk_y = 12.0*mm;
100 G4double sciBulk_z = 15.0*mm;
102 G4double defectHalfLength = 0.5*mm;
103 G4double separationFromBox = 25*mm;
110 G4cout <<
"##################################################################" 112 <<
"######### ActarSimSciDetectorConstruction::ConstructSci() #######" 114 <<
" Note that only a thin (1 micron) Al window is defined in front" 116 <<
" of the silicons. Here only the scintillator volume is described." 118 <<
" x dimension (half-side) of scintillator: " << sciBulk_x/mm <<
" mm" 120 <<
" y dimension (half-side) of scintillator: " << sciBulk_y/mm <<
" mm" 122 <<
" z dimension (half-side) of scintillator: " << sciBulk_z/mm <<
" mm" 124 G4cout <<
"##################################################################" 127 G4LogicalVolume* sciLog(0);
128 G4VPhysicalVolume* sciPhys(0);
133 new G4Box(
"sciBox", sciBulk_x, sciBulk_y, sciBulk_z);
150 G4int numberOfRowsX = ((G4int) (2*
xBoxSciHalfLength/(2*(sciBulk_x+defectHalfLength)))) - 1;
152 G4int numberOfRowsY = ((G4int) (2*
yBoxSciHalfLength/(2*(sciBulk_x+defectHalfLength)))) - 1;
154 G4int numberOfRowsZ = ((G4int) (2*
zBoxSciHalfLength/(2*(sciBulk_x+defectHalfLength)))) - 1;
159 G4int iterationNumber = 0;
163 G4RotationMatrix* rotBack =
164 new G4RotationMatrix(0,pi,pi);
166 G4RotationMatrix* rotBottom =
167 new G4RotationMatrix(0,pi/2,0);
168 G4RotationMatrix* rotTop =
169 new G4RotationMatrix(0,-pi/2,0);
170 G4RotationMatrix* rotLeft =
171 new G4RotationMatrix(pi/2,pi/2,-pi/2);
172 G4RotationMatrix* rotRight =
173 new G4RotationMatrix(-pi/2,pi/2,pi/2);
190 for(G4int rowX=0;rowX<4;rowX++){
191 for(G4int rowY=0;rowY<4;rowY++){
194 new G4PVPlacement(0,G4ThreeVector( (rowX-1.5)*2*(sciBulk_x+defectHalfLength),
195 (rowY-1.5)*2*(sciBulk_x+defectHalfLength),
197 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
205 for(G4int rowZ=0;rowZ<numberOfRowsZ;rowZ++){
206 for(G4int rowX=0;rowX<numberOfRowsX;rowX++){
209 new G4PVPlacement(rotBottom,G4ThreeVector(-
xBoxSciHalfLength + ((rowX+1)*2-1)*(sciBulk_x+defectHalfLength),
211 ((rowZ+1)*2-1)*(sciBulk_x+defectHalfLength) - zGasBoxPosition),
212 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
217 for(G4int rowZ=0;rowZ<numberOfRowsZ;rowZ++){
218 for(G4int rowX=0;rowX<numberOfRowsX;rowX++){
221 new G4PVPlacement(rotTop,G4ThreeVector(-
xBoxSciHalfLength + ((rowX+1)*2-1)*(sciBulk_x+defectHalfLength),
223 ((rowZ+1)*2-1)*(sciBulk_x+defectHalfLength) - zGasBoxPosition),
224 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
243 for(G4int rowZ=0;rowZ<6;rowZ++){
244 for(G4int rowY=0;rowY<4;rowY++){
247 new G4PVPlacement(rotLeft,G4ThreeVector(
xBoxSciHalfLength + separationFromBox + sciBulk_z,
248 (rowY-1.5)*2*(sciBulk_x+defectHalfLength),
250 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
269 for(G4int rowZ=0;rowZ<2;rowZ++){
270 for(G4int rowY=0;rowY<2;rowY++){
273 new G4PVPlacement(rotRight,G4ThreeVector(-(
xBoxSciHalfLength + separationFromBox + sciBulk_z),
274 (rowY-0.5)*2*(sciBulk_y+defectHalfLength),
276 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
283 for(G4int rowX=0;rowX<numberOfRowsX;rowX++){
284 for(G4int rowY=0;rowY<numberOfRowsY;rowY++){
287 new G4PVPlacement(rotBack,G4ThreeVector(-
xBoxSciHalfLength + ((rowX+1)*2-1)*(sciBulk_x+defectHalfLength),
289 -separationFromBox - sciBulk_z - zGasBoxPosition),
290 sciLog,
"sciPhys", worldLog,
false, iterationNumber);
303 G4VisAttributes* sciVisAtt1 =
new G4VisAttributes(G4Colour(0,1,1));
304 sciVisAtt1->SetVisibility(
true);
305 sciLog->SetVisAttributes(sciVisAtt1);
313 G4Material* pttoMaterial = G4Material::GetMaterial(mat);
321 G4RunManager::GetRunManager()->
328 G4cout <<
"##################################################################" 330 <<
"#### ActarSimSciDetectorConstruction::PrintDetectorParameters() ####" 332 G4cout <<
"##################################################################"
G4VPhysicalVolume * Construct(G4LogicalVolume *)
Wrap for the construction function.
~ActarSimSciDetectorConstruction()
Destructor.
ActarSimSciDetectorMessenger * sciMessenger
Pointer to the Messenger.
G4VPhysicalVolume * ConstructSci(G4LogicalVolume *)
void SetSideCoverage(G4int cov)
ActarSimSciSD * GetSciSD(void)
void SetSciBulkMaterial(G4String)
Set the material the scintillator bulk is made of.
G4Material * sciBulkMaterial
Pointer to the material the scintillator is made of.
G4double xBoxSciHalfLength
Scintillator box half length along X (X is horizontal)
ActarSimSciDetectorConstruction(ActarSimDetectorConstruction *)
Constructor. Sets the material and the pointer to the Messenger.
ActarSimGasDetectorConstruction * GetGasDetector()
G4double zBoxSciHalfLength
Scintillator box half length along Z (Z is along beam)
void SetXBoxSciHalfLength(G4double xBox)
void SetYBoxSciHalfLength(G4double yBox)
G4VPhysicalVolume * GetWorldPhysicalVolume()
void UpdateGeometry()
Updates Scintillator detector.
void SetZBoxSciHalfLength(G4double zBox)
void PrintDetectorParameters()
Prints Scintillator detector parameters. TODO: To be filled.
G4double GetGasBoxCenterZ(void)
ActarSimDetectorConstruction * detConstruction
Pointer to the global detector.
G4double yBoxSciHalfLength
Scintillator box half length along Y (Y is vertical)
G4LogicalVolume * GetWorldLogicalVolume()