ATLAS Offline Software
Loading...
Searching...
No Matches
QuirksPhysicsTool::PhysicsConstructor Class Reference

#include <QuirkPhysicsTool.h>

Inheritance diagram for QuirksPhysicsTool::PhysicsConstructor:
Collaboration diagram for QuirksPhysicsTool::PhysicsConstructor:

Public Member Functions

 PhysicsConstructor (const std::string &name, MSG::Level level, G4double mass, G4double charge, G4int pdgid, G4double stringForce, G4double firstStringLength, G4double maxBoost, G4double maxMergeT, G4double maxMergeMag)
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

G4double m_mass {}
G4double m_charge {}
G4int m_pdgid {}
G4double m_stringForce {}
G4double m_firstStringLength {}
G4double m_maxBoost {}
G4double m_maxMergeT {}
G4double m_maxMergeMag {}
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 34 of file QuirkPhysicsTool.h.

Constructor & Destructor Documentation

◆ PhysicsConstructor()

QuirksPhysicsTool::PhysicsConstructor::PhysicsConstructor ( const std::string & name,
MSG::Level level,
G4double mass,
G4double charge,
G4int pdgid,
G4double stringForce,
G4double firstStringLength,
G4double maxBoost,
G4double maxMergeT,
G4double maxMergeMag )
inline

Definition at line 36 of file QuirkPhysicsTool.h.

40 : IPhysicsContructor(name, level),
41 m_mass(mass),
43 m_pdgid(pdgid),
44 m_stringForce(stringForce),
45 m_firstStringLength(firstStringLength),
46 m_maxBoost(maxBoost),
47 m_maxMergeT(maxMergeT),
48 m_maxMergeMag(maxMergeMag) {}
double charge(const T &p)
Definition AtlasPID.h:997
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.

Member Function Documentation

◆ ConstructParticle()

void QuirksPhysicsTool::PhysicsConstructor::ConstructParticle ( )
overridevirtual

Definition at line 96 of file QuirkPhysicsTool.cxx.

96 {
97 ATH_MSG_DEBUG("ConstructParticle for the Quirks being run");
98
99 Quirk* q1 = new Quirk(
100 /*name*/ "quirk+", m_mass, /*width*/ 0.0, +m_charge,
101 /*2*spin*/ 1, /*parity*/ 0, /*C-conjugation*/ 0,
102 /*2*Isospin*/ 0, /*2*Isospin3*/ 0, /*G-parity*/ 0,
103 /*type*/ "lepton", /*lepton number*/ +1, /*baryon number*/ 0, +m_pdgid,
104 /*stable*/ true, /*lifetime*/ -1.0, /*decay table*/ 0,
105 /*shortlived*/ false
106 );
107 new Quirk(
108 /*name*/ "quirk-", m_mass, /*width*/ 0.0, -m_charge,
109 /*2*spin*/ 1, /*parity*/ 0, /*C-conjugation*/ 0,
110 /*2*Isospin*/ 0, /*2*Isospin3*/ 0, /*G-parity*/ 0,
111 /*type*/ "lepton", /*lepton number*/ -1, /*baryon number*/ 0, -m_pdgid,
112 /*stable*/ true, /*lifetime*/ -1.0, /*decay table*/ 0,
113 /*shortlived*/ false
114 );
115
116 InfracolorForce& s = q1->GetStringIn();
117 s.SetStringForce(m_stringForce);
118 s.SetFirstStringLength(m_firstStringLength);
119 s.SetMaxBoost(m_maxBoost);
120 s.SetMaxMergeT(m_maxMergeT);
121 s.SetMaxMergeMag(m_maxMergeMag);
122}
#define ATH_MSG_DEBUG(x)
const InfracolorForce & GetStringIn() const
Definition Quirk.h:29

◆ ConstructProcess()

void QuirksPhysicsTool::PhysicsConstructor::ConstructProcess ( )
overridevirtual

Definition at line 124 of file QuirkPhysicsTool.cxx.

124 {
125 ATH_MSG_DEBUG(" ConstructProcess for Quirks being run");
126 PARTICLEITERATOR->reset();
127 while( (*PARTICLEITERATOR)() ){
128 G4ParticleDefinition* particle = PARTICLEITERATOR->value();
129 if (dynamic_cast<Quirk*>(particle) != 0) {
130 G4ProcessManager* pmanager = particle->GetProcessManager();
131 //G4cout << "# processes = " << pmanager->GetProcessListLength() << G4endl;
132 //for (int i = 0; i < pmanager->GetProcessList()->size(); i++) {
133 // G4cout << "process i: " << (*pmanager->GetProcessList())[i]->GetProcessName() << G4endl;
134 //}
135 while (pmanager->GetProcessListLength() != 0) pmanager->RemoveProcess(0);
136 G4VProcess* aTransportation = new QuirkTransportation;
137 pmanager->AddProcess(aTransportation);
138 pmanager->SetProcessOrderingToFirst(aTransportation, idxAlongStep);
139 pmanager->SetProcessOrderingToFirst(aTransportation, idxPostStep);
140 pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
141 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
142 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
143 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
144 //pmanager->AddProcess(new TestProcess, -1, 1, 1);
145 pmanager->AddProcess(new QuirkWatcher, -1,-1, 5);
146 //G4cout << "# processes = " << pmanager->GetProcessListLength() << G4endl;
147 //for (int i = 0; i < pmanager->GetProcessList()->size(); i++) {
148 // G4cout << "process i: " << (*pmanager->GetProcessList())[i]->GetProcessName() << G4endl;
149 //}
150 }
151 }
152 G4RunManager* runManager = G4RunManager::GetRunManager();
153 runManager->SetNumberOfAdditionalWaitingStacks(1);
154 G4UserStackingAction* defaultStackingAction = G4EventManager::GetEventManager()->GetUserStackingAction();
155 ATH_MSG_WARNING("This tool is interfering with the normal G4Atlas workflow, by forcing a differentcustom StackingAction instead of the default one. This is acceptable only as a temporary solution, and should be fixed asap.");
156 runManager->SetUserAction(new QuirkStackingAction(defaultStackingAction));
157
158 // ADS this must be done on the python side
159 //f (m_enableDebug) {
160 // DebugSteppingAction* debugger = new DebugSteppingAction(m_debugStep, m_numDebugSteps);
161 //#//f QUIRKS_STANDALONE
162 // runManager->SetUserAction(debugger);
163 //#//
164 // FADS::FadsSteppingAction::GetSteppingAction()->RegisterAction(debugger);
165 //#//f
166 //
167}
#define ATH_MSG_WARNING(x)
#define PARTICLEITERATOR
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

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

G4double QuirksPhysicsTool::PhysicsConstructor::m_charge {}
private

Definition at line 55 of file QuirkPhysicsTool.h.

55{};

◆ m_firstStringLength

G4double QuirksPhysicsTool::PhysicsConstructor::m_firstStringLength {}
private

Definition at line 58 of file QuirkPhysicsTool.h.

58{};

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

G4double QuirksPhysicsTool::PhysicsConstructor::m_mass {}
private

Definition at line 54 of file QuirkPhysicsTool.h.

54{};

◆ m_maxBoost

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxBoost {}
private

Definition at line 59 of file QuirkPhysicsTool.h.

59{};

◆ m_maxMergeMag

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxMergeMag {}
private

Definition at line 61 of file QuirkPhysicsTool.h.

61{};

◆ m_maxMergeT

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxMergeT {}
private

Definition at line 60 of file QuirkPhysicsTool.h.

60{};

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

G4int QuirksPhysicsTool::PhysicsConstructor::m_pdgid {}
private

Definition at line 56 of file QuirkPhysicsTool.h.

56{};

◆ m_stringForce

G4double QuirksPhysicsTool::PhysicsConstructor::m_stringForce {}
private

Definition at line 57 of file QuirkPhysicsTool.h.

57{};

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