CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | 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 ()
 

Protected Member Functions

void addCustomPhysics ()
 

Private Member Functions

void setupRHadronPhycis (G4ParticleDefinition *particle)
 
void setupSUSYPhycis (G4ParticleDefinition *particle)
 

Private Attributes

double dfactor
 
edm::ParameterSet myConfig
 
G4ProcessHelper * myHelper
 
std::string particleDefFilePath
 
std::string processDefFilePath
 

Detailed Description

Definition at line 14 of file CustomPhysicsList.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file CustomPhysicsList.cc.

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

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

Definition at line 40 of file CustomPhysicsList.cc.

References myHelper.

40  {
41  delete myHelper;
42 }
G4ProcessHelper * myHelper

Member Function Documentation

void CustomPhysicsList::addCustomPhysics ( )
protected

Definition at line 52 of file CustomPhysicsList.cc.

References CommonMethods::cp(), dfactor, CustomParticle::GetCloud(), CustomParticle::GetSpectator(), GeV, CustomParticleFactory::isCustomParticle(), LogDebug, myConfig, and myHelper.

Referenced by ConstructProcess().

52  {
53 
54  edm::LogInfo("CustomPhysics") << " CustomPhysicsList: adding CustomPhysics processes "
55  << "for the list of particles: \n";
56  aParticleIterator->reset();
57 
58  while((*aParticleIterator)()) {
59  G4ParticleDefinition* particle = aParticleIterator->value();
61  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
62  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
63  <<" PDGcode= "<<particle->GetPDGEncoding()
64  << " Mass= "
65  <<particle->GetPDGMass()/GeV <<" GeV.";
66  if(cp->GetCloud()!=0) {
67  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
68  <<" CloudMass= "
69  <<cp->GetCloud()->GetPDGMass()/GeV
70  <<" GeV; SpectatorMass= "
71  << cp->GetSpectator()->GetPDGMass()/GeV
72  <<" GeV.";
73  }
74  G4ProcessManager* pmanager = particle->GetProcessManager();
75  if(pmanager) {
76  if(particle->GetPDGCharge() != 0.0) {
77  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
78  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
79  }
80  if(cp != 0) {
81  if(particle->GetParticleType()=="rhadron" ||
82  particle->GetParticleType()=="mesonino" ||
83  particle->GetParticleType() == "sbaryon"){
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  else LogDebug("CustomPhysics") << " No pmanager";
94  }
95  }
96 }
#define LogDebug(id)
const double GeV
Definition: MathUtil.h:16
edm::ParameterSet myConfig
G4ParticleDefinition * GetCloud()
G4ParticleDefinition * GetSpectator()
G4ProcessHelper * myHelper
static bool isCustomParticle(G4ParticleDefinition *particle)
void CustomPhysicsList::ConstructParticle ( )
virtual

Definition at line 44 of file CustomPhysicsList.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 48 of file CustomPhysicsList.cc.

References addCustomPhysics().

48  {
50 }
void CustomPhysicsList::setupRHadronPhycis ( G4ParticleDefinition *  particle)
private

Definition at line 99 of file CustomPhysicsList.cc.

References CommonMethods::cp(), CustomParticle::GetCloud(), GeV, LogDebug, myConfig, and myHelper.

100 {
101  // LogDebug("CustomPhysics")<<"Configuring rHadron: "
102  // <<cp->
103 
104  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
105  if(cp->GetCloud()!=0) {
106  LogDebug("CustomPhysics")
107  <<"Cloud mass is "
108  <<cp->GetCloud()->GetPDGMass()/GeV
109  <<" GeV. Spectator mass is "
110  <<static_cast<CustomParticle*>(particle)->GetSpectator()->GetPDGMass()/GeV
111  <<" GeV.";
112  }
113  G4ProcessManager* pmanager = particle->GetProcessManager();
114  if(pmanager){
115  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
116  if(particle->GetPDGCharge()/eplus != 0){
117  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
118  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
119  }
120  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper)); //GHEISHA
121  }
122  else LogDebug("CustomPhysics") << " No pmanager";
123 }
#define LogDebug(id)
const double GeV
Definition: MathUtil.h:16
edm::ParameterSet myConfig
G4ParticleDefinition * GetCloud()
G4ProcessHelper * myHelper
void CustomPhysicsList::setupSUSYPhycis ( G4ParticleDefinition *  particle)
private

Definition at line 125 of file CustomPhysicsList.cc.

References LogDebug.

126 {
127  G4ProcessManager* pmanager = particle->GetProcessManager();
128  if(pmanager){
129  if(particle->GetPDGCharge()/eplus != 0){
130  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
131  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
132  }
133  pmanager->AddProcess(new G4Decay, 1, -1, 3);
134  }
135  else LogDebug("CustomPhysics") << " No pmanager";
136 }
#define LogDebug(id)

Member Data Documentation

double CustomPhysicsList::dfactor
private

Definition at line 38 of file CustomPhysicsList.h.

Referenced by addCustomPhysics(), and CustomPhysicsList().

edm::ParameterSet CustomPhysicsList::myConfig
private

Definition at line 34 of file CustomPhysicsList.h.

Referenced by addCustomPhysics(), CustomPhysicsList(), and setupRHadronPhycis().

G4ProcessHelper* CustomPhysicsList::myHelper
private
std::string CustomPhysicsList::particleDefFilePath
private

Definition at line 36 of file CustomPhysicsList.h.

Referenced by ConstructParticle(), and CustomPhysicsList().

std::string CustomPhysicsList::processDefFilePath
private

Definition at line 37 of file CustomPhysicsList.h.