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

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

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) {}

Member Function Documentation

◆ ConstructParticle()

void QuirksPhysicsTool::PhysicsConstructor::ConstructParticle ( )
overridevirtual

Definition at line 97 of file QuirkPhysicsTool.cxx.

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

◆ ConstructProcess()

void QuirksPhysicsTool::PhysicsConstructor::ConstructProcess ( )
overridevirtual

Definition at line 125 of file QuirkPhysicsTool.cxx.

125  {
126  ATH_MSG_DEBUG(" ConstructProcess for Quirks being run");
127  PARTICLEITERATOR->reset();
128  while( (*PARTICLEITERATOR)() ){
129  G4ParticleDefinition* particle = PARTICLEITERATOR->value();
130  if (dynamic_cast<Quirk*>(particle) != 0) {
131  G4ProcessManager* pmanager = particle->GetProcessManager();
132  //G4cout << "# processes = " << pmanager->GetProcessListLength() << G4endl;
133  //for (int i = 0; i < pmanager->GetProcessList()->size(); i++) {
134  // G4cout << "process i: " << (*pmanager->GetProcessList())[i]->GetProcessName() << G4endl;
135  //}
136  while (pmanager->GetProcessListLength() != 0) pmanager->RemoveProcess(0);
137  G4VProcess* aTransportation = new QuirkTransportation;
138  pmanager->AddProcess(aTransportation);
139  pmanager->SetProcessOrderingToFirst(aTransportation, idxAlongStep);
140  pmanager->SetProcessOrderingToFirst(aTransportation, idxPostStep);
141  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
142  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
143  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
144  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
145  //pmanager->AddProcess(new TestProcess, -1, 1, 1);
146  pmanager->AddProcess(new QuirkWatcher, -1,-1, 5);
147  //G4cout << "# processes = " << pmanager->GetProcessListLength() << G4endl;
148  //for (int i = 0; i < pmanager->GetProcessList()->size(); i++) {
149  // G4cout << "process i: " << (*pmanager->GetProcessList())[i]->GetProcessName() << G4endl;
150  //}
151  }
152  }
153  G4RunManager* runManager = G4RunManager::GetRunManager();
154  runManager->SetNumberOfAdditionalWaitingStacks(1);
155  G4UserStackingAction* defaultStackingAction = G4EventManager::GetEventManager()->GetUserStackingAction();
156  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.");
157  runManager->SetUserAction(new QuirkStackingAction(defaultStackingAction));
158 
159  // ADS this must be done on the python side
160  //f (m_enableDebug) {
161  // DebugSteppingAction* debugger = new DebugSteppingAction(m_debugStep, m_numDebugSteps);
162  //#//f QUIRKS_STANDALONE
163  // runManager->SetUserAction(debugger);
164  //#//
165  // FADS::FadsSteppingAction::GetSteppingAction()->RegisterAction(debugger);
166  //#//f
167  //
168 }

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

G4double QuirksPhysicsTool::PhysicsConstructor::m_charge
private

Definition at line 55 of file QuirkPhysicsTool.h.

◆ m_firstStringLength

G4double QuirksPhysicsTool::PhysicsConstructor::m_firstStringLength
private

Definition at line 58 of file QuirkPhysicsTool.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_mass

G4double QuirksPhysicsTool::PhysicsConstructor::m_mass
private

Definition at line 54 of file QuirkPhysicsTool.h.

◆ m_maxBoost

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxBoost
private

Definition at line 59 of file QuirkPhysicsTool.h.

◆ m_maxMergeMag

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxMergeMag
private

Definition at line 61 of file QuirkPhysicsTool.h.

◆ m_maxMergeT

G4double QuirksPhysicsTool::PhysicsConstructor::m_maxMergeT
private

Definition at line 60 of file QuirkPhysicsTool.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_pdgid

G4int QuirksPhysicsTool::PhysicsConstructor::m_pdgid
private

Definition at line 56 of file QuirkPhysicsTool.h.

◆ m_stringForce

G4double QuirksPhysicsTool::PhysicsConstructor::m_stringForce
private

Definition at line 57 of file QuirkPhysicsTool.h.


The documentation for this class was generated from the following files:
QuirksPhysicsTool::PhysicsConstructor::m_pdgid
G4int m_pdgid
Definition: QuirkPhysicsTool.h:56
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
PARTICLEITERATOR
#define PARTICLEITERATOR
Definition: QuirkPhysicsTool.cxx:44
QuirksPhysicsTool::PhysicsConstructor::m_charge
G4double m_charge
Definition: QuirkPhysicsTool.h:55
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
QuirkTransportation
Definition: QuirkTransportation.h:60
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
IPhysicsContructor::IPhysicsContructor
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.
Definition: IPhysicsConstructor.h:44
QuirksPhysicsTool::PhysicsConstructor::m_maxMergeT
G4double m_maxMergeT
Definition: QuirkPhysicsTool.h:60
QuirksPhysicsTool::PhysicsConstructor::m_firstStringLength
G4double m_firstStringLength
Definition: QuirkPhysicsTool.h:58
Quirk::GetStringIn
const InfracolorForce & GetStringIn() const
Definition: Quirk.h:29
QuirkWatcher
Definition: QuirkWatcher.h:11
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
QuirksPhysicsTool::PhysicsConstructor::m_mass
G4double m_mass
Definition: QuirkPhysicsTool.h:54
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
Quirk
Definition: Quirk.h:12
InfracolorForce
Definition: InfracolorForce.h:14
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
QuirksPhysicsTool::PhysicsConstructor::m_maxMergeMag
G4double m_maxMergeMag
Definition: QuirkPhysicsTool.h:61
charge
double charge(const T &p)
Definition: AtlasPID.h:931
QuirksPhysicsTool::PhysicsConstructor::m_stringForce
G4double m_stringForce
Definition: QuirkPhysicsTool.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
QuirkStackingAction
Definition: QuirkStackingAction.h:11
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
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
QuirksPhysicsTool::PhysicsConstructor::m_maxBoost
G4double m_maxBoost
Definition: QuirkPhysicsTool.h:59