CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
CustomPhysicsListSS Class Reference

#include <CustomPhysicsListSS.h>

Inheritance diagram for CustomPhysicsListSS:

Public Member Functions

void ConstructParticle () override
 
void ConstructProcess () override
 
 CustomPhysicsListSS (const std::string &name, const edm::ParameterSet &p)
 
 ~CustomPhysicsListSS () override
 

Private Attributes

double dfactor
 
bool fHadronicInteraction
 
std::unique_ptr< CustomParticleFactoryfParticleFactory
 
edm::ParameterSet myConfig
 
std::string particleDefFilePath
 
std::string processDefFilePath
 

Static Private Attributes

static G4ThreadLocal std::unique_ptr< G4Decay > fDecayProcess
 
static G4ThreadLocal std::unique_ptr< G4ProcessHelpermyHelper
 

Detailed Description

Definition at line 12 of file CustomPhysicsListSS.h.

Constructor & Destructor Documentation

CustomPhysicsListSS::CustomPhysicsListSS ( const std::string &  name,
const edm::ParameterSet p 
)

Definition at line 26 of file CustomPhysicsListSS.cc.

References dfactor, fDecayProcess, fHadronicInteraction, fParticleFactory, edm::ParameterSet::getParameter(), myConfig, myHelper, AlCaHLTBitMon_ParallelJobs::p, and particleDefFilePath.

27  : G4VPhysicsConstructor(name)
28 {
29  myConfig = p;
30  dfactor = p.getParameter<double>("dark_factor");
31  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
32  fHadronicInteraction = p.getParameter<bool>("rhadronPhysics");
33  particleDefFilePath = fp.fullPath();
35  fDecayProcess.reset(nullptr);
36  myHelper.reset(nullptr);
37 
38  edm::LogInfo("SimG4CoreCustomPhysics")
39  <<"CustomPhysicsListSS: Path for custom particle definition file: \n"
41 }
std::string particleDefFilePath
T getParameter(std::string const &) const
std::unique_ptr< CustomParticleFactory > fParticleFactory
static G4ThreadLocal std::unique_ptr< G4Decay > fDecayProcess
static G4ThreadLocal std::unique_ptr< G4ProcessHelper > myHelper
edm::ParameterSet myConfig
CustomPhysicsListSS::~CustomPhysicsListSS ( )
override

Definition at line 43 of file CustomPhysicsListSS.cc.

43  {
44 }

Member Function Documentation

void CustomPhysicsListSS::ConstructParticle ( )
override

Definition at line 46 of file CustomPhysicsListSS.cc.

References fParticleFactory, and particleDefFilePath.

46  {
47  edm::LogInfo("SimG4CoreCustomPhysicsSS")
48  << "===== CustomPhysicsList::ConstructParticle ";
49  fParticleFactory.get()->loadCustomParticles(particleDefFilePath);
50 }
std::string particleDefFilePath
std::unique_ptr< CustomParticleFactory > fParticleFactory
void CustomPhysicsListSS::ConstructProcess ( )
override

Definition at line 52 of file CustomPhysicsListSS.cc.

References SimDataFormats::CaloAnalysis::cp, dfactor, fDecayProcess, fHadronicInteraction, fParticleFactory, CustomParticle::GetCloud(), CustomParticle::GetSpectator(), GeV, myConfig, myHelper, and CustomPDGParser::s_isRHadron().

52  {
53 
54  edm::LogInfo("SimG4CoreCustomPhysicsSS")
55  <<"CustomPhysicsListSS: adding CustomPhysics processes";
56 
57  fDecayProcess.reset(new G4Decay());
58  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
59 
60  for(auto particle : fParticleFactory.get()->GetCustomParticles()) {
61 
62  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
63  if(cp) {
64  G4ProcessManager* pmanager = particle->GetProcessManager();
65  edm::LogInfo("SimG4CoreCustomPhysics")
66  <<"CustomPhysicsListSS: " << particle->GetParticleName()
67  <<" PDGcode= " << particle->GetPDGEncoding()
68  << " Mass= " << particle->GetPDGMass()/GeV <<" GeV.";
69  if(pmanager) {
70  if(particle->GetPDGCharge() != 0.0) {
71  ph->RegisterProcess(new G4hMultipleScattering, particle);
72  ph->RegisterProcess(new G4hIonisation, particle);
73  }
74  if(fDecayProcess.get()->IsApplicable(*particle)) {
75  ph->RegisterProcess(fDecayProcess.get(), particle);
76  }
77  if(cp->GetCloud() && fHadronicInteraction &&
78  CustomPDGParser::s_isRHadron(particle->GetPDGEncoding())) {
79  edm::LogInfo("SimG4CoreCustomPhysics")
80  <<"CustomPhysicsListSS: " << particle->GetParticleName()
81  <<" CloudMass= " <<cp->GetCloud()->GetPDGMass()/GeV
82  <<" GeV; SpectatorMass= " << cp->GetSpectator()->GetPDGMass()/GeV <<" GeV.";
83 
84  if(!myHelper.get()) { myHelper.reset(new G4ProcessHelper(myConfig, fParticleFactory.get())); }
85  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper.get()));
86  }
87  if(particle->GetParticleType()=="darkpho"){
88  CMSDarkPairProductionProcess * darkGamma = new CMSDarkPairProductionProcess(dfactor);
89  pmanager->AddDiscreteProcess(darkGamma);
90  }
91  }
92  }
93  }
94 }
const double GeV
Definition: MathUtil.h:16
std::unique_ptr< CustomParticleFactory > fParticleFactory
G4ParticleDefinition * GetCloud()
static G4ThreadLocal std::unique_ptr< G4Decay > fDecayProcess
G4ParticleDefinition * GetSpectator()
static G4ThreadLocal std::unique_ptr< G4ProcessHelper > myHelper
edm::ParameterSet myConfig
static bool s_isRHadron(int pdg)

Member Data Documentation

double CustomPhysicsListSS::dfactor
private

Definition at line 34 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

G4ThreadLocal std::unique_ptr< G4Decay > CustomPhysicsListSS::fDecayProcess
staticprivate

Definition at line 23 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

bool CustomPhysicsListSS::fHadronicInteraction
private

Definition at line 28 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

std::unique_ptr<CustomParticleFactory> CustomPhysicsListSS::fParticleFactory
private

Definition at line 26 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), ConstructProcess(), and CustomPhysicsListSS().

edm::ParameterSet CustomPhysicsListSS::myConfig
private

Definition at line 30 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

G4ThreadLocal std::unique_ptr< G4ProcessHelper > CustomPhysicsListSS::myHelper
staticprivate

Definition at line 24 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::particleDefFilePath
private

Definition at line 32 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::processDefFilePath
private

Definition at line 33 of file CustomPhysicsListSS.h.