72 G4bool validateGDMLFile_ ) :
73 world( 0 ), gdmlFile( gdmlFile_ ), validateGDMLFile( validateGDMLFile_ ),
74 calorimeterRegionInitialized( false ),
75 calorimeterGeometryDataInitialized( false ), monitorVolume( NULL ),
76 vetoCounterVolume( NULL ), calorimeterVolume( NULL ), targetVolume( NULL ),
77 rightVetoCounter( NULL ), rightCalorimeter( NULL )
104 dynamic_cast< const CexmcPhysicsManager * >(
107 if ( ! physicsManager )
111 const_cast< CexmcPhysicsManager * >( physicsManager ) );
124 for ( std::vector< G4LogicalVolume * >::const_iterator
125 lvIter( lvs->begin() ); lvIter != lvs->end(); ++lvIter )
132 for ( G4GDMLAuxListType::const_iterator pair( auxInfo.begin() );
133 pair != auxInfo.end(); ++pair )
136 G4String detectorName(
"uninitialized" );
139 if ( pair->type ==
"EnergyDepositDetector" )
143 if ( pair->value ==
"MonitorRole" )
151 if ( pair->value ==
"VetoCounterRole" )
160 if ( pair->value ==
"CalorimeterRole" )
172 detectorName <<
"' in volume '" << volumeName <<
176 if ( pair->type ==
"TrackPointsDetector" )
180 if ( pair->value ==
"MonitorRole" )
188 if ( pair->value ==
"VetoCounterRole" )
197 if ( pair->value ==
"CalorimeterRole" )
206 if ( pair->value ==
"TargetRole" )
217 detectorName <<
"' in volume '" << volumeName <<
227 if ( pair->type ==
"SensitiveRegion" )
231 if ( pair->value ==
"CalorimeterRegion" )
248 GetUserPhysicsList() );
250 defaultProductionCut =
261 "volume '" << volumeName <<
"' registered" <<
265 if ( pair->type ==
"SpecialVolume" )
269 if ( pair->value ==
"Monitor" )
275 if ( pair->value ==
"VetoCounter" )
281 if ( pair->value ==
"Calorimeter" )
289 if ( pair->value ==
"Target" )
305 if ( ! detector[ curDetectorRole ] )
307 detector[ curDetectorRole ] =
318 ( *lvIter )->SetSensitiveDetector(
319 detector[ curDetectorRole ] );
349 rotation = gdmlParser.
GetRotation(
"CalorimeterLeftRot" );
356 rotation = gdmlParser.
GetRotation(
"CalorimeterRightRot" );
379 if ( pVolume->IsReplicated() )
381 pVolume->GetReplicationData( axis,
383 width, offset, consuming );
386 lVolume = pVolume->GetLogicalVolume();
396 if ( pVolume->IsReplicated() )
399 width, offset, consuming );
402 lVolume = pVolume->GetLogicalVolume();
407 G4Box * crystalBox( dynamic_cast< G4Box * >( lVolume->
GetSolid() ) );
426 row =
G4int( ( src.
y() + crystalHeight * nCrystalsInColumn / 2 ) /
428 column =
G4int( ( src.
x() + crystalWidth * nCrystalsInRow / 2 ) /
432 crystalWidth + crystalWidth / 2 );
435 crystalHeight + crystalHeight / 2 );
436 dst.
setX( src.
x() - xInCalorimeterOffset );
437 dst.
setY( src.
y() - yInCalorimeterOffset );
445 for ( std::vector< G4VPhysicalVolume * >::const_iterator k( pvs->begin() );
446 k != pvs->end(); ++k )
460 if ( ( *k )->GetName().contains(
"Right" ) )
466 if ( ( *k )->GetName().contains(
"Right" ) )
481 detectorRole =
value;
void AddRootLogicalVolume(G4LogicalVolume *lv)
static G4RunManager * GetRunManager()
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void SetProductionCut(G4double cut, G4int index=-1)
G4double GetYHalfLength() const
CexmcSetup(const G4String &gdmlFile="default.gdml", G4bool validateGDMLFile=true)
const G4VUserPhysicsList * GetUserPhysicsList() const
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
void InitializeMessenger(void)
G4double GetDefaultCutValue() const
static constexpr double mm
void AddNewDetector(G4VSensitiveDetector *aSD)
const G4String CexmcCalorimeterRegionName("Calorimeter")
CLHEP::HepRotation G4RotationMatrix
G4int GetNoDaughters() const
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
void Read(const G4String &filename, G4bool Validate=true)
void SetProductionCuts(G4ProductionCuts *cut)
G4ThreeVector GetRotation(const G4String &name) const
G4LogicalVolume * vetoCounterVolume
void SetFilter(G4VSDFilter *f)
G4LogicalVolume * calorimeterVolume
G4AffineTransform calorimeterRightTransform
static void RotateMatrix(const G4ThreeVector &pos, G4RotationMatrix &rm)
const XML_Char int const XML_Char * value
G4AffineTransform calorimeterLeftTransform
G4VPhysicalVolume * Construct(void)
void ConvertToCrystalGeometry(const G4ThreeVector &src, G4int &row, G4int &column, G4ThreeVector &dst) const
G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume *lvol) const
G4bool calorimeterGeometryDataInitialized
G4double GetXHalfLength() const
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
G4VPhysicalVolume * world
G4VPhysicalVolume * rightCalorimeter
G4LogicalVolume * monitorVolume
void ReadCalorimeterGeometryData(const G4LogicalVolume *lVolume)
static G4SDManager * GetSDMpointer()
static G4PhysicalVolumeStore * GetInstance()
HepRotation & rotateY(double delta)
static G4RegionStore * GetInstance()
G4LogicalVolume * targetVolume
G4VPhysicalVolume * rightVetoCounter
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4AffineTransform targetTransform
G4ThreeVector GetPosition(const G4String &name) const
G4bool calorimeterRegionInitialized
void SetupConstructionHook(void)
HepRotation & rotateZ(double delta)
G4GLOB_DLL std::ostream G4cout
virtual void SetupConstructionHook(const CexmcSetup *setup)=0
G4VSolid * GetSolid() const
void ReadTransforms(const G4GDMLParser &gdmlParser)
CalorimeterGeometryData calorimeterGeometry
void SetupSpecialVolumes(const G4GDMLParser &gdmlParser)
static void AssertAndAsignDetectorRole(CexmcDetectorRole &detectorRole, CexmcDetectorRole value)
G4double GetZHalfLength() const
HepRotation & rotateX(double delta)
static G4LogicalVolumeStore * GetInstance()
G4VPhysicalVolume * GetDaughter(const G4int i) const
void ReadRightDetectors(void)