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

#include <ExGflashDetectorConstruction.hh>

Inheritance diagram for ExGflashDetectorConstruction:
Collaboration diagram for ExGflashDetectorConstruction:

Public Member Functions

 ExGflashDetectorConstruction ()
 
 ~ExGflashDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
const G4VPhysicalVolumeGetCristal (int num__crystal)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
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 46 of file ExGflashDetectorConstruction.hh.

Constructor & Destructor Documentation

ExGflashDetectorConstruction::ExGflashDetectorConstruction ( )

Definition at line 72 of file ExGflashDetectorConstruction.cc.

74 {
75  G4cout<<"ExGflashDetectorConstruction::Detector constructor"<<G4endl;
76 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
ExGflashDetectorConstruction::~ExGflashDetectorConstruction ( )

Definition at line 80 of file ExGflashDetectorConstruction.cc.

81 {
82  delete fFastShowerModel;
83  delete fParameterisation;
84  delete fParticleBounds;
85  delete fHitMaker;
86 }

Member Function Documentation

G4VPhysicalVolume * ExGflashDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 90 of file ExGflashDetectorConstruction.cc.

91 {
92  //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
93  G4cout << "Defining the materials" << G4endl;
94  // Get nist material manager
95  G4NistManager* nistManager = G4NistManager::Instance();
96  // Build materials
97  G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
98  G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
99 
100  /*******************************
101  * The Experimental Hall *
102  *******************************/
103  G4double experimentalHall_x=1000.*cm;
104  G4double experimentalHall_y=1000.*cm;
105  G4double experimentalHall_z=1000.*cm;
106 
107  G4VSolid* experimentalHall_box
108  = new G4Box("expHall_box", // World Volume
109  experimentalHall_x, // x size
110  experimentalHall_y, // y size
111  experimentalHall_z); // z size
112 
113  G4LogicalVolume* experimentalHall_log
114  = new G4LogicalVolume(experimentalHall_box,
115  air,
116  "expHall_log",
117  0, //opt: fieldManager
118  0, //opt: SensitiveDetector
119  0); //opt: UserLimits
120  G4VPhysicalVolume* experimentalHall_phys
121  = new G4PVPlacement(0,
122  G4ThreeVector(), //at (0,0,0)
123  "expHall",
124  experimentalHall_log,
125  0,
126  false,
127  0);
128 
129 
130  //------------------------------
131  // Calorimeter segments
132  //------------------------------
133  // Simplified `CMS-like` PbWO4 crystal calorimeter
134 
135  G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
136  // cube of 10 x 10 crystals
137  // don't change it @the moment, since
138  // the readout in event action assumes this
139  // dimensions and is not automatically adapted
140  // in this version of the example :-(
141  // Simplified `CMS-like` PbWO4 crystal calorimeter
142  G4double calo_xside = 31*cm;
143  G4double calo_yside = 31*cm;
144  G4double calo_zside = 24*cm;
145 
146  G4double crystalWidth = 3*cm;
147  G4double crystalLength = 24*cm;
148 
149  calo_xside = (crystalWidth*nbOfCrystals)+1*cm;
150  calo_yside = (crystalWidth*nbOfCrystals)+1*cm;
151  calo_zside = crystalLength;
152 
153  G4Box* calo_box= new G4Box("CMS calorimeter", // its name
154  calo_xside/2., // size
155  calo_yside/2.,
156  calo_zside/2.);
157  G4LogicalVolume* calo_log
158  = new G4LogicalVolume(calo_box, // its solid
159  air, // its material
160  "calo log", // its name
161  0, // opt: fieldManager
162  0, // opt: SensitiveDetector
163  0); // opt: UserLimit
164 
165  G4double xpos = 0.0;
166  G4double ypos = 0.0;
167  G4double zpos = 100.0*cm;
168  new G4PVPlacement(0,
169  G4ThreeVector(xpos, ypos, zpos),
170  calo_log,
171  "calorimeter",
172  experimentalHall_log,
173  false,
174  1);
175 
176  // Crystals
177  G4VSolid* crystal_box
178  = new G4Box("Crystal", // its name
179  crystalWidth/2,
180  crystalWidth/2,
181  crystalLength/2);
182  // size
183  fCrystal_log
184  = new G4LogicalVolume(crystal_box, // its solid
185  pbWO4, // its material
186  "Crystal_log"); // its name
187 
188  for (G4int i=0; i<nbOfCrystals; i++)
189  {
190 
191  for (G4int j=0; j<nbOfCrystals; j++)
192  {
193  G4int n = i*10+j;
194  G4ThreeVector crystalPos((i*crystalWidth)-135,
195  (j*crystalWidth)-135,0 );
196  fCrystal_phys[n]
197  = new G4PVPlacement(0, // no rotation
198  crystalPos, // translation
199  fCrystal_log,
200  "crystal", // its name
201  calo_log,
202  false,
203  i);
204  }
205  }
206  G4cout << "There are " << nbOfCrystals <<
207  " crystals per row in the calorimeter, so in total "<<
208  nbOfCrystals*nbOfCrystals << " crystals" << G4endl;
209  G4cout << "They have width of " << crystalWidth /cm <<
210  " cm and a length of " << crystalLength /cm
211  <<" cm. The Material is "<< pbWO4 << G4endl;
212 
213 
214  experimentalHall_log->SetVisAttributes(G4VisAttributes::GetInvisible());
215  G4VisAttributes* caloVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
216  G4VisAttributes* crystalVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
217  calo_log->SetVisAttributes(caloVisAtt);
218  fCrystal_log->SetVisAttributes(crystalVisAtt);
219 
220  // define the fParameterisation region
221  fRegion = new G4Region("crystals");
222  calo_log->SetRegion(fRegion);
223  fRegion->AddRootLogicalVolume(calo_log);
224 
225  return experimentalHall_phys;
226 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
Definition: G4Box.hh:64
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
void SetRegion(G4Region *reg)
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
const G4int n
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const G4VisAttributes & GetInvisible()
void SetVisAttributes(const G4VisAttributes *pVA)

Here is the call graph for this function:

void ExGflashDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 230 of file ExGflashDetectorConstruction.cc.

231 {
232  // -- sensitive detectors:
235  = new ExGflashSensitiveDetector("Calorimeter",this);
236  SDman->AddNewDetector(CaloSD);
237  fCrystal_log->SetSensitiveDetector(CaloSD);
238 
239  // Get nist material manager
240  G4NistManager* nistManager = G4NistManager::Instance();
241  G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
242  // -- fast simulation models:
243  // **********************************************
244  // * Initializing shower modell
245  // ***********************************************
246  G4cout << "Creating shower parameterization models" << G4endl;
247  fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
249  fFastShowerModel->SetParameterisation(*fParameterisation);
250  // Energy Cuts to kill particles:
251  fParticleBounds = new GFlashParticleBounds();
252  fFastShowerModel->SetParticleBounds(*fParticleBounds);
253  // Makes the EnergieSpots
254  fHitMaker = new GFlashHitMaker();
255  fFastShowerModel->SetHitMaker(*fHitMaker);
256  G4cout<<"end shower parameterization."<<G4endl;
257  // **********************************************
258 }
void SetHitMaker(GFlashHitMaker &Maker)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void SetParticleBounds(GFlashParticleBounds &SpecificBound)
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
void SetParameterisation(GVFlashShowerParameterisation &DP)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)

Here is the call graph for this function:

const G4VPhysicalVolume* ExGflashDetectorConstruction::GetCristal ( int  num__crystal)
inline

Definition at line 56 of file ExGflashDetectorConstruction.hh.

57  {return fCrystal_phys[num__crystal];};

Here is the caller graph for this function:


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