ATLAS Offline Software
InnerDetProbeCollectorTool.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 Inner Detector");
46  ATH_CHECK(evtStore()->record(m_IDProbeTrackContainer,"InnerDetectorProbeTracks"));
47  ATH_MSG_DEBUG("InnerDetectorProbeTracks Container recorded in evtStore.");
48 
50  const Rec::TrackParticleContainer* trackTES=nullptr;
52  if (!trackTES) {
53  ATH_MSG_WARNING("No " << m_MSTrackContainerName << " container found in TDS");
54  return StatusCode::FAILURE;
55  }
56  ATH_MSG_DEBUG("MuonTrack Container successfully retrieved");
57 
59  const Analysis::MuonContainer* muonTDS=nullptr;
61  if (!muonTDS ) {
62  ATH_MSG_WARNING("No AOD "<<m_CombinedMuonTracksContainerName<<" container of muons found in TDS");
63  return StatusCode::FAILURE;
64  }
65  ATH_MSG_DEBUG("MuonContainer successfully retrieved");
66 
69  Analysis::MuonContainer::const_iterator muonItrE = muonTDS->end();
70  for (; muonItr != muonItrE; ++muonItr)
71  {
72  if (((*muonItr)->pt()>m_muonPtCut) && ((*muonItr)->isCombinedMuon()))
73  {
74  const Rec::TrackParticle *muonTrack = (*muonItr)->track();
75  if ((m_RequireTrigger==false) || (m_InsituPerformanceTools->isTriggeredMuon(muonTrack)==true))
76  {
77  Rec::TrackParticleContainer::const_iterator MSTrackItr = trackTES->begin();
78  Rec::TrackParticleContainer::const_iterator MSTrackItrE = trackTES->end();
79  for (; MSTrackItr != MSTrackItrE; ++MSTrackItr)
80  {
81  const Rec::TrackParticle *MSTrack = (*MSTrackItr);
82  if (MSTrack->pt()>m_muonPtCut)
83  {
84 
85  if (m_InsituPerformanceTools->isZBosonCandidate(MSTrack, muonTrack)==true)
86  {
88  }
89  }
90  }
91  }
92  }
93  }
95  return StatusCode::SUCCESS;
96  }
97 }//namespace
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
Muon::InnerDetProbeCollectorTool::m_InsituPerformanceTools
ToolHandle< IInsituTrackTools > m_InsituPerformanceTools
get a handle to the InnerDetProbeCollectorTool
Definition: InnerDetProbeCollectorTool.h:73
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
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
Muon::InnerDetProbeCollectorTool::m_CombinedMuonTracksContainerName
std::string m_CombinedMuonTracksContainerName
Definition: InnerDetProbeCollectorTool.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
Muon::InnerDetProbeCollectorTool::createProbeCollection
StatusCode createProbeCollection()
Definition: InnerDetProbeCollectorTool.cxx:41
InnerDetProbeCollectorTool.h
Muon::InnerDetProbeCollectorTool::m_IDProbeTrackContainer
Rec::TrackParticleContainer * m_IDProbeTrackContainer
Definition: InnerDetProbeCollectorTool.h:70
Muon::InnerDetProbeCollectorTool::m_MSTrackContainerName
std::string m_MSTrackContainerName
Definition: InnerDetProbeCollectorTool.h:78
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
I4Momentum::pt
virtual double pt() const =0
transverse momentum
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
Muon::InnerDetProbeCollectorTool::m_RequireTrigger
bool m_RequireTrigger
Definition: InnerDetProbeCollectorTool.h:80
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Analysis::MuonContainer
definition of StoreGate container holding a vector of Analysis::Muon
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/MuonContainer.h:38
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.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::InnerDetProbeCollectorTool::m_muonPtCut
float m_muonPtCut
Definition: InnerDetProbeCollectorTool.h:81
Muon::InnerDetProbeCollectorTool::m_InnerTrackContainerName
std::string m_InnerTrackContainerName
member variables for algorithm properties:
Definition: InnerDetProbeCollectorTool.h:77
AthAlgTool
Definition: AthAlgTool.h:26
Muon::InnerDetProbeCollectorTool::InnerDetProbeCollectorTool
InnerDetProbeCollectorTool(const std::string &, const std::string &, const IInterface *)
Definition: InnerDetProbeCollectorTool.cxx:9
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Muon::InnerDetProbeCollectorTool::initialize
virtual StatusCode initialize()
standard Athena-Algorithm method
Definition: InnerDetProbeCollectorTool.cxx:28