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

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 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 25 of file CustomPhysicsListSS.cc.

References fHadronicInteraction, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), myConfig, myHelper, 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");
32  edm::LogInfo("SimG4CoreCustomPhysics")
33  <<"CustomPhysicsListSS: Path for custom particle definition file: \n"
35  myHelper = 0;
36 }
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 38 of file CustomPhysicsListSS.cc.

38  {
39 }

Member Function Documentation

void CustomPhysicsListSS::ConstructParticle ( )
virtual

Definition at line 41 of file CustomPhysicsListSS.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 45 of file CustomPhysicsListSS.cc.

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

45  {
46 
47  edm::LogInfo("SimG4CoreCustomPhysics")
48  <<"CustomPhysicsListSS: adding CustomPhysics processes";
49 
50  fDecayProcess = new G4Decay();
51  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
52 
53  aParticleIterator->reset();
54  G4ParticleDefinition* particle;
55 
56  while((*aParticleIterator)()) {
57  particle = aParticleIterator->value();
59  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
60  G4ProcessManager* pmanager = particle->GetProcessManager();
61  edm::LogInfo("SimG4CoreCustomPhysics")
62  <<"CustomPhysicsListSS: " << particle->GetParticleName()
63  <<" PDGcode= " << particle->GetPDGEncoding()
64  << " Mass= " << particle->GetPDGMass()/GeV <<" GeV.";
65  if(cp && 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  <<"CustomPhysicsListSS: " << 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  }
84  }
85  }
86 }
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 29 of file CustomPhysicsListSS.h.

Referenced by ConstructProcess(), and CustomPhysicsListSS().

edm::ParameterSet CustomPhysicsListSS::myConfig
private

Definition at line 31 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 33 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::processDefFilePath
private

Definition at line 34 of file CustomPhysicsListSS.h.