source: trunk/examples/advanced/Rich/src/RichTbPhysicsList.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 10.1 KB
Line 
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// Rich advanced example for Geant4
27// RichTbPhysicsList.cc for Rich of LHCb
28// History:
29// Created: Sajan Easo (Sajan.Easo@cern.ch)
30// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
31/////////////////////////////////////////////////////////////////////////////
32#include "G4ios.hh"
33#include <iomanip>
34
35#include "globals.hh"
36#include "RichTbPhysicsList.hh"
37
38#include "G4ParticleDefinition.hh"
39#include "G4ParticleTypes.hh"
40#include "G4ParticleWithCuts.hh"
41#include "G4ParticleTable.hh"
42#include "G4VUserPhysicsList.hh"
43#include "G4ParticleTable.hh"
44#include "G4UserPhysicsListMessenger.hh"
45#include "G4UImanager.hh"
46#include "G4Material.hh"
47#include "G4MaterialTable.hh"
48
49#include "G4ProcessManager.hh"
50#include "G4ProcessVector.hh"
51#include "G4UnitsTable.hh"
52
53
54RichTbPhysicsList::RichTbPhysicsList(RichTbRunConfig* RConfig) 
55  : G4VUserPhysicsList() {
56
57  G4cout<<" Now define the physics List"<<G4endl;
58  rConfigPh = RConfig;
59
60
61    defaultCutValue = 0.1*mm;
62
63  // pointer to the particle table
64  theParticleTable = G4ParticleTable::GetParticleTable();
65  theParticleIterator = theParticleTable->GetIterator();
66
67}
68RichTbPhysicsList::RichTbPhysicsList() :G4VUserPhysicsList(){
69  // pointer to the particle table
70  theParticleTable = G4ParticleTable::GetParticleTable();
71  theParticleIterator = theParticleTable->GetIterator();
72
73
74}
75
76RichTbPhysicsList::~RichTbPhysicsList() {}
77
78void RichTbPhysicsList::ConstructParticle()
79{
80  // In this method, static member functions should be called
81  // for all particles which you want to use.
82  // This ensures that objects of these particle types will be
83  // created in the program.
84
85  ConstructBosons();
86  ConstructLeptons();
87  ConstructMesons();
88  ConstructBaryons();
89
90}
91
92void RichTbPhysicsList::ConstructBosons()
93{
94  // pseudo-particles
95  G4Geantino::GeantinoDefinition();
96  G4ChargedGeantino::ChargedGeantinoDefinition();
97
98  // gamma
99  G4Gamma::GammaDefinition();
100
101  // optical photon
102  G4OpticalPhoton::OpticalPhotonDefinition();
103}
104
105void RichTbPhysicsList::ConstructLeptons()
106{
107  // leptons
108  G4Electron::ElectronDefinition();
109  G4Positron::PositronDefinition();
110  G4NeutrinoE::NeutrinoEDefinition();
111  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
112  G4MuonPlus::MuonPlusDefinition();
113  G4MuonMinus::MuonMinusDefinition();
114  G4NeutrinoMu::NeutrinoMuDefinition();
115  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
116}
117
118void RichTbPhysicsList::ConstructMesons()
119{
120 //  mesons
121  G4PionPlus::PionPlusDefinition();
122  G4PionMinus::PionMinusDefinition();
123  G4PionZero::PionZeroDefinition();
124}
125
126void RichTbPhysicsList::ConstructBaryons()
127{
128//  barions
129  G4Proton::ProtonDefinition();
130  G4AntiProton::AntiProtonDefinition();
131  G4Neutron::NeutronDefinition();
132  G4AntiNeutron::AntiNeutronDefinition();
133}
134
135void RichTbPhysicsList::ConstructProcess()
136{
137  AddTransportation();
138  ConstructGeneral();
139  ConstructEM();
140  ConstructOp();
141}
142
143#include "G4Decay.hh"
144
145void RichTbPhysicsList::ConstructGeneral()
146{
147  G4Decay* theDecayProcess = new G4Decay();
148  theParticleIterator->reset();
149
150  while( (*theParticleIterator)() ){
151    G4ParticleDefinition* particle = theParticleIterator->value();
152    G4ProcessManager* pmanager = particle->GetProcessManager();
153    if (theDecayProcess->IsApplicable(*particle)) {
154      pmanager->AddDiscreteProcess(theDecayProcess);
155    }
156  }
157}
158
159#include "G4ComptonScattering.hh"
160#include "G4GammaConversion.hh"
161#include "G4PhotoElectricEffect.hh"
162
163// A.R. 31-Mar-2010 : Replaced obsolete G4MultipleScattering with:
164//                      -  G4eMultipleScattering for e+ and e-;
165//                      -  G4MuMultipleScattering for mu+ and mu-;
166//                      -  G4hMultipleScattering for hadrons and ions.
167//#include "G4MultipleScattering.hh"
168#include "G4eMultipleScattering.hh"
169#include "G4MuMultipleScattering.hh"
170#include "G4hMultipleScattering.hh"
171
172#include "G4eIonisation.hh"
173#include "G4eBremsstrahlung.hh"
174#include "G4eplusAnnihilation.hh"
175
176#include "G4MuIonisation.hh"
177#include "G4MuBremsstrahlung.hh"
178#include "G4MuPairProduction.hh"
179
180#include "G4hIonisation.hh"
181#include "HpdSiEnergyLoss.hh"
182void RichTbPhysicsList::ConstructEM()
183{
184  theParticleIterator->reset();
185  G4cout<<" Now creating EM processes"<<G4endl;
186  while( (*theParticleIterator)() ){
187    G4ParticleDefinition* particle = theParticleIterator->value();
188    G4ProcessManager* pmanager = particle->GetProcessManager();
189    G4String particleName = particle->GetParticleName();
190    HpdSiEnergyLoss* HpdSiEnergyLossProcess = 
191
192      new HpdSiEnergyLoss("Silicon","HpdSiEnergyLoss");
193    pmanager->AddProcess( HpdSiEnergyLossProcess ,-1,2,2);
194
195
196    if (particleName == "gamma") {
197      // Construct processes for gamma
198      pmanager->AddDiscreteProcess(new G4GammaConversion());
199      pmanager->AddDiscreteProcess(new G4ComptonScattering());
200      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
201
202    } else if (particleName == "e-") {
203      //Construct processes for electron
204      //A.R. 31-Mar-2010 : replaced G4MultipleScattering with G4eMultipleScattering.
205      pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
206      pmanager->AddProcess(new G4eIonisation(),-1,2,2);
207      pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
208
209    } else if (particleName == "e+") {
210      // Construct processes for positron
211      // A.R. 31-Mar-2010 : replaced G4MultipleScattering with G4eMultipleScattering.
212      pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
213      pmanager->AddProcess(new G4eIonisation(),-1,2,2);
214       pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
215       pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
216
217    } else if( particleName == "mu+" ||
218               particleName == "mu-"    ) {
219      // Construct processes for muon
220      // A.R. 31-Mar-2010 : replaced G4MultipleScattering with G4MuMultipleScattering.
221      pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
222      pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
223      pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
224      pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
225
226    } else {
227      if ((particle->GetPDGCharge() != 0.0) &&
228          (particle->GetParticleName() != "chargedgeantino")) {
229        // all others charged particles except geantino
230        // A.R. 31-Mar-2010 : replaced G4MultipleScattering with G4hMultipleScattering.
231        pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
232        pmanager->AddProcess(new G4hIonisation(),-1,2,2);
233     }
234    }
235  }
236}
237
238#include "G4Cerenkov.hh"
239#include "G4OpAbsorption.hh"
240#include "G4OpRayleigh.hh"
241#include "G4OpBoundaryProcess.hh"
242#include "PadHpdPhotoElectricEffect.hh"
243#include "RichTbMaterialParameters.hh"
244
245void RichTbPhysicsList::ConstructOp()
246{
247  G4cout<<"Now creating Optical processes"<<G4endl;
248  G4Cerenkov*   theCerenkovProcess = new G4Cerenkov("Cerenkov");
249  G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
250  G4cout<<"Now creating the Rayleigh scattering process "<<G4endl;
251  G4OpRayleigh*   theRayleighScatteringProcess = new G4OpRayleigh();
252  G4cout<<"Now creating the boundary process "<<G4endl;
253  G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
254
255  PadHpdPhotoElectricEffect* theHpdPhotoElectricProcess= 
256    new PadHpdPhotoElectricEffect("PadHpdPhot",rConfigPh);
257
258  theCerenkovProcess->SetVerboseLevel(0);
259  theAbsorptionProcess->SetVerboseLevel(0);
260  theRayleighScatteringProcess->SetVerboseLevel(0);
261  theBoundaryProcess->SetVerboseLevel(0);
262
263   G4int MaxNumPhotons = 300;
264
265  theCerenkovProcess->SetTrackSecondariesFirst(true);
266  theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
267
268  G4OpticalSurfaceModel themodel = unified;
269  theBoundaryProcess->SetModel(themodel);
270
271  theParticleIterator->reset();
272  while( (*theParticleIterator)() ){
273    G4ParticleDefinition* particle = theParticleIterator->value();
274    G4ProcessManager* pmanager = particle->GetProcessManager();
275    G4String particleName = particle->GetParticleName();
276    if (theCerenkovProcess->IsApplicable(*particle)) {
277      pmanager->AddProcess(theCerenkovProcess);
278      pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);
279    }
280    if (particleName == "opticalphoton") {
281      G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
282      pmanager->AddDiscreteProcess(theAbsorptionProcess);
283      pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
284      pmanager->AddDiscreteProcess(theBoundaryProcess);
285      pmanager->AddDiscreteProcess(theHpdPhotoElectricProcess);
286    }
287  }
288}
289
290void RichTbPhysicsList::SetCuts()
291{
292  if (verboseLevel >1){
293    G4cout << "RichTbPhysicsList::SetCuts:";
294  } 
295  //  " G4VUserPhysicsList::SetCutsWithDefault" method sets
296  //   the default cut value for all particle types
297   SetCutsWithDefault();   
298}
299
300
301
302
303
304
Note: See TracBrowser for help on using the repository browser.