Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Types | Public Member Functions
CexmcSetup Class Reference

#include <CexmcSetup.hh>

Inheritance diagram for CexmcSetup:
G4VUserDetectorConstruction

Data Structures

struct  CalorimeterGeometryData
 

Public Types

enum  SpecialVolumeType { Monitor, VetoCounter, Calorimeter, Target }
 

Public Member Functions

 CexmcSetup (const G4String &gdmlFile="default.gdml", G4bool validateGDMLFile=true)
 
G4VPhysicalVolumeConstruct (void)
 
const G4AffineTransformGetTargetTransform (void) const
 
const G4AffineTransformGetCalorimeterLeftTransform (void) const
 
const G4AffineTransformGetCalorimeterRightTransform (void) const
 
void ConvertToCrystalGeometry (const G4ThreeVector &src, G4int &row, G4int &column, G4ThreeVector &dst) const
 
const CalorimeterGeometryDataGetCalorimeterGeometry (void) const
 
const G4LogicalVolumeGetVolume (SpecialVolumeType volume) const
 
G4bool IsRightDetector (const G4VPhysicalVolume *pVolume) const
 
G4bool IsRightCalorimeter (const G4VPhysicalVolume *pVolume) const
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 59 of file CexmcSetup.hh.

Member Enumeration Documentation

Enumerator
Monitor 
VetoCounter 
Calorimeter 
Target 

Definition at line 62 of file CexmcSetup.hh.

Constructor & Destructor Documentation

CexmcSetup::CexmcSetup ( const G4String gdmlFile = "default.gdml",
G4bool  validateGDMLFile = true 
)
explicit

Definition at line 71 of file CexmcSetup.cc.

71  :
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 )
77 {
78 }

Member Function Documentation

G4VPhysicalVolume * CexmcSetup::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 81 of file CexmcSetup.cc.

References CexmcWeirdException, G4RunManager::GetRunManager(), G4RunManager::GetUserPhysicsList(), G4GDMLParser::GetWorldVolume(), G4GDMLParser::Read(), CexmcPhysicsManager::SetupConstructionHook(), and CexmcRunManager::SetupConstructionHook().

82 {
83  if ( world )
84  return world;
85 
86  G4GDMLParser gdmlParser;
87 
88  gdmlParser.Read( gdmlFile, validateGDMLFile );
89  world = gdmlParser.GetWorldVolume();
90 
91  SetupSpecialVolumes( gdmlParser );
92 
93  ReadTransforms( gdmlParser );
94 
95  ReadRightDetectors();
96 
97  CexmcRunManager * runManager( static_cast< CexmcRunManager * >(
99 
100  runManager->SetupConstructionHook();
101 
102  const CexmcPhysicsManager * physicsManager(
103  dynamic_cast< const CexmcPhysicsManager * >(
104  runManager->GetUserPhysicsList() ) );
105 
106  if ( ! physicsManager )
108 
109  CexmcPhysicsManager * thePhysicsManager(
110  const_cast< CexmcPhysicsManager * >( physicsManager ) );
111  thePhysicsManager->SetupConstructionHook( this );
112 
113  return world;
114 }
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
void Read(const G4String &filename, G4bool Validate=true)
void CexmcSetup::ConvertToCrystalGeometry ( const G4ThreeVector src,
G4int row,
G4int column,
G4ThreeVector dst 
) const

Definition at line 417 of file CexmcSetup.cc.

References CexmcSetup::CalorimeterGeometryData::crystalHeight, CexmcSetup::CalorimeterGeometryData::crystalWidth, CexmcSetup::CalorimeterGeometryData::nCrystalsInColumn, CexmcSetup::CalorimeterGeometryData::nCrystalsInRow, CLHEP::Hep3Vector::setX(), CLHEP::Hep3Vector::setY(), CLHEP::Hep3Vector::x(), and CLHEP::Hep3Vector::y().

419 {
420  G4int nCrystalsInColumn( calorimeterGeometry.nCrystalsInColumn );
421  G4int nCrystalsInRow( calorimeterGeometry.nCrystalsInRow );
422  G4double crystalWidth( calorimeterGeometry.crystalWidth );
423  G4double crystalHeight( calorimeterGeometry.crystalHeight );
424 
425  row = G4int( ( src.y() + crystalHeight * nCrystalsInColumn / 2 ) /
426  crystalHeight );
427  column = G4int( ( src.x() + crystalWidth * nCrystalsInRow / 2 ) /
428  crystalWidth );
429  G4double xInCalorimeterOffset(
430  ( G4double( column ) - G4double( nCrystalsInRow ) / 2 ) *
431  crystalWidth + crystalWidth / 2 );
432  G4double yInCalorimeterOffset(
433  ( G4double( row ) - G4double( nCrystalsInColumn ) / 2 ) *
434  crystalHeight + crystalHeight / 2 );
435  dst.setX( src.x() - xInCalorimeterOffset );
436  dst.setY( src.y() - yInCalorimeterOffset );
437 }
double x() const
int G4int
Definition: G4Types.hh:78
void setY(double)
void setX(double)
double y() const
double G4double
Definition: G4Types.hh:76
const CexmcSetup::CalorimeterGeometryData & CexmcSetup::GetCalorimeterGeometry ( void  ) const
inline
const G4AffineTransform & CexmcSetup::GetCalorimeterLeftTransform ( void  ) const
inline

Definition at line 167 of file CexmcSetup.hh.

Referenced by CexmcReconstructor::CexmcReconstructor().

169 {
170  return calorimeterLeftTransform;
171 }
const G4AffineTransform & CexmcSetup::GetCalorimeterRightTransform ( void  ) const
inline

Definition at line 174 of file CexmcSetup.hh.

Referenced by CexmcReconstructor::CexmcReconstructor().

176 {
177  return calorimeterRightTransform;
178 }
const G4AffineTransform & CexmcSetup::GetTargetTransform ( void  ) const
inline

Definition at line 161 of file CexmcSetup.hh.

Referenced by CexmcReconstructor::CexmcReconstructor(), and CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::SetupConstructionHook().

162 {
163  return targetTransform;
164 }
const G4LogicalVolume * CexmcSetup::GetVolume ( SpecialVolumeType  volume) const
inline

Definition at line 188 of file CexmcSetup.hh.

References Calorimeter, Monitor, Target, and VetoCounter.

Referenced by CexmcSteppingAction::CexmcSteppingAction(), CexmcTrackingAction::CexmcTrackingAction(), and CexmcPhysicsList< BasePhysics, StudiedPhysics, ProductionModel >::SetupConstructionHook().

190 {
191  switch ( volume )
192  {
193  case Monitor :
194  return monitorVolume;
195  case VetoCounter :
196  return vetoCounterVolume;
197  case Calorimeter :
198  return calorimeterVolume;
199  case Target :
200  return targetVolume;
201  default :
202  return NULL;
203  }
204 }
G4bool CexmcSetup::IsRightCalorimeter ( const G4VPhysicalVolume pVolume) const
inline

Definition at line 217 of file CexmcSetup.hh.

Referenced by CexmcEnergyDepositInCalorimeter::GetIndex(), and CexmcTrackPointsInCalorimeter::GetIndex().

219 {
220  if ( pVolume == rightCalorimeter )
221  return true;
222 
223  return false;
224 }
G4bool CexmcSetup::IsRightDetector ( const G4VPhysicalVolume pVolume) const
inline

Definition at line 207 of file CexmcSetup.hh.

Referenced by CexmcEnergyDepositInLeftRightSet::GetIndex(), and CexmcTrackPointsInLeftRightSet::GetIndex().

209 {
210  if ( pVolume == rightVetoCounter || pVolume == rightCalorimeter )
211  return true;
212 
213  return false;
214 }

The documentation for this class was generated from the following files: