|
ATLAS Offline Software
|
#include <MuonSegmentPerformanceAlg.h>
|
| MuonSegmentPerformanceAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~MuonSegmentPerformanceAlg ()=default |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
unsigned int | cardinality () const override final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
bool | retrieve (const SG::ReadHandleKey< xAOD::MuonSegmentContainer > &, const xAOD::MuonSegmentContainer *&ptr) const |
|
std::string | printRatio (const std::string &prefix, unsigned int begin, unsigned int end, const std::vector< int > &reco, const std::vector< int > &truth) const |
|
std::string | printRatio (const std::string &prefix, unsigned int begin, unsigned int end, const std::vector< int > &reco) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 17 of file MuonSegmentPerformanceAlg.h.
◆ StoreGateSvc_t
◆ MuonSegmentPerformanceAlg()
MuonSegmentPerformanceAlg::MuonSegmentPerformanceAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~MuonSegmentPerformanceAlg()
virtual MuonSegmentPerformanceAlg::~MuonSegmentPerformanceAlg |
( |
| ) |
|
|
virtualdefault |
◆ cardinality()
unsigned int MuonSegmentPerformanceAlg::cardinality |
( |
| ) |
const |
|
inlinefinaloverride |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode MuonSegmentPerformanceAlg::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 43 of file MuonSegmentPerformanceAlg.cxx.
49 std::set<const xAOD::MuonSegment*> matchedSegments;
52 bool missedSegment =
false;
53 for (
const auto seg : *truthSegments) {
54 int chIndex = seg->chamberIndex();
59 unsigned int index = 0;
60 if (seg->nPrecisionHits() < 3)
continue;
72 recoSegmentLinkAcc(
"recoSegmentLink");
76 matchedSegments.insert(*recoLink);
80 <<
" eta " << seg->etaIndex() <<
" nprec " << seg->nPrecisionHits() <<
" nphi " << seg->nPhiLayers()
81 <<
" nTrigEta " << seg->nTrigEtaLayers());
87 for (
const auto seg : *segments) {
88 if (matchedSegments.count(seg))
continue;
89 int chIndex = seg->chamberIndex();
95 unsigned int index = 0;
96 if (seg->nPrecisionHits() < 3)
continue;
101 <<
" eta " << seg->etaIndex() <<
" nprec " << seg->nPrecisionHits() <<
" nphi " << seg->nPhiLayers()
102 <<
" nTrigEta " << seg->nTrigEtaLayers());
107 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode MuonSegmentPerformanceAlg::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 151 of file MuonSegmentPerformanceAlg.cxx.
153 std::string
outfile =
"muonPerformance_segments.txt";
155 std::ostringstream sout;
158 unsigned int width = 9;
159 sout <<
"Segment finding efficiencies barrel" << std::endl;
160 sout <<
" Chambers ";
161 std::string prefix_eff =
" Efficiency ";
162 std::string prefix_fake =
" Fake rate ";
165 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
169 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
174 sout <<
"Segment finding efficiencies endcaps" << std::endl;
175 sout <<
" Chambers ";
178 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
183 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
189 return StatusCode::SUCCESS;
◆ initialize()
StatusCode MuonSegmentPerformanceAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ printRatio() [1/2]
std::string MuonSegmentPerformanceAlg::printRatio |
( |
const std::string & |
prefix, |
|
|
unsigned int |
begin, |
|
|
unsigned int |
end, |
|
|
const std::vector< int > & |
reco |
|
) |
| const |
|
private |
Definition at line 135 of file MuonSegmentPerformanceAlg.cxx.
137 std::ostringstream sout;
138 unsigned int width = 9;
139 unsigned int precision = 3;
140 sout << std::endl <<
prefix;
142 sout << std::setw(
width) << std::setprecision(precision);
146 sout << static_cast<double>(
reco[
i]) /
static_cast<double>(
m_nevents);
◆ printRatio() [2/2]
std::string MuonSegmentPerformanceAlg::printRatio |
( |
const std::string & |
prefix, |
|
|
unsigned int |
begin, |
|
|
unsigned int |
end, |
|
|
const std::vector< int > & |
reco, |
|
|
const std::vector< int > & |
truth |
|
) |
| const |
|
private |
Definition at line 110 of file MuonSegmentPerformanceAlg.cxx.
112 std::ostringstream sout;
113 unsigned int width = 9;
114 unsigned int precision = 3;
115 sout << std::endl <<
prefix;
117 sout << std::setw(
width) << std::setprecision(precision);
121 sout << static_cast<double>(
reco[
i]) /
static_cast<double>(truth[
i]);
127 sout << std::setw(
width) << std::setprecision(precision);
131 sout << static_cast<double>(truth[
i]);
◆ renounce()
◆ renounceArray()
◆ retrieve()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fileName
std::string MuonSegmentPerformanceAlg::m_fileName |
|
private |
◆ m_fileOutput
std::ofstream MuonSegmentPerformanceAlg::m_fileOutput |
|
private |
◆ m_hitCutString
std::vector<std::string> MuonSegmentPerformanceAlg::m_hitCutString |
|
private |
◆ m_nevents
unsigned int MuonSegmentPerformanceAlg::m_nevents |
|
private |
◆ m_nfake
std::vector<std::vector<int> > MuonSegmentPerformanceAlg::m_nfake |
|
private |
◆ m_nfound
std::vector<std::vector<int> > MuonSegmentPerformanceAlg::m_nfound |
|
private |
◆ m_nhitCuts
std::vector<int> MuonSegmentPerformanceAlg::m_nhitCuts |
|
private |
◆ m_ntruth
std::vector<std::vector<int> > MuonSegmentPerformanceAlg::m_ntruth |
|
private |
◆ m_segmentKey
◆ m_truthSegmenLinkKey
◆ m_truthSegmentKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeToFile
bool MuonSegmentPerformanceAlg::m_writeToFile |
|
private |
The documentation for this class was generated from the following files:
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool isValid() const
Test to see if the link can be dereferenced.
virtual void setOwner(IDataHandleHolder *o)=0
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ChIndex
enum to classify the different chamber layers in the muon spectrometer
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>