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(), CustomParticle::GetSpectator(), GeV, CustomParticleFactory::isCustomParticle(), 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  aParticleIterator->reset();
58  G4ParticleDefinition* particle;
59 
60  while((*aParticleIterator)()) {
61  particle = aParticleIterator->value();
63  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
64  G4ProcessManager* pmanager = particle->GetProcessManager();
65  edm::LogInfo("SimG4CoreCustomPhysics")
66  <<"CustomPhysicsList: " << particle->GetParticleName()
67  <<" PDGcode= " << particle->GetPDGEncoding()
68  << " Mass= " << particle->GetPDGMass()/GeV <<" GeV.";
69  if(cp && pmanager) {
70  if(particle->GetPDGCharge() != 0.0) {
71  ph->RegisterProcess(new G4hMultipleScattering, particle);
72  ph->RegisterProcess(new G4hIonisation, particle);
73  }
74  if(fDecayProcess->IsApplicable(*particle)) {
75  ph->RegisterProcess(fDecayProcess, particle);
76  }
77  if(cp->GetCloud() && fHadronicInteraction &&
78  CustomPDGParser::s_isRHadron(particle->GetPDGEncoding())) {
79  edm::LogInfo("SimG4CoreCustomPhysics")
80  <<"CustomPhysicsList: " << particle->GetParticleName()
81  <<" CloudMass= " <<cp->GetCloud()->GetPDGMass()/GeV
82  <<" GeV; SpectatorMass= " << cp->GetSpectator()->GetPDGMass()/GeV<<" GeV.";
83 
84  if(!myHelper) { myHelper = new G4ProcessHelper(myConfig); }
85  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper));
86  }
87  if(particle->GetParticleType()=="darkpho"){
88  CMSDarkPairProductionProcess * darkGamma = new CMSDarkPairProductionProcess(dfactor);
89  pmanager->AddDiscreteProcess(darkGamma);
90  }
91  }
92  }
93  }
94 }
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

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.