ATLAS Offline Software
BMuonTrackIsoTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //============================================================================
6 // BMuonTrackIsoTool.h
7 //============================================================================
8 //
9 // Author : Wolfgang Walkowiak <Wolfgang.Walkowiak@cern.ch.>
10 // Changes:
11 //
12 // Add muon track isolation information for different configurations,
13 // different track selections and different PV-to-SV association methods.
14 //
15 // For an usage example see BPHY8.py .
16 //
17 //============================================================================
18 //
19 #ifndef DERIVATIONFRAMEWORK_BMuonTrackIsoTool_H
20 #define DERIVATIONFRAMEWORK_BMuonTrackIsoTool_H
21 
23 #include "xAODMuon/MuonContainer.h"
24 #include "boost/multi_array.hpp"
25 
26 namespace InDet {
27  class IInDetTrackSelectionTool;
28 }
29 
30 namespace DerivationFramework {
31 
33 
34  private:
36 
37  //
38  // internal helper class
39  //
40  protected:
41  class MuIsoItem : public BaseItem {
42 
43  public:
44  MuIsoItem(const std::string& Name="_none_",
45  const std::string& Bname="muiso",
46  const std::string& Prefix="");
47  virtual ~MuIsoItem();
48 
49  virtual void resetVals() override;
50  virtual void copyVals(const BaseItem& item) override;
51  void copyVals(const MuIsoItem& item);
52  void fill(double isoValue=-2., int nTracks=-1,
53  const xAOD::Muon* muon=NULL);
54  std::string muIsoName() const;
55  std::string nTracksName() const;
56  std::string muLinkName() const;
57 
58  public:
59  std::vector<float> vIsoValues;
60  std::vector<int> vNTracks;
62  }; // MuIsoItem
63 
64  public:
65  BMuonTrackIsoTool(const std::string& t, const std::string& n,
66  const IInterface* p);
67 
68  protected:
69  // Hook methods
70  virtual StatusCode initializeHook() override;
71  virtual StatusCode finalizeHook() override;
72 
73  virtual StatusCode addBranchesVCSetupHook(size_t ivc) const override;
74 
75  virtual StatusCode addBranchesSVLoopHook(const xAOD::Vertex* vtx) const override;
76 
77  virtual StatusCode calcValuesHook(const xAOD::Vertex* vtx,
78  const unsigned int ipv,
79  const unsigned int its,
80  const unsigned int itt) const override;
81  virtual bool fastFillHook(const xAOD::Vertex* vtx,
82  const int ipv) const override;
83 
84  private:
85  StatusCode saveIsolation(const xAOD::Vertex* vtx) const;
86  void initResults();
87  void setResultsPrefix(std::string prefix) const;
88 
89  std::string buildBranchName(unsigned int ic,
90  unsigned int its,
91  unsigned int ipv,
92  unsigned int itt) const;
93 
94  private:
95  // job options
96  std::string m_muonContainerName;
97  std::vector<double> m_isoConeSizes;
98  std::vector<double> m_isoTrkImpLogChi2Max;
99  std::vector<int> m_isoDoTrkImpLogChi2Cut;
100 
101  // containers
102  mutable const xAOD::MuonContainer* m_muons;
103 
104 
105  // results array
106  typedef boost::multi_array<MuIsoItem, 4> MuIsoItem4_t;
108 
109  }; // BMuonTrackIsoTool
110 } // namespace
111 
112 #endif // DERIVATIONFRAMEWORK_BMuonTrackIsoTool_H
DerivationFramework::BMuonTrackIsoTool::MuIsoItem::vMuons
MuonBag vMuons
Definition: BMuonTrackIsoTool.h:61
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
DerivationFramework::BMuonTrackIsoTool
Definition: BMuonTrackIsoTool.h:32
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
BPhysVertexTrackBase.h
DerivationFramework::MuonBag
std::vector< const xAOD::Muon * > MuonBag
Definition: BPhysAddMuonBasedInvMass.h:33
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
DerivationFramework::BMuonTrackIsoTool::m_isoDoTrkImpLogChi2Cut
std::vector< int > m_isoDoTrkImpLogChi2Cut
Definition: BMuonTrackIsoTool.h:99
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::BMuonTrackIsoTool::MuIsoItem::vIsoValues
std::vector< float > vIsoValues
Definition: BMuonTrackIsoTool.h:59
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::BMuonTrackIsoTool::m_isoTrkImpLogChi2Max
std::vector< double > m_isoTrkImpLogChi2Max
Definition: BMuonTrackIsoTool.h:98
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
DerivationFramework::BMuonTrackIsoTool::m_muons
const xAOD::MuonContainer * m_muons
Definition: BMuonTrackIsoTool.h:102
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::BMuonTrackIsoTool::m_muonContainerName
std::string m_muonContainerName
Definition: BMuonTrackIsoTool.h:96
grepfile.ic
int ic
Definition: grepfile.py:33
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
DerivationFramework::BMuonTrackIsoTool::MuIsoItem::vNTracks
std::vector< int > vNTracks
Definition: BMuonTrackIsoTool.h:60
item
Definition: ItemListSvc.h:43
MuonContainer.h
Name
JetDumper::Name Name
Definition: JetDumper.cxx:19
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
DerivationFramework::BPhysVertexTrackBase::BaseItem
Definition: BPhysVertexTrackBase.h:60
DerivationFramework::BMuonTrackIsoTool::MuIsoItem
Definition: BMuonTrackIsoTool.h:41
DerivationFramework::BPhysVertexTrackBase
Definition: BPhysVertexTrackBase.h:57
DerivationFramework::BMuonTrackIsoTool::m_results
MuIsoItem4_t m_results
Definition: BMuonTrackIsoTool.h:107
DerivationFramework::BMuonTrackIsoTool::MuIsoItem4_t
boost::multi_array< MuIsoItem, 4 > MuIsoItem4_t
Definition: BMuonTrackIsoTool.h:106
DerivationFramework::BMuonTrackIsoTool::super
BPhysVertexTrackBase super
Definition: BMuonTrackIsoTool.h:35
DerivationFramework::BMuonTrackIsoTool::m_isoConeSizes
std::vector< double > m_isoConeSizes
Definition: BMuonTrackIsoTool.h:97