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(), CustomParticleFactory::isCustomParticle(), LogDebug, myConfig, and myHelper.

Referenced by ConstructProcess().

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

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

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

Definition at line 117 of file CustomPhysicsList.cc.

References LogDebug.

118 {
119  G4ProcessManager* pmanager = particle->GetProcessManager();
120  if(pmanager){
121  if(particle->GetPDGCharge()/eplus != 0){
122  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
123  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
124  }
125  pmanager->AddProcess(new G4Decay, 1, -1, 3);
126  }
127  else LogDebug("CustomPhysics") << " No pmanager";
128 }
#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.