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

#include <DeadMaterialShowerTool.h>

Inheritance diagram for DeadMaterialShowerTool:
Collaboration diagram for DeadMaterialShowerTool:

Public Member Functions

 DeadMaterialShowerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Default constructor. More...
 
 ~DeadMaterialShowerTool ()
 
StatusCode initializeFastSim () override
 Construct and setup the fast simulation model. More...
 
virtual StatusCode BeginOfAthenaEvent () override
 Begin of an athena event - do anything that needs to be done at the beginning of each athena event. More...
 
virtual StatusCode EndOfAthenaEvent () override
 End of an athena event - do any tidying up required at the end of each athena event. More...
 

Protected Member Functions

virtual G4VFastSimulationModel * makeFastSimModel () override final
 Method to make the actual fast simulation model itself, which will be owned by the tool. More...
 
G4VFastSimulationModel * getFastSimModel ()
 Retrieve the current Fast Simulation Model. More...
 
G4Region * getRegion () const
 

Protected Attributes

Gaudi::Property< std::string > m_regionName {this, "RegionName", ""}
 The region to which this fast sim is assigned. More...
 
Gaudi::Property< bool > m_noRegions {this, "NoRegions", false}
 This Fast Simulation has no regions associated with it. More...
 

Private Member Functions

void setFastSimModel (G4VFastSimulationModel *)
 Set the current model. In hive, this gets assigned as the thread-local model. More...
 
void deleteFastSimModel ()
 Delete the current model. More...
 

Private Attributes

double m_highEnergy
 
double m_lowEnergy
 !< Kill everything but muons up to this energy More...
 
double m_zcutoff
 !< Kill only electrons and positrons up to this energy More...
 
G4VFastSimulationModel * m_FastSimModel {}
 The Fast Simulation Model to which this thing corresponds. More...
 

Detailed Description

Definition at line 11 of file DeadMaterialShowerTool.h.

Constructor & Destructor Documentation

◆ DeadMaterialShowerTool()

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

Default constructor.

Definition at line 11 of file DeadMaterialShowerTool.cxx.

13 {
14  declareProperty( "HighEnergy" , m_highEnergy = 1000.0*CLHEP::GeV , "Kill everything but muons up to this energy" );
15  declareProperty( "LowEnergy" , m_lowEnergy = 0.0*CLHEP::GeV , "Kill only electrons and positrons up to this energy" );
16  declareProperty( "ZCutoff" , m_zcutoff = 5698.*CLHEP::mm , "Z-position to start killing everything but muons" );
17 }

◆ ~DeadMaterialShowerTool()

DeadMaterialShowerTool::~DeadMaterialShowerTool ( )
inline

Definition at line 16 of file DeadMaterialShowerTool.h.

16 {}

Member Function Documentation

◆ BeginOfAthenaEvent()

virtual StatusCode FastSimulationBase::BeginOfAthenaEvent ( )
inlineoverridevirtualinherited

Begin of an athena event - do anything that needs to be done at the beginning of each athena event.

Reimplemented in FastCaloSimTool.

Definition at line 42 of file FastSimulationBase.h.

42 { return StatusCode::SUCCESS; }

◆ deleteFastSimModel()

void FastSimulationBase::deleteFastSimModel ( )
privateinherited

Delete the current model.

Definition at line 78 of file FastSimulationBase.cxx.

79 {
80 #ifdef G4MULTITHREADED
81  for(auto& threadMapPair : m_fastsimmodelThreadMap)
82  {
83  auto fastSimModel = threadMapPair.second;
84  if (fastSimModel)
85  delete fastSimModel;
86  }
87  m_fastsimmodelThreadMap.clear();
88 #else
89  if(m_FastSimModel)
90  {
91  delete m_FastSimModel;
92  m_FastSimModel = 0;
93  }
94 #endif
95 }

◆ EndOfAthenaEvent()

virtual StatusCode FastSimulationBase::EndOfAthenaEvent ( )
inlineoverridevirtualinherited

End of an athena event - do any tidying up required at the end of each athena event.

Reimplemented in FastCaloSimTool.

Definition at line 45 of file FastSimulationBase.h.

45 { return StatusCode::SUCCESS; }

◆ getFastSimModel()

G4VFastSimulationModel * FastSimulationBase::getFastSimModel ( )
protectedinherited

Retrieve the current Fast Simulation Model.

In MT, this means the thread-local Fast Simulation Model. Otherwise, it is simply the single Fast Simulation Model.

Definition at line 52 of file FastSimulationBase.cxx.

53 {
54 #ifdef G4MULTITHREADED
55  // Get current thread-ID
56  const auto tid = std::this_thread::get_id();
57  // Retrieve it from the FastSimModel map
58  auto fastsimmodelPair = m_fastsimmodelThreadMap.find(tid);
59  if(fastsimmodelPair == m_fastsimmodelThreadMap.end()) return nullptr;
60  return fastsimmodelPair->second;
61 #else
62  return m_FastSimModel;
63 #endif
64 }

◆ getRegion()

G4Region * FastSimulationBase::getRegion ( ) const
protectedinherited

Definition at line 22 of file FastSimulationBase.cxx.

23 {
24  if (m_regionName.value().empty()) {
25  return nullptr;
26  }
27  return G4RegionStore::GetInstance()->GetRegion(m_regionName.value());
28 }

◆ initializeFastSim()

StatusCode FastSimulationBase::initializeFastSim ( )
overrideinherited

Construct and setup the fast simulation model.

This method invokes the makeFastSimModel of the derived concrete tool type and assigns the configured regions. Errors are reported if regions are missing. In multi-threading jobs, this method is called once per worker thread.

Definition at line 32 of file FastSimulationBase.cxx.

32  {
33  ATH_MSG_VERBOSE( name() << "::initializeFastSim()" );
34 
35  // Make sure Fast Simulation Model isn't already registered
36  if(getFastSimModel()){
37  ATH_MSG_ERROR("Trying to create a Fast Simulation Model which already exists!");
38  return StatusCode::FAILURE;
39  }
40 
41  // Make the FastSimModel stored by this tool
42  auto* fastsimmodel = makeFastSimModel();
43  setFastSimModel(fastsimmodel);
44 
45  // Set the verbosity information on this thing - this will have to go into the makeFastSimModel methods...
46  //if(msgLvl(MSG::VERBOSE)) m_FastSimModel->SetVerboseLevel(10);
47  //else if(msgLvl(MSG::DEBUG)) m_FastSimModel->SetVerboseLevel(5);
48 
49  return StatusCode::SUCCESS;
50 }

◆ makeFastSimModel()

G4VFastSimulationModel * DeadMaterialShowerTool::makeFastSimModel ( )
finaloverrideprotectedvirtual

Method to make the actual fast simulation model itself, which will be owned by the tool.

Must be implemented in all concrete base classes.

Definition at line 19 of file DeadMaterialShowerTool.cxx.

20 {
21  ATH_MSG_DEBUG( "Initializing Fast Sim Model" );
22 
23  // Create a fresh Fast Sim Model
25 }

◆ setFastSimModel()

void FastSimulationBase::setFastSimModel ( G4VFastSimulationModel *  fastsimmodel)
privateinherited

Set the current model. In hive, this gets assigned as the thread-local model.

Definition at line 66 of file FastSimulationBase.cxx.

67 {
68 #ifdef G4MULTITHREADED
69  // Make sure one isn't already assigned
70  const auto tid = std::this_thread::get_id();
71  ATH_MSG_DEBUG("Creating and registering FastSimModel " << fastsimmodel << " in thread " << tid);
72  m_fastsimmodelThreadMap.insert( std::make_pair(tid, fastsimmodel) );
73 #else
74  m_FastSimModel = fastsimmodel;
75 #endif
76 }

Member Data Documentation

◆ m_FastSimModel

G4VFastSimulationModel* FastSimulationBase::m_FastSimModel {}
privateinherited

The Fast Simulation Model to which this thing corresponds.

Definition at line 78 of file FastSimulationBase.h.

◆ m_highEnergy

double DeadMaterialShowerTool::m_highEnergy
private

Definition at line 25 of file DeadMaterialShowerTool.h.

◆ m_lowEnergy

double DeadMaterialShowerTool::m_lowEnergy
private

!< Kill everything but muons up to this energy

Definition at line 26 of file DeadMaterialShowerTool.h.

◆ m_noRegions

Gaudi::Property<bool> FastSimulationBase::m_noRegions {this, "NoRegions", false}
protectedinherited

This Fast Simulation has no regions associated with it.

Definition at line 59 of file FastSimulationBase.h.

◆ m_regionName

Gaudi::Property<std::string> FastSimulationBase::m_regionName {this, "RegionName", ""}
protectedinherited

The region to which this fast sim is assigned.

Definition at line 57 of file FastSimulationBase.h.

◆ m_zcutoff

double DeadMaterialShowerTool::m_zcutoff
private

!< Kill only electrons and positrons up to this energy

Definition at line 27 of file DeadMaterialShowerTool.h.


The documentation for this class was generated from the following files:
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:18
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
DeadMaterialShowerTool::m_lowEnergy
double m_lowEnergy
!< Kill everything but muons up to this energy
Definition: DeadMaterialShowerTool.h:26
FastSimulationBase::m_regionName
Gaudi::Property< std::string > m_regionName
The region to which this fast sim is assigned.
Definition: FastSimulationBase.h:57
FastSimulationBase::m_FastSimModel
G4VFastSimulationModel * m_FastSimModel
The Fast Simulation Model to which this thing corresponds.
Definition: FastSimulationBase.h:78
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
DeadMaterialShowerTool::m_zcutoff
double m_zcutoff
!< Kill only electrons and positrons up to this energy
Definition: DeadMaterialShowerTool.h:27
FastSimulationBase::setFastSimModel
void setFastSimModel(G4VFastSimulationModel *)
Set the current model. In hive, this gets assigned as the thread-local model.
Definition: FastSimulationBase.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FastSimulationBase::FastSimulationBase
FastSimulationBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: FastSimulationBase.cxx:12
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DeadMaterialShowerTool::m_highEnergy
double m_highEnergy
Definition: DeadMaterialShowerTool.h:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
FastSimulationBase::getFastSimModel
G4VFastSimulationModel * getFastSimModel()
Retrieve the current Fast Simulation Model.
Definition: FastSimulationBase.cxx:52
DeadMaterialShower
Definition: DeadMaterialShower.h:17
FastSimulationBase::getRegion
G4Region * getRegion() const
Definition: FastSimulationBase.cxx:22