CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Static Private Attributes

static G4ThreadLocal G4Decay * fDecayProcess = 0
 
static G4ThreadLocal bool fInitialized = false
 
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 fHadronicInteraction, personalPlayback::fp, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), myConfig, AlCaHLTBitMon_ParallelJobs::p, and particleDefFilePath.

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

Definition at line 38 of file CustomPhysicsList.cc.

38  {
39 }

Member Function Documentation

void CustomPhysicsList::ConstructParticle ( )
virtual

Definition at line 41 of file CustomPhysicsList.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 46 of file CustomPhysicsList.cc.

References CommonMethods::cp(), fDecayProcess, fHadronicInteraction, CustomParticle::GetCloud(), CustomParticle::GetSpectator(), GeV, CustomParticleFactory::isCustomParticle(), myConfig, myHelper, and CustomPDGParser::s_isRHadron().

46  {
47 
48  //if(fInitialized) { return; }
49  //fInitialized = true;
50 
51  edm::LogInfo("SimG4CoreCustomPhysics")
52  <<"CustomPhysicsList: adding CustomPhysics processes "
53  << "for the list of particles";
54 
55  fDecayProcess = new G4Decay();
56 
57  aParticleIterator->reset();
58 
59  while((*aParticleIterator)()) {
60  G4ParticleDefinition* particle = aParticleIterator->value();
62  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
63  G4ProcessManager* pmanager = particle->GetProcessManager();
64  edm::LogInfo("SimG4CoreCustomPhysics")
65  <<"CustomPhysicsList: " << particle->GetParticleName()
66  <<" PDGcode= " << particle->GetPDGEncoding()
67  << " Mass= " << particle->GetPDGMass()/GeV <<" GeV.";
68  if(cp && pmanager) {
69  if(particle->GetPDGCharge() != 0.0) {
70  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
71  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
72  }
73  if(fDecayProcess->IsApplicable(*particle)) {
74  pmanager->AddProcess(new G4Decay, 0, -1, 3);
75  }
76  if(cp->GetCloud() && fHadronicInteraction &&
77  CustomPDGParser::s_isRHadron(particle->GetPDGEncoding())) {
78  edm::LogInfo("SimG4CoreCustomPhysics")
79  <<"CustomPhysicsList: " << particle->GetParticleName()
80  <<" CloudMass= " <<cp->GetCloud()->GetPDGMass()/GeV
81  <<" GeV; SpectatorMass= " << cp->GetSpectator()->GetPDGMass()/GeV<<" GeV.";
82 
83  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
84  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper));
85  }
86  }
87  }
88  }
89 }
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 bool isCustomParticle(G4ParticleDefinition *particle)

Member Data Documentation

G4ThreadLocal G4Decay * CustomPhysicsList::fDecayProcess = 0
staticprivate

Definition at line 26 of file CustomPhysicsList.h.

Referenced by ConstructProcess().

bool CustomPhysicsList::fHadronicInteraction
private

Definition at line 30 of file CustomPhysicsList.h.

Referenced by ConstructProcess(), and CustomPhysicsList().

G4ThreadLocal bool CustomPhysicsList::fInitialized = false
staticprivate

Definition at line 28 of file CustomPhysicsList.h.

edm::ParameterSet CustomPhysicsList::myConfig
private

Definition at line 32 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 34 of file CustomPhysicsList.h.

Referenced by ConstructParticle(), and CustomPhysicsList().

std::string CustomPhysicsList::processDefFilePath
private

Definition at line 35 of file CustomPhysicsList.h.