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 24 of file CustomPhysicsList.cc.

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

24  : G4VPhysicsConstructor(name) {
25 
26  myConfig = p;
27  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
29  edm::LogInfo("CustomPhysics")<<"Path for custom particle definition file: "<<particleDefFilePath;
30  myHelper = 0;
31 
32  }
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 34 of file CustomPhysicsList.cc.

References myHelper.

34  {
35  delete myHelper;
36 }
G4ProcessHelper * myHelper

Member Function Documentation

void CustomPhysicsList::addCustomPhysics ( )
protected

Definition at line 46 of file CustomPhysicsList.cc.

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

Referenced by ConstructProcess().

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

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 42 of file CustomPhysicsList.cc.

References addCustomPhysics().

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

Definition at line 84 of file CustomPhysicsList.cc.

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

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

Definition at line 110 of file CustomPhysicsList.cc.

References LogDebug.

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