Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalDetectorConstruction Class Reference

#include <CCalDetectorConstruction.hh>

Inheritance diagram for CCalDetectorConstruction:
Collaboration diagram for CCalDetectorConstruction:

Public Member Functions

 CCalDetectorConstruction ()
 
 ~CCalDetectorConstruction ()
 
G4VPhysicalVolumeConstruct ()
 
- 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 37 of file CCalDetectorConstruction.hh.

Constructor & Destructor Documentation

CCalDetectorConstruction::CCalDetectorConstruction ( )

Definition at line 69 of file CCalDetectorConstruction.cc.

69 {}
CCalDetectorConstruction::~CCalDetectorConstruction ( )

Definition at line 71 of file CCalDetectorConstruction.cc.

71 {}

Member Function Documentation

G4VPhysicalVolume * CCalDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 73 of file CCalDetectorConstruction.cc.

73  {
74 
76  //Instantiate for the first time the materials and rotations
77 #ifdef debug
78  G4cout << "Retrieving materials...." << G4endl;
79 #endif
80  CCalMaterialFactory::getInstance("material.cms");
81 
82 #ifdef debug
83  G4cout << "Retrieving rotation matrices....." << G4endl;
84 #endif
86 
87  //-------------------------------------------------------------------------
88  // Magnetic field
89  //-------------------------------------------------------------------------
90 
91  static G4bool fieldIsInitialized = false;
92  //And finally that it was not initialized previously
93  if (!fieldIsInitialized) {
94  CCalMagneticField* ccalField=new CCalMagneticField("fmap.tb96");
95  G4double field = ccalField->GetConstantFieldvalue();
96  if (field == 0) {
97  ccalField = NULL;
98  G4cout << "***************************" << G4endl
99  << "* *" << G4endl
100  << "* Magnetic Field is off *" << G4endl
101  << "* *" << G4endl
102  << "***************************" << G4endl;
103  } else {
104  G4cout << "***************************" << G4endl
105  << "* *" << G4endl
106  << "* Magnetic Field is on *" << G4endl
107  << "* *" << G4endl
108  << "***************************" << G4endl << G4endl
109  << " Field Value " << tab << field << G4endl;
110  }
111  G4FieldManager* fieldMgr
113  fieldMgr->SetDetectorField(ccalField);
114  G4Mag_UsualEqRhs *fEquation = new G4Mag_UsualEqRhs(ccalField);
115 
116  G4MagIntegratorStepper *pStepper = new G4ClassicalRK4 (fEquation);
117  //pStepper = new G4ExplicitEuler( fEquation );
118  //pStepper = new G4ImplicitEuler( fEquation );
119  //pStepper = new G4SimpleRunge( fEquation );
120  //pStepper = new G4SimpleHeum( fEquation );
121  //pStepper = new G4HelixExplicitEuler( fEquation );
122  //pStepper = new G4HelixImplicitEuler( fEquation );
123  //pStepper = new G4HelixSimpleRunge( fEquation );
124  //pStepper = new G4CashKarpRKF45( fEquation );
125  //pStepper = new G4RKG3_Stepper( fEquation );
126 
127  G4ChordFinder *pChordFinder = new G4ChordFinder(ccalField,
128  1.e-1*mm, pStepper);
129  pChordFinder->SetDeltaChord(1.0e-3*mm);
130  fieldMgr->SetChordFinder(pChordFinder);
131  fieldMgr->SetDeltaOneStep(1.0e-3*mm);
132  fieldMgr->SetDeltaIntersection(1.0e-4*mm);
133  G4PropagatorInField* fieldPropagator
136  fieldPropagator->SetMinimumEpsilonStep(1.e-5*mm);
137  fieldPropagator->SetMaximumEpsilonStep(1.e-2*mm);
138  fieldIsInitialized = true;
139  }
140 
141 #ifdef debug
142  G4cout << tab << "CCalDetectorConstruction: Starting timer!!!"
143  << G4endl;
144  G4Timer timer;
145  timer.Start();
146 #endif
147 
148  //HCAL Test Beam 96
149  CCalG4Hall* testBeamHCal96 = new CCalG4Hall("HcalTB96");
150  testBeamHCal96->constructHierarchy();
151 #ifdef debug
152  timer.Stop();
153  G4cout << tab << "CCalDetectorConstruction: Total time to "
154  << "construct the geometry: " << timer << G4endl;
155 #endif //debug
156  G4VPhysicalVolume* volume = testBeamHCal96->PhysicalVolume(0);
157 
158  //Addsenistive detector types
159  //G4bool result;
160  G4int sensitive;
162  getSensitiveFlag("HadronCalorimeter");
163  if (sensitive>0) /*result =*/ CCalSensAssign::getInstance()->
164  addCaloSD("HadronCalorimeter", new CCalHcalOrganization);
166  getSensitiveFlag("CrystalMatrixModule");
167  if (sensitive>0) /*result =*/ CCalSensAssign::getInstance()->
168  addCaloSD("CrystalMatrix", new CCalEcalOrganization);
169 
170  //Assign the sensitive detectors
171  /*result =*/ CCalSensAssign::getInstance()->assign();
172 
173  //Create the stacking manager required by Calorimeter
175 
176  return volume;
177 
178 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4bool SetDetectorField(G4Field *detectorField)
G4VPhysicalVolume * PhysicalVolume(G4VPhysicalVolume *)
Definition: CCalG4Able.cc:65
void SetChordFinder(G4ChordFinder *aChordFinder)
int G4int
Definition: G4Types.hh:78
static CCalSensAssign * getInstance()
static CCalSensitiveConfiguration * getInstance()
G4double GetConstantFieldvalue() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
std::ostream & tab(std::ostream &)
Definition: CCalutils.cc:89
static CCalRotationMatrixFactory * getInstance()
void constructHierarchy()
Definition: CCalDetector.hh:66
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
void Stop()
void SetDeltaIntersection(G4double valueDintersection)
void SetMinimumEpsilonStep(G4double newEpsMin)
#define G4endl
Definition: G4ios.hh:61
void Start()
static CCalMaterialFactory * getInstance()
double G4double
Definition: G4Types.hh:76
void SetMaximumEpsilonStep(G4double newEpsMax)
void SetDeltaOneStep(G4double valueD1step)
G4PropagatorInField * GetPropagatorInField() const
void SetDeltaChord(G4double newval)

Here is the call graph for this function:


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