Sensitive detector tool which manages inactive-area LAr calib SDs.
More...
#include <InactiveSDTool.h>
|
| Gaudi::Property< std::vector< std::string > > | m_barPreVolumes {this, "BarrelPreVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_barVolumes {this, "BarrelVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_ECPosInVolumes {this, "ECPosInVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_ECPosOutVolumes {this, "ECPosOutVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_ECNegInVolumes {this, "ECNegInVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_ECNegOutVolumes {this, "ECNegOutVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_HECWheelVolumes {this, "HECWheelVolumes"} |
| Gaudi::Property< std::vector< std::string > > | m_fcal1Volumes {this, "FCAL1Volumes"} |
| Gaudi::Property< std::vector< std::string > > | m_fcal2Volumes {this, "FCAL2Volumes"} |
| Gaudi::Property< std::vector< std::string > > | m_fcal3Volumes {this, "FCAL3Volumes"} |
| Gaudi::Property< std::string > | m_hitCollName {this, "HitCollectionName", "LArCalibrationHitInactive"} |
| | Hit collection name.
|
| ServiceHandle< ILArCalibCalculatorSvc > | m_embpscalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_embcalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_emepiwcalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_emeniwcalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_emepowcalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_emenowcalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_heccalc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_fcal1calc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_fcal2calc |
| ServiceHandle< ILArCalibCalculatorSvc > | m_fcal3calc |
| G4VSensitiveDetector * | m_SD {} |
| | The sensitive detector to which this thing corresponds.
|
Sensitive detector tool which manages inactive-area LAr calib SDs.
Design is in flux.
Definition at line 24 of file InactiveSDTool.h.
◆ InactiveSDTool()
| LArG4::InactiveSDTool::InactiveSDTool |
( |
const std::string & | type, |
|
|
const std::string & | name, |
|
|
const IInterface * | parent ) |
◆ assignSD()
| StatusCode SensitiveDetectorBase::assignSD |
( |
std::unique_ptr< 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.
66{
67
68 if(msgLvl(MSG::VERBOSE))
sd->SetVerboseLevel(10);
69 else if(msgLvl(MSG::DEBUG))
sd->SetVerboseLevel(5);
70
71
72
73 auto sdMgr = G4SDManager::GetSDMpointer();
74 auto sdPtr =
sd.get();
75
76
77 auto sdName =
sd->GetName();
78 sdMgr->AddNewDetector(
sd.release());
79
80 if(!volumes.empty()) {
81 bool gotOne = false;
82 auto logicalVolumeStore = G4LogicalVolumeStore::GetInstance();
83 for(const auto& volumeName : volumes) {
84
85
86 int numFound = 0;
87
88
89 for(auto* logVol : *logicalVolumeStore) {
90
91 ATH_MSG_VERBOSE(
"Check whether "<<logVol->GetName()<<
" belongs to the set of sensitive detectors "<<volumeName);
92 if(
matchStrings( volumeName.data(), logVol->GetName() ) ){
93 ++numFound;
95 }
96
97 }
98
99 if(numFound == 0) {
101 " not found in G4LogicalVolumeStore.");
102 }
103 else {
104 ATH_MSG_VERBOSE(
"Found " << numFound <<
" copies of LV " << volumeName <<
105 "; SD " << sdName << " assigned.");
106 gotOne = true;
107 }
108
109 }
110
111
112 if(!gotOne) {
114 " and expected at least one. Size of the volume store "<<G4LogicalVolumeStore::GetInstance()->
size() );
115 return StatusCode::FAILURE;
116 }
117 }
118
119 return StatusCode::SUCCESS;
120}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
size_t size() const
Number of registered mappings.
static bool matchStrings(const char *first, const char *second)
Match two strings with wildcard support.
void SetSensitiveDetector(G4LogicalVolume *, G4VSensitiveDetector *) const
Method stolen from G4VUserDetectorConstruction in G4 10.2.
◆ deadHitCollectionName()
| std::string LArG4::InactiveSDTool::deadHitCollectionName |
( |
| ) |
const |
|
finaloverrideprivatevirtual |
◆ Gather() [1/2]
|
|
finaloverridevirtualinherited |
◆ Gather() [2/2]
| virtual StatusCode SensitiveDetectorBase::Gather |
( |
| ) |
|
|
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 122 of file SensitiveDetectorBase.cxx.
123{
124#ifdef G4MULTITHREADED
125
126 const auto tid = std::this_thread::get_id();
127
128 auto sdPair = m_sdThreadMap.find(tid);
129 if(sdPair == m_sdThreadMap.end()) return nullptr;
130 return sdPair->second;
131#else
133#endif
134}
G4VSensitiveDetector * m_SD
The sensitive detector to which this thing corresponds.
◆ hitCollectionName()
| std::string LArG4::InactiveSDTool::hitCollectionName |
( |
| ) |
const |
|
finaloverrideprivatevirtual |
◆ initialize()
| StatusCode LArG4::CalibSDTool::initialize |
( |
| ) |
|
|
finaloverrideinherited |
◆ initializeCalculators()
| StatusCode LArG4::InactiveSDTool::initializeCalculators |
( |
| ) |
|
|
finaloverrideprivatevirtual |
◆ initializeSD()
| StatusCode LArG4::CalibSDTool::initializeSD |
( |
| ) |
|
|
finaloverrideinherited |
Create and register all SDs for the current thread.
◆ makeOneSD()
Helper method to create one SD.
◆ makeSD()
| G4VSensitiveDetector * LArG4::InactiveSDTool::makeSD |
( |
| ) |
const |
|
finaloverrideprivate |
Create the SDs 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 149 of file SensitiveDetectorBase.cxx.
150{
151
152 if (*first == '\0' && *second == '\0')
153 return true;
154
155
156
157 if(*first == '*' && *(first + 1) == '*')
159
160
161 if (*first == '*' && *(first + 1) != '\0' && *second == '\0')
162 return false;
163
164
165 if (*first == *second)
167
168
169
170
171 if (*first == '*')
173 return false;
174}
◆ setSD()
| void SensitiveDetectorBase::setSD |
( |
G4VSensitiveDetector * | sd | ) |
|
|
privateinherited |
Set the current SD.
In hive, this gets assigned as the thread-local SD.
Definition at line 136 of file SensitiveDetectorBase.cxx.
137{
138#ifdef G4MULTITHREADED
139 const auto tid = std::this_thread::get_id();
140 ATH_MSG_DEBUG(
"Creating and registering SD " << sd <<
" in thread " << tid);
141 m_sdThreadMap.insert( std::make_pair(tid, sd) );
142#else
144#endif
145}
◆ SetSensitiveDetector()
| void SensitiveDetectorBase::SetSensitiveDetector |
( |
G4LogicalVolume * | logVol, |
|
|
G4VSensitiveDetector * | aSD ) const |
|
protectedinherited |
Method stolen from G4VUserDetectorConstruction in G4 10.2.
Definition at line 176 of file SensitiveDetectorBase.cxx.
178{
179
180
181
182
183 G4VSensitiveDetector* originalSD = logVol->GetSensitiveDetector();
184 if ( originalSD == nullptr )
185 {
186 logVol->SetSensitiveDetector(aSD);
187 }
188 else
189 {
190 G4MultiSensitiveDetector* msd = dynamic_cast<G4MultiSensitiveDetector*>(originalSD);
191 if ( msd != nullptr )
192 {
193 msd->AddSD(aSD);
194 }
195 else
196 {
197
198 std::stringstream
ss;
200 const G4String msdname =
"/MultiSD_" + logVol->GetName() +
ss.str();
201 msd = new G4MultiSensitiveDetector(std::move(msdname));
202
203 G4SDManager::GetSDMpointer()->AddNewDetector(msd);
204 msd->AddSD(originalSD);
205 msd->AddSD(aSD);
206 logVol->SetSensitiveDetector(msd);
207 }
208 }
209}
◆ SetupEvent() [1/2]
|
|
finaloverridevirtualinherited |
◆ SetupEvent() [2/2]
| virtual StatusCode SensitiveDetectorBase::SetupEvent |
( |
| ) |
|
|
inlineoverridevirtualinherited |
Beginning of an athena event.
This is where collection initialization should happen. If we are using a WriteHandle, then this could be empty.
Definition at line 70 of file SensitiveDetectorBase.h.
70{ return StatusCode::SUCCESS; }
◆ srHitCollectionName()
| virtual std::string LArG4::CalibSDTool::srHitCollectionName |
( |
| ) |
const |
|
protectedvirtualinherited |
◆ m_barPreVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_barPreVolumes {this, "BarrelPreVolumes"} |
|
private |
◆ m_barVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_barVolumes {this, "BarrelVolumes"} |
|
private |
◆ 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 88 of file CalibSDTool.h.
88{this, "ParticleID", false};
◆ m_ECNegInVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_ECNegInVolumes {this, "ECNegInVolumes"} |
|
private |
◆ m_ECNegOutVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_ECNegOutVolumes {this, "ECNegOutVolumes"} |
|
private |
◆ m_ECPosInVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_ECPosInVolumes {this, "ECPosInVolumes"} |
|
private |
◆ m_ECPosOutVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_ECPosOutVolumes {this, "ECPosOutVolumes"} |
|
private |
◆ m_embcalc
Initial value:{this, "EMBCalibrationCalculator"
, "BarrelCalibrationCalculator"}
Definition at line 58 of file InactiveSDTool.h.
58 {this, "EMBCalibrationCalculator"
59 , "BarrelCalibrationCalculator"};
◆ m_embpscalc
Initial value:{this, "EMBPSCalibrationCalculator"
, "BarrelPresamplerCalibrationCalculator"}
Definition at line 56 of file InactiveSDTool.h.
56 {this, "EMBPSCalibrationCalculator"
57 , "BarrelPresamplerCalibrationCalculator"};
◆ m_emeniwcalc
Initial value:{this, "EMECNegIWCalibrationCalculator"
, "EMECNegInnerWheelCalibrationCalculator"}
Definition at line 62 of file InactiveSDTool.h.
62 {this, "EMECNegIWCalibrationCalculator"
63 , "EMECNegInnerWheelCalibrationCalculator"};
◆ m_emenowcalc
Initial value:{this, "EMECNegOWCalibrationCalculator"
, "EMECNegOuterWheelCalibrationCalculator"}
Definition at line 66 of file InactiveSDTool.h.
66 {this, "EMECNegOWCalibrationCalculator"
67 , "EMECNegOuterWheelCalibrationCalculator"};
◆ m_emepiwcalc
Initial value:{this, "EMECPosIWCalibrationCalculator"
, "EMECPosInnerWheelCalibrationCalculator"}
Definition at line 60 of file InactiveSDTool.h.
60 {this, "EMECPosIWCalibrationCalculator"
61 , "EMECPosInnerWheelCalibrationCalculator"};
◆ m_emepowcalc
Initial value:{this, "EMECPosOWCalibrationCalculator"
, "EMECPosOuterWheelCalibrationCalculator"}
Definition at line 64 of file InactiveSDTool.h.
64 {this, "EMECPosOWCalibrationCalculator"
65 , "EMECPosOuterWheelCalibrationCalculator"};
◆ m_fcal1calc
Initial value:{this, "FCAL1CalibCalculator"
, "FCAL1CalibCalculator"}
Definition at line 70 of file InactiveSDTool.h.
70 {this, "FCAL1CalibCalculator"
71 , "FCAL1CalibCalculator"};
◆ m_fcal1Volumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_fcal1Volumes {this, "FCAL1Volumes"} |
|
private |
◆ m_fcal2calc
Initial value:{this, "FCAL2CalibCalculator"
, "FCAL2CalibCalculator"}
Definition at line 72 of file InactiveSDTool.h.
72 {this, "FCAL2CalibCalculator"
73 , "FCAL2CalibCalculator"};
◆ m_fcal2Volumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_fcal2Volumes {this, "FCAL2Volumes"} |
|
private |
◆ m_fcal3calc
Initial value:{this, "FCAL3CalibCalculator"
, "FCAL3CalibCalculator"}
Definition at line 74 of file InactiveSDTool.h.
74 {this, "FCAL3CalibCalculator"
75 , "FCAL3CalibCalculator"};
◆ m_fcal3Volumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_fcal3Volumes {this, "FCAL3Volumes"} |
|
private |
◆ m_heccalc
Initial value:{this, "HECWheelInactiveCalculator"
, "HECCalibrationWheelInactiveCalculator"}
Definition at line 68 of file InactiveSDTool.h.
68 {this, "HECWheelInactiveCalculator"
69 , "HECCalibrationWheelInactiveCalculator"};
◆ m_HECWheelVolumes
| Gaudi::Property<std::vector<std::string> > LArG4::InactiveSDTool::m_HECWheelVolumes {this, "HECWheelVolumes"} |
|
private |
◆ m_hitCollName
| Gaudi::Property<std::string> LArG4::InactiveSDTool::m_hitCollName {this, "HitCollectionName", "LArCalibrationHitInactive"} |
|
private |
Hit collection name.
Definition at line 54 of file InactiveSDTool.h.
54{this, "HitCollectionName", "LArCalibrationHitInactive"};
◆ m_id_helper
◆ m_larEmID
◆ m_larFcalID
◆ m_larHecID
◆ m_noVolumes
| Gaudi::Property<bool> SensitiveDetectorBase::m_noVolumes {this, "NoVolumes", false} |
|
protectedinherited |
This SensitiveDetector has no volumes associated with it.
Definition at line 101 of file SensitiveDetectorBase.h.
101{this, "NoVolumes", false};
◆ m_outputCollectionNames
| Gaudi::Property<std::vector<std::string> > SensitiveDetectorBase::m_outputCollectionNames {this, "OutputCollectionNames", {}} |
|
protectedinherited |
Names of all output collections written out by this SD.
Definition at line 98 of file SensitiveDetectorBase.h.
98{this, "OutputCollectionNames", {}};
◆ m_SD
| G4VSensitiveDetector* SensitiveDetectorBase::m_SD {} |
|
privateinherited |
◆ m_volumeNames
| Gaudi::Property<std::vector<std::string> > SensitiveDetectorBase::m_volumeNames {this, "LogicalVolumeNames", {}} |
|
protectedinherited |
All the volumes to which this SD is assigned.
Definition at line 96 of file SensitiveDetectorBase.h.
96{this, "LogicalVolumeNames", {}};
The documentation for this class was generated from the following file: