79 fHodoscope1Logical(nullptr), fHodoscope2Logical(nullptr),
80 fWirePlane1Logical(nullptr), fWirePlane2Logical(nullptr),
81 fCellLogical(nullptr), fHadCalScintiLogical(nullptr),
82 fMagneticLogical(nullptr),
84 fArmAngle(30.*
deg), fArmRotation(nullptr), fSecondArmPhys(nullptr)
102 delete visAttributes;
121 G4bool checkOverlaps =
true;
126 =
new G4Box(
"worldBox",10.*
m,3.*
m,10.*
m);
131 false,0,checkOverlaps);
136 =
new G4Tubs(
"magneticTubs",0.,1.*
m,1.*
m,0.,360.*
deg);
146 "magneticPhysical",worldLogical,
147 false,0,checkOverlaps);
155 =
new G4Box(
"firstArmBox",1.5*
m,1.*
m,3.*
m);
159 "firstArmPhysical",worldLogical,
160 false,0,checkOverlaps);
164 =
new G4Box(
"secondArmBox",2.*
m,2.*
m,3.5*
m);
165 auto secondArmLogical
171 "fSecondArmPhys",worldLogical,
172 false,0,checkOverlaps);
178 =
new G4LogicalVolume(hodoscope1Solid,scintillator,
"hodoscope1Logical");
183 "hodoscope1Physical",firstArmLogical,
184 false,i,checkOverlaps);
196 "chamber1Physical",firstArmLogical,
197 false,i,checkOverlaps);
202 =
new G4Box(
"wirePlane1Box",1.*
m,30.*
cm,0.1*
mm);
206 "wirePlane1Physical",chamber1Logical,
207 false,0,checkOverlaps);
213 =
new G4LogicalVolume(hodoscope2Solid,scintillator,
"hodoscope2Logical");
218 "hodoscope2Physical",secondArmLogical,
219 false,i,checkOverlaps);
224 =
new G4Box(
"chamber2Box",1.5*
m,30.*
cm,1.*
cm);
229 G4double z2 = (i-kNofChambers/2)*0.5*
m - 1.5*
m;
231 "chamber2Physical",secondArmLogical,
232 false,i,checkOverlaps);
237 =
new G4Box(
"wirePlane2Box",1.5*
m,30.*
cm,0.1*
mm);
241 "wirePlane2Physical",chamber2Logical,
242 false,0,checkOverlaps);
245 auto emCalorimeterSolid
246 =
new G4Box(
"EMcalorimeterBox",1.5*
m,30.*
cm,15.*
cm);
247 auto emCalorimeterLogical
250 "EMcalorimeterPhysical",secondArmLogical,
251 false,0,checkOverlaps);
263 auto hadCalorimeterSolid
264 =
new G4Box(
"HadCalorimeterBox",1.5*
m,30.*
cm,50.*
cm);
265 auto hadCalorimeterLogical
266 =
new G4LogicalVolume(hadCalorimeterSolid,lead,
"HadCalorimeterLogical");
268 "HadCalorimeterPhysical",secondArmLogical,
269 false,0,checkOverlaps);
272 auto HadCalColumnSolid
273 =
new G4Box(
"HadCalColumnBox",15.*
cm,30.*
cm,50.*
cm);
274 auto HadCalColumnLogical
276 new G4PVReplica(
"HadCalColumnPhysical",HadCalColumnLogical,
282 auto HadCalCellLogical
284 new G4PVReplica(
"HadCalCellPhysical",HadCalCellLogical,
288 auto HadCalLayerSolid
289 =
new G4Box(
"HadCalLayerBox",15.*
cm,15.*
cm,2.5*
cm);
290 auto HadCalLayerLogical
292 new G4PVReplica(
"HadCalLayerPhysical",HadCalLayerLogical,
296 auto HadCalScintiSolid
297 =
new G4Box(
"HadCalScintiBox",15.*
cm,15.*
cm,0.5*
cm);
300 "HadCalScintiLogical");
302 "HadCalScintiPhysical",HadCalLayerLogical,
303 false,0,checkOverlaps);
308 visAttributes->SetVisibility(
false);
309 worldLogical->SetVisAttributes(visAttributes);
317 visAttributes->SetVisibility(
false);
318 firstArmLogical->SetVisAttributes(visAttributes);
319 secondArmLogical->SetVisAttributes(visAttributes);
328 chamber1Logical->SetVisAttributes(visAttributes);
329 chamber2Logical->SetVisAttributes(visAttributes);
333 visAttributes->SetVisibility(
false);
339 visAttributes->SetVisibility(
false);
340 emCalorimeterLogical->SetVisAttributes(visAttributes);
348 hadCalorimeterLogical->SetVisAttributes(visAttributes);
352 visAttributes->SetVisibility(
false);
353 HadCalColumnLogical->SetVisAttributes(visAttributes);
354 HadCalCellLogical->SetVisAttributes(visAttributes);
355 HadCalLayerLogical->SetVisAttributes(visAttributes);
361 return worldPhysical;
373 sdManager->AddNewDetector(hodoscope1);
377 sdManager->AddNewDetector(hodoscope2);
381 sdManager->AddNewDetector(chamber1);
385 sdManager->AddNewDetector(chamber2);
389 sdManager->AddNewDetector(emCalorimeter);
393 sdManager->AddNewDetector(hadCalorimeter);
401 G4bool forceToAllDaughters =
true;
412 nistManager->FindOrBuildMaterial(
"G4_AIR");
415 nistManager->FindOrBuildMaterial(
"G4_Ar");
423 nistManager->FindOrBuildMaterial(
"G4_PLASTIC_SC_VINYLTOLUENE");
426 nistManager->FindOrBuildMaterial(
"G4_CESIUM_IODIDE");
429 nistManager->FindOrBuildMaterial(
"G4_Pb");
449 G4cerr <<
"Detector has not yet been constructed." <<
G4endl;
477 "Set rotation angle of the second arm.");
479 armAngleCmd.
SetRange(
"angle>=0. && angle<180.");
static G4RunManager * GetRunManager()
This class is generic messenger.
CLHEP::Hep3Vector G4ThreeVector
Definition of the B5MagneticField class.
static G4MaterialTable * GetMaterialTable()
void ConstructMaterials()
static constexpr double mm
virtual void ConstructSDandField()
Float_t x1[n_points_granero]
CLHEP::HepRotation G4RotationMatrix
Command & DeclareMethodWithUnit(const G4String &name, const G4String &defaultUnit, const G4AnyMethod &fun, const G4String &doc="")
EM calorimeter sensitive detector.
void SetFieldManager(G4FieldManager *pFieldMgr, G4bool forceToAllDaughters)
Definition of the B5DriftChamberSD class.
void SetTranslation(const G4ThreeVector &v)
Command & SetDefaultValue(const G4String &)
Definition of the B5HodoscopeSD class.
void SetArmAngle(G4double val)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
virtual G4VPhysicalVolume * Construct()
G4bool SetDetectorField(G4Field *detectorField, int failMode=0)
void CreateChordFinder(G4MagneticField *detectorMagField)
Definition of the B5CellParameterisation class.
static constexpr double m
constexpr G4int kNofHadCells
constexpr G4int kNofHodoscopes2
G4LogicalVolume * fHadCalScintiLogical
Definition of the B5DetectorConstruction class.
static constexpr double deg
constexpr G4int kNofHadRows
std::vector< G4VisAttributes * > fVisAttributes
constexpr G4int kNofHadColumns
Command & SetRange(const G4String &range)
G4LogicalVolume * fCellLogical
G4LogicalVolume * fHodoscope1Logical
G4GenericMessenger * fMessenger
Definition of the B5EmCalorimeterSD class.
virtual ~B5DetectorConstruction()
void SetVisAttributes(const G4VisAttributes *pVA)
void GeometryHasBeenModified(G4bool prop=true)
G4GLOB_DLL std::ostream G4cerr
void SetUserLimits(G4UserLimits *pULimits)
Hadron calorimeter sensitive detector.
G4VPhysicalVolume * fSecondArmPhys
G4LogicalVolume * fHodoscope2Logical
static G4SDManager * GetSDMpointer()
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
HepRotation & rotateY(double delta)
G4RotationMatrix * fArmRotation
constexpr G4int kNofChambers
G4LogicalVolume * fWirePlane2Logical
constexpr G4int kNofHodoscopes1
Definition of the B5HadCalorimeterSD class.
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
EM Calorimeter cell parameterisation.
static G4ThreadLocal G4FieldManager * fFieldMgr
Hodoscope sensitive detector.
Float_t x2[n_points_geant4]
G4LogicalVolume * fWirePlane1Logical
constexpr G4int kNofEmCells
Drift chamber sensitive detector.
HepRotation & rotateX(double delta)
static G4NistManager * Instance()
G4LogicalVolume * fMagneticLogical
static G4ThreadLocal B5MagneticField * fMagneticField
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)