CMS 3D CMS Logo

CMSEmStandardPhysicsEMMT.cc
Go to the documentation of this file.
1 #include "G4Version.hh"
2 #if G4VERSION_NUMBER >= 1100
3 
7 
8 #include "G4SystemOfUnits.hh"
9 #include "G4ParticleDefinition.hh"
10 #include "G4EmParameters.hh"
11 #include "G4EmBuilder.hh"
12 
13 #include "G4hMultipleScattering.hh"
14 #include "G4ionIonisation.hh"
15 
16 #include "G4ParticleTable.hh"
17 #include "G4Gamma.hh"
18 #include "G4Electron.hh"
19 #include "G4Positron.hh"
20 #include "G4GenericIon.hh"
21 
22 #include "G4MuonNuclearProcess.hh"
23 #include "G4MuonVDNuclearModel.hh"
24 #include "G4MuonPlus.hh"
25 #include "G4MuonMinus.hh"
26 
27 #include "G4PhysicsListHelper.hh"
28 #include "G4BuilderType.hh"
29 
30 CMSEmStandardPhysicsEMMT::CMSEmStandardPhysicsEMMT(G4int ver, const edm::ParameterSet& p)
31  : G4VPhysicsConstructor("CMSEmStandard_emmt"), fParameterSet(p) {
32  SetVerboseLevel(ver);
33  G4EmParameters* param = G4EmParameters::Instance();
34  param->SetDefaults();
35  param->SetVerbose(ver);
36  param->SetApplyCuts(true);
37  param->SetStepFunction(0.8, 1 * CLHEP::mm);
38  param->SetMscRangeFactor(0.2);
39  param->SetMscStepLimitType(fMinimal);
40  param->SetFluo(false);
41  SetPhysicsType(bElectromagnetic);
42  double tcut = p.getParameter<double>("G4TrackingCut") * CLHEP::MeV;
43  param->SetLowestElectronEnergy(tcut);
44  param->SetLowestMuHadEnergy(tcut);
45 }
46 
47 CMSEmStandardPhysicsEMMT::~CMSEmStandardPhysicsEMMT() {}
48 
49 void CMSEmStandardPhysicsEMMT::ConstructParticle() {
50  // minimal set of particles for EM physics
51  G4EmBuilder::ConstructMinimalEmSet();
52 }
53 
54 void CMSEmStandardPhysicsEMMT::ConstructProcess() {
55  if (verboseLevel > 0) {
56  edm::LogVerbatim("PhysicsList") << "### " << GetPhysicsName() << " Construct EM Processes";
57  }
58 
59  G4EmBuilder::PrepareEMPhysics();
60 
61  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
62  // processes used by several particles
63  G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
64  G4NuclearStopping* pnuc(nullptr);
65 
66  // register specialized tracking for e-/e+ and gammas
67  auto* trackingManager = new CMSEmStandardPhysicsTrackingManager(fParameterSet);
68  G4Electron::Electron()->SetTrackingManager(trackingManager);
69  G4Positron::Positron()->SetTrackingManager(trackingManager);
70  G4Gamma::Gamma()->SetTrackingManager(trackingManager);
71 
72  // generic ion
73  G4ParticleDefinition* particle = G4GenericIon::GenericIon();
74  G4ionIonisation* ionIoni = new G4ionIonisation();
75  ph->RegisterProcess(hmsc, particle);
76  ph->RegisterProcess(ionIoni, particle);
77 
78  // muons, hadrons ions
79  G4EmBuilder::ConstructCharged(hmsc, pnuc);
80 
81  // add muon-nuclear processes (normally done by G4EmExtraPhysics)
82  G4MuonNuclearProcess* muNucProcess = new G4MuonNuclearProcess();
83  G4MuonVDNuclearModel* muNucModel = new G4MuonVDNuclearModel();
84  muNucProcess->RegisterMe(muNucModel);
85  ph->RegisterProcess(muNucProcess, G4MuonPlus::MuonPlus());
86  ph->RegisterProcess(muNucProcess, G4MuonMinus::MuonMinus());
87 }
88 
89 #endif
Log< level::Info, true > LogVerbatim