ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
ExtraParticlesPhysicsTool Class Reference

#include <ExtraParticlesPhysicsTool.h>

Inheritance diagram for ExtraParticlesPhysicsTool:
Collaboration diagram for ExtraParticlesPhysicsTool:

Public Member Functions

 ExtraParticlesPhysicsTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
virtual ~ExtraParticlesPhysicsTool ()
 Destructor. More...
 
virtual StatusCode initialize () override final
 Initialize method. More...
 
virtual void ConstructParticle () override final
 
virtual void ConstructProcess () override final
 
virtual ExtraParticlesPhysicsToolGetPhysicsOption () override final
 Implements. More...
 

Protected Attributes

std::map< std::string, std::vector< double > > m_extraParticlesConfig
 a set of parameters for extra particle building More...
 
std::set< G4ParticleDefinition * > m_extraParticles
 a set to hold the newly created extra particles More...
 

Detailed Description

"ExtraParticles/ExtraParticlesPhysicsTool.h"

Tool for the concrete implementation of a Physics List selection class

Author
Miha Muskinja
Date
August-2019

Definition at line 21 of file ExtraParticlesPhysicsTool.h.

Constructor & Destructor Documentation

◆ ExtraParticlesPhysicsTool()

ExtraParticlesPhysicsTool::ExtraParticlesPhysicsTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard constructor.

Definition at line 31 of file ExtraParticlesPhysicsTool.cxx.

34  : base_class(type, name, parent) {
36 
37  declareProperty("ExtraParticlesConfig", m_extraParticlesConfig);
38 }

◆ ~ExtraParticlesPhysicsTool()

ExtraParticlesPhysicsTool::~ExtraParticlesPhysicsTool ( )
virtual

Destructor.

Definition at line 43 of file ExtraParticlesPhysicsTool.cxx.

43 {}

Member Function Documentation

◆ ConstructParticle()

void ExtraParticlesPhysicsTool::ConstructParticle ( )
finaloverridevirtual

Definition at line 64 of file ExtraParticlesPhysicsTool.cxx.

64  {
65  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructParticle - start");
66  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructParticle - m_extraParticlesConfig = " << m_extraParticlesConfig);
67 
68  // the existing particle table
69  G4ParticleTable *theParticleTable = G4ParticleTable::GetParticleTable();
70 
71  for (const auto &particle : m_extraParticlesConfig) {
72 
73  G4String name = particle.first;
74  G4double mass = particle.second[0];
75  G4double width = particle.second[1];
76  G4int charge = particle.second[2];
77  G4int pdg = particle.second[3];
78  G4double lifetime = particle.second[4];
79  G4bool stable = false;
80 
81  // don't add if the particle already exists
82  if (theParticleTable->FindParticle(pdg)) {
83  ATH_MSG_DEBUG("Skipping " << theParticleTable->FindParticle(pdg)->GetParticleName() << " ("<<pdg<<") as it is already in the ParticleTable.");
84  continue;
85  }
86 
87  // printout
88  ATH_MSG_DEBUG("Adding: " << name << " " << pdg << " " << charge << " "
89  << mass << " " << width << " " << lifetime);
90 
91  // create the new particle
93  pdg, stable, lifetime));
94  }
95  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructParticle - end");
96 }

◆ ConstructProcess()

void ExtraParticlesPhysicsTool::ConstructProcess ( )
finaloverridevirtual

Definition at line 101 of file ExtraParticlesPhysicsTool.cxx.

101  {
102  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructProcess - start");
103  if (msgLvl(MSG::DEBUG)) {
104  std::vector<std::string> extraParticleNames;
105  for ( G4ParticleDefinition* extraParticle : m_extraParticles) {
106  extraParticleNames.push_back(extraParticle->GetParticleName());
107  }
108  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructProcess - m_extraParticleNames = " << extraParticleNames);
109  }
110  for (auto *particle : m_extraParticles) {
111  if (particle->GetPDGCharge() != 0) {
112  ATH_MSG_DEBUG("Adding EM processes for "
113  << particle->GetParticleName());
114  G4ProcessManager *proc = particle->GetProcessManager();
115  proc->AddProcess(new G4hMultipleScattering, -1, 1, 1);
116  proc->AddProcess(new G4hIonisation, -1, 2, 2);
117  }
118  }
119  ATH_MSG_DEBUG("ExtraParticlesPhysicsTool::ConstructProcess - end");
120 }

◆ GetPhysicsOption()

ExtraParticlesPhysicsTool * ExtraParticlesPhysicsTool::GetPhysicsOption ( )
finaloverridevirtual

Implements.

Definition at line 57 of file ExtraParticlesPhysicsTool.cxx.

57  {
58  return this;
59 }

◆ initialize()

StatusCode ExtraParticlesPhysicsTool::initialize ( )
finaloverridevirtual

Initialize method.

Definition at line 48 of file ExtraParticlesPhysicsTool.cxx.

48  {
49  ATH_MSG_DEBUG("initializing...");
50  this->SetPhysicsName(this->name());
51  return StatusCode::SUCCESS;
52 }

Member Data Documentation

◆ m_extraParticles

std::set<G4ParticleDefinition *> ExtraParticlesPhysicsTool::m_extraParticles
protected

a set to hold the newly created extra particles

Definition at line 44 of file ExtraParticlesPhysicsTool.h.

◆ m_extraParticlesConfig

std::map<std::string, std::vector<double> > ExtraParticlesPhysicsTool::m_extraParticlesConfig
protected

a set of parameters for extra particle building

Definition at line 41 of file ExtraParticlesPhysicsTool.h.


The documentation for this class was generated from the following files:
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ExtraParticlesPhysicsTool::m_extraParticles
std::set< G4ParticleDefinition * > m_extraParticles
a set to hold the newly created extra particles
Definition: ExtraParticlesPhysicsTool.h:44
ExtraParticlesPhysicsTool::m_extraParticlesConfig
std::map< std::string, std::vector< double > > m_extraParticlesConfig
a set of parameters for extra particle building
Definition: ExtraParticlesPhysicsTool.h:41
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MCTruthPartClassifier::stable
@ stable
Definition: TruthClassifiers.h:148
CustomParticle
Definition: CustomParticle.h:17
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
charge
double charge(const T &p)
Definition: AtlasPID.h:756
G4AtlasPhysicsOption::QS_ExtraParticles
@ QS_ExtraParticles
Definition: IPhysicsOptionTool.h:23
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11