ATLAS Offline Software
MuonSpectrometerProbeCollectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 //================ Constructor =================================================
8 namespace Muon {
10  const std::string& n,
11  const IInterface* p )
12  :
13  AthAlgTool(t,n,p),
14  m_InsituPerformanceTools("InsituTrackPerformanceTools/TestTool")
15  {
16  declareInterface<IProbeCollectorTool>(this);
17 
18  declareProperty("InnerTrackContainerName", m_InnerTrackContainerName = "TrackParticleCandidate");
19  declareProperty("MSTrackContainerName", m_MSTrackContainerName = "MuonboyTrackParticles" );
20  declareProperty("CombinedMuonTracksContainerName", m_CombinedMuonTracksContainerName = "StacoMuonCollection");
21  declareProperty("RequireTrigger", m_RequireTrigger = false);
22  declareProperty("InsituPerformanceTools", m_InsituPerformanceTools);
23  declareProperty("MuonPtCut", m_muonPtCut=20000.);
24  }
25 
26  //================ Initialisation =================================================
27 
29  {
31 
33  ATH_CHECK(m_InsituPerformanceTools->initialize());
34 
35  ATH_MSG_INFO("initialize() successful");
36  return StatusCode::SUCCESS;
37  }
38 
39  //============================================================================================
40 
42  {
43  ATH_MSG_DEBUG("createProbeCollection() for Muon Spectrometer");
44 
47  ATH_CHECK(evtStore()->record(m_MSProbeTrackContainer,"MuonSpectrometerProbeTracks"));
48  ATH_MSG_DEBUG("MuonSpectrometerProbeTracks Container recorded in evtStore.");
49 
51  const Rec::TrackParticleContainer* trackTES=nullptr;
53  if (!trackTES ) {
54  ATH_MSG_WARNING("No " << m_InnerTrackContainerName << " container found in TDS");
55  return StatusCode::FAILURE;
56  }
57  ATH_MSG_DEBUG("TrackParticleContainer successfully retrieved");
58 
60  const Analysis::MuonContainer* muonTDS=nullptr;
62  if (!muonTDS) {
63  ATH_MSG_WARNING("No AOD "<<m_CombinedMuonTracksContainerName<<" container of muons found in TDS");
64  return StatusCode::FAILURE;
65  }
66  ATH_MSG_DEBUG("MuonContainer successfully retrieved");
67 
70  Analysis::MuonContainer::const_iterator muonItrE = muonTDS->end();
71  for (; muonItr != muonItrE; ++muonItr)
72  {
73  if (((*muonItr)->pt()>m_muonPtCut) && ((*muonItr)->isCombinedMuon()))
74  {
75  const Rec::TrackParticle *muonTrack = (*muonItr)->track();
76  if ((m_RequireTrigger==false) || (m_InsituPerformanceTools->isTriggeredMuon(muonTrack)==true))
77  {
78  Rec::TrackParticleContainer::const_iterator innerTrackItr = trackTES->begin();
79  Rec::TrackParticleContainer::const_iterator innerTrackItrE = trackTES->end();
80  for (; innerTrackItr != innerTrackItrE; ++innerTrackItr)
81  {
82  const Rec::TrackParticle *innerTrack = (*innerTrackItr);
83  if (innerTrack->pt()>m_muonPtCut)
84  {
85  if (m_InsituPerformanceTools->isZBosonCandidate(innerTrack, muonTrack)==true)
86  {
87  Rec::TrackParticle temp;
88  temp.setPx(innerTrack->px());
89  temp.setPy(innerTrack->py());
90  temp.setPz(innerTrack->pz());
91  temp.setE(innerTrack->e());
93  }
94  }
95  }
96  }
97  }
98  }
100  return StatusCode::SUCCESS;
101  }
102 }//namespace
103 
104 
Muon::MuonSpectrometerProbeCollectorTool::m_CombinedMuonTracksContainerName
std::string m_CombinedMuonTracksContainerName
Definition: MuonSpectrometerProbeCollectorTool.h:78
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
Muon::MuonSpectrometerProbeCollectorTool::m_MSProbeTrackContainer
Rec::TrackParticleContainer * m_MSProbeTrackContainer
Definition: MuonSpectrometerProbeCollectorTool.h:70
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
P4PxPyPzE::e
virtual double e() const
get energy data member
Definition: P4PxPyPzE.h:132
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
P4PxPyPzE::py
virtual double py() const
get py data member
Definition: P4PxPyPzE.h:126
AthCUDAExamples::TrackParticleContainer
vecmem::edm::container< TrackParticleInterface, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float > > TrackParticleContainer
SoA, GPU friendly TrackParticleContainer.
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:46
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Muon::MuonSpectrometerProbeCollectorTool::m_InsituPerformanceTools
ToolHandle< IInsituTrackTools > m_InsituPerformanceTools
get a handle to the MuonSpectrometerProbeCollectorTool
Definition: MuonSpectrometerProbeCollectorTool.h:73
initialize
void initialize()
Definition: run_EoverP.cxx:894
Muon::MuonSpectrometerProbeCollectorTool::m_InnerTrackContainerName
std::string m_InnerTrackContainerName
member variables for algorithm properties:
Definition: MuonSpectrometerProbeCollectorTool.h:76
P4PxPyPzE::pz
virtual double pz() const
get pz data member
Definition: P4PxPyPzE.h:129
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
I4Momentum::pt
virtual double pt() const =0
transverse momentum
Muon::MuonSpectrometerProbeCollectorTool::m_muonPtCut
float m_muonPtCut
Definition: MuonSpectrometerProbeCollectorTool.h:80
Muon::MuonSpectrometerProbeCollectorTool::MuonSpectrometerProbeCollectorTool
MuonSpectrometerProbeCollectorTool(const std::string &, const std::string &, const IInterface *)
Definition: MuonSpectrometerProbeCollectorTool.cxx:9
P4PxPyPzE::setE
virtual void setE(double theE)
set energy data member
Definition: P4PxPyPzE.h:144
MuonSpectrometerProbeCollectorTool.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
P4PxPyPzE::setPx
virtual void setPx(double thePx)
set Px data member
Definition: P4PxPyPzE.h:135
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonSpectrometerProbeCollectorTool::m_RequireTrigger
bool m_RequireTrigger
Definition: MuonSpectrometerProbeCollectorTool.h:79
Analysis::MuonContainer
definition of StoreGate container holding a vector of Analysis::Muon
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/MuonContainer.h:38
Muon::MuonSpectrometerProbeCollectorTool::createProbeCollection
StatusCode createProbeCollection()
Definition: MuonSpectrometerProbeCollectorTool.cxx:41
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Muon::MuonSpectrometerProbeCollectorTool::initialize
virtual StatusCode initialize()
standard Athena-Algorithm method
Definition: MuonSpectrometerProbeCollectorTool.cxx:28
P4PxPyPzE::px
virtual double px() const
get px data member
Definition: P4PxPyPzE.h:122
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
P4PxPyPzE::setPz
virtual void setPz(double thePz)
set Pz data member
Definition: P4PxPyPzE.h:141
Muon::MuonSpectrometerProbeCollectorTool::m_MSTrackContainerName
std::string m_MSTrackContainerName
Definition: MuonSpectrometerProbeCollectorTool.h:77
P4PxPyPzE::setPy
virtual void setPy(double thePy)
set Py data member
Definition: P4PxPyPzE.h:138
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.