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
CustomPhysicsListSS Class Reference

#include <CustomPhysicsListSS.h>

Inheritance diagram for CustomPhysicsListSS:

Public Member Functions

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

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 CustomPhysicsListSS.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file CustomPhysicsListSS.cc.

References fHadronicInteraction, personalPlayback::fp, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), myConfig, myHelper, AlCaHLTBitMon_ParallelJobs::p, and particleDefFilePath.

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

Definition at line 39 of file CustomPhysicsListSS.cc.

39  {
40 }

Member Function Documentation

void CustomPhysicsListSS::ConstructParticle ( )
virtual

Definition at line 42 of file CustomPhysicsListSS.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

42  {
44 }
std::string particleDefFilePath
static void loadCustomParticles(const std::string &filePath)
void CustomPhysicsListSS::ConstructProcess ( )
virtual

Definition at line 46 of file CustomPhysicsListSS.cc.

References CommonMethods::cp(), fDecayProcess, fHadronicInteraction, fInitialized, 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  <<"CustomPhysicsListSS: adding CustomPhysics processes";
53 
54  fDecayProcess = new G4Decay();
55 
56  aParticleIterator->reset();
57 
58  while((*aParticleIterator)()) {
59  G4ParticleDefinition* particle = aParticleIterator->value();
61  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
62  G4ProcessManager* pmanager = particle->GetProcessManager();
63  edm::LogInfo("SimG4CoreCustomPhysics")
64  <<"CustomPhysicsListSS: " << particle->GetParticleName()
65  <<" PDGcode= " << particle->GetPDGEncoding()
66  << " Mass= " << particle->GetPDGMass()/GeV <<" GeV.";
67  if(cp && pmanager) {
68  if(particle->GetPDGCharge()/eplus != 0) {
69  pmanager->AddProcess(new G4CoulombScattering, -1,-1, 1);
70  pmanager->AddProcess(new G4hIonisation, -1, 1, 2);
71  }
72  if(fDecayProcess->IsApplicable(*particle)) {
73  pmanager->AddProcess(new G4Decay, 0, -1, 3);
74  }
75  if(cp->GetCloud() && fHadronicInteraction &&
76  CustomPDGParser::s_isRHadron(particle->GetPDGEncoding())) {
77  edm::LogInfo("SimG4CoreCustomPhysics")
78  <<"CustomPhysicsListSS: " << particle->GetParticleName()
79  <<" CloudMass= " <<cp->GetCloud()->GetPDGMass()/GeV
80  <<" GeV; SpectatorMass= " << cp->GetSpectator()->GetPDGMass()/GeV <<" GeV.";
81 
82  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
83  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper));
84  }
85  }
86  }
87  }
88 }
static G4ThreadLocal bool fInitialized
const double GeV
Definition: MathUtil.h:16
G4ParticleDefinition * GetCloud()
static G4ThreadLocal G4ProcessHelper * myHelper
static G4ThreadLocal G4Decay * fDecayProcess
G4ParticleDefinition * GetSpectator()
edm::ParameterSet myConfig
static bool s_isRHadron(int pdg)
static bool isCustomParticle(G4ParticleDefinition *particle)

Member Data Documentation

G4ThreadLocal G4Decay * CustomPhysicsListSS::fDecayProcess = 0
staticprivate

Definition at line 26 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess().

bool CustomPhysicsListSS::fHadronicInteraction
private

Definition at line 30 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

G4ThreadLocal bool CustomPhysicsListSS::fInitialized = false
staticprivate

Definition at line 28 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess().

edm::ParameterSet CustomPhysicsListSS::myConfig
private

Definition at line 32 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

G4ThreadLocal G4ProcessHelper * CustomPhysicsListSS::myHelper = 0
staticprivate

Definition at line 27 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::particleDefFilePath
private

Definition at line 34 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::processDefFilePath
private

Definition at line 35 of file CustomPhysicsListSS.h.