ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonStationNtupleHelperTool Class Reference

This is for the Doxygen-Documentation. More...

#include <MuonStationNtupleHelperTool.h>

Inheritance diagram for Muon::MuonStationNtupleHelperTool:
Collaboration diagram for Muon::MuonStationNtupleHelperTool:

Public Member Functions

 MuonStationNtupleHelperTool (const std::string &, const std::string &, const IInterface *)
virtual ~MuonStationNtupleHelperTool ()=default
 default destructor
virtual StatusCode initialize ()
 standard Athena-Algorithm method
virtual StatusCode finalize ()
 standard Athena-Algorithm method
virtual StatusCode fillMeasurementData (const Trk::MeasurementBase *, const Trk::TrackParameters *, const int &detectorType, const bool &isOutlier)
 fill hit position data
virtual StatusCode fillHoleData (const Trk::TrackStateOnSurface &, const int &)
 fill special data about holes on track (here: do nothing)
virtual StatusCode addNtupleItems (TTree *tree, const int &detectorType)
 add items to the ntuple and configure the helper tool: should be called once (per detector type) by the steering tool (Trk::IValidationNtupleTool)
virtual StatusCode resetVariables (const int &detectorType)
 reset ntuple variables
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Interface ID, declared here, and defined below.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
std::vector< int > * m_mdtSectorIx
 sector number 1-16, odd=large, even=small
std::vector< int > * m_mdtStationIx
 describe
std::vector< int > * m_rpcSectorIx
 sector number 1-16, odd=large, even=small
std::vector< int > * m_rpcStationIx
 describe
std::vector< int > * m_rpcMeasuresPhi
 describe
std::vector< int > * m_tgcStationIx
 describe
std::vector< int > * m_tgcMeasuresPhi
 describe
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

This is for the Doxygen-Documentation.


Please delete these lines and fill in information about the Algorithm! Please precede every member function declaration with a short Doxygen comment stating the purpose of this function.

Author
Wolfgang Liebig <wolfgang.liebig -at- cern.ch>

Definition at line 27 of file MuonStationNtupleHelperTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonStationNtupleHelperTool()

Muon::MuonStationNtupleHelperTool::MuonStationNtupleHelperTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 14 of file MuonStationNtupleHelperTool.cxx.

17 :
18 AthAlgTool(t,n,p),
19 m_mdtSectorIx(nullptr),
20 m_mdtStationIx(nullptr),
21 m_rpcSectorIx(nullptr),
22 m_rpcStationIx(nullptr),
23 m_rpcMeasuresPhi(nullptr),
24 m_tgcStationIx(nullptr),
25 m_tgcMeasuresPhi(nullptr)
26{
27 declareInterface<Trk::IValidationNtupleHelperTool>(this);
28}
AthAlgTool()
Default constructor:
std::vector< int > * m_rpcMeasuresPhi
describe
std::vector< int > * m_mdtSectorIx
sector number 1-16, odd=large, even=small
std::vector< int > * m_tgcMeasuresPhi
describe
std::vector< int > * m_rpcSectorIx
sector number 1-16, odd=large, even=small
std::vector< int > * m_mdtStationIx
describe
std::vector< int > * m_tgcStationIx
describe
std::vector< int > * m_rpcStationIx
describe

◆ ~MuonStationNtupleHelperTool()

virtual Muon::MuonStationNtupleHelperTool::~MuonStationNtupleHelperTool ( )
virtualdefault

default destructor

Member Function Documentation

◆ addNtupleItems()

StatusCode Muon::MuonStationNtupleHelperTool::addNtupleItems ( TTree * tree,
const int & detectorType )
virtual

add items to the ntuple and configure the helper tool: should be called once (per detector type) by the steering tool (Trk::IValidationNtupleTool)

addNtupleItems

Implements Trk::IValidationNtupleHelperTool.

Definition at line 65 of file MuonStationNtupleHelperTool.cxx.

67 {
68
69 // add items to the ntuple
70 if (detectorType==Trk::TrackState::MDT) {
71
72 tree->Branch("MdtSectorIndex", &m_mdtSectorIx);
73 tree->Branch("MdtStationIndex", &m_mdtStationIx);
74 }
75 if (detectorType==Trk::TrackState::RPC) {
76 tree->Branch("RpcSectorIndex", &m_rpcSectorIx);
77 tree->Branch("RpcStationIndex", &m_rpcStationIx);
78 tree->Branch("RpcMeasuresPhi", &m_rpcMeasuresPhi);
79 }
80 if (detectorType==Trk::TrackState::TGC) {
81 // TGC sectors are not defined, will cause warning if tried to compute from helper
82 tree->Branch("TgcStationIndex", &m_tgcStationIx);
83 tree->Branch("TgcMeasuresPhi", &m_tgcMeasuresPhi);
84 }
85
86 ATH_MSG_VERBOSE ("added items to ntuple.");
87 return StatusCode::SUCCESS;
88}
#define ATH_MSG_VERBOSE(x)
TChain * tree

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ fillHoleData()

StatusCode Muon::MuonStationNtupleHelperTool::fillHoleData ( const Trk::TrackStateOnSurface & ,
const int &  )
virtual

fill special data about holes on track (here: do nothing)

Implements Trk::IValidationNtupleHelperTool.

Definition at line 140 of file MuonStationNtupleHelperTool.cxx.

142 {
143 // we do nothing with holes
144 return StatusCode::SUCCESS;
145}

◆ fillMeasurementData()

StatusCode Muon::MuonStationNtupleHelperTool::fillMeasurementData ( const Trk::MeasurementBase * hit,
const Trk::TrackParameters * ,
const int & detectorType,
const bool & isOutlier )
virtual

fill hit position data

Implements Trk::IValidationNtupleHelperTool.

Definition at line 93 of file MuonStationNtupleHelperTool.cxx.

97 {
98
99 // todo is this actually called for outliers?
100
101 // identify the detector type:
102 Identifier id = Trk::IdentifierExtractor::extract(hit);
103 using namespace Muon::MuonStationIndex;
104 const int stIdx = toInt(m_idHelperSvc->stationIndex(id));
105 if (detectorType==Trk::TrackState::MDT) {
106 m_mdtSectorIx->push_back(m_idHelperSvc->sector(id));
107 m_mdtStationIx->push_back(stIdx);
108 }
109 if (detectorType==Trk::TrackState::RPC) {
110 m_rpcSectorIx->push_back(m_idHelperSvc->sector(id));
111 m_rpcStationIx->push_back(stIdx);
112 m_rpcMeasuresPhi->push_back(m_idHelperSvc->measuresPhi(id));
113 }
114 if (detectorType==Trk::TrackState::TGC) {
115 m_tgcStationIx->push_back(stIdx);
116 m_tgcMeasuresPhi->push_back(m_idHelperSvc->measuresPhi(id));
117 }
118
119 return StatusCode::SUCCESS;
120}
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
static void extract(std::vector< Identifier > &ids, const std::vector< const MeasurementBase * > &measurements)
constexpr int toInt(const EnumType enumVal)

◆ finalize()

StatusCode Muon::MuonStationNtupleHelperTool::finalize ( )
virtual

standard Athena-Algorithm method

Definition at line 50 of file MuonStationNtupleHelperTool.cxx.

51{
52 delete m_mdtSectorIx; m_mdtSectorIx=nullptr;
53 delete m_mdtStationIx; m_mdtStationIx=nullptr;
54 delete m_rpcSectorIx; m_rpcSectorIx=nullptr;
55 delete m_rpcStationIx; m_rpcStationIx=nullptr;
56 delete m_rpcMeasuresPhi; m_rpcMeasuresPhi=nullptr;
57 delete m_tgcStationIx; m_tgcStationIx=nullptr;
58 delete m_tgcMeasuresPhi; m_tgcMeasuresPhi=nullptr;
59 return StatusCode::SUCCESS;
60}

◆ initialize()

StatusCode Muon::MuonStationNtupleHelperTool::initialize ( )
virtual

standard Athena-Algorithm method

Definition at line 32 of file MuonStationNtupleHelperTool.cxx.

33{
34 ATH_CHECK(m_idHelperSvc.retrieve());
35
36 m_mdtSectorIx = new std::vector<int>();
37 m_mdtStationIx = new std::vector<int>();
38 m_rpcSectorIx = new std::vector<int>();
39 m_rpcStationIx = new std::vector<int>();
40 m_rpcMeasuresPhi = new std::vector<int>();
41 m_tgcStationIx = new std::vector<int>();
42 m_tgcMeasuresPhi = new std::vector<int>();
43
44 ATH_MSG_INFO ("initialize() successful in " << name());
45 return StatusCode::SUCCESS;
46}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ interfaceID()

const InterfaceID & Trk::IValidationNtupleHelperTool::interfaceID ( )
inlinestaticinherited

Interface ID, declared here, and defined below.

Definition at line 76 of file IValidationNtupleHelperTool.h.

76 {
78}
static const InterfaceID IID_IValidationNtupleHelperTool("IValidationNtupleHelperTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resetVariables()

StatusCode Muon::MuonStationNtupleHelperTool::resetVariables ( const int & detectorType)
virtual

reset ntuple variables

Implements Trk::IValidationNtupleHelperTool.

Definition at line 122 of file MuonStationNtupleHelperTool.cxx.

123 {
124 if (detectorType==Trk::TrackState::MDT) {
125 m_mdtSectorIx->clear();
126 m_mdtStationIx->clear();
127 }
128 if (detectorType==Trk::TrackState::RPC) {
129 m_rpcSectorIx->clear();
130 m_rpcStationIx->clear();
131 m_rpcMeasuresPhi->clear();
132 }
133 if (detectorType==Trk::TrackState::TGC) {
134 m_tgcStationIx->clear();
135 m_tgcMeasuresPhi->clear();
136 }
137 return StatusCode::SUCCESS;
138}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonStationNtupleHelperTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 65 of file MuonStationNtupleHelperTool.h.

65{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_mdtSectorIx

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_mdtSectorIx
private

sector number 1-16, odd=large, even=small

Definition at line 67 of file MuonStationNtupleHelperTool.h.

◆ m_mdtStationIx

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_mdtStationIx
private

describe

Definition at line 68 of file MuonStationNtupleHelperTool.h.

◆ m_rpcMeasuresPhi

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_rpcMeasuresPhi
private

describe

Definition at line 71 of file MuonStationNtupleHelperTool.h.

◆ m_rpcSectorIx

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_rpcSectorIx
private

sector number 1-16, odd=large, even=small

Definition at line 69 of file MuonStationNtupleHelperTool.h.

◆ m_rpcStationIx

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_rpcStationIx
private

describe

Definition at line 70 of file MuonStationNtupleHelperTool.h.

◆ m_tgcMeasuresPhi

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_tgcMeasuresPhi
private

describe

Definition at line 73 of file MuonStationNtupleHelperTool.h.

◆ m_tgcStationIx

std::vector<int>* Muon::MuonStationNtupleHelperTool::m_tgcStationIx
private

describe

Definition at line 72 of file MuonStationNtupleHelperTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: