ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExGflash3DetectorConstruction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ExGflash3DetectorConstruction.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
29 //
30 // Created by Joanna Weng 26.11.2004
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 // User Classes
37 
38 // G4 Classes
39 #include "G4NistManager.hh"
40 #include "G4Material.hh"
41 #include "G4ThreeVector.hh"
42 #include "G4PVPlacement.hh"
43 #include "G4VPhysicalVolume.hh"
44 #include "G4LogicalVolume.hh"
45 #include "G4Box.hh"
46 #include "G4SDManager.hh"
47 #include "G4VisAttributes.hh"
48 #include "G4Colour.hh"
49 #include "G4SystemOfUnits.hh"
50 #include "G4AutoDelete.hh"
51 #include "globals.hh"
52 
53 //fast simulation
56 #include "GFlashShowerModel.hh"
57 #include "GFlashHitMaker.hh"
58 #include "GFlashParticleBounds.hh"
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
72 {
73  G4cout<<"ExGflash3DetectorConstruction::Detector constructor"<<G4endl;
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 {
80  delete fFastShowerModel;
81  delete fParameterisation;
82  delete fParticleBounds;
83  delete fHitMaker;
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 {
90  //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
91  G4cout << "Defining the materials" << G4endl;
92  // Get nist material manager
93  G4NistManager* nistManager = G4NistManager::Instance();
94  // Build materials
95  G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
96  G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
97 
98  /*******************************
99  * The Experimental Hall *
100  *******************************/
101  G4double experimentalHall_x=1000.*cm;
102  G4double experimentalHall_y=1000.*cm;
103  G4double experimentalHall_z=1000.*cm;
104 
105  G4VSolid* experimentalHall_box
106  = new G4Box("expHall_box", // World Volume
107  experimentalHall_x, // x size
108  experimentalHall_y, // y size
109  experimentalHall_z); // z size
110 
111  G4LogicalVolume* experimentalHallLog
112  = new G4LogicalVolume(experimentalHall_box,
113  air,
114  "expHallLog",
115  0, //opt: fieldManager
116  0, //opt: SensitiveDetector
117  0); //opt: UserLimits
118  G4VPhysicalVolume* experimentalHall_phys
119  = new G4PVPlacement(0,
120  G4ThreeVector(), //at (0,0,0)
121  "expHall",
122  experimentalHallLog,
123  0,
124  false,
125  0);
126 
127 
128  //------------------------------
129  // Calorimeter segments
130  //------------------------------
131  // Simplified `CMS-like` PbWO4 crystal calorimeter
132 
133  G4int nbOfCrystals = 10; // this are the crystals PER ROW in this example
134  // cube of 10 x 10 crystals
135  // don't change it @the moment, since
136  // the readout in event action assumes this
137  // dimensions and is not automatically adapted
138  // in this version of the example :-(
139  // Simplified `CMS-like` PbWO4 crystal calorimeter
140  G4double calo_xside = 31*cm;
141  G4double calo_yside = 31*cm;
142  G4double calo_zside = 24*cm;
143 
144  G4double crystalWidth = 3*cm;
145  G4double crystalLength = 24*cm;
146 
147  calo_xside = (crystalWidth*nbOfCrystals)+1*cm;
148  calo_yside = (crystalWidth*nbOfCrystals)+1*cm;
149  calo_zside = crystalLength;
150 
151  G4Box* calo_box= new G4Box("CMS calorimeter", // its name
152  calo_xside/2., // size
153  calo_yside/2.,
154  calo_zside/2.);
155  G4LogicalVolume* caloLog
156  = new G4LogicalVolume(calo_box, // its solid
157  pbWO4, // its material
158  "calo log", // its name
159  0, // opt: fieldManager
160  0, // opt: SensitiveDetector
161  0); // opt: UserLimit
162 
163  G4double xpos = 0.0;
164  G4double ypos = 0.0;
165  G4double zpos = 100.0*cm;
166  new G4PVPlacement(0,
167  G4ThreeVector(xpos, ypos, zpos),
168  caloLog,
169  "calorimeter",
170  experimentalHallLog,
171  false,
172  1);
173 
174  // Individual crystals are created as part of the readout geometry in the parallel world
175 
176  experimentalHallLog->SetVisAttributes(G4VisAttributes::GetInvisible());
177  G4VisAttributes* caloVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
178  caloLog->SetVisAttributes(caloVisAtt);
179 
180  // define the fParameterisation region
181  fRegion = new G4Region("crystals");
182  caloLog->SetRegion(fRegion);
183  fRegion->AddRootLogicalVolume(caloLog);
184 
185  return experimentalHall_phys;
186 }
187 
188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
189 
191 {
192  // SD moved to parallel world
193 
194  // -- fast simulation models:
195  // **********************************************
196  // * Initializing shower modell
197  // ***********************************************
198  G4cout << "Creating shower parameterization models" << G4endl;
199  fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
202  // Energy Cuts to kill particles:
205  // Makes the EnergieSpots
206  fHitMaker = new GFlashHitMaker();
207  // Important: use SD defined in different geometry
208  fHitMaker->SetNameOfWorldWithSD("parallelWorld");
210  G4cout<<"end shower parameterization."<<G4endl;
211  // **********************************************
212 }
213 
214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......