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

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

Protected Member Functions

void addCustomPhysics ()
 
virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 13 of file CustomPhysicsList.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file CustomPhysicsList.cc.

References 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");
31  edm::LogInfo("CustomPhysics")<<"Path for custom particle definition file: "<<particleDefFilePath;
32  myHelper = 0;
33 
34  }
T getParameter(std::string const &) const
edm::ParameterSet myConfig
std::string particleDefFilePath
G4ProcessHelper * myHelper
std::string fullPath() const
Definition: FileInPath.cc:171
CustomPhysicsList::~CustomPhysicsList ( )
virtual

Definition at line 36 of file CustomPhysicsList.cc.

References myHelper.

36  {
37  delete myHelper;
38 }
G4ProcessHelper * myHelper

Member Function Documentation

void CustomPhysicsList::addCustomPhysics ( )
protected

Definition at line 48 of file CustomPhysicsList.cc.

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

Referenced by ConstructProcess().

48  {
49  LogDebug("CustomPhysics") << " CustomPhysics: adding CustomPhysics processes";
50  theParticleIterator->reset();
51 
52  while((*theParticleIterator)()) {
53  int i = 0;
54  G4ParticleDefinition* particle = theParticleIterator->value();
55  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
57  LogDebug("CustomPhysics") << particle->GetParticleName()<<", "<<particle->GetPDGEncoding()
58  << " is Custom. Mass is "
59  <<particle->GetPDGMass()/GeV <<" GeV.";
60  if(cp->GetCloud()!=0) {
61  LogDebug("CustomPhysics")<<"Cloud mass is "
62  <<cp->GetCloud()->GetPDGMass()/GeV
63  <<" GeV. Spectator mass is "
64  <<static_cast<CustomParticle*>(particle)->GetSpectator()->GetPDGMass()/GeV
65  <<" GeV.";
66  }
67  G4ProcessManager* pmanager = particle->GetProcessManager();
68  if(pmanager) {
69  if(cp!=0) {
70  if(particle->GetParticleType()=="rhadron" || particle->GetParticleType()=="mesonino" || particle->GetParticleType() == "sbaryon"){
71  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
72  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper)); //GHEISHA
73  }
74  }
75  if(particle->GetPDGCharge()/eplus != 0) {
76  pmanager->AddProcess(new G4hMultipleScattering,-1, 1,i+1);
77  pmanager->AddProcess(new G4hIonisation, -1, 2,i+2);
78  }
79  }
80  else LogDebug("CustomPhysics") << " No pmanager";
81  }
82  }
83 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
edm::ParameterSet myConfig
G4ParticleDefinition * GetCloud()
G4ProcessHelper * myHelper
static bool isCustomParticle(G4ParticleDefinition *particle)
void CustomPhysicsList::ConstructParticle ( )
protectedvirtual

Definition at line 40 of file CustomPhysicsList.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

40  {
42 }
std::string particleDefFilePath
static void loadCustomParticles(const std::string &filePath)
void CustomPhysicsList::ConstructProcess ( )
protectedvirtual

Definition at line 44 of file CustomPhysicsList.cc.

References addCustomPhysics().

44  {
46 }
void CustomPhysicsList::setupRHadronPhycis ( G4ParticleDefinition *  particle)
private

Definition at line 86 of file CustomPhysicsList.cc.

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

86  {
87 
88  // LogDebug("CustomPhysics")<<"Configuring rHadron: "
89  // <<cp->
90 
91  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
92  if(cp->GetCloud()!=0)
93  LogDebug("CustomPhysics")<<"Cloud mass is "
94  <<cp->GetCloud()->GetPDGMass()/GeV
95  <<" GeV. Spectator mass is "
96  <<static_cast<CustomParticle*>(particle)->GetSpectator()->GetPDGMass()/GeV
97  <<" GeV.";
98 
99  G4ProcessManager* pmanager = particle->GetProcessManager();
100  if(pmanager){
101  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
102  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper)); //GHEISHA
103  if(particle->GetPDGCharge()/eplus != 0){
104  pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
105  pmanager->AddProcess(new G4hIonisation, -1, 2,2);
106  }
107  }
108  else LogDebug("CustomPhysics") << " No pmanager";
109 }
#define LogDebug(id)
edm::ParameterSet myConfig
G4ParticleDefinition * GetCloud()
G4ProcessHelper * myHelper
void CustomPhysicsList::setupSUSYPhycis ( G4ParticleDefinition *  particle)
private

Definition at line 112 of file CustomPhysicsList.cc.

References LogDebug.

112  {
113 
114 // CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
115  G4ProcessManager* pmanager = particle->GetProcessManager();
116  if(pmanager){
117  pmanager->AddProcess(new G4Decay,1, 1,1);
118  if(particle->GetPDGCharge()/eplus != 0){
119  pmanager->AddProcess(new G4hMultipleScattering,-1, 2,2);
120  pmanager->AddProcess(new G4hIonisation, -1, 3,3);
121  }
122  }
123  else LogDebug("CustomPhysics") << " No pmanager";
124 }
#define LogDebug(id)

Member Data Documentation

edm::ParameterSet CustomPhysicsList::myConfig
private

Definition at line 32 of file CustomPhysicsList.h.

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

G4ProcessHelper* CustomPhysicsList::myHelper
private
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.