ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorConstruction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorConstruction.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 //
28 //
29 //
30 //
31 //
32 
33 #include "DetectorConstruction.hh"
34 #include "DetectorSimpleALICE.hh"
35 #include "DetectorALICE06.hh"
36 #include "DetectorBari05.hh"
37 #include "DetectorHarris73.hh"
38 #include "DetectorWatase86.hh"
39 #include "DetectorBarr90.hh"
40 #include "DetectorMessenger.hh"
41 #include "Materials.hh"
42 #include "G4Region.hh"
43 #include "G4RegionStore.hh"
44 #include "G4ProductionCuts.hh"
45 
46 #include "G4LogicalVolumeStore.hh"
47 #include "G4LogicalVolume.hh"
48 #include "G4ios.hh"
49 
50 #include "G4SystemOfUnits.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
56  fRadiatorDescription(0),
57  fSetUp("simpleALICE")
58 {
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 
65 {
66  delete fRadiatorDescription;
67  delete fDetectorMessenger;
68  delete Materials::GetInstance();
69 }
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  G4VPhysicalVolume* world = nullptr;
76  if( fSetUp == "simpleALICE" )
77  {
78  DetectorSimpleALICE simpleALICE;
79  world = simpleALICE.Construct();
81  }
82  else if( fSetUp == "alice06" )
83  {
84  DetectorALICE06 alice06;
85  world = alice06.Construct();
87  }
88  else if( fSetUp == "bari05" )
89  {
90  DetectorBari05 bari05;
91  world = bari05.Construct();
93  }
94  else if( fSetUp == "harris73" )
95  {
96  DetectorHarris73 harris73;
97  world = harris73.Construct();
99  }
100  else if( fSetUp == "watase86" )
101  {
102  DetectorWatase86 watase86;
103  world = watase86.Construct();
105  }
106  else if( fSetUp == "barr90" )
107  {
108  DetectorBarr90 barr90;
109  world = barr90.Construct();
111  }
112  else
113  {
114  G4cout << "Experimental setup is unsupported. Check /XTRdetector/setup "
115  <<G4endl;
116  G4cout << "Run default: simpleALICE"<<G4endl;
117 
118  DetectorSimpleALICE simpleALICE;
119  world = simpleALICE.Construct();
121  }
122  G4RegionStore* regionStore = G4RegionStore::GetInstance();
123  size_t nRegions = regionStore->size();
124  G4double cut = 1.*CLHEP::mm;
125  for(size_t i=0; i<nRegions; ++i) {
126  G4Region* reg = (*regionStore)[i];
127  if(!reg->GetProductionCuts()) {
128  G4ProductionCuts* cuts = new G4ProductionCuts();
129  cuts->SetProductionCut(cut,"gamma");
130  cuts->SetProductionCut(cut,"e-");
131  cuts->SetProductionCut(cut,"e+");
132  cuts->SetProductionCut(cut,"proton");
133  reg->SetProductionCuts(cuts);
134  }
135  }
136  return world;
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
142 {
143  if ( ! fRadiatorDescription ) {
144  G4cout << "RadiatorDescription is not defined" << G4endl;
145  }
146  return fRadiatorDescription;
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 
152 {
153  G4LogicalVolume* lv
155 
156  if ( ! lv ) {
157  G4cerr << "Absorber logical volume is not defined." << G4endl;
158  return 0;
159  }
160 
161  return lv->GetMaterial();
162 }
163 
164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
165