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

#include "G4AtlasInfrstructure/AddPhysicsDecayTool.h"

Inheritance diagram for AddPhysicsDecayTool:
Collaboration diagram for AddPhysicsDecayTool:

Public Member Functions

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

Protected Attributes

Gaudi::Property< std::string > m_ParticleName {this, "ParticleName", "NoFile", "Particle name"}
 
Gaudi::Property< double > m_BR {this, "BR", 0, "Branching Ratio"}
 
Gaudi::Property< std::string > m_Daughters {this, "Daughters", "NoFile", "Daughters"}
 
std::vector< std::string > m_Daughters_vec
 

Detailed Description

Tool for the concrete implementation of a Physics List selection class

Author
Andrea Dell'Acqua
Date
2014-10-01

Definition at line 23 of file AddPhysicsDecayTool.h.

Constructor & Destructor Documentation

◆ AddPhysicsDecayTool()

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

Standard constructor.

Definition at line 37 of file AddPhysicsDecayTool.cxx.

39  : base_class ( type, nam , parent )
40 {
41  m_physicsOptionType = G4AtlasPhysicsOption::Type::GlobalProcesses;
42 }

◆ ~AddPhysicsDecayTool()

AddPhysicsDecayTool::~AddPhysicsDecayTool ( )
virtual

Destructor.

Definition at line 48 of file AddPhysicsDecayTool.cxx.

49 {
50 }

Member Function Documentation

◆ ConstructParticle()

void AddPhysicsDecayTool::ConstructParticle ( )
overridevirtual

Definition at line 134 of file AddPhysicsDecayTool.cxx.

135 {
136  //This should remain empty
137 }

◆ ConstructProcess()

void AddPhysicsDecayTool::ConstructProcess ( )
overridevirtual

Definition at line 71 of file AddPhysicsDecayTool.cxx.

72 {
73  PARTICLEITERATOR->reset();
74  while( (*PARTICLEITERATOR)() )
75  {
76  G4ParticleDefinition *particle = PARTICLEITERATOR->value();
77  if (m_ParticleName.value()== static_cast<const std::string&>(particle->GetParticleName()))
78  {
79 
80  G4DecayTable *table = particle->GetDecayTable();
81  if (!table)
82  {
83  table = new G4DecayTable();
84  }
85 
86  G4VDecayChannel *mode_vec(nullptr);
87 
88  if (m_Daughters_vec.size()==2)
89  {
90  mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,2,m_Daughters_vec[0],m_Daughters_vec[1]);
91  }
92  else if (m_Daughters_vec.size()==3)
93  {
94  mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,3,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2]);
95  }
96  else if (m_Daughters_vec.size()==4)
97  {
98  mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,4,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2],m_Daughters_vec[3]);
99  }
100  else
101  {
102  //This could be checked during initialize also
103  ATH_MSG_FATAL("No decay in more than 4 particles allowed");
104  throw "Decay with more than four particles";
105  }
106  /*
107  for (int i=0; i<table->entries(); i++)
108  {
109  if(*(table->GetDecayChannel(i))==*mode_vec)
110  {
111  ATH_MSG_FATAL("Trying to Add a decay already present" );
112  throw "FailedAddDecay";
113  }
114  }
115  */
116 
117  table->Insert(mode_vec);
118 
119  ATH_MSG_DEBUG( "Adding decay to "<<m_ParticleName.value() );
120  particle->SetDecayTable(table);
121  }
122  }
123 }

◆ GetPhysicsOption()

AddPhysicsDecayTool * AddPhysicsDecayTool::GetPhysicsOption ( )
overridevirtual

Definition at line 126 of file AddPhysicsDecayTool.cxx.

127 {
128 
129  return this;
130 }

◆ initialize()

StatusCode AddPhysicsDecayTool::initialize ( )
overridevirtual

Initialize method.

Definition at line 55 of file AddPhysicsDecayTool.cxx.

56 {
57  ATH_MSG_DEBUG("AddPhysicsDecayTool initialize( )");
58  ATH_MSG_DEBUG("Add Decay to the particle: "<<m_ParticleName);
59 
60  std::istringstream ss(m_Daughters);
61  std::string token;
62 
63  while(std::getline(ss, token, ','))
64  {
65  m_Daughters_vec.push_back(token);
66  }
67 
68  return StatusCode::SUCCESS;
69 }

Member Data Documentation

◆ m_BR

Gaudi::Property<double> AddPhysicsDecayTool::m_BR {this, "BR", 0, "Branching Ratio"}
protected

Definition at line 42 of file AddPhysicsDecayTool.h.

◆ m_Daughters

Gaudi::Property<std::string> AddPhysicsDecayTool::m_Daughters {this, "Daughters", "NoFile", "Daughters"}
protected

Definition at line 43 of file AddPhysicsDecayTool.h.

◆ m_Daughters_vec

std::vector<std::string> AddPhysicsDecayTool::m_Daughters_vec
protected

Definition at line 44 of file AddPhysicsDecayTool.h.

◆ m_ParticleName

Gaudi::Property<std::string> AddPhysicsDecayTool::m_ParticleName {this, "ParticleName", "NoFile", "Particle name"}
protected

Definition at line 41 of file AddPhysicsDecayTool.h.


The documentation for this class was generated from the following files:
AddPhysicsDecayTool::m_ParticleName
Gaudi::Property< std::string > m_ParticleName
Definition: AddPhysicsDecayTool.h:41
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
PARTICLEITERATOR
#define PARTICLEITERATOR
Definition: AddPhysicsDecayTool.cxx:31
AddPhysicsDecayTool::m_Daughters_vec
std::vector< std::string > m_Daughters_vec
Definition: AddPhysicsDecayTool.h:44
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.ext.table_printer.table
list table
Definition: table_printer.py:81
G4AtlasPhysicsOption::GlobalProcesses
@ GlobalProcesses
Definition: IPhysicsOptionTool.h:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AddPhysicsDecayTool::m_Daughters
Gaudi::Property< std::string > m_Daughters
Definition: AddPhysicsDecayTool.h:43
AddPhysicsDecayTool::m_BR
Gaudi::Property< double > m_BR
Definition: AddPhysicsDecayTool.h:42