HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PhysicsList.cc
Go to the documentation of this file.
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 //
27 // $Id$
28 //
29 //
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "HGCal/TBStandaloneSimulator/interface/PhysicsList.hh"
35 #include "HGCal/TBStandaloneSimulator/interface/DetectorConstruction.hh"
36 #include "G4RunManager.hh"
37 #include "G4ProcessManager.hh"
38 #include "G4SystemOfUnits.hh"
39 #include "G4UnitsTable.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
43 PhysicsList::PhysicsList(): QGSP_BERT()
44 {
45  // A hack to avoid compiler warning
46  int level = CLHEP::HepRandomGenActive;
47  level = 1;
48 
49  defaultCutValue = 0.03 * mm;
50  SetVerboseLevel(level);
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
55 PhysicsList::~PhysicsList()
56 {}
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
60 // void PhysicsList::ConstructParticle()
61 // {
62 // // In this method, static member functions should be called
63 // // for all particles which you want to use.
64 // // This ensures that objects of these particle types will be
65 // // created in the program.
66 
67 // G4BosonConstructor pBosonConstructor;
68 // pBosonConstructor.ConstructParticle();
69 
70 // G4LeptonConstructor pLeptonConstructor;
71 // pLeptonConstructor.ConstructParticle();
72 
73 // G4MesonConstructor pMesonConstructor;
74 // pMesonConstructor.ConstructParticle();
75 
76 // G4BaryonConstructor pBaryonConstructor;
77 // pBaryonConstructor.ConstructParticle();
78 
79 // G4IonConstructor pIonConstructor;
80 // pIonConstructor.ConstructParticle();
81 // }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
85 // void PhysicsList::ConstructProcess()
86 // {
87 // AddTransportation();
88 // ConstructEM();
89 // ConstructDecay();
90 // }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
94 //#include "G4PhysicsListHelper.hh"
95 
96 //#include "G4ComptonScattering.hh"
97 // #include "G4GammaConversion.hh"
98 // #include "G4PhotoElectricEffect.hh"
99 
100 // #include "G4eMultipleScattering.hh"
101 // #include "G4eIonisation.hh"
102 // #include "G4eBremsstrahlung.hh"
103 // #include "G4eplusAnnihilation.hh"
104 
105 // #include "G4MuMultipleScattering.hh"
106 // #include "G4MuIonisation.hh"
107 // #include "G4MuBremsstrahlung.hh"
108 // #include "G4MuPairProduction.hh"
109 
110 // #include "G4hMultipleScattering.hh"
111 // #include "G4hIonisation.hh"
112 // #include "G4hBremsstrahlung.hh"
113 // #include "G4hPairProduction.hh"
114 
115 // #include "G4ionIonisation.hh"
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
119 // void PhysicsList::ConstructEM()
120 // {
121 // G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
122 
123 // theParticleIterator->reset();
124 // while( (*theParticleIterator)() ){
125 // G4ParticleDefinition* particle = theParticleIterator->value();
126 // G4String particleName = particle->GetParticleName();
127 
128 // if (particleName == "gamma") {
129 // // gamma
130 // ph->RegisterProcess(new G4PhotoElectricEffect, particle);
131 // ph->RegisterProcess(new G4ComptonScattering, particle);
132 // ph->RegisterProcess(new G4GammaConversion, particle);
133 
134 // } else if (particleName == "e-") {
135 // //electron
136 // ph->RegisterProcess(new G4eMultipleScattering, particle);
137 // ph->RegisterProcess(new G4eIonisation, particle);
138 // ph->RegisterProcess(new G4eBremsstrahlung, particle);
139 
140 // } else if (particleName == "e+") {
141 // //positron
142 // ph->RegisterProcess(new G4eMultipleScattering, particle);
143 // ph->RegisterProcess(new G4eIonisation, particle);
144 // ph->RegisterProcess(new G4eBremsstrahlung, particle);
145 // ph->RegisterProcess(new G4eplusAnnihilation, particle);
146 
147 // } else if( particleName == "mu+" ||
148 // particleName == "mu-" ) {
149 // //muon
150 // ph->RegisterProcess(new G4MuMultipleScattering, particle);
151 // ph->RegisterProcess(new G4MuIonisation, particle);
152 // ph->RegisterProcess(new G4MuBremsstrahlung, particle);
153 // ph->RegisterProcess(new G4MuPairProduction, particle);
154 
155 // } else if( particleName == "proton" ||
156 // particleName == "pi-" ||
157 // particleName == "pi+" ) {
158 // //proton
159 // ph->RegisterProcess(new G4hMultipleScattering, particle);
160 // ph->RegisterProcess(new G4hIonisation, particle);
161 // ph->RegisterProcess(new G4hBremsstrahlung, particle);
162 // ph->RegisterProcess(new G4hPairProduction, particle);
163 
164 // } else if( particleName == "alpha" ||
165 // particleName == "He3" ) {
166 // //alpha
167 // ph->RegisterProcess(new G4hMultipleScattering, particle);
168 // ph->RegisterProcess(new G4ionIonisation, particle);
169 
170 // } else if( particleName == "GenericIon" ) {
171 // //Ions
172 // ph->RegisterProcess(new G4hMultipleScattering, particle);
173 // ph->RegisterProcess(new G4ionIonisation, particle);
174 
175 // } else if ((!particle->IsShortLived()) &&
176 // (particle->GetPDGCharge() != 0.0) &&
177 // (particle->GetParticleName() != "chargedgeantino")) {
178 // //all others charged particles except geantino
179 // ph->RegisterProcess(new G4hMultipleScattering, particle);
180 // ph->RegisterProcess(new G4hIonisation, particle);
181 // }
182 // }
183 // }
184 
185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186 
187 // #include "G4Decay.hh"
188 
189 // void PhysicsList::ConstructDecay()
190 // {
191 // G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
192 
193 // // Add Decay Process
194 // G4Decay* theDecayProcess = new G4Decay();
195 // theParticleIterator->reset();
196 // while( (*theParticleIterator)() ){
197 // G4ParticleDefinition* particle = theParticleIterator->value();
198 // if (theDecayProcess->IsApplicable(*particle)) {
199 // ph->RegisterProcess(theDecayProcess, particle);
200 // }
201 // }
202 // }
203 
204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
205 
206 void PhysicsList::SetCuts()
207 {
208  if (verboseLevel > 0) {
209  G4cout << "PhysicsList::SetCuts:";
210  G4cout << "CutLength : " << G4BestUnit(defaultCutValue, "Length") << G4endl;
211  }
212 
213  // set cut values for gamma at first and for e- second and next for e+,
214  // because some processes for e+/e- need cut values for gamma
215  //
216 
217  SetCutValue(0.7 * mm, "gamma");
218  SetCutValue(0.7 * mm, "e-");
219  SetCutValue(0.7 * mm, "e+");
220  SetCutValue(0.7 * mm, "proton");
221 
222  //set smaller cut for Si
223  const std::vector<G4LogicalVolume*>& logSi
224  = ((DetectorConstruction*)G4RunManager::GetRunManager()->
225  GetUserDetectorConstruction())->getSiLogVol();
226 
227  for(size_t i = 0; i < logSi.size(); i++) {
228  //sprintf(nameBuf,"Si%dReg",int(i+1));
229  G4Region* reg = logSi[i]->GetRegion();
230  G4ProductionCuts* cuts = new G4ProductionCuts;
231  cuts->SetProductionCut(defaultCutValue);
232  reg->SetProductionCuts(cuts);
233  }
234 
235  if (verboseLevel > 0) DumpCutValuesTable();
236 }
237 
238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
239