72 world( 0 ), gdmlFile( gdmlFile ), validateGDMLFile( validateGDMLFile ),
73 calorimeterRegionInitialized( false ),
74 calorimeterGeometryDataInitialized( false ), monitorVolume( NULL ),
75 vetoCounterVolume( NULL ), calorimeterVolume( NULL ), targetVolume( NULL ),
76 rightVetoCounter( NULL ), rightCalorimeter( NULL )
103 dynamic_cast< const CexmcPhysicsManager * >(
106 if ( ! physicsManager )
110 const_cast< CexmcPhysicsManager * >( physicsManager ) );
123 for ( std::vector< G4LogicalVolume * >::const_iterator
124 lvIter( lvs->begin() ); lvIter != lvs->end(); ++lvIter )
131 for ( G4GDMLAuxListType::const_iterator pair( auxInfo.begin() );
132 pair != auxInfo.end(); ++pair )
135 G4String detectorName(
"uninitialized" );
138 if ( pair->type ==
"EnergyDepositDetector" )
142 if ( pair->value ==
"MonitorRole" )
150 if ( pair->value ==
"VetoCounterRole" )
159 if ( pair->value ==
"CalorimeterRole" )
171 detectorName <<
"' in volume '" << volumeName <<
175 if ( pair->type ==
"TrackPointsDetector" )
179 if ( pair->value ==
"MonitorRole" )
187 if ( pair->value ==
"VetoCounterRole" )
196 if ( pair->value ==
"CalorimeterRole" )
205 if ( pair->value ==
"TargetRole" )
216 detectorName <<
"' in volume '" << volumeName <<
226 if ( pair->type ==
"SensitiveRegion" )
230 if ( pair->value ==
"CalorimeterRegion" )
247 GetUserPhysicsList() );
249 defaultProductionCut =
260 "volume '" << volumeName <<
"' registered" <<
264 if ( pair->type ==
"SpecialVolume" )
268 if ( pair->value ==
"Monitor" )
274 if ( pair->value ==
"VetoCounter" )
280 if ( pair->value ==
"Calorimeter" )
288 if ( pair->value ==
"Target" )
304 if ( ! detector[ curDetectorRole ] )
306 detector[ curDetectorRole ] =
317 ( *lvIter )->SetSensitiveDetector(
318 detector[ curDetectorRole ] );
348 rotation = gdmlParser.
GetRotation(
"CalorimeterLeftRot" );
355 rotation = gdmlParser.
GetRotation(
"CalorimeterRightRot" );
378 if ( pVolume->IsReplicated() )
380 pVolume->GetReplicationData( axis,
382 width, offset, consuming );
385 lVolume = pVolume->GetLogicalVolume();
395 if ( pVolume->IsReplicated() )
398 width, offset, consuming );
401 lVolume = pVolume->GetLogicalVolume();
406 G4Box * crystalBox( dynamic_cast< G4Box * >( lVolume->
GetSolid() ) );
425 row =
G4int( ( src.y() + crystalHeight * nCrystalsInColumn / 2 ) /
427 column =
G4int( ( src.x() + crystalWidth * nCrystalsInRow / 2 ) /
431 crystalWidth + crystalWidth / 2 );
434 crystalHeight + crystalHeight / 2 );
435 dst.setX( src.x() - xInCalorimeterOffset );
436 dst.setY( src.y() - yInCalorimeterOffset );
444 for ( std::vector< G4VPhysicalVolume * >::const_iterator k( pvs->begin() );
445 k != pvs->end(); ++k )
459 if ( ( *k )->GetName().contains(
"Right" ) )
465 if ( ( *k )->GetName().contains(
"Right" ) )
480 detectorRole = value;
487 rm.rotateX( rot.x() );
488 rm.rotateY( rot.y() );
489 rm.rotateZ( rot.z() );
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
G4VPhysicalVolume * rightVetoCounter
G4double GetXHalfLength() const
static constexpr double mm
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
CLHEP::HepRotation G4RotationMatrix
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void ConvertToCrystalGeometry(const G4ThreeVector &src, G4int &row, G4int &column, G4ThreeVector &dst) const
void SetupConstructionHook(void)
void SetFilter(G4VSDFilter *f)
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
void SetupSpecialVolumes(const G4GDMLParser &gdmlParser)
CalorimeterGeometryData calorimeterGeometry
void SetProductionCut(G4double cut, G4int index=-1)
CexmcSetup(const G4String &gdmlFile="default.gdml", G4bool validateGDMLFile=true)
G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume *lvol) const
G4double GetZHalfLength() const
G4bool calorimeterGeometryDataInitialized
G4AffineTransform calorimeterRightTransform
G4VPhysicalVolume * rightCalorimeter
static G4PhysicalVolumeStore * GetInstance()
static G4RegionStore * GetInstance()
static void RotateMatrix(const G4ThreeVector &pos, G4RotationMatrix &rm)
G4double GetDefaultCutValue() const
G4GLOB_DLL std::ostream G4cout
G4LogicalVolume * calorimeterVolume
G4AffineTransform calorimeterLeftTransform
static G4LogicalVolumeStore * GetInstance()
void ReadCalorimeterGeometryData(const G4LogicalVolume *lVolume)
G4double GetYHalfLength() const
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
void ReadRightDetectors(void)
virtual void SetupConstructionHook(const CexmcSetup *setup)=0
G4LogicalVolume * monitorVolume
G4int GetNoDaughters() const
void AddNewDetector(G4VSensitiveDetector *aSD)
static void AssertAndAsignDetectorRole(CexmcDetectorRole &detectorRole, CexmcDetectorRole value)
G4ThreeVector GetRotation(const G4String &name) const
static G4RunManager * GetRunManager()
const G4String CexmcCalorimeterRegionName("Calorimeter")
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4bool calorimeterRegionInitialized
static G4SDManager * GetSDMpointer()
void Read(const G4String &filename, G4bool Validate=true)
void InitializeMessenger(void)
G4LogicalVolume * targetVolume
void ReadTransforms(const G4GDMLParser &gdmlParser)
void SetProductionCuts(G4ProductionCuts *cut)
G4VPhysicalVolume * world
G4VPhysicalVolume * Construct(void)
const G4VUserPhysicsList * GetUserPhysicsList() const
G4LogicalVolume * vetoCounterVolume
G4AffineTransform targetTransform
G4ThreeVector GetPosition(const G4String &name) const