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

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

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

28  : G4VPhysicsConstructor(name)
29 {
30  myConfig = p;
31  edm::FileInPath fp = p.getParameter<edm::FileInPath>("particlesDef");
33  edm::LogInfo("CustomPhysics")<<"Path for custom particle definition file: "
35  myHelper = 0;
36 }
T getParameter(std::string const &) const
edm::ParameterSet myConfig
std::string particleDefFilePath
G4ProcessHelper * myHelper
std::string fullPath() const
Definition: FileInPath.cc:165
CustomPhysicsList::~CustomPhysicsList ( )
virtual

Definition at line 38 of file CustomPhysicsList.cc.

References myHelper.

38  {
39  delete myHelper;
40 }
G4ProcessHelper * myHelper

Member Function Documentation

void CustomPhysicsList::addCustomPhysics ( )
protected

Definition at line 50 of file CustomPhysicsList.cc.

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

Referenced by ConstructProcess().

50  {
51 
52  edm::LogInfo("CustomPhysics") << " CustomPhysicsList: adding CustomPhysics processes "
53  << "for the list of particles: \n";
54  aParticleIterator->reset();
55 
56  while((*aParticleIterator)()) {
57  G4ParticleDefinition* particle = aParticleIterator->value();
59  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
60  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
61  <<" PDGcode= "<<particle->GetPDGEncoding()
62  << " Mass= "
63  <<particle->GetPDGMass()/GeV <<" GeV.";
64  if(cp->GetCloud()!=0) {
65  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
66  <<" CloudMass= "
67  <<cp->GetCloud()->GetPDGMass()/GeV
68  <<" GeV; SpectatorMass= "
69  << cp->GetSpectator()->GetPDGMass()/GeV
70  <<" GeV.";
71  }
72  G4ProcessManager* pmanager = particle->GetProcessManager();
73  if(pmanager) {
74  if(particle->GetPDGCharge() != 0.0) {
75  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
76  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
77  }
78  if(cp != 0) {
79  if(particle->GetParticleType()=="rhadron" ||
80  particle->GetParticleType()=="mesonino" ||
81  particle->GetParticleType() == "sbaryon"){
82  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
83  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper));
84  }
85  }
86  }
87  else LogDebug("CustomPhysics") << " No pmanager";
88  }
89  }
90 }
#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 42 of file CustomPhysicsList.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 46 of file CustomPhysicsList.cc.

References addCustomPhysics().

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

Definition at line 93 of file CustomPhysicsList.cc.

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

94 {
95  // LogDebug("CustomPhysics")<<"Configuring rHadron: "
96  // <<cp->
97 
98  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
99  if(cp->GetCloud()!=0) {
100  LogDebug("CustomPhysics")
101  <<"Cloud mass is "
102  <<cp->GetCloud()->GetPDGMass()/GeV
103  <<" GeV. Spectator mass is "
104  <<static_cast<CustomParticle*>(particle)->GetSpectator()->GetPDGMass()/GeV
105  <<" GeV.";
106  }
107  G4ProcessManager* pmanager = particle->GetProcessManager();
108  if(pmanager){
109  if(!myHelper) myHelper = new G4ProcessHelper(myConfig);
110  if(particle->GetPDGCharge()/eplus != 0){
111  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
112  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
113  }
114  pmanager->AddDiscreteProcess(new FullModelHadronicProcess(myHelper)); //GHEISHA
115  }
116  else LogDebug("CustomPhysics") << " No pmanager";
117 }
#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 119 of file CustomPhysicsList.cc.

References LogDebug.

120 {
121  G4ProcessManager* pmanager = particle->GetProcessManager();
122  if(pmanager){
123  if(particle->GetPDGCharge()/eplus != 0){
124  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
125  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
126  }
127  pmanager->AddProcess(new G4Decay, 1, -1, 3);
128  }
129  else LogDebug("CustomPhysics") << " No pmanager";
130 }
#define LogDebug(id)

Member Data Documentation

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.