 |
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, V, H > &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 |
|
|
std::string | printRatio (const std::string &prefix, unsigned int begin, unsigned int end, const counter_t &reco, const counter_t &truth) const |
|
std::string | printRatio (const std::string &prefix, unsigned int begin, unsigned int end, const counter_t &reco) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 18 of file MuonSegmentPerformanceAlg.h.
◆ counter_t
◆ 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 39 of file MuonSegmentPerformanceAlg.cxx.
40 const EventContext& ctx{Gaudi::Hive::currentContext()};
45 if (!segments || !truthSegments) {
46 return StatusCode::SUCCESS;
48 std::set<const xAOD::MuonSegment*> matchedSegments;
51 bool missedSegment =
false;
52 for (
const auto seg : *truthSegments) {
54 if (
chIndex == ChIndex::ChUnknown ||
chIndex == ChIndex::ChIndexMax) {
57 unsigned int index = 0;
58 if (seg->nPrecisionHits() < 3)
continue;
67 recoSegmentLinkAcc(
"recoSegmentLink");
71 matchedSegments.insert(*recoLink);
75 <<
" eta " << seg->etaIndex() <<
" nprec " << seg->nPrecisionHits() <<
" nphi " << seg->nPhiLayers()
76 <<
" nTrigEta " << seg->nTrigEtaLayers());
82 for (
const auto seg : *segments) {
83 if (matchedSegments.count(seg))
continue;
85 if (
chIndex == ChIndex::ChUnknown ||
chIndex == ChIndex::ChIndexMax) {
90 unsigned int index = 0;
91 if (seg->nPrecisionHits() < 3)
continue;
96 <<
" eta " << seg->etaIndex() <<
" nprec " << seg->nPrecisionHits() <<
" nphi " << seg->nPhiLayers()
97 <<
" nTrigEta " << seg->nTrigEtaLayers());
102 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 146 of file MuonSegmentPerformanceAlg.cxx.
148 std::string
outfile =
"muonPerformance_segments.txt";
150 std::ostringstream sout;
153 unsigned int width = 9;
154 sout <<
"Segment finding efficiencies barrel" << std::endl;
155 sout <<
" Chambers ";
156 std::string prefix_eff =
" Efficiency ";
157 std::string prefix_fake =
" Fake rate ";
163 sout << std::setw(width) << chName(static_cast<ChIndex>(
i));
166 for (
unsigned int j = 0; j <
end; ++j) {
170 for (
unsigned int j = 0; j <
end; ++j) {
175 sout <<
"Segment finding efficiencies endcaps" << std::endl;
176 sout <<
" Chambers ";
179 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
184 for (
unsigned int j = 0; j <
m_nfound.size(); ++j) {
190 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 counter_t & |
reco |
|
) |
| const |
|
private |
Definition at line 130 of file MuonSegmentPerformanceAlg.cxx.
132 std::ostringstream sout;
133 unsigned int width = 9;
134 unsigned int precision = 3;
135 sout << std::endl <<
prefix;
137 sout << std::setw(
width) << std::setprecision(precision);
141 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 counter_t & |
reco, |
|
|
const counter_t & |
truth |
|
) |
| const |
|
private |
Definition at line 105 of file MuonSegmentPerformanceAlg.cxx.
107 std::ostringstream sout;
108 unsigned int width = 9;
109 unsigned int precision = 3;
110 sout << std::endl <<
prefix;
112 sout << std::setw(
width) << std::setprecision(precision);
116 sout << static_cast<double>(
reco[
i]) /
static_cast<double>(truth[
i]);
122 sout << std::setw(
width) << std::setprecision(precision);
126 sout << static_cast<double>(truth[
i]);
◆ renounce()
◆ renounceArray()
◆ 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<counter_t > MuonSegmentPerformanceAlg::m_nfake |
|
private |
◆ m_nfound
std::vector<counter_t > MuonSegmentPerformanceAlg::m_nfound |
|
private |
◆ m_nhitCuts
std::vector<int> MuonSegmentPerformanceAlg::m_nhitCuts |
|
private |
◆ m_ntruth
std::vector<counter_t > MuonSegmentPerformanceAlg::m_ntruth |
|
private |
◆ m_segmentKey
◆ m_truthSegmenLinkKey
◆ m_truthSegmentKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeToFile
bool MuonSegmentPerformanceAlg::m_writeToFile |
|
private |
◆ s_chIdxMax
The documentation for this class was generated from the following files:
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.
bool isValid() const
Test to see if the link can be dereferenced.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
::StatusCode StatusCode
StatusCode definition for legacy code.
const std::string & chName(ChIndex index)
convert ChIndex into a string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
constexpr int toInt(const ParamDefs p)
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
ChIndex
enum to classify the different chamber layers in the muon spectrometer