Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-10 02:21:27

0001 #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMH.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 
0004 #include <CLHEP/Units/SystemOfUnits.h>
0005 #include "G4ParticleDefinition.hh"
0006 #include "G4EmParameters.hh"
0007 #include "G4EmBuilder.hh"
0008 
0009 #include "G4MscStepLimitType.hh"
0010 
0011 #include "G4hIonisation.hh"
0012 #include "G4hMultipleScattering.hh"
0013 #include "G4ionIonisation.hh"
0014 
0015 #include "G4ParticleTable.hh"
0016 #include "G4Gamma.hh"
0017 #include "G4Electron.hh"
0018 #include "G4Positron.hh"
0019 #include "G4GenericIon.hh"
0020 
0021 #include "G4PhysicsListHelper.hh"
0022 #include "G4BuilderType.hh"
0023 #include "G4ProcessManager.hh"
0024 
0025 #include "G4HepEmProcess.hh"
0026 
0027 #include <string>
0028 
0029 CMSEmStandardPhysicsEMH::CMSEmStandardPhysicsEMH(G4int ver, const edm::ParameterSet& p)
0030     : G4VPhysicsConstructor("CMSEmStandard_emh") {
0031   SetVerboseLevel(ver);
0032   G4EmParameters* param = G4EmParameters::Instance();
0033   param->SetDefaults();
0034   param->SetVerbose(ver);
0035   param->SetApplyCuts(true);
0036   param->SetStepFunction(0.8, 1 * CLHEP::mm);
0037   param->SetMscRangeFactor(0.2);
0038   param->SetMscStepLimitType(fUseSafety);
0039   param->SetFluo(false);
0040   SetPhysicsType(bElectromagnetic);
0041   fRangeFactor = p.getParameter<double>("G4MscRangeFactor");
0042   fGeomFactor = p.getParameter<double>("G4MscGeomFactor");
0043   fSafetyFactor = p.getParameter<double>("G4MscSafetyFactor");
0044   fLambdaLimit = p.getParameter<double>("G4MscLambdaLimit") * CLHEP::mm;
0045   std::string msc = p.getParameter<std::string>("G4MscStepLimit");
0046   fStepLimitType = fUseSafety;
0047   if (msc == "UseSafetyPlus") {
0048     fStepLimitType = fUseSafetyPlus;
0049   }
0050   if (msc == "Minimal") {
0051     fStepLimitType = fMinimal;
0052   }
0053   double tcut = p.getParameter<double>("G4TrackingCut") * CLHEP::MeV;
0054   param->SetLowestElectronEnergy(tcut);
0055   param->SetLowestMuHadEnergy(tcut);
0056 }
0057 
0058 CMSEmStandardPhysicsEMH::~CMSEmStandardPhysicsEMH() {}
0059 
0060 void CMSEmStandardPhysicsEMH::ConstructParticle() {
0061   // minimal set of particles for EM physics
0062   G4EmBuilder::ConstructMinimalEmSet();
0063 }
0064 
0065 void CMSEmStandardPhysicsEMH::ConstructProcess() {
0066   if (verboseLevel > 0) {
0067     edm::LogVerbatim("PhysicsList") << "### " << GetPhysicsName() << " Construct EM Processes";
0068   }
0069 
0070   // This EM builder takes default models of Geant4 10 EMV.
0071   // Multiple scattering by WentzelVI for all particles except:
0072   //   a) e+e- below 100 MeV for which the Urban model is used
0073   //   b) ions for which Urban model is used
0074   G4EmBuilder::PrepareEMPhysics();
0075 
0076   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0077   // processes used by several particles
0078   G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
0079   G4NuclearStopping* pnuc(nullptr);
0080 
0081   G4HepEmProcess* hepEmProcess = new G4HepEmProcess();
0082   G4Electron::Electron()->GetProcessManager()->AddProcess(hepEmProcess, -1, -1, 1);
0083   G4Positron::Positron()->GetProcessManager()->AddProcess(hepEmProcess, -1, -1, 1);
0084   G4Gamma::Gamma()->GetProcessManager()->AddProcess(hepEmProcess, -1, -1, 1);
0085 
0086   // generic ion
0087   G4ParticleDefinition* particle = G4GenericIon::GenericIon();
0088   G4ionIonisation* ionIoni = new G4ionIonisation();
0089   ph->RegisterProcess(hmsc, particle);
0090   ph->RegisterProcess(ionIoni, particle);
0091 
0092   // muons, hadrons ions
0093   G4EmBuilder::ConstructCharged(hmsc, pnuc);
0094 }