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

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

Private Attributes

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

Static Private Attributes

static G4ThreadLocal G4Decay * fDecayProcess = 0
 
static G4ThreadLocal G4ProcessHelper * myHelper = 0
 

Detailed Description

Definition at line 15 of file CustomPhysicsList.h.

Constructor & Destructor Documentation

CustomPhysicsList::CustomPhysicsList ( std::string  name,
const edm::ParameterSet p 
)

Definition at line 25 of file CustomPhysicsList.cc.

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

26  : G4VPhysicsConstructor(name)
27 {
28  myConfig = p;
29  dfactor = p.getParameter<double>("dark_factor");
30  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
31  fHadronicInteraction = p.getParameter<bool>("rhadronPhysics");
32 
33  particleDefFilePath = fp.fullPath();
34  edm::LogInfo("SimG4CoreCustomPhysics")
35  << "CustomPhysicsList: Path for custom particle definition file: \n"
36  <<particleDefFilePath << "\n" << " dark_factor= " << dfactor;
37 }
T getParameter(std::string const &) const
edm::ParameterSet myConfig
std::string particleDefFilePath
CustomPhysicsList::~CustomPhysicsList ( )
virtual

Definition at line 39 of file CustomPhysicsList.cc.

39  {
40 }

Member Function Documentation

void CustomPhysicsList::ConstructParticle ( )
virtual

Definition at line 42 of file CustomPhysicsList.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::G4cout, CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

42  {
43  G4cout << "===== CustomPhysicsList::ConstructParticle " << this << G4endl;
45 }
std::string particleDefFilePath
static void loadCustomParticles(const std::string &filePath)
void CustomPhysicsList::ConstructProcess ( )
virtual

Definition at line 47 of file CustomPhysicsList.cc.

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

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

Member Data Documentation

double CustomPhysicsList::dfactor
private

Definition at line 35 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

G4ThreadLocal G4Decay * CustomPhysicsList::fDecayProcess = 0
staticprivate

Definition at line 26 of file CustomPhysicsList.h.

Referenced by ConstructProcess().

bool CustomPhysicsList::fHadronicInteraction
private

Definition at line 29 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

edm::ParameterSet CustomPhysicsList::myConfig
private

Definition at line 31 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

G4ThreadLocal G4ProcessHelper * CustomPhysicsList::myHelper = 0
staticprivate

Definition at line 27 of file CustomPhysicsList.h.

Referenced by ConstructProcess().

std::string CustomPhysicsList::particleDefFilePath
private

Definition at line 33 of file CustomPhysicsList.h.

Referenced by ConstructParticle(), and CustomPhysicsList().

std::string CustomPhysicsList::processDefFilePath
private

Definition at line 34 of file CustomPhysicsList.h.