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
CustomPhysicsListSS Class Reference

#include <CustomPhysicsListSS.h>

Inheritance diagram for CustomPhysicsListSS:

Public Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 
 CustomPhysicsListSS (std::string name, const edm::ParameterSet &p)
 
virtual ~CustomPhysicsListSS ()
 

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 CustomPhysicsListSS.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file CustomPhysicsListSS.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 }
std::string particleDefFilePath
T getParameter(std::string const &) const
edm::ParameterSet myConfig
std::string fullPath() const
Definition: FileInPath.cc:165
G4ProcessHelper * myHelper
CustomPhysicsListSS::~CustomPhysicsListSS ( )
virtual

Definition at line 38 of file CustomPhysicsListSS.cc.

References myHelper.

38  {
39  delete myHelper;
40 }
G4ProcessHelper * myHelper

Member Function Documentation

void CustomPhysicsListSS::addCustomPhysics ( )
protected

Definition at line 50 of file CustomPhysicsListSS.cc.

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

Referenced by ConstructProcess().

50  {
51  edm::LogInfo("CustomPhysics") << " CustomPhysicsListSS: adding CustomPhysics processes";
52  aParticleIterator->reset();
53 
54  while((*aParticleIterator)()) {
55  G4ParticleDefinition* particle = aParticleIterator->value();
57  CustomParticle* cp = dynamic_cast<CustomParticle*>(particle);
58  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
59  <<" PDGcode= "<<particle->GetPDGEncoding()
60  << " Mass= "
61  <<particle->GetPDGMass()/GeV <<" GeV.";
62  if(cp->GetCloud()!=0) {
63  edm::LogInfo("CustomPhysics") << particle->GetParticleName()
64  << " CloudMass= "
65  <<cp->GetCloud()->GetPDGMass()/GeV
66  <<" GeV; SpectatorMass= "
67  <<cp->GetSpectator()->GetPDGMass()/GeV
68  <<" GeV.";
69  }
70  G4ProcessManager* pmanager = particle->GetProcessManager();
71  if(pmanager) {
72  if(particle->GetPDGCharge()/eplus != 0) {
73  pmanager->AddProcess(new G4CoulombScattering, -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)
const double GeV
Definition: MathUtil.h:16
G4ParticleDefinition * GetCloud()
G4ParticleDefinition * GetSpectator()
edm::ParameterSet myConfig
static bool isCustomParticle(G4ParticleDefinition *particle)
G4ProcessHelper * myHelper
void CustomPhysicsListSS::ConstructParticle ( )
virtual

Definition at line 42 of file CustomPhysicsListSS.cc.

References CustomParticleFactory::loadCustomParticles(), and particleDefFilePath.

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

Definition at line 46 of file CustomPhysicsListSS.cc.

References addCustomPhysics().

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

Definition at line 90 of file CustomPhysicsListSS.cc.

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

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

Definition at line 116 of file CustomPhysicsListSS.cc.

References LogDebug.

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

Member Data Documentation

edm::ParameterSet CustomPhysicsListSS::myConfig
private

Definition at line 34 of file CustomPhysicsListSS.h.

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

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

Definition at line 36 of file CustomPhysicsListSS.h.

Referenced by ConstructParticle(), and CustomPhysicsListSS().

std::string CustomPhysicsListSS::processDefFilePath
private

Definition at line 37 of file CustomPhysicsListSS.h.