 |
ATLAS Offline Software
|
A base class for tools that manage FCS_StepInfoSDs.
More...
#include <FCS_StepInfoSDTool.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...
|
|
A base class for tools that manage FCS_StepInfoSDs.
- Todo:
- Add more details.
- Author
- Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch
Definition at line 40 of file FCS_StepInfoSDTool.h.
◆ FCS_StepInfoSDTool()
FCS_Param::FCS_StepInfoSDTool::FCS_StepInfoSDTool |
( |
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 69 of file SensitiveDetectorBase.cxx.
78 auto sdMgr = G4SDManager::GetSDMpointer();
79 sdMgr->AddNewDetector(
sd);
81 if(!volumes.empty()) {
83 auto logicalVolumeStore = G4LogicalVolumeStore::GetInstance();
84 for(
const auto& volumeName : volumes) {
90 for(
auto* logVol : *logicalVolumeStore) {
92 ATH_MSG_VERBOSE(
"Check whether "<<logVol->GetName()<<
" belongs to the set of sensitive detectors "<<volumeName);
93 if(
matchStrings( volumeName.data(), logVol->GetName() ) ){
102 " not found in G4LogicalVolumeStore.");
105 ATH_MSG_VERBOSE(
"Found " << numFound <<
" copies of LV " << volumeName <<
106 "; SD " <<
sd->GetName() <<
" assigned.");
115 " and expected at least one. Size of the volume store "<<G4LogicalVolumeStore::GetInstance()->
size() );
116 return StatusCode::FAILURE;
120 return StatusCode::SUCCESS;
◆ Gather() [1/2]
StatusCode FCS_Param::FCS_StepInfoSDTool::Gather |
( |
| ) |
|
|
finaloverridevirtual |
Calls down to all the SDs to pack their hits into one collection.
Reimplemented from SensitiveDetectorBase.
Definition at line 168 of file FCS_StepInfoSDTool.cxx.
173 return StatusCode::FAILURE;
175 sdWrapper->EndOfAthenaEvent();
176 return StatusCode::SUCCESS;
◆ 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 123 of file SensitiveDetectorBase.cxx.
125 #ifdef G4MULTITHREADED
127 const auto tid = std::this_thread::get_id();
129 auto sdPair = m_sdThreadMap.find(tid);
130 if(sdPair == m_sdThreadMap.end())
return nullptr;
131 return sdPair->second;
◆ initialize()
StatusCode FCS_Param::FCS_StepInfoSDTool::initialize |
( |
| ) |
|
|
finaloverride |
Initialize the tool.
Definition at line 108 of file FCS_StepInfoSDTool.cxx.
116 return StatusCode::FAILURE;
121 return StatusCode::FAILURE;
126 return StatusCode::FAILURE;
131 return StatusCode::FAILURE;
139 return StatusCode::SUCCESS;
◆ initializeCalculators()
StatusCode FCS_Param::FCS_StepInfoSDTool::initializeCalculators |
( |
| ) |
|
|
privatevirtual |
◆ 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 30 of file SensitiveDetectorBase.cxx.
38 << (
m_noVolumes?
"true" :
"false") <<
", but LogicalVolumeNames = "
40 return StatusCode::FAILURE;
47 return StatusCode::FAILURE;
55 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
◆ makeOneLArSD()
Helper method to create one SD.
Definition at line 223 of file FCS_StepInfoSDTool.cxx.
236 throw GaudiException(
237 "nullptr for ILArCalculatorSvc provided to constructor for: " + sdName,
238 name(), StatusCode::FAILURE);
246 std::unique_ptr<FCS_StepInfoSD>
sd =
247 std::make_unique<LArFCS_StepInfoSD>(sdName,
config);
251 if (this->
assignSD(sd.get(), parsedVolumes).isFailure()) {
253 throw GaudiException(
"Failed to assign sd: " + sdName,
name(),
254 StatusCode::FAILURE);
◆ makeOneTileSD()
Helper method to create one SD.
Definition at line 262 of file FCS_StepInfoSDTool.cxx.
271 throw GaudiException(
272 "nullptr for ITileCalculator provided to constructor for: " + sdName,
273 name(), StatusCode::FAILURE);
281 std::unique_ptr<FCS_StepInfoSD>
sd =
282 std::make_unique<TileFCS_StepInfoSD>(sdName,
config);
286 if (this->
assignSD(sd.get(), volumes).isFailure()) {
288 throw GaudiException(
"Failed to assign sd: " + sdName,
name(),
289 StatusCode::FAILURE);
◆ makeSD()
G4VSensitiveDetector * FCS_Param::FCS_StepInfoSDTool::makeSD |
( |
| ) |
const |
|
finaloverrideprivate |
Create the SD wrapper for current worker thread.
Definition at line 182 of file FCS_StepInfoSDTool.cxx.
188 sdWrapper->addSD(
makeOneLArSD(
"Barrel::Presampler::Module::StepInfo",
192 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Pos::InnerWheel::StepInfo",
194 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Neg::InnerWheel::StepInfo",
196 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Pos::OuterWheel::StepInfo",
198 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Neg::OuterWheel::StepInfo",
200 sdWrapper->addSD(
makeOneLArSD(
"Endcap::Presampler::LiquidArgon::StepInfo",
202 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Pos::BackOuterBarrette::StepInfo",
204 sdWrapper->addSD(
makeOneLArSD(
"EMEC::Neg::BackOuterBarrette::StepInfo",
212 sdWrapper->addSD(
makeOneLArSD(
"HEC::Module::Depth::Slice::Wheel::StepInfo",
214 sdWrapper->addSD(
makeOneTileSD(
"Tile::Scintillator::StepInfo",
◆ 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 150 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 137 of file SensitiveDetectorBase.cxx.
139 #ifdef G4MULTITHREADED
140 const auto tid = std::this_thread::get_id();
141 ATH_MSG_DEBUG(
"Creating and registering SD " <<
sd <<
" in thread " << tid);
142 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 177 of file SensitiveDetectorBase.cxx.
184 G4VSensitiveDetector* originalSD = logVol->GetSensitiveDetector();
185 if ( originalSD ==
nullptr )
187 logVol->SetSensitiveDetector(aSD);
191 G4MultiSensitiveDetector* msd =
dynamic_cast<G4MultiSensitiveDetector*
>(originalSD);
192 if ( msd !=
nullptr )
199 std::stringstream
ss;
200 ss << static_cast<const void*>(logVol);
201 const G4String msdname =
"/MultiSD_" + logVol->GetName() +
ss.str();
203 msd =
new G4MultiSensitiveDetector(msdname);
205 G4SDManager::GetSDMpointer()->AddNewDetector(msd);
206 msd->AddSD(originalSD);
208 logVol->SetSensitiveDetector(msd);
◆ SetupEvent() [1/2]
virtual StatusCode SensitiveDetectorBase::SetupEvent |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ SetupEvent() [2/2]
|
inlineoverridevirtualinherited |
◆ m_bpsmodcalc
◆ m_config
◆ m_embcalc
◆ m_emeniwcalc
◆ m_emenobarcalc
◆ m_emenowcalc
◆ m_emepiwcalc
◆ m_emepobarcalc
◆ m_emepowcalc
◆ m_emepscalc
◆ m_fcal1calc
◆ m_fcal1Volumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_fcal1Volumes |
|
private |
◆ m_fcal2calc
◆ m_fcal2Volumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_fcal2Volumes |
|
private |
◆ m_fcal3calc
◆ m_fcal3Volumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_fcal3Volumes |
|
private |
◆ m_heccalc
◆ m_hitCollName
std::string FCS_Param::FCS_StepInfoSDTool::m_hitCollName |
|
private |
◆ m_larEmID
◆ m_larFcalID
◆ m_larHecID
◆ m_nBOBVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_nBOBVolumes |
|
private |
◆ m_negIWVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_negIWVolumes |
|
private |
◆ m_negOWVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_negOWVolumes |
|
private |
◆ 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_pBOBVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_pBOBVolumes |
|
private |
◆ m_posIWVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_posIWVolumes |
|
private |
◆ m_posOWVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_posOWVolumes |
|
private |
◆ m_presBarVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_presBarVolumes |
|
private |
◆ m_presECVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_presECVolumes |
|
private |
◆ m_SD
G4VSensitiveDetector* SensitiveDetectorBase::m_SD {} |
|
privateinherited |
◆ m_sliceVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_sliceVolumes |
|
private |
◆ m_stacVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_stacVolumes |
|
private |
◆ m_tileCalculator
◆ m_tileID
◆ m_tileVolumes
std::vector<std::string> FCS_Param::FCS_StepInfoSDTool::m_tileVolumes |
|
private |
◆ m_volumeNames
Gaudi::Property<std::vector<std::string> > SensitiveDetectorBase::m_volumeNames {this, "LogicalVolumeNames", {}} |
|
protectedinherited |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
virtual StatusCode SetupEvent() override
Beginning of an athena event.
G4VSensitiveDetector * m_SD
The sensitive detector to which this thing corresponds.
std::vector< double > m_maxRadiusLateral
property, see LArG4GenShowerLib::LArG4GenShowerLib
const LArEM_ID * getEM_ID(void) const
std::set< std::string > findLogicalVolumes(const std::string &pattern)
Search for logical volumes in the G4 volume store.
SensitiveDetectorBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
#define ATH_MSG_VERBOSE(x)
G4VSensitiveDetector * getSD()
Retrieve the current SD.
std::vector< double > m_maxRadiusLongitudinal
property, see LArG4GenShowerLib::LArG4GenShowerLib
const TileID * getTileID(void) const
const LArHEC_ID * getHEC_ID(void) const
This class initializes the Calo (LAr and Tile) offline identifiers.
const LArFCAL_ID * getFCAL_ID(void) const
#define CHECK(...)
Evaluate an expression and check for errors.
detail::SDWrapper< FCS_StepInfoSD, ISF_FCS_Parametrization::FCS_StepInfoCollection > FCS_StepInfoSDWrapper
Template instantiation for LArG4SimpleSD.
void SetSensitiveDetector(G4LogicalVolume *, G4VSensitiveDetector *) const
Method stolen from G4VUserDetectorConstruction in G4 10.2.
static bool matchStrings(const char *first, const char *second)
Match two strings with wildcard support.
Gaudi::Property< std::vector< std::string > > m_volumeNames
All the volumes to which this SD is assigned.
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_noVolumes
This SensitiveDetector has no volumes associated with it.
A template class which wraps multiple sensitive detectors.
virtual StatusCode Gather() override
End of an athena event.
void setSD(G4VSensitiveDetector *)
Set the current SD.
StatusCode assignSD(G4VSensitiveDetector *sd, const std::vector< std::string > &volumes) const
Assign SD to a list of volumes.