Tool for constructing H62004 calib SDs for inactive material.
More...
#include <H62004InactiveSDTool.h>
|
| Gaudi::Property< std::vector< std::string > > | m_volumeNames {this, "LogicalVolumeNames", {}} |
| | All the volumes to which this SD is assigned. More...
|
| |
| Gaudi::Property< std::vector< std::string > > | m_outputCollectionNames {this, "OutputCollectionNames", {}} |
| | Names of all output collections written out by this SD. More...
|
| |
| Gaudi::Property< bool > | m_noVolumes {this, "NoVolumes", false} |
| | This SensitiveDetector has no volumes associated with it. More...
|
| |
|
| std::string | m_hitCollName {"LArCalibrationHitInactive"} |
| | Hit collection name. More...
|
| |
| ServiceHandle< ILArCalibCalculatorSvc > | m_emepiwcalc {this, "EMECPosIWCalibrationCalculator", "EMECPosInnerWheelCalibrationCalculator"} |
| |
| ServiceHandle< ILArCalibCalculatorSvc > | m_heccalc {this, "HECWheelInactiveCalculator", "LocalCalibrationInactiveCalculator"} |
| |
| ServiceHandle< ILArCalibCalculatorSvc > | m_fcal1calc {this, "FCAL1CalibCalculator", "LArFCAL1H62004CalibCalculator"} |
| |
| ServiceHandle< ILArCalibCalculatorSvc > | m_fcal2calc {this, "FCAL2CalibCalculator", "LArFCAL2H62004CalibCalculator"} |
| |
| G4VSensitiveDetector * | m_SD {} |
| | The sensitive detector to which this thing corresponds. More...
|
| |
|
| Gaudi::Property< std::vector< std::string > > | m_emecVolumes {this, "EMECVolumes"} |
| |
| Gaudi::Property< std::vector< std::string > > | m_hecVolumes {this, "HECVolumes"} |
| |
| Gaudi::Property< std::vector< std::string > > | m_fcal1Volumes {this, "FCAL1Volumes"} |
| |
| Gaudi::Property< std::vector< std::string > > | m_fcal2Volumes {this, "FCAL2Volumes"} |
| |
Tool for constructing H62004 calib SDs for inactive material.
Based on the previous LArG4H62004InactiveSDTool implementation.
This implementation uses the LAr SD wrapper design for managing multiple SDs when running multi-threaded. See ATLASSIM-2606 for discussions.
Definition at line 27 of file H62004InactiveSDTool.h.
◆ H62004InactiveSDTool()
| LArG4::H62004InactiveSDTool::H62004InactiveSDTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ assignSD()
| StatusCode SensitiveDetectorBase::assignSD |
( |
G4VSensitiveDetector * |
sd, |
|
|
const std::vector< std::string > & |
volumes |
|
) |
| const |
|
protectedinherited |
Assign SD to a list of volumes.
This method supports wild card matching
Definition at line 64 of file SensitiveDetectorBase.cxx.
73 auto sdMgr = G4SDManager::GetSDMpointer();
74 sdMgr->AddNewDetector(
sd);
76 if(!volumes.empty()) {
78 auto logicalVolumeStore = G4LogicalVolumeStore::GetInstance();
79 for(
const auto& volumeName : volumes) {
85 for(
auto* logVol : *logicalVolumeStore) {
87 ATH_MSG_VERBOSE(
"Check whether "<<logVol->GetName()<<
" belongs to the set of sensitive detectors "<<volumeName);
88 if(
matchStrings( volumeName.data(), logVol->GetName() ) ){
97 " not found in G4LogicalVolumeStore.");
100 ATH_MSG_VERBOSE(
"Found " << numFound <<
" copies of LV " << volumeName <<
101 "; SD " <<
sd->GetName() <<
" assigned.");
110 " and expected at least one. Size of the volume store "<<G4LogicalVolumeStore::GetInstance()->
size() );
111 return StatusCode::FAILURE;
115 return StatusCode::SUCCESS;
◆ Gather() [1/2]
| StatusCode LArG4::CalibSDTool::Gather |
( |
| ) |
|
|
finaloverridevirtualinherited |
Calls down to all the SDs to pack their hits into one collection.
Reimplemented from SensitiveDetectorBase.
◆ Gather() [2/2]
|
|
inlineoverridevirtualinherited |
◆ getSD()
| G4VSensitiveDetector * SensitiveDetectorBase::getSD |
( |
| ) |
|
|
protectedinherited |
Retrieve the current SD.
In AthenaMT, this means the thread-local SD. Otherwise, it is simply the single SD.
Definition at line 118 of file SensitiveDetectorBase.cxx.
120 #ifdef G4MULTITHREADED
122 const auto tid = std::this_thread::get_id();
124 auto sdPair = m_sdThreadMap.find(tid);
125 if(sdPair == m_sdThreadMap.end())
return nullptr;
126 return sdPair->second;
◆ initialize()
| StatusCode LArG4::CalibSDTool::initialize |
( |
| ) |
|
|
finaloverrideinherited |
◆ initializeCalculators()
| StatusCode LArG4::H62004InactiveSDTool::initializeCalculators |
( |
| ) |
|
|
finaloverrideprivatevirtual |
◆ initializeSD()
| StatusCode SensitiveDetectorBase::initializeSD |
( |
| ) |
|
|
overrideinherited |
Setup an SD in the current thread.
Separate from the AthAlgTool initialize() method because it needs to be called once per worker thread in AthenaMT. Don't confuse this with the G4 SD method Initialize which is called at the beginning of every G4 event.
Definition at line 25 of file SensitiveDetectorBase.cxx.
33 << (
m_noVolumes?
"true" :
"false") <<
", but LogicalVolumeNames = "
35 return StatusCode::FAILURE;
42 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
◆ makeOneSD()
Override helper method to create one SD.
◆ makeSD()
| G4VSensitiveDetector* LArG4::H62004InactiveSDTool::makeSD |
( |
| ) |
const |
|
finaloverrideprivate |
Create the SD wrapper for current worker thread.
◆ matchStrings()
| bool SensitiveDetectorBase::matchStrings |
( |
const char * |
first, |
|
|
const char * |
second |
|
) |
| |
|
staticprivateinherited |
Match two strings with wildcard support.
Compares two strings character by character with optional * wildcard in the first argument
Definition at line 145 of file SensitiveDetectorBase.cxx.
◆ setSD()
| void SensitiveDetectorBase::setSD |
( |
G4VSensitiveDetector * |
sd | ) |
|
|
privateinherited |
Set the current SD.
In hive, this gets assigned as the thread-local SD.
Definition at line 132 of file SensitiveDetectorBase.cxx.
134 #ifdef G4MULTITHREADED
135 const auto tid = std::this_thread::get_id();
136 ATH_MSG_DEBUG(
"Creating and registering SD " <<
sd <<
" in thread " << tid);
137 m_sdThreadMap.insert( std::make_pair(tid,
sd) );
◆ SetSensitiveDetector()
| void SensitiveDetectorBase::SetSensitiveDetector |
( |
G4LogicalVolume * |
logVol, |
|
|
G4VSensitiveDetector * |
aSD |
|
) |
| const |
|
protectedinherited |
Method stolen from G4VUserDetectorConstruction in G4 10.2.
Definition at line 172 of file SensitiveDetectorBase.cxx.
179 G4VSensitiveDetector* originalSD = logVol->GetSensitiveDetector();
180 if ( originalSD ==
nullptr )
182 logVol->SetSensitiveDetector(aSD);
186 G4MultiSensitiveDetector* msd =
dynamic_cast<G4MultiSensitiveDetector*
>(originalSD);
187 if ( msd !=
nullptr )
194 std::stringstream
ss;
195 ss << static_cast<const void*>(logVol);
196 const G4String msdname =
"/MultiSD_" + logVol->GetName() +
ss.str();
198 msd =
new G4MultiSensitiveDetector(msdname);
200 G4SDManager::GetSDMpointer()->AddNewDetector(msd);
201 msd->AddSD(originalSD);
203 logVol->SetSensitiveDetector(msd);
◆ SetupEvent() [1/2]
| virtual StatusCode SensitiveDetectorBase::SetupEvent |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ SetupEvent() [2/2]
|
|
inlineoverridevirtualinherited |
◆ m_caloDmID
◆ m_doPID
| Gaudi::Property<G4bool> LArG4::CalibSDTool::m_doPID {this, "ParticleID", false} |
|
protectedinherited |
Are we set up to run with PID hits?
Definition at line 74 of file CalibSDTool.h.
◆ m_emecVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::H62004InactiveSDTool::m_emecVolumes {this, "EMECVolumes"} |
|
private |
◆ m_emepiwcalc
◆ m_fcal1calc
◆ m_fcal1Volumes
| Gaudi::Property<std::vector<std::string> > LArG4::H62004InactiveSDTool::m_fcal1Volumes {this, "FCAL1Volumes"} |
|
private |
◆ m_fcal2calc
◆ m_fcal2Volumes
| Gaudi::Property<std::vector<std::string> > LArG4::H62004InactiveSDTool::m_fcal2Volumes {this, "FCAL2Volumes"} |
|
private |
◆ m_heccalc
◆ m_hecVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::H62004InactiveSDTool::m_hecVolumes {this, "HECVolumes"} |
|
private |
◆ m_hitCollName
| std::string LArG4::H62004InactiveSDTool::m_hitCollName {"LArCalibrationHitInactive"} |
|
private |
◆ m_id_helper
◆ m_larEmID
◆ m_larFcalID
◆ m_larHecID
◆ m_noVolumes
| Gaudi::Property<bool> SensitiveDetectorBase::m_noVolumes {this, "NoVolumes", false} |
|
protectedinherited |
◆ m_outputCollectionNames
| Gaudi::Property<std::vector<std::string> > SensitiveDetectorBase::m_outputCollectionNames {this, "OutputCollectionNames", {}} |
|
protectedinherited |
◆ m_SD
| G4VSensitiveDetector* SensitiveDetectorBase::m_SD {} |
|
privateinherited |
◆ m_volumeNames
| Gaudi::Property<std::vector<std::string> > SensitiveDetectorBase::m_volumeNames {this, "LogicalVolumeNames", {}} |
|
protectedinherited |
The documentation for this class was generated from the following file: