ATLAS Offline Software
BVertexClosestTrackTool.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 // BVertexClosestTrackTool.h
7 //============================================================================
8 //
9 // Author : Wolfgang Walkowiak <Wolfgang.Walkowiak@cern.ch.>
10 // Changes:
11 //
12 // Add B vertex closest track 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_BVertexClosestTrackTool_H
20 #define DERIVATIONFRAMEWORK_BVertexClosestTrackTool_H
21 
23 #include "boost/multi_array.hpp"
24 
25 namespace InDet {
26  class IInDetTrackSelectionTool;
27 }
28 
29 namespace DerivationFramework {
30 
32 
33  private:
35 
36  //
37  // internal helper class
38  //
39  protected:
41 
42  public:
43  CtItem(const std::string& Name="_none_",
44  const std::string& Bname = "ctrk",
45  const std::string& Prefix="",
46  double Dca=-999., double DcaErr=-99.,
47  double Zca=-999., double ZcaErr=-99.,
48  double VtxNDErr2=-99., double TrkNDErr2=-99.,
49  double Phi0Used=-999.,
50  int NTrksChi2=0, xAOD::TrackParticle* CloseTrack=NULL,
51  const TrackBag& Tracks = {},
52  const std::vector<std::vector<double> >& Vtap = {},
53  const std::vector<unsigned short>& Selpat = {});
54 
55  virtual ~CtItem();
56 
57  virtual void setup(const std::string& Name="_none_",
58  const std::string& Bname="ctrk",
59  const std::string& Prefix="");
60  virtual void setup(const std::string& Name,
61  const std::string& Bname,
62  const std::string& Prefix,
63  double Dca, double DcaErr,
64  double Zca, double ZcaErr,
65  double VtxNDErr2, double TrkNDErr2,
66  double Phi0Used,
67  int NTrksChi2,
68  xAOD::TrackParticle* CloseTrack=NULL,
69  TrackBag Tracks = {},
70  std::vector<std::vector<double> > Vtap = {},
71  std::vector<unsigned short> Selpat = {});
72  virtual void resetVals();
73  virtual void copyVals(const BaseItem& item);
74  virtual void copyVals(const CtItem& item);
75  virtual std::string dcaName() const;
76  virtual std::string dcaErrName() const;
77  virtual std::string zcaName() const;
78  virtual std::string zcaErrName() const;
79  virtual std::string vtxNDErr2Name() const;
80  virtual std::string trkNDErr2Name() const;
81  virtual std::string phi0UsedName() const;
82  virtual std::string nTrksChi2Name() const;
83  virtual std::string closeTrackName() const;
84  virtual std::string toString() const;
85 
86  public:
87  double dca;
88  double dcaErr;
89  double zca;
90  double zcaErr;
91  double vtxNDErr2;
92  double trkNDErr2;
93  double phi0Used;
94  int nTrksChi2;
97  std::vector<std::vector<double> > vtap;
98  std::vector<unsigned short> selpat;
99 
100  }; // CtItem
101 
102  public:
103  BVertexClosestTrackTool(const std::string& t, const std::string& n,
104  const IInterface* p);
105 
106  protected:
107  // Hook methods
108  virtual StatusCode initializeHook();
109  virtual StatusCode finalizeHook();
110 
111  virtual StatusCode addBranchesVCSetupHook(size_t ivc) const;
112 
113  virtual StatusCode addBranchesSVLoopHook(const xAOD::Vertex* vtx) const;
114 
115  virtual StatusCode calcValuesHook(const xAOD::Vertex* vtx,
116  const unsigned int ipv,
117  const unsigned int its,
118  const unsigned int itt) const;
119  virtual bool fastFillHook(const xAOD::Vertex* vtx,
120  const int ipv) const;
121  private:
122  virtual StatusCode saveClosestTrack(const xAOD::Vertex* vtx) const;
123  virtual void initResults();
124  virtual void setResultsPrefix(std::string prefix) const;
125  virtual StatusCode logCloseTracksDebugInfo() const;
126 
127  private:
128  // job options
129 
130  std::vector<std::string> m_closeTrackChi2SetName;
131  std::vector<int> m_closeTrackCorrChi2;
132  std::vector<bool> m_minDCAin3D;
133  std::vector<double> m_closeTrackMaxLogChi2;
134  std::vector<double> m_nCloseTrackMaxLogChi2;
135 
136  // results array
137  typedef boost::multi_array<CtItem, 4> CtItem4_t;
139 
140  // last run and event numbers seen
141  mutable unsigned int m_lastRunNumber;
143 
144  // last secondary vertex (candidate) index
145  mutable unsigned int m_svIdx;
146 
147  }; // BVertexClosestTrackTool
148 } // namespace
149 
150 #endif // DERIVATIONFRAMEWORK_BVertexClosestTrackTool_H
DerivationFramework::BVertexClosestTrackTool::CtItem::vtxNDErr2
double vtxNDErr2
Definition: BVertexClosestTrackTool.h:91
InDetGNNHardScatterSelection::getter_utils::Tracks
std::vector< const xAOD::TrackParticle * > Tracks
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/InDetGNNHardScatterSelection/CustomGetterUtils.h:49
DerivationFramework::BVertexClosestTrackTool::CtItem4_t
boost::multi_array< CtItem, 4 > CtItem4_t
Definition: BVertexClosestTrackTool.h:137
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
setup
bool setup(asg::AnaToolHandle< Interface > &tool, const std::string &type, const std::vector< std::string > &config, const std::string &progressFile="")
mostly useful for athena, which will otherwise re-use the previous tool
Definition: fbtTestBasics.cxx:185
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
DerivationFramework::BVertexClosestTrackTool::CtItem::tracks
TrackBag tracks
Definition: BVertexClosestTrackTool.h:96
DerivationFramework::BVertexClosestTrackTool::m_lastEvtNumber
uint64_t m_lastEvtNumber
Definition: BVertexClosestTrackTool.h:142
DerivationFramework::BVertexClosestTrackTool::CtItem::dcaErr
double dcaErr
Definition: BVertexClosestTrackTool.h:88
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
BPhysVertexTrackBase.h
DerivationFramework::BVertexClosestTrackTool::CtItem::phi0Used
double phi0Used
Definition: BVertexClosestTrackTool.h:93
DerivationFramework::BVertexClosestTrackTool::m_nCloseTrackMaxLogChi2
std::vector< double > m_nCloseTrackMaxLogChi2
Definition: BVertexClosestTrackTool.h:134
DerivationFramework::BVertexClosestTrackTool::CtItem::nTrksChi2
int nTrksChi2
Definition: BVertexClosestTrackTool.h:94
DerivationFramework::BVertexClosestTrackTool::m_minDCAin3D
std::vector< bool > m_minDCAin3D
Definition: BVertexClosestTrackTool.h:132
DerivationFramework::BVertexClosestTrackTool::m_closeTrackMaxLogChi2
std::vector< double > m_closeTrackMaxLogChi2
Definition: BVertexClosestTrackTool.h:133
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
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::BVertexClosestTrackTool::CtItem::zca
double zca
Definition: BVertexClosestTrackTool.h:89
DerivationFramework::BVertexClosestTrackTool::CtItem::zcaErr
double zcaErr
Definition: BVertexClosestTrackTool.h:90
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
DerivationFramework::TrackBag
std::vector< const xAOD::TrackParticle * > TrackBag
Definition: BPhysAddMuonBasedInvMass.h:32
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::BVertexClosestTrackTool::CtItem::dca
double dca
Definition: BVertexClosestTrackTool.h:87
DerivationFramework::BVertexClosestTrackTool::super
BPhysVertexTrackBase super
Definition: BVertexClosestTrackTool.h:34
DerivationFramework::BVertexClosestTrackTool::m_closeTrackChi2SetName
std::vector< std::string > m_closeTrackChi2SetName
Definition: BVertexClosestTrackTool.h:130
item
Definition: ItemListSvc.h:43
DerivationFramework::BVertexClosestTrackTool::CtItem::vtap
std::vector< std::vector< double > > vtap
Definition: BVertexClosestTrackTool.h:97
DerivationFramework::BVertexClosestTrackTool::CtItem
Definition: BVertexClosestTrackTool.h:40
Name
JetDumper::Name Name
Definition: JetDumper.cxx:19
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
DerivationFramework::BVertexClosestTrackTool::m_closeTrackCorrChi2
std::vector< int > m_closeTrackCorrChi2
Definition: BVertexClosestTrackTool.h:131
DerivationFramework::BPhysVertexTrackBase::BaseItem
Definition: BPhysVertexTrackBase.h:60
DerivationFramework::BVertexClosestTrackTool::m_lastRunNumber
unsigned int m_lastRunNumber
Definition: BVertexClosestTrackTool.h:141
DerivationFramework::BVertexClosestTrackTool::CtItem::trkNDErr2
double trkNDErr2
Definition: BVertexClosestTrackTool.h:92
DerivationFramework::BVertexClosestTrackTool::m_svIdx
unsigned int m_svIdx
Definition: BVertexClosestTrackTool.h:145
DerivationFramework::BVertexClosestTrackTool::m_results
CtItem4_t m_results
Definition: BVertexClosestTrackTool.h:138
DerivationFramework::BVertexClosestTrackTool::CtItem::closeTrack
const xAOD::TrackParticle * closeTrack
Definition: BVertexClosestTrackTool.h:95
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DerivationFramework::BPhysVertexTrackBase
Definition: BPhysVertexTrackBase.h:57
DerivationFramework::BVertexClosestTrackTool::CtItem::selpat
std::vector< unsigned short > selpat
Definition: BVertexClosestTrackTool.h:98
DerivationFramework::BVertexClosestTrackTool
Definition: BVertexClosestTrackTool.h:31