CMS 3D CMS Logo

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

#include <CustomPhysicsList.h>

Inheritance diagram for CustomPhysicsList:

Public Member Functions

void ConstructParticle () override
 
void ConstructProcess () override
 
 CustomPhysicsList (const std::string &name, const edm::ParameterSet &p, bool useuni=false)
 
 ~CustomPhysicsList () 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 12 of file CustomPhysicsList.h.

Constructor & Destructor Documentation

◆ CustomPhysicsList()

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

Definition at line 25 of file CustomPhysicsList.cc.

26  : G4VPhysicsConstructor(name) {
27  myConfig = p;
28  if (apinew) {
29  dfactor = p.getParameter<double>("DarkMPFactor");
30  fHadronicInteraction = p.getParameter<bool>("RhadronPhysics");
31  } else {
32  // this is left for backward compatibility
33  dfactor = p.getParameter<double>("dark_factor");
34  fHadronicInteraction = p.getParameter<bool>("rhadronPhysics");
35  }
36  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
37  particleDefFilePath = fp.fullPath();
39  myHelper.reset(nullptr);
40 
41  edm::LogVerbatim("SimG4CoreCustomPhysics") << "CustomPhysicsList: Path for custom particle definition file: \n"
42  << particleDefFilePath << "\n"
43  << " dark_factor= " << dfactor;
44 }

References dfactor, fHadronicInteraction, personalPlayback::fp, fParticleFactory, myConfig, myHelper, AlCaHLTBitMon_ParallelJobs::p, and particleDefFilePath.

◆ ~CustomPhysicsList()

CustomPhysicsList::~CustomPhysicsList ( )
override

Definition at line 46 of file CustomPhysicsList.cc.

46 {}

Member Function Documentation

◆ ConstructParticle()

void CustomPhysicsList::ConstructParticle ( )
override

Definition at line 48 of file CustomPhysicsList.cc.

48  {
49  edm::LogVerbatim("SimG4CoreCustomPhysics") << "===== CustomPhysicsList::ConstructParticle ";
50  fParticleFactory.get()->loadCustomParticles(particleDefFilePath);
51 }

References fParticleFactory, and particleDefFilePath.

◆ ConstructProcess()

void CustomPhysicsList::ConstructProcess ( )
override

Definition at line 53 of file CustomPhysicsList.cc.

53  {
54  edm::LogVerbatim("SimG4CoreCustomPhysics") << "CustomPhysicsList: adding CustomPhysics processes "
55  << "for the list of particles";
56 
57  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
58 
59  for (auto particle : fParticleFactory.get()->GetCustomParticles()) {
60  if (particle->GetParticleType() == "simp") {
61  G4ProcessManager* pmanager = particle->GetProcessManager();
62  if (pmanager) {
64  CMSQGSPSIMPBuilder* theQGSPSIMPB = new CMSQGSPSIMPBuilder();
65  theQGSPSIMPB->Build(simpInelPr);
66  pmanager->AddDiscreteProcess(simpInelPr);
67  } else
68  edm::LogInfo("CustomPhysics") << " No pmanager";
69  }
70 
71  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
72  if (cp) {
73  G4ProcessManager* pmanager = particle->GetProcessManager();
74  edm::LogVerbatim("SimG4CoreCustomPhysics")
75  << "CustomPhysicsList: " << particle->GetParticleName() << " PDGcode= " << particle->GetPDGEncoding()
76  << " Mass= " << particle->GetPDGMass() / GeV << " GeV.";
77  if (pmanager) {
78  if (particle->GetPDGCharge() != 0.0) {
79  ph->RegisterProcess(new G4hMultipleScattering, particle);
80  ph->RegisterProcess(new G4hIonisation, particle);
81  }
82  if (cp->GetCloud() && fHadronicInteraction && CustomPDGParser::s_isRHadron(particle->GetPDGEncoding())) {
83  edm::LogVerbatim("SimG4CoreCustomPhysics")
84  << "CustomPhysicsList: " << particle->GetParticleName()
85  << " CloudMass= " << cp->GetCloud()->GetPDGMass() / GeV
86  << " GeV; SpectatorMass= " << cp->GetSpectator()->GetPDGMass() / GeV << " GeV.";
87 
88  if (!myHelper.get()) {
90  }
91  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper.get()));
92  }
93  if (particle->GetParticleType() == "darkpho") {
95  pmanager->AddDiscreteProcess(darkGamma);
96  }
97  }
98  }
99  }
100 }

References CMSQGSPSIMPBuilder::Build(), CommonMethods::cp(), dfactor, fHadronicInteraction, fParticleFactory, GeV, myConfig, myHelper, and CustomPDGParser::s_isRHadron().

Member Data Documentation

◆ dfactor

double CustomPhysicsList::dfactor
private

Definition at line 30 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

◆ fHadronicInteraction

bool CustomPhysicsList::fHadronicInteraction
private

Definition at line 24 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

◆ fParticleFactory

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

Definition at line 22 of file CustomPhysicsList.h.

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

◆ myConfig

edm::ParameterSet CustomPhysicsList::myConfig
private

Definition at line 26 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

◆ myHelper

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

Definition at line 21 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

◆ particleDefFilePath

std::string CustomPhysicsList::particleDefFilePath
private

Definition at line 28 of file CustomPhysicsList.h.

Referenced by ConstructParticle(), and CustomPhysicsList().

◆ processDefFilePath

std::string CustomPhysicsList::processDefFilePath
private

Definition at line 29 of file CustomPhysicsList.h.

G4ProcessHelper
Definition: G4ProcessHelper.h:26
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CustomPhysicsList::myHelper
static G4ThreadLocal std::unique_ptr< G4ProcessHelper > myHelper
Definition: CustomPhysicsList.h:21
edm::LogInfo
Definition: MessageLogger.h:254
CMSQGSPSIMPBuilder
Definition: CMSQGSPSIMPBuilder.h:16
CMSSIMPInelasticProcess
Definition: CMSSIMPInelasticProcess.h:8
personalPlayback.fp
fp
Definition: personalPlayback.py:523
CustomPhysicsList::myConfig
edm::ParameterSet myConfig
Definition: CustomPhysicsList.h:26
CustomPhysicsList::particleDefFilePath
std::string particleDefFilePath
Definition: CustomPhysicsList.h:28
edm::FileInPath
Definition: FileInPath.h:64
CustomPhysicsList::fHadronicInteraction
bool fHadronicInteraction
Definition: CustomPhysicsList.h:24
CustomPhysicsList::dfactor
double dfactor
Definition: CustomPhysicsList.h:30
GeV
const double GeV
Definition: MathUtil.h:16
FullModelHadronicProcess
Definition: FullModelHadronicProcess.h:16
CustomParticle
Definition: CustomParticle.h:11
edm::LogVerbatim
Definition: MessageLogger.h:297
CustomPDGParser::s_isRHadron
static bool s_isRHadron(int pdg)
Definition: CustomPDGParser.cc:10
CMSDarkPairProductionProcess
Definition: CMSDarkPairProductionProcess.h:20
CustomParticleFactory
Definition: CustomParticleFactory.h:12
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
CustomPhysicsList::fParticleFactory
std::unique_ptr< CustomParticleFactory > fParticleFactory
Definition: CustomPhysicsList.h:22
CMSQGSPSIMPBuilder::Build
void Build(CMSSIMPInelasticProcess *aP)
Definition: CMSQGSPSIMPBuilder.cc:26