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

#include <MuonSpectrometerProbeCollectorTool.h>

Inheritance diagram for Muon::MuonSpectrometerProbeCollectorTool:
Collaboration diagram for Muon::MuonSpectrometerProbeCollectorTool:

Public Member Functions

 MuonSpectrometerProbeCollectorTool (const std::string &, const std::string &, const IInterface *)
virtual ~MuonSpectrometerProbeCollectorTool ()
 default destructor
virtual StatusCode initialize ()
 standard Athena-Algorithm method
StatusCode createProbeCollection ()
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 ()

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

Rec::TrackParticleContainerm_MSProbeTrackContainer = nullptr
ToolHandle< IInsituTrackToolsm_InsituPerformanceTools
 get a handle to the MuonSpectrometerProbeCollectorTool
std::string m_InnerTrackContainerName
 member variables for algorithm properties:
std::string m_MSTrackContainerName
std::string m_CombinedMuonTracksContainerName
bool m_RequireTrigger
float m_muonPtCut
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

Definition at line 28 of file MuonSpectrometerProbeCollectorTool.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

◆ MuonSpectrometerProbeCollectorTool()

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

Definition at line 13 of file MuonSpectrometerProbeCollectorTool.cxx.

16 :
17 AthAlgTool(t,n,p),
18 m_InsituPerformanceTools("InsituTrackPerformanceTools/TestTool")
19 {
20 declareInterface<IProbeCollectorTool>(this);
21
22 declareProperty("InnerTrackContainerName", m_InnerTrackContainerName = "TrackParticleCandidate");
23 declareProperty("MSTrackContainerName", m_MSTrackContainerName = "MuonboyTrackParticles" );
24 declareProperty("CombinedMuonTracksContainerName", m_CombinedMuonTracksContainerName = "StacoMuonCollection");
25 declareProperty("RequireTrigger", m_RequireTrigger = false);
26 declareProperty("InsituPerformanceTools", m_InsituPerformanceTools);
27 declareProperty("MuonPtCut", m_muonPtCut=20000.);
28 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< IInsituTrackTools > m_InsituPerformanceTools
get a handle to the MuonSpectrometerProbeCollectorTool
std::string m_InnerTrackContainerName
member variables for algorithm properties:

◆ ~MuonSpectrometerProbeCollectorTool()

virtual Muon::MuonSpectrometerProbeCollectorTool::~MuonSpectrometerProbeCollectorTool ( )
inlinevirtual

default destructor

Definition at line 34 of file MuonSpectrometerProbeCollectorTool.h.

34{};

Member Function Documentation

◆ createProbeCollection()

StatusCode MuonSpectrometerProbeCollectorTool::createProbeCollection ( )
virtual

Record the container of Probe Muons in evtStore

Retrieve Inner Tracks

Retrieve Combined Tracks

Loop over Combined Muon Tracks

Implements IProbeCollectorTool.

Definition at line 45 of file MuonSpectrometerProbeCollectorTool.cxx.

46 {
47 ATH_MSG_DEBUG("createProbeCollection() for Muon Spectrometer");
48
50 m_MSProbeTrackContainer = new Rec::TrackParticleContainer();
51 ATH_CHECK(evtStore()->record(m_MSProbeTrackContainer,"MuonSpectrometerProbeTracks"));
52 ATH_MSG_DEBUG("MuonSpectrometerProbeTracks Container recorded in evtStore.");
53
55 const Rec::TrackParticleContainer* trackTES=nullptr;
57 if (!trackTES ) {
58 ATH_MSG_WARNING("No " << m_InnerTrackContainerName << " container found in TDS");
59 return StatusCode::FAILURE;
60 }
61 ATH_MSG_DEBUG("TrackParticleContainer successfully retrieved");
62
64 const Analysis::MuonContainer* muonTDS=nullptr;
66 if (!muonTDS) {
67 ATH_MSG_WARNING("No AOD "<<m_CombinedMuonTracksContainerName<<" container of muons found in TDS");
68 return StatusCode::FAILURE;
69 }
70 ATH_MSG_DEBUG("MuonContainer successfully retrieved");
71
74 Analysis::MuonContainer::const_iterator muonItrE = muonTDS->end();
75 for (; muonItr != muonItrE; ++muonItr)
76 {
77 if (((*muonItr)->pt()>m_muonPtCut) && ((*muonItr)->isCombinedMuon()))
78 {
79 const Rec::TrackParticle *muonTrack = (*muonItr)->track();
80 if ((m_RequireTrigger==false) || (m_InsituPerformanceTools->isTriggeredMuon(muonTrack)==true))
81 {
82 Rec::TrackParticleContainer::const_iterator innerTrackItr = trackTES->begin();
83 Rec::TrackParticleContainer::const_iterator innerTrackItrE = trackTES->end();
84 for (; innerTrackItr != innerTrackItrE; ++innerTrackItr)
85 {
86 const Rec::TrackParticle *innerTrack = (*innerTrackItr);
87 if (innerTrack->pt()>m_muonPtCut)
88 {
89 if (m_InsituPerformanceTools->isZBosonCandidate(innerTrack, muonTrack)==true)
90 {
91 Rec::TrackParticle temp;
92 temp.setPx(innerTrack->px());
93 temp.setPy(innerTrack->py());
94 temp.setPz(innerTrack->pz());
95 temp.setE(innerTrack->e());
96 m_MSProbeTrackContainer->push_back( new Rec::TrackParticle(temp));
97 }
98 }
99 }
100 }
101 }
102 }
104 return StatusCode::SUCCESS;
105 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual double pt() const =0
transverse momentum
virtual double e() const
get energy data member
Definition P4PxPyPzE.h:132
virtual void setE(double theE)
set energy data member
Definition P4PxPyPzE.h:144
virtual void setPz(double thePz)
set Pz data member
Definition P4PxPyPzE.h:141
virtual void setPx(double thePx)
set Px data member
Definition P4PxPyPzE.h:135
virtual void setPy(double thePy)
set Py data member
Definition P4PxPyPzE.h:138
virtual double px() const
get px data member
Definition P4PxPyPzE.h:122
virtual double py() const
get py data member
Definition P4PxPyPzE.h:126
virtual double pz() const
get pz data member
Definition P4PxPyPzE.h:129
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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 }

◆ 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

◆ initialize()

StatusCode MuonSpectrometerProbeCollectorTool::initialize ( )
virtual

standard Athena-Algorithm method

Getting InsituPerformanceTools

Definition at line 32 of file MuonSpectrometerProbeCollectorTool.cxx.

33 {
34 ATH_CHECK(AlgTool::initialize());
35
38
39 ATH_MSG_INFO("initialize() successful");
40 return StatusCode::SUCCESS;
41 }
#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 & IProbeCollectorTool::interfaceID ( )
inlinestaticinherited

Definition at line 24 of file IProbeCollectorTool.h.

25{
27}
static const InterfaceID IID_IProbeCollectorTool("IProbeCollectorTool", 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 }

◆ 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_CombinedMuonTracksContainerName

std::string Muon::MuonSpectrometerProbeCollectorTool::m_CombinedMuonTracksContainerName
private

Definition at line 51 of file MuonSpectrometerProbeCollectorTool.h.

◆ 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_InnerTrackContainerName

std::string Muon::MuonSpectrometerProbeCollectorTool::m_InnerTrackContainerName
private

member variables for algorithm properties:

Definition at line 49 of file MuonSpectrometerProbeCollectorTool.h.

◆ m_InsituPerformanceTools

ToolHandle<IInsituTrackTools> Muon::MuonSpectrometerProbeCollectorTool::m_InsituPerformanceTools
private

get a handle to the MuonSpectrometerProbeCollectorTool

Definition at line 46 of file MuonSpectrometerProbeCollectorTool.h.

◆ m_MSProbeTrackContainer

Rec::TrackParticleContainer* Muon::MuonSpectrometerProbeCollectorTool::m_MSProbeTrackContainer = nullptr
private

Definition at line 43 of file MuonSpectrometerProbeCollectorTool.h.

◆ m_MSTrackContainerName

std::string Muon::MuonSpectrometerProbeCollectorTool::m_MSTrackContainerName
private

Definition at line 50 of file MuonSpectrometerProbeCollectorTool.h.

◆ m_muonPtCut

float Muon::MuonSpectrometerProbeCollectorTool::m_muonPtCut
private

Definition at line 53 of file MuonSpectrometerProbeCollectorTool.h.

◆ m_RequireTrigger

bool Muon::MuonSpectrometerProbeCollectorTool::m_RequireTrigger
private

Definition at line 52 of file MuonSpectrometerProbeCollectorTool.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: