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, bool useuni=false)
 
 ~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< G4ProcessHelpermyHelper
 

Detailed Description

Definition at line 11 of file CustomPhysicsListSS.h.

Constructor & Destructor Documentation

CustomPhysicsListSS::CustomPhysicsListSS ( const std::string &  name,
const edm::ParameterSet p,
bool  useuni = false 
)

Definition at line 24 of file CustomPhysicsListSS.cc.

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

25  : G4VPhysicsConstructor(name) {
26  myConfig = p;
27  if (apinew) {
28  dfactor = p.getParameter<double>("DarkMPFactor");
29  fHadronicInteraction = p.getParameter<bool>("RhadronPhysics");
30  } else {
31  // this is left for backward compatibility
32  dfactor = p.getParameter<double>("dark_factor");
33  fHadronicInteraction = p.getParameter<bool>("rhadronPhysics");
34  }
35  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
36  particleDefFilePath = fp.fullPath();
38  myHelper.reset(nullptr);
39 
40  edm::LogVerbatim("SimG4CoreCustomPhysics") << "CustomPhysicsListSS: Path for custom particle definition file: \n"
42 }
std::string particleDefFilePath
T getParameter(std::string const &) const
std::unique_ptr< CustomParticleFactory > fParticleFactory
static G4ThreadLocal std::unique_ptr< G4ProcessHelper > myHelper
edm::ParameterSet myConfig
CustomPhysicsListSS::~CustomPhysicsListSS ( )
override

Definition at line 44 of file CustomPhysicsListSS.cc.

44 {}

Member Function Documentation

void CustomPhysicsListSS::ConstructParticle ( )
override

Definition at line 46 of file CustomPhysicsListSS.cc.

References fParticleFactory, and particleDefFilePath.

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

Definition at line 51 of file CustomPhysicsListSS.cc.

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

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

Member Data Documentation

double CustomPhysicsListSS::dfactor
private

Definition at line 30 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

bool CustomPhysicsListSS::fHadronicInteraction
private

Definition at line 24 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

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

Definition at line 22 of file CustomPhysicsListSS.h.

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

edm::ParameterSet CustomPhysicsListSS::myConfig
private

Definition at line 26 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

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

Definition at line 20 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::particleDefFilePath
private

Definition at line 28 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::processDefFilePath
private

Definition at line 29 of file CustomPhysicsListSS.h.