80 fHodoscope1Logical(nullptr), fHodoscope2Logical(nullptr),
81 fWirePlane1Logical(nullptr), fWirePlane2Logical(nullptr),
82 fCellLogical(nullptr), fHadCalScintiLogical(nullptr),
83 fMagneticLogical(nullptr),
85 fArmAngle(30.*
deg), fArmRotation(nullptr), fSecondArmPhys(nullptr)
89 fArmRotation->
rotateY(fArmAngle);
102 for (
auto visAttributes: fVisAttributes) {
103 delete visAttributes;
122 G4bool checkOverlaps =
true;
127 =
new G4Box(
"worldBox",10.*
m,3.*
m,10.*
m);
132 false,0,checkOverlaps);
137 =
new G4Tubs(
"magneticTubs",0.,1.*
m,1.*
m,0.,360.*
deg);
147 "magneticPhysical",worldLogical,
148 false,0,checkOverlaps);
156 =
new G4Box(
"firstArmBox",1.5*
m,1.*
m,3.*
m);
160 "firstArmPhysical",worldLogical,
161 false,0,checkOverlaps);
165 =
new G4Box(
"secondArmBox",2.*
m,2.*
m,3.5*
m);
166 auto secondArmLogical
168 auto x = -5.*
m * std::sin(fArmAngle);
169 auto z = 5.*
m * std::cos(fArmAngle);
172 "fSecondArmPhys",worldLogical,
173 false,0,checkOverlaps);
179 =
new G4LogicalVolume(hodoscope1Solid,scintillator,
"hodoscope1Logical");
184 "hodoscope1Physical",firstArmLogical,
185 false,i,checkOverlaps);
197 "chamber1Physical",firstArmLogical,
198 false,i,checkOverlaps);
203 =
new G4Box(
"wirePlane1Box",1.*
m,30.*
cm,0.1*
mm);
207 "wirePlane1Physical",chamber1Logical,
208 false,0,checkOverlaps);
214 =
new G4LogicalVolume(hodoscope2Solid,scintillator,
"hodoscope2Logical");
219 "hodoscope2Physical",secondArmLogical,
220 false,i,checkOverlaps);
225 =
new G4Box(
"chamber2Box",1.5*
m,30.*
cm,1.*
cm);
230 G4double z2 = (i-kNofChambers/2)*0.5*
m - 1.5*
m;
232 "chamber2Physical",secondArmLogical,
233 false,i,checkOverlaps);
238 =
new G4Box(
"wirePlane2Box",1.5*
m,30.*
cm,0.1*
mm);
242 "wirePlane2Physical",chamber2Logical,
243 false,0,checkOverlaps);
246 auto emCalorimeterSolid
247 =
new G4Box(
"EMcalorimeterBox",1.5*
m,30.*
cm,15.*
cm);
248 auto emCalorimeterLogical
251 "EMcalorimeterPhysical",secondArmLogical,
252 false,0,checkOverlaps);
264 auto hadCalorimeterSolid
265 =
new G4Box(
"HadCalorimeterBox",1.5*
m,30.*
cm,50.*
cm);
266 auto hadCalorimeterLogical
267 =
new G4LogicalVolume(hadCalorimeterSolid,lead,
"HadCalorimeterLogical");
269 "HadCalorimeterPhysical",secondArmLogical,
270 false,0,checkOverlaps);
273 auto HadCalColumnSolid
274 =
new G4Box(
"HadCalColumnBox",15.*
cm,30.*
cm,50.*
cm);
275 auto HadCalColumnLogical
277 new G4PVReplica(
"HadCalColumnPhysical",HadCalColumnLogical,
283 auto HadCalCellLogical
285 new G4PVReplica(
"HadCalCellPhysical",HadCalCellLogical,
289 auto HadCalLayerSolid
290 =
new G4Box(
"HadCalLayerBox",15.*
cm,15.*
cm,2.5*
cm);
291 auto HadCalLayerLogical
293 new G4PVReplica(
"HadCalLayerPhysical",HadCalLayerLogical,
297 auto HadCalScintiSolid
298 =
new G4Box(
"HadCalScintiBox",15.*
cm,15.*
cm,0.5*
cm);
301 "HadCalScintiLogical");
303 "HadCalScintiPhysical",HadCalLayerLogical,
304 false,0,checkOverlaps);
309 visAttributes->SetVisibility(
false);
310 worldLogical->SetVisAttributes(visAttributes);
311 fVisAttributes.push_back(visAttributes);
315 fVisAttributes.push_back(visAttributes);
318 visAttributes->SetVisibility(
false);
319 firstArmLogical->SetVisAttributes(visAttributes);
320 secondArmLogical->SetVisAttributes(visAttributes);
321 fVisAttributes.push_back(visAttributes);
326 fVisAttributes.push_back(visAttributes);
329 chamber1Logical->SetVisAttributes(visAttributes);
330 chamber2Logical->SetVisAttributes(visAttributes);
331 fVisAttributes.push_back(visAttributes);
334 visAttributes->SetVisibility(
false);
337 fVisAttributes.push_back(visAttributes);
340 visAttributes->SetVisibility(
false);
341 emCalorimeterLogical->SetVisAttributes(visAttributes);
342 fVisAttributes.push_back(visAttributes);
346 fVisAttributes.push_back(visAttributes);
349 hadCalorimeterLogical->SetVisAttributes(visAttributes);
350 fVisAttributes.push_back(visAttributes);
353 visAttributes->SetVisibility(
false);
354 HadCalColumnLogical->SetVisAttributes(visAttributes);
355 HadCalCellLogical->SetVisAttributes(visAttributes);
356 HadCalLayerLogical->SetVisAttributes(visAttributes);
358 fVisAttributes.push_back(visAttributes);
362 return worldPhysical;
374 sdManager->AddNewDetector(hodoscope1);
378 sdManager->AddNewDetector(hodoscope2);
382 sdManager->AddNewDetector(chamber1);
386 sdManager->AddNewDetector(chamber2);
390 sdManager->AddNewDetector(emCalorimeter);
394 sdManager->AddNewDetector(hadCalorimeter);
402 G4bool forceToAllDaughters =
true;
417 nistManager->FindOrBuildMaterial(
"G4_AIR");
420 nistManager->FindOrBuildMaterial(
"G4_Ar");
428 nistManager->FindOrBuildMaterial(
"G4_PLASTIC_SC_VINYLTOLUENE");
431 nistManager->FindOrBuildMaterial(
"G4_CESIUM_IODIDE");
434 nistManager->FindOrBuildMaterial(
"G4_Pb");
453 if (!fSecondArmPhys) {
454 G4cerr <<
"Detector has not yet been constructed." <<
G4endl;
460 fArmRotation->
rotateY(fArmAngle);
461 auto x = -5.*
m * std::sin(fArmAngle);
462 auto z = 5.*
m * std::cos(fArmAngle);
471 void B5DetectorConstruction::DefineCommands()
482 "Set rotation angle of the second arm.");
484 armAngleCmd.
SetRange(
"angle>=0. && angle<180.");
void GeometryHasBeenModified(G4bool prop=true)
Definition of the B5HadCalorimeterSD class.
Definition of the B5CellParameterisation class.
void SetArmAngle(G4double val)
Definition of the B5DetectorConstruction class.
static constexpr double mm
Definition of the B5DriftChamberSD class.
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
CLHEP::HepRotation G4RotationMatrix
G4bool SetDetectorField(G4Field *detectorField)
This class is generic messenger.
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetUserLimits(G4UserLimits *pULimits)
virtual ~B5DetectorConstruction()
static G4MaterialTable * GetMaterialTable()
Drift chamber sensitive detector.
constexpr G4int kNofChambers
Definition of the B5EmCalorimeterSD class.
HepRotation & rotateY(double delta)
Command & DeclareMethodWithUnit(const G4String &name, const G4String &defaultUnit, const G4AnyMethod &fun, const G4String &doc="")
constexpr G4int kNofHadCells
static G4NistManager * Instance()
void ConstructMaterials()
void SetFieldManager(G4FieldManager *pFieldMgr, G4bool forceToAllDaughters)
Command & SetDefaultValue(const G4String &)
virtual G4VPhysicalVolume * Construct()
G4GLOB_DLL std::ostream G4cout
static constexpr double m
constexpr G4int kNofHadRows
EM Calorimeter cell parameterisation.
virtual void ConstructSDandField()
static constexpr double cm
void SetTranslation(const G4ThreeVector &v)
constexpr G4int kNofHadColumns
Command & SetRange(const G4String &range)
constexpr G4int kNofHodoscopes2
static G4RunManager * GetRunManager()
Definition of the B5MagneticField class.
Definition of the B5HodoscopeSD class.
static G4SDManager * GetSDMpointer()
Hodoscope sensitive detector.
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
void CreateChordFinder(G4MagneticField *detectorMagField)
static constexpr double deg
constexpr G4int kNofEmCells
constexpr G4int kNofHodoscopes1
EM calorimeter sensitive detector.
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
Hadron calorimeter sensitive detector.
G4GLOB_DLL std::ostream G4cerr