Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SleptonsPhysicsTool::PhysicsConstructor Class Reference

#include <SleptonsPhysicsTool.h>

Inheritance diagram for SleptonsPhysicsTool::PhysicsConstructor:
Collaboration diagram for SleptonsPhysicsTool::PhysicsConstructor:

Public Member Functions

 PhysicsConstructor (const std::string &name, MSG::Level level, SleptonsPhysicsTool const &sleptonsPhysicsTool)
 
virtual void ConstructParticle () override
 
virtual void ConstructProcess () override
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

SleptonsParticlesConfig constm_particlesConfig
 
G4ParticleDefinition * m_theSElectronLMinus {nullptr}
 
G4ParticleDefinition * m_theSElectronLPlus {nullptr}
 
G4ParticleDefinition * m_theSMuonLMinus {nullptr}
 
G4ParticleDefinition * m_theSMuonLPlus {nullptr}
 
G4ParticleDefinition * m_theSTau1Minus {nullptr}
 
G4ParticleDefinition * m_theSTau1Plus {nullptr}
 
G4ParticleDefinition * m_theSElectronRMinus {nullptr}
 
G4ParticleDefinition * m_theSElectronRPlus {nullptr}
 
G4ParticleDefinition * m_theSMuonRMinus {nullptr}
 
G4ParticleDefinition * m_theSMuonRPlus {nullptr}
 
G4ParticleDefinition * m_theSTau2Minus {nullptr}
 
G4ParticleDefinition * m_theSTau2Plus {nullptr}
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 55 of file SleptonsPhysicsTool.h.

Constructor & Destructor Documentation

◆ PhysicsConstructor()

SleptonsPhysicsTool::PhysicsConstructor::PhysicsConstructor ( const std::string &  name,
MSG::Level  level,
SleptonsPhysicsTool const sleptonsPhysicsTool 
)
inline

Definition at line 57 of file SleptonsPhysicsTool.h.

60  m_particlesConfig(sleptonsPhysicsTool.m_particlesConfig) {}

Member Function Documentation

◆ ConstructParticle()

void SleptonsPhysicsTool::PhysicsConstructor::ConstructParticle ( )
overridevirtual

Definition at line 291 of file SleptonsPhysicsTool.cxx.

291  {
292  ATH_MSG_DEBUG("ConstructParticle for the Sleptons being run");
293  // Lambda to handle particle definition with consistent logic and reduce
294  // duplication
295  using ParticleDefinitionFn = std::function<G4ParticleDefinition*(
297  auto defineParticle = [](ParticleDefinitionParams const& particleDef,
298  G4ParticleDefinition** particle,
299  ParticleDefinitionFn definitionFn,
300  bool requireLargePDG) {
301  if (particleDef.mass <= 0. ||
302  !(requireLargePDG ? (std::abs(particleDef.pdgCode) >= 2000000)
303  : (std::abs(particleDef.pdgCode) < 2000000))) {
304  return;
305  }
306 
307  *particle =
308  definitionFn(particleDef.mass, particleDef.width, particleDef.charge,
309  particleDef.pdgCode, particleDef.stable,
310  particleDef.lifetime, particleDef.shortlived);
311  };
312  // R-types (large PDG code)
314  G4SElectronRMinus::Definition, true);
316  G4SElectronRPlus::Definition, true);
318  G4SMuonRMinus::Definition, true);
320  G4SMuonRPlus::Definition, true);
322  G4STau2Minus::Definition, true);
323  defineParticle(m_particlesConfig.STau2Plus, &m_theSTau2Plus,
324  G4STau2Plus::Definition, true);
325 
326  // L-types (small PDG code)
328  G4STau1Minus::Definition, false);
329  defineParticle(m_particlesConfig.STau1Plus, &m_theSTau1Plus,
330  G4STau1Plus::Definition, false);
332  G4SElectronLMinus::Definition, false);
334  G4SElectronLPlus::Definition, false);
336  G4SMuonLMinus::Definition, false);
338  G4SMuonLPlus::Definition, false);
339 }

◆ ConstructProcess()

void SleptonsPhysicsTool::PhysicsConstructor::ConstructProcess ( )
overridevirtual

Definition at line 341 of file SleptonsPhysicsTool.cxx.

341  {
342  ATH_MSG_DEBUG(" ConstructProcess for Sleptons being run");
343  PARTICLEITERATOR->reset();
344  while( (*PARTICLEITERATOR)() ){
345  G4ParticleDefinition* particle = PARTICLEITERATOR->value();
346  int pdgcode=std::abs(particle->GetPDGEncoding());
347  if (pdgcode==2000011 || pdgcode==2000013 || pdgcode==1000015 || pdgcode==1000011 || pdgcode==1000013 || pdgcode==2000015)
348  {
349  G4ProcessManager* proc=particle->GetProcessManager();
350  proc->AddProcess(new G4hMultipleScattering,-1,1,1);
351  proc->AddProcess(new G4hIonisation,-1,2,2);
352  }
353  }
354 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_particlesConfig

SleptonsParticlesConfig const& SleptonsPhysicsTool::PhysicsConstructor::m_particlesConfig
private

Definition at line 66 of file SleptonsPhysicsTool.h.

◆ m_theSElectronLMinus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronLMinus {nullptr}
private

Definition at line 68 of file SleptonsPhysicsTool.h.

◆ m_theSElectronLPlus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronLPlus {nullptr}
private

Definition at line 69 of file SleptonsPhysicsTool.h.

◆ m_theSElectronRMinus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronRMinus {nullptr}
private

Definition at line 75 of file SleptonsPhysicsTool.h.

◆ m_theSElectronRPlus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronRPlus {nullptr}
private

Definition at line 76 of file SleptonsPhysicsTool.h.

◆ m_theSMuonLMinus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonLMinus {nullptr}
private

Definition at line 70 of file SleptonsPhysicsTool.h.

◆ m_theSMuonLPlus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonLPlus {nullptr}
private

Definition at line 71 of file SleptonsPhysicsTool.h.

◆ m_theSMuonRMinus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonRMinus {nullptr}
private

Definition at line 77 of file SleptonsPhysicsTool.h.

◆ m_theSMuonRPlus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonRPlus {nullptr}
private

Definition at line 78 of file SleptonsPhysicsTool.h.

◆ m_theSTau1Minus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSTau1Minus {nullptr}
private

Definition at line 72 of file SleptonsPhysicsTool.h.

◆ m_theSTau1Plus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSTau1Plus {nullptr}
private

Definition at line 73 of file SleptonsPhysicsTool.h.

◆ m_theSTau2Minus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSTau2Minus {nullptr}
private

Definition at line 79 of file SleptonsPhysicsTool.h.

◆ m_theSTau2Plus

G4ParticleDefinition* SleptonsPhysicsTool::PhysicsConstructor::m_theSTau2Plus {nullptr}
private

Definition at line 80 of file SleptonsPhysicsTool.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
SleptonsPhysicsTool::PhysicsConstructor::m_theSTau2Plus
G4ParticleDefinition * m_theSTau2Plus
Definition: SleptonsPhysicsTool.h:80
SleptonsParticlesConfig::SElectronRMinus
ParticleParams SElectronRMinus
Definition: SleptonsPhysicsTool.h:24
SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonLPlus
G4ParticleDefinition * m_theSMuonLPlus
Definition: SleptonsPhysicsTool.h:71
SleptonsParticlesConfig::SMuonLMinus
ParticleParams SMuonLMinus
Definition: SleptonsPhysicsTool.h:20
SleptonsParticlesConfig::STau2Minus
ParticleParams STau2Minus
Definition: SleptonsPhysicsTool.h:28
SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronLMinus
G4ParticleDefinition * m_theSElectronLMinus
Definition: SleptonsPhysicsTool.h:68
IPhysicsContructor::IPhysicsContructor
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.
Definition: IPhysicsConstructor.h:44
ParticleDefinitionParams
Struct to hold the parameters of a particle definition.
Definition: IPhysicsConstructor.h:21
SleptonsPhysicsTool::PhysicsConstructor::m_theSTau2Minus
G4ParticleDefinition * m_theSTau2Minus
Definition: SleptonsPhysicsTool.h:79
SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronRPlus
G4ParticleDefinition * m_theSElectronRPlus
Definition: SleptonsPhysicsTool.h:76
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
SleptonsPhysicsTool::PhysicsConstructor::m_theSTau1Plus
G4ParticleDefinition * m_theSTau1Plus
Definition: SleptonsPhysicsTool.h:73
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
PARTICLEITERATOR
#define PARTICLEITERATOR
Definition: SleptonsPhysicsTool.cxx:45
SleptonsParticlesConfig::SElectronLPlus
ParticleParams SElectronLPlus
Definition: SleptonsPhysicsTool.h:19
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ParticleDefinitionParams::lifetime
double lifetime
Definition: IPhysicsConstructor.h:27
ParticleDefinitionParams::pdgCode
double pdgCode
Definition: IPhysicsConstructor.h:25
SleptonsPhysicsTool::PhysicsConstructor::m_particlesConfig
SleptonsParticlesConfig const & m_particlesConfig
Definition: SleptonsPhysicsTool.h:66
SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronRMinus
G4ParticleDefinition * m_theSElectronRMinus
Definition: SleptonsPhysicsTool.h:75
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SleptonsParticlesConfig::STau1Plus
ParticleParams STau1Plus
Definition: SleptonsPhysicsTool.h:23
ParticleDefinitionParams::stable
bool stable
Definition: IPhysicsConstructor.h:26
SleptonsParticlesConfig::SElectronLMinus
ParticleParams SElectronLMinus
Definition: SleptonsPhysicsTool.h:18
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonLMinus
G4ParticleDefinition * m_theSMuonLMinus
Definition: SleptonsPhysicsTool.h:70
SleptonsParticlesConfig::SMuonRPlus
ParticleParams SMuonRPlus
Definition: SleptonsPhysicsTool.h:27
SleptonsParticlesConfig::SMuonRMinus
ParticleParams SMuonRMinus
Definition: SleptonsPhysicsTool.h:26
SleptonsParticlesConfig::SElectronRPlus
ParticleParams SElectronRPlus
Definition: SleptonsPhysicsTool.h:25
ParticleDefinitionParams::charge
double charge
Definition: IPhysicsConstructor.h:24
SleptonsParticlesConfig::STau2Plus
ParticleParams STau2Plus
Definition: SleptonsPhysicsTool.h:29
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
SleptonsPhysicsTool::PhysicsConstructor::m_theSTau1Minus
G4ParticleDefinition * m_theSTau1Minus
Definition: SleptonsPhysicsTool.h:72
SleptonsParticlesConfig::SMuonLPlus
ParticleParams SMuonLPlus
Definition: SleptonsPhysicsTool.h:21
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
ParticleDefinitionParams::width
double width
Definition: IPhysicsConstructor.h:23
ParticleDefinitionParams::mass
double mass
Definition: IPhysicsConstructor.h:22
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
SleptonsParticlesConfig::STau1Minus
ParticleParams STau1Minus
Definition: SleptonsPhysicsTool.h:22
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
ParticleDefinitionParams::shortlived
bool shortlived
Definition: IPhysicsConstructor.h:28
SleptonsPhysicsTool::PhysicsConstructor::m_theSElectronLPlus
G4ParticleDefinition * m_theSElectronLPlus
Definition: SleptonsPhysicsTool.h:69
SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonRPlus
G4ParticleDefinition * m_theSMuonRPlus
Definition: SleptonsPhysicsTool.h:78
SleptonsPhysicsTool::PhysicsConstructor::m_theSMuonRMinus
G4ParticleDefinition * m_theSMuonRMinus
Definition: SleptonsPhysicsTool.h:77