ATLAS Offline Software
Loading...
Searching...
No Matches
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.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Member Functions

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

Private Attributes

SleptonsParticlesConfig const & m_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.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

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.

59 : IPhysicsContructor(name, level),
60 m_particlesConfig(sleptonsPhysicsTool.m_particlesConfig) {}
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.
SleptonsParticlesConfig const & 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)
313 defineParticle(m_particlesConfig.SElectronRMinus, &m_theSElectronRMinus,
314 G4SElectronRMinus::Definition, true);
315 defineParticle(m_particlesConfig.SElectronRPlus, &m_theSElectronRPlus,
316 G4SElectronRPlus::Definition, true);
317 defineParticle(m_particlesConfig.SMuonRMinus, &m_theSMuonRMinus,
318 G4SMuonRMinus::Definition, true);
319 defineParticle(m_particlesConfig.SMuonRPlus, &m_theSMuonRPlus,
320 G4SMuonRPlus::Definition, true);
321 defineParticle(m_particlesConfig.STau2Minus, &m_theSTau2Minus,
322 G4STau2Minus::Definition, true);
323 defineParticle(m_particlesConfig.STau2Plus, &m_theSTau2Plus,
324 G4STau2Plus::Definition, true);
325
326 // L-types (small PDG code)
327 defineParticle(m_particlesConfig.STau1Minus, &m_theSTau1Minus,
328 G4STau1Minus::Definition, false);
329 defineParticle(m_particlesConfig.STau1Plus, &m_theSTau1Plus,
330 G4STau1Plus::Definition, false);
331 defineParticle(m_particlesConfig.SElectronLMinus, &m_theSElectronLMinus,
332 G4SElectronLMinus::Definition, false);
333 defineParticle(m_particlesConfig.SElectronLPlus, &m_theSElectronLPlus,
334 G4SElectronLPlus::Definition, false);
335 defineParticle(m_particlesConfig.SMuonLMinus, &m_theSMuonLMinus,
336 G4SMuonLMinus::Definition, false);
337 defineParticle(m_particlesConfig.SMuonLPlus, &m_theSMuonLPlus,
338 G4SMuonLPlus::Definition, false);
339}
#define ATH_MSG_DEBUG(x)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
setBGCode setTAP setLVL2ErrorBits bool

◆ 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}
#define PARTICLEITERATOR

◆ 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 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ 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 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ 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_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ 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.

135{ nullptr };

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ 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.

68{nullptr};

◆ m_theSElectronLPlus

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

Definition at line 69 of file SleptonsPhysicsTool.h.

69{nullptr};

◆ m_theSElectronRMinus

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

Definition at line 75 of file SleptonsPhysicsTool.h.

75{nullptr};

◆ m_theSElectronRPlus

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

Definition at line 76 of file SleptonsPhysicsTool.h.

76{nullptr};

◆ m_theSMuonLMinus

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

Definition at line 70 of file SleptonsPhysicsTool.h.

70{nullptr};

◆ m_theSMuonLPlus

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

Definition at line 71 of file SleptonsPhysicsTool.h.

71{nullptr};

◆ m_theSMuonRMinus

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

Definition at line 77 of file SleptonsPhysicsTool.h.

77{nullptr};

◆ m_theSMuonRPlus

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

Definition at line 78 of file SleptonsPhysicsTool.h.

78{nullptr};

◆ m_theSTau1Minus

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

Definition at line 72 of file SleptonsPhysicsTool.h.

72{nullptr};

◆ m_theSTau1Plus

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

Definition at line 73 of file SleptonsPhysicsTool.h.

73{nullptr};

◆ m_theSTau2Minus

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

Definition at line 79 of file SleptonsPhysicsTool.h.

79{nullptr};

◆ m_theSTau2Plus

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

Definition at line 80 of file SleptonsPhysicsTool.h.

80{nullptr};

The documentation for this class was generated from the following files: