ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Rec::NewVrtSecInclusiveTool Class Reference

#include <NewVrtSecInclusiveTool.h>

Inheritance diagram for Rec::NewVrtSecInclusiveTool:
Collaboration diagram for Rec::NewVrtSecInclusiveTool:

Classes

struct  DevTuple
 
struct  Hists
 
struct  Vrt2Tr
 
struct  WrkVrt
 

Public Member Functions

 NewVrtSecInclusiveTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~NewVrtSecInclusiveTool ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
std::unique_ptr< Trk::VxSecVertexInfofindAllVertices (const std::vector< const xAOD::TrackParticle * > &inputTracks, const xAOD::Vertex &primaryVertex) const final
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) 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 More...
 
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. More...
 

Private Types

using compatibilityGraph_t = boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS >
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

int getIdHF (const xAOD::TrackParticle *TP) const
 
std::vector< xAOD::Vertex * > getVrtSecMulti (workVectorArrxAOD *inpParticlesxAOD, const xAOD::Vertex &primVrt, compatibilityGraph_t &compatibilityGraph) const
 
void printWrkSet (const std::vector< WrkVrt > *WrkSet, const std::string &name) const
 
TLorentzVector momAtVrt (const std::vector< double > &inpTrk) const
 
double minVrtVrtDist (std::vector< WrkVrt > *WrkVrtSet, int &indexV1, int &indexV2, std::vector< double > &check) const
 
double distToMatLayerSignificance (Vrt2Tr &Vrt) const
 
double refitVertex (WrkVrt &Vrt, std::vector< const xAOD::TrackParticle * > &SelectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
 
double refineVerticesWithCommonTracks (WrkVrt &v1, WrkVrt &v2, std::vector< const xAOD::TrackParticle * > &allTrackList, Trk::IVKalState &istate) const
 
double mergeAndRefitVertices (WrkVrt &v1, WrkVrt &v2, WrkVrt &newvrt, std::vector< const xAOD::TrackParticle * > &AllTrackList, Trk::IVKalState &istate, int robKey=0) const
 
double improveVertexChi2 (WrkVrt &vertex, std::vector< const xAOD::TrackParticle * > &allTracks, Trk::IVKalState &istate, bool ifCovV0) const
 
void selGoodTrkParticle (workVectorArrxAOD *xAODwrk, const xAOD::Vertex &primVrt) const
 
void select2TrVrt (std::vector< const xAOD::TrackParticle * > &SelectedTracks, const xAOD::Vertex &primVrt, std::map< long int, std::vector< double >> &vrt, compatibilityGraph_t &compatibilityGraph) const
 
HistsgetHists () const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static int notFromBC (int PDGID)
 
static const xAOD::TruthParticlegetPreviousParent (const xAOD::TruthParticle *child, int &ParentPDG)
 
static int getG4Inter (const xAOD::TrackParticle *TP)
 
static int getMCPileup (const xAOD::TrackParticle *TP)
 
static double massV0 (const std::vector< std::vector< double > > &TrkAtVrt, double massP, double massPi)
 
static double vrtRadiusError (const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
 
static int nTrkCommon (std::vector< WrkVrt > *WrkVrtSet, int indexV1, int indexV2)
 
static bool isPart (const std::deque< long int > &test, std::deque< long int > base)
 
static std::vector< double > estimVrtPos (int nTrk, std::deque< long int > &selTrk, std::map< long int, std::vector< double >> &vrt)
 
static double vrtVrtDist (const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
 
static double vrtVrtDist2D (const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
 
static double vrtVrtDist (const Amg::Vector3D &vrt1, const std::vector< double > &vrtErr1, const Amg::Vector3D &vrt2, const std::vector< double > &vrtErr2)
 
static double PntPntDist (const Amg::Vector3D &Vrt1, const Amg::Vector3D &Vrt2)
 
static double projSV_PV (const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
 
static double MomProjDist (const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
 
static int mostHeavyTrk (WrkVrt V, std::vector< const xAOD::TrackParticle * > AllTracks)
 
static void getPixelDiscs (const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
 
static int getIBLHit (const xAOD::TrackParticle *Part)
 
static int getBLHit (const xAOD::TrackParticle *Part)
 

Private Attributes

double m_w_1 {}
 
std::unique_ptr< Histsm_h
 
long int m_cutSctHits {}
 
long int m_cutPixelHits {}
 
long int m_cutTRTHits {}
 
long int m_cutSiHits {}
 
long int m_cutBLayHits {}
 
long int m_cutSharedHits {}
 
double m_cutPt {}
 
double m_cutZVrt {}
 
double m_cutD0Max {}
 
double m_cutD0Min {}
 
double m_cutChi2 {}
 
double m_sel2VrtProbCut {}
 
double m_globVrtProbCut {}
 
double m_maxSVRadiusCut {}
 
double m_selVrtSigCut {}
 
double m_trkSigCut {}
 
float m_vrtMassLimit {}
 
float m_vrt2TrMassLimit {}
 
float m_vrt2TrPtLimit {}
 
float m_antiPileupSigRCut {}
 
float m_dRdZRatioCut {}
 
float m_v2tIniBDTCut {}
 
float m_v2tFinBDTCut {}
 
float m_vertexMergeCut {}
 
float m_beampipeR {}
 
float m_firstPixelLayerR {}
 
float m_removeTrkMatSignif {}
 
float m_fastZSVCut {}
 
float m_cosSVPVCut {}
 
bool m_fillHist {}
 
bool m_useVertexCleaning {}
 
bool m_multiWithOneTrkVrt {}
 
std::string m_calibFileName
 
std::unique_ptr< MVAUtils::BDTm_SV2T_BDT
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 
ToolHandle< Trk::IExtrapolatorm_extrapolator {this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator"}
 
ToolHandle< Trk::TrkVKalVrtFitterm_fitSvc
 
double m_massPi {}
 
double m_massP {}
 
double m_massE {}
 
double m_massK0 {}
 
double m_massLam {}
 
std::string m_instanceName
 
float m_chiScale [11] {}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 75 of file NewVrtSecInclusiveTool.h.

Member Typedef Documentation

◆ compatibilityGraph_t

using Rec::NewVrtSecInclusiveTool::compatibilityGraph_t = boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>
private

Definition at line 278 of file NewVrtSecInclusiveTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ NewVrtSecInclusiveTool()

Rec::NewVrtSecInclusiveTool::NewVrtSecInclusiveTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 31 of file NewVrtSecInclusiveTool.cxx.

33  :
35  m_cutSctHits(4),
36  m_cutPixelHits(2),
37  m_cutTRTHits(10),
38  m_cutSiHits(8),
39  m_cutBLayHits(0),
40  m_cutSharedHits(1),
41  m_cutPt(500.),
42  m_cutZVrt(15.),
43  m_cutD0Max(10.),
44  m_cutD0Min(0.),
45  m_cutChi2(5.),
46  m_sel2VrtProbCut(0.02),
47  m_globVrtProbCut(0.005),
48  m_maxSVRadiusCut(140.),
49  m_selVrtSigCut(3.0),
50  m_trkSigCut(2.0),
51  m_vrtMassLimit(5500.),
52  m_vrt2TrMassLimit(4000.),
53  m_vrt2TrPtLimit(5.e5),
55  m_dRdZRatioCut(0.25),
56  m_v2tIniBDTCut(-0.6),
57  m_v2tFinBDTCut(0.),
58  m_vertexMergeCut(4.),
59  m_beampipeR(24.3),
60  m_firstPixelLayerR(32.0),
62  m_fastZSVCut(15.),
63  m_cosSVPVCut(0.),
64  m_fillHist(false),
65  m_useVertexCleaning(true),
67  m_calibFileName("Fake2TrVertexReject.MVA.v02.root"),
68  m_SV2T_BDT(nullptr),
69  m_fitSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this)
70  {
71 //
72 // Declare additional interface
73 //
74  declareInterface< IVrtInclusive >(this);
75 // Properties
76 //
77 //
78  declareProperty("CutSctHits", m_cutSctHits , "Remove track is it has less SCT hits" );
79  declareProperty("CutPixelHits", m_cutPixelHits, "Remove track is it has less Pixel hits");
80  declareProperty("CutTRTHits", m_cutTRTHits, "Remove track is it has less TRT hits");
81  declareProperty("CutSiHits", m_cutSiHits, "Remove track is it has less Pixel+SCT hits" );
82  declareProperty("CutBLayHits", m_cutBLayHits, "Remove track is it has less B-layer hits" );
83  declareProperty("CutSharedHits", m_cutSharedHits,"Reject final 2tr vertices if tracks have shared hits" );
84 
85  declareProperty("CutPt", m_cutPt, "Track Pt selection cut" );
86  declareProperty("CutD0Min", m_cutD0Min, "Track minimal D0 selection cut" );
87  declareProperty("CutD0Max", m_cutD0Max, "Track maximal D0 selection cut" );
88  declareProperty("CutZVrt", m_cutZVrt, "Track Z impact selection cut");
89  declareProperty("CutChi2", m_cutChi2, "Track Chi2 selection cut" );
90  declareProperty("TrkSigCut", m_trkSigCut, "Track 3D impact significance w/r primary vertex. Should be >=AntiPileupSigRCut" );
91 
92  declareProperty("VrtMassLimit", m_vrtMassLimit, "Maximal allowed mass for found vertices" );
93  declareProperty("Vrt2TrMassLimit",m_vrt2TrMassLimit,"Maximal allowed mass for 2-track vertices" );
94  declareProperty("Vrt2TrPtLimit", m_vrt2TrPtLimit, "Maximal allowed Pt for 2-track vertices. Calibration limit" );
95 
96  declareProperty("Sel2VrtProbCut", m_sel2VrtProbCut, "Cut on probability of 2-track vertex for initial selection" );
97  declareProperty("GlobVrtProbCut", m_globVrtProbCut, "Cut on probability of any vertex for final selection" );
98  declareProperty("MaxSVRadiusCut", m_maxSVRadiusCut, "Cut on maximal radius of SV (def = Pixel detector size)" );
99  declareProperty("SelVrtSigCut", m_selVrtSigCut, "Cut on significance of 3D distance between vertex and PV" );
100  declareProperty("AntiPileupSigRCut", m_antiPileupSigRCut, "Upper cut on significance of 2D distance between beam and perigee" );
101  declareProperty("dRdZRatioCut", m_dRdZRatioCut, "Cut on dR/dZ ratio to remove pileup tracks" );
102  declareProperty("v2tIniBDTCut", m_v2tIniBDTCut, "Initial BDT cut for 2track vertices selection " );
103  declareProperty("v2tFinBDTCut", m_v2tFinBDTCut, "Final BDT cut for 2track vertices selection " );
104  declareProperty("FastZSVCut", m_fastZSVCut, "Cut to remove SV candidates based on fast SV estimation. To save full fit CPU." );
105  declareProperty("cosSVPVCut", m_cosSVPVCut, "Cut on cos of angle between SV-PV and full vertex momentum" );
106 
107  declareProperty("FillHist", m_fillHist, "Fill technical histograms" );
108 
109 
110  declareProperty("useVertexCleaning", m_useVertexCleaning, "Clean vertices by requiring pixel hit presence according to vertex position" );
111 
112  declareProperty("MultiWithOneTrkVrt", m_multiWithOneTrkVrt,"Allow one-track-vertex addition to already found secondary vertices");
113 
114  declareProperty("VertexMergeCut", m_vertexMergeCut, "To allow vertex merging for MultiVertex Finder" );
115 
116  declareProperty("BeampipeR", m_beampipeR, "Radius of the beampipe material for aggressive material rejection" );
117  declareProperty("FirstPixelLayerR", m_firstPixelLayerR, "Radius of the first Pixel layer" );
118  declareProperty("removeTrkMatSignif", m_removeTrkMatSignif, "Significance of Vertex-TrackingMaterial distance for removal. No removal if <=0." );
119 
120  declareProperty("calibFileName", m_calibFileName, " MVA calibration file for 2-track fake vertices removal" );
121 
122  declareProperty("VertexFitterTool", m_fitSvc, "Name of the Vertex Fitter tool");
123 //
128  m_massLam = 1115.683 ;
130 
131  }

◆ ~NewVrtSecInclusiveTool()

Rec::NewVrtSecInclusiveTool::~NewVrtSecInclusiveTool ( )
virtual

Definition at line 134 of file NewVrtSecInclusiveTool.cxx.

134  {
135  ATH_MSG_DEBUG("NewVrtSecInclusiveTool destructor called");
136  }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ distToMatLayerSignificance()

double Rec::NewVrtSecInclusiveTool::distToMatLayerSignificance ( Vrt2Tr Vrt) const
private

Definition at line 315 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

316  {
317  const EventContext& ctx = Gaudi::Hive::currentContext();
318  if(Vrt.fitVertex.perp()<20.) return 1.e9;
319  double normP=1./Vrt.momentum.P();
320  Amg::Vector3D momentumP(Vrt.momentum.Px()*normP,Vrt.momentum.Py()*normP,Vrt.momentum.Pz()*normP);
321  Amg::Vector3D momentumN=-momentumP;
322 
323  const Trk::Layer * someLayer = nullptr;
324  const Trk::Layer * nextLayerP = nullptr;
325  const Trk::Layer * nextLayerN = nullptr;
326  const auto *volume = m_extrapolator->trackingGeometry()->lowestTrackingVolume(Vrt.fitVertex);
327  someLayer = volume->associatedLayer(Vrt.fitVertex);
328  const auto *material = someLayer->layerMaterialProperties();
329  if(material){
330  nextLayerP=someLayer;
331  } else {
332  nextLayerP = someLayer->nextLayer(Vrt.fitVertex,momentumP);
333  if(nextLayerP){ if(!nextLayerP->layerMaterialProperties())nextLayerP=nullptr; }
334  nextLayerN = someLayer->nextLayer(Vrt.fitVertex,momentumN);
335  if(nextLayerN){ if(!nextLayerN->layerMaterialProperties())nextLayerN=nullptr; }
336  }
337  momentumP *= 1.e5; //100GeV to have straight trajectory
338  double charge = 1.;
339  const Trk::Perigee pseudoVrtPart(Vrt.fitVertex, momentumP, charge, Vrt.fitVertex);
340 
341  const Trk::TrackParameters * extrapParP=nullptr; //along momentum
342  const Trk::TrackParameters * extrapParN=nullptr; //backward
343  if(nextLayerP){ extrapParP = m_extrapolator->extrapolate(ctx, pseudoVrtPart,
344  nextLayerP->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon).release();}
345  if(nextLayerN){ extrapParN = m_extrapolator->extrapolate(ctx, pseudoVrtPart,
346  nextLayerN->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon).release();}
347 
348  float distanceP=1.e9, distanceN=1.e9;
349  if(extrapParP)distanceP=PntPntDist(extrapParP->position(), Vrt.fitVertex);
350  if(extrapParN)distanceN=PntPntDist(extrapParN->position(), Vrt.fitVertex);
351  if(distanceP==1.e9 && distanceN==1.e9) return 1.e9;
352 
353  //std::pair<const Trk::TrackParameters*,const Trk::Layer*> next=
354  // m_extrapolator->extrapolateToNextActiveLayer(pseudoVrtPart,Trk::anyDirection,true,Trk::pion) ;
355 
356  double signif=1.e9;
357  std::vector<double> pntCovar={1.e-2,0.,1.e-2,0.,0.,4.e-2};
358  if(distanceP<distanceN)signif=vrtVrtDist(Vrt.fitVertex, Vrt.errorMatrix, extrapParP->position(), pntCovar);
359  else signif=vrtVrtDist(Vrt.fitVertex, Vrt.errorMatrix, extrapParN->position(), pntCovar);
360  delete extrapParP;
361  delete extrapParN;
362  return signif;
363  }

◆ estimVrtPos()

std::vector< double > Rec::NewVrtSecInclusiveTool::estimVrtPos ( int  nTrk,
std::deque< long int > &  selTrk,
std::map< long int, std::vector< double >> &  vrt 
)
staticprivate

Definition at line 365 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

366  {
367  std::vector<double> estimation(3,0.);
368  int ntsel=selTrk.size();
369  for( int i=0; i<ntsel-1; i++){
370  for( int j=i+1; j<ntsel; j++){
371  int k = selTrk[i]<selTrk[j] ? selTrk[i]*nTrk+selTrk[j] : selTrk[j]*nTrk+selTrk[i];
372  estimation[0]+=vrt.at(k)[0];
373  estimation[1]+=vrt[k][1];
374  estimation[2]+=vrt[k][2];
375  } }
376  estimation[0] /= ntsel*(ntsel-1)/2;
377  estimation[1] /= ntsel*(ntsel-1)/2;
378  estimation[2] /= ntsel*(ntsel-1)/2;
379  return estimation;
380  }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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

◆ finalize()

StatusCode Rec::NewVrtSecInclusiveTool::finalize ( )

Definition at line 310 of file NewVrtSecInclusiveTool.cxx.

311  {
312  ATH_MSG_DEBUG("NewVrtSecInclusiveTool finalize()");
313  return StatusCode::SUCCESS;
314  }

◆ findAllVertices()

std::unique_ptr< Trk::VxSecVertexInfo > Rec::NewVrtSecInclusiveTool::findAllVertices ( const std::vector< const xAOD::TrackParticle * > &  inputTracks,
const xAOD::Vertex primaryVertex 
) const
finalvirtual

Implements Rec::IVrtInclusive.

Definition at line 319 of file NewVrtSecInclusiveTool.cxx.

322  {
323  std::vector<xAOD::Vertex*> listVrtSec(0);
324 
325  if(m_fillHist) {
326  Hists& h = getHists();
327  h.m_curTup->nTrk=0;
328  h.m_curTup->n2Vrt=0;
329  h.m_curTup->nNVrt=0;
330  };
331 
332  workVectorArrxAOD * tmpVectxAOD=new workVectorArrxAOD();
333  tmpVectxAOD->inpTrk.resize(inpTrk.size());
334  std::copy(inpTrk.begin(),inpTrk.end(), tmpVectxAOD->inpTrk.begin());
336  tmpVectxAOD->beamX=beamSpotHandle->beamPos().x();
337  tmpVectxAOD->beamY=beamSpotHandle->beamPos().y();
338  tmpVectxAOD->beamZ=beamSpotHandle->beamPos().z();
339  tmpVectxAOD->tanBeamTiltX=tan(beamSpotHandle->beamTilt(0));
340  tmpVectxAOD->tanBeamTiltY=tan(beamSpotHandle->beamTilt(1));
341 
342  compatibilityGraph_t compatibilityGraph;
343  listVrtSec = getVrtSecMulti(tmpVectxAOD,primVrt,compatibilityGraph);
344  delete tmpVectxAOD;
345 
346 
347 
348  std::vector<const xAOD::IParticle*> iparTrkV0(0);
349  std::unique_ptr<Trk::VxSecVertexInfo> res = std::make_unique<Trk::VxSecVertexInfo>(Trk::VxSecVertexInfo(listVrtSec));
350 
351  if(m_fillHist){
352  Hists& h = getHists();
353  h.m_tuple->Fill();
354  };
355 
356  return res;
357  }

◆ getBLHit()

int Rec::NewVrtSecInclusiveTool::getBLHit ( const xAOD::TrackParticle Part)
staticprivate

Definition at line 224 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

225  {
226  uint8_t BLhit,BLexp;
227  if(!Part->summaryValue( BLexp, xAOD::expectNextToInnermostPixelLayerHit) ) BLexp = 0;
228  if( BLexp==0 ) return -1;
229  if(!Part->summaryValue( BLhit, xAOD::numberOfNextToInnermostPixelLayerHits) ) BLhit = 0;
230  if(BLhit) return 1;
231  else return 0;
232  }

◆ getG4Inter()

int Rec::NewVrtSecInclusiveTool::getG4Inter ( const xAOD::TrackParticle TP)
staticprivate

Definition at line 294 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

294  {
296  truthParticleLinkAcc ( "truthParticleLink");
297  if( truthParticleLinkAcc.isAvailable( *TP ) ) {
299  truthParticleLinkAcc( *TP );
300  if( tplink.isValid() && HepMC::is_simulation_particle((*tplink))) return 1;
301  }
302  return 0;
303  }

◆ getHists()

NewVrtSecInclusiveTool::Hists & Rec::NewVrtSecInclusiveTool::getHists ( ) const
private

Definition at line 361 of file NewVrtSecInclusiveTool.cxx.

362  {
363  // We earlier checked that no more than one thread is being used.
364  Hists* h ATLAS_THREAD_SAFE = m_h.get();
365  return *h;
366  }

◆ getIBLHit()

int Rec::NewVrtSecInclusiveTool::getIBLHit ( const xAOD::TrackParticle Part)
staticprivate

Definition at line 215 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

216  {
217  uint8_t IBLhit,IBLexp;
218  if(!Part->summaryValue( IBLexp, xAOD::expectInnermostPixelLayerHit) ) IBLexp = 0;
219  if( IBLexp==0 ) return -1;
220  if(!Part->summaryValue( IBLhit, xAOD::numberOfInnermostPixelLayerHits) ) IBLhit = 0;
221  if(IBLhit) return 1;
222  else return 0;
223  }

◆ getIdHF()

int Rec::NewVrtSecInclusiveTool::getIdHF ( const xAOD::TrackParticle TP) const
private

Definition at line 243 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

243  {
245  truthParticleLinkAcc ( "truthParticleLink");
246  if( truthParticleLinkAcc.isAvailable(*TP) ) {
248  truthParticleLinkAcc(*TP);
249  if( !tplink.isValid() ) return 0;
250  static const SG::ConstAccessor< float >
251  truthMatchProbabilityAcc ( "truthMatchProbability" );
252  if( truthMatchProbabilityAcc( *TP ) < 0.75 ) return 0;
253  if( HepMC::is_simulation_particle((*tplink))) return 0;
254  if( (*tplink)->hasProdVtx()){
255  if( (*tplink)->prodVtx()->nIncomingParticles()==1){
256  int PDGID1=0, PDGID2=0, PDGID3=0;
257  const xAOD::TruthParticle * parTP1=getPreviousParent(*tplink, PDGID1);
258  const xAOD::TruthParticle * parTP2=nullptr;
259  int noBC1=notFromBC(PDGID1);
260  if(noBC1) parTP2 = getPreviousParent(parTP1, PDGID2);
261  int noBC2=notFromBC(PDGID2);
262  if(noBC2 && parTP2) getPreviousParent(parTP2, PDGID3);
263  int noBC3=notFromBC(PDGID3);
264  if((*tplink)->prodVtx()->perp()>1.)return 1.; //For SUSY studies
265  if(noBC1 && noBC2 && noBC3)return 0;
266  return 1; //This is a reconstructed track from B/C decays
267  } } }
268  return 0;
269  }

◆ getMCPileup()

int Rec::NewVrtSecInclusiveTool::getMCPileup ( const xAOD::TrackParticle TP)
staticprivate

Definition at line 304 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

304  {
306  truthParticleLinkAcc ( "truthParticleLink");
307  if( truthParticleLinkAcc.isAvailable( *TP ) ) {
309  truthParticleLinkAcc( *TP );
310  if( !tplink.isValid() ) return 1;
311  } else { return 1; }
312  return 0;
313  }

◆ getPixelDiscs()

void Rec::NewVrtSecInclusiveTool::getPixelDiscs ( const xAOD::TrackParticle Part,
int &  d0Hit,
int &  d1Hit,
int &  d2Hit 
)
staticprivate

Definition at line 234 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

235  {
236  uint32_t HitPattern=Part->hitPattern();
237  d0Hit=0; if( HitPattern&((1<<Trk::pixelEndCap0)) ) d0Hit=1;
238  d1Hit=0; if( HitPattern&((1<<Trk::pixelEndCap1)) ) d1Hit=1;
239  d2Hit=0; if( HitPattern&((1<<Trk::pixelEndCap2)) ) d2Hit=1;
240  }

◆ getPreviousParent()

const xAOD::TruthParticle * Rec::NewVrtSecInclusiveTool::getPreviousParent ( const xAOD::TruthParticle child,
int &  ParentPDG 
)
staticprivate

Definition at line 282 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

282  {
283  ParentPDG=0;
284  if( child->hasProdVtx() ){
285  if( child->prodVtx()->nIncomingParticles()==1 ){
286  ParentPDG = std::abs((*(child->prodVtx()->incomingParticleLinks())[0])->pdgId());
287  return *(child->prodVtx()->incomingParticleLinks())[0];
288  }
289  }
290  return nullptr;
291  }

◆ getVrtSecMulti()

std::vector< xAOD::Vertex * > Rec::NewVrtSecInclusiveTool::getVrtSecMulti ( workVectorArrxAOD inpParticlesxAOD,
const xAOD::Vertex primVrt,
compatibilityGraph_t compatibilityGraph 
) const
private

Definition at line 28 of file VrtSecMulti.cxx.

32  {
33 
34  const double probVrtMergeLimit=0.01;
35 
36  int i,j;
37  int inpNPart=xAODwrk->inpTrk.size();
38  std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
39  ATH_MSG_DEBUG( "getVrtSecMulti() called with NPart=" << inpNPart);
40 
41  std::vector<xAOD::Vertex*> finalVertices(0);
42 
43  if( inpNPart < 2 ) { return finalVertices;} // 0,1 track => nothing to do!
44 
45  selGoodTrkParticle( xAODwrk, primVrt);
46  int nTracks = xAODwrk->listSelTracks.size();
47 
48  if( nTracks < 2 ) { return finalVertices;} // 0,1 selected track => nothing to do!
49 
50  ATH_MSG_DEBUG( "Number of selected tracks = " <<nTracks);
51 
52  if(m_fillHist){
53  Hists& h = getHists();
54  h.m_hb_ntrksel->Fill( (double) nTracks, m_w_1);
55  }
56 
57 //
58 // inpTrk[] - input track list
59 // listSelTracks[] - list of good tracks in jet for vertex search
60 //------------------------------------------------------------
61 // Initial track list ready
62 // Find 2track vertices
63 //
64 
65  std::map<long int,std::vector<double>> foundVrt2t;
66  select2TrVrt(xAODwrk->listSelTracks, primVrt, foundVrt2t, compatibilityGraph);
67 
68 //---
69  ATH_MSG_DEBUG(" Defined edges in the graph="<< num_edges(compatibilityGraph));
70  if(num_edges(compatibilityGraph)==0){ return finalVertices;} //No vertices!
71 
72 //
73 // m_Incomp[] - main vector of pointers for multivertex search
74 //-----------------------------------------------------------------------------------------------------
75 // Secondary track list is ready
76 // Creation of initial vertex set
77 //
78 
79 
80  std::unique_ptr<std::vector<WrkVrt>> wrkVrtSet = std::make_unique<std::vector<WrkVrt>>();
81  WrkVrt newvrt; newvrt.Good=true;
82  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
83  StatusCode sc;
84  long int NPTR=0, nth=2; // VK nth=2 to speed up PGRAPH when it's used
85 
86 
87  std::vector< std::vector<int> > allCliques;
88  bron_kerbosch_all_cliques(compatibilityGraph, clique_visitor(allCliques));
89  for(int cq=0; cq<(int)allCliques.size();cq++){
90  newvrt.selTrk.clear();
91  NPTR=allCliques[cq].size();
92  for(i=0;i<NPTR;i++){ newvrt.selTrk.push_back(allCliques[cq][i]);}
93 //==================================================
94  xAODwrk->tmpListTracks.clear();
95  TLorentzVector vpsum;
96  for(i=0;i<NPTR;i++) {
97  xAODwrk->tmpListTracks.push_back( xAODwrk->listSelTracks.at(newvrt.selTrk[i]) );
98  vpsum += xAODwrk->listSelTracks.at(newvrt.selTrk[i])->p4();
99  }
100  std::vector<double> iniVrtPos=estimVrtPos(nTracks,newvrt.selTrk,foundVrt2t);
101  m_fitSvc->setApproximateVertex(iniVrtPos[0], iniVrtPos[1], iniVrtPos[2], *state); /*Use as starting point*/
102  sc=m_fitSvc->VKalVrtFit(xAODwrk->tmpListTracks, neutralPartDummy,
103  newvrt.vertex, newvrt.vertexMom, newvrt.vertexCharge, newvrt.vertexCov,
104  newvrt.chi2PerTrk, newvrt.trkAtVrt, newvrt.chi2,
105  *state, false);
106  if( sc.isFailure() ) continue; /* Bad fit - goto next solution */
107  ATH_MSG_VERBOSE("Found IniVertex="<<newvrt.vertex[0]<<", "<<newvrt.vertex[1]<<", "<<newvrt.vertex[2]);
108  ATH_MSG_VERBOSE("with Chi2="<<newvrt.chi2<<" Ntrk="<<NPTR<<" trk1,2="<<newvrt.selTrk[0]<<", "<<newvrt.selTrk[1]);
109  if(NPTR==2 && newvrt.chi2>10.) continue; /* Bad 2track vertex */
110  if(newvrt.chi2PerTrk.size()==2) newvrt.chi2PerTrk[0]=newvrt.chi2PerTrk[1]=newvrt.chi2/2.;
111  newvrt.Good = true;
112  newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom); //3D SV-PV distance
113  wrkVrtSet->push_back(newvrt);
114  }
115  std::sort(wrkVrtSet->begin(),wrkVrtSet->end(),[](WrkVrt a, WrkVrt b){return a.selTrk.size()>b.selTrk.size();});
116 //==================================================================================
117 // boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>::vertex_iterator vertexIt, vertexEnd;
118 // boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>::adjacency_iterator neighbourIt, neighbourEnd;
119 // tie(vertexIt, vertexEnd) = vertices(compatibilityGraph);
120 // for (; vertexIt != vertexEnd; ++vertexIt) { std::cout << *vertexIt << " is connected with ";
121 // tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt, compatibilityGraph);
122 // for (; neighbourIt != neighbourEnd; ++neighbourIt) std::cout << *neighbourIt << " "; std::cout << "\n"; }
123 //==================================================================================
124  if((*wrkVrtSet).empty())return finalVertices;
125  if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Initial Vertices");
126  //
127  //--Count track participation in different vertices
128  std::vector<int> trkNPairs(nTracks,0);
129  for(auto &vrt : (*wrkVrtSet)){
130  int ntInV=vrt.selTrk.size()-1;
131  for(auto &trk : vrt.selTrk)trkNPairs.at(trk) += ntInV;
132  }
133 //
134 //- Resolve all overlapped vertices
135 //
136  state = m_fitSvc->makeState();
137  std::multimap<double,std::pair<int,int>> vrtWithCommonTrk;
138  while(true){
139  int nSoluI=(*wrkVrtSet).size();
140  vrtWithCommonTrk.clear();
141  unsigned int nTComMax=0;
142  for(int iv=0; iv<nSoluI-1; iv++ ){
143  if(!(*wrkVrtSet)[iv].Good) continue;
144  if( (*wrkVrtSet)[iv].selTrk.size()<nTComMax) continue; // Optimisation. Only biggest overlap matters
145  for(int jv=iv+1; jv<nSoluI; jv++){
146  if(!(*wrkVrtSet)[jv].Good) continue;
147  if( (*wrkVrtSet)[jv].selTrk.size()<nTComMax) continue; // Optimisation. Only biggest overlap matters
148  unsigned int nTCom=nTrkCommon( wrkVrtSet.get(), iv, jv);
149  if(!nTCom) continue;
150  if(nTCom<nTComMax) continue;
151  double sumChi2=(*wrkVrtSet)[iv].chi2+(*wrkVrtSet)[jv].chi2;
152  sumChi2=std::min(sumChi2,999.)*1.e-3;
153  vrtWithCommonTrk.emplace(nTCom+sumChi2,std::make_pair(iv,jv));
154  nTComMax=std::max(nTComMax,nTCom);
155  } }
156  if(vrtWithCommonTrk.empty())break;
157  //============================== DEBUG output
158  //for(auto ku : vrtWithCommonTrk)std::cout<<" nCom="<<ku.first<<" v1="<<ku.second.first<<" v2="<<ku.second.second<<'\n';
159  //if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Overlapped Vertex Cleaning");
160  //===========================================
161  std::multimap<double,std::pair<int,int>>::reverse_iterator ovitr=vrtWithCommonTrk.rbegin();
162  for( ; ovitr!=vrtWithCommonTrk.rend(); ovitr++){
163  WrkVrt & v1 = (*wrkVrtSet)[(*ovitr).second.first];
164  WrkVrt & v2 = (*wrkVrtSet)[(*ovitr).second.second];
165  if(!v1.Good)continue; //----One of the vertices is already preocessed
166  if(!v2.Good)continue;
167  //--Recheck amount of common tracks
168  unsigned int nTCom=nTrkCommon( wrkVrtSet.get(), (*ovitr).second.first, (*ovitr).second.second);
169  if(nTCom<nTComMax)continue; //----One of the vertices is already preocessed
170  //--First check if one vertex is fully contained in another
171  if( nTCom==v1.selTrk.size() || nTCom==v2.selTrk.size() ){
172  if(nTCom==v1.selTrk.size()){v1.Good = false; continue;}
173  if(nTCom==v2.selTrk.size()){v2.Good = false; continue;}
174  }
175  //--Then check if 2 vertices with common tracks can be simply merged
176  if( nTCom>1 && TMath::Prob( v1.chi2, 2*v1.selTrk.size()-3) > probVrtMergeLimit
177  && TMath::Prob( v2.chi2, 2*v2.selTrk.size()-3) > probVrtMergeLimit){
178  double prbV=mergeAndRefitVertices( v1, v2, newvrt, xAODwrk->listSelTracks, *state);
179  if(prbV>probVrtMergeLimit){
180  v1.Good = false; v2.Good = false;
181  newvrt.Good = true;
182  newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom); //3D SV-PV distance
183  std::swap(v1,newvrt); //Replace v1 by new vertex
184  continue;
185  } }
186  //--If not mergeable - refine them
187  refineVerticesWithCommonTracks( v1, v2, xAODwrk->listSelTracks, *state);
188  }
189  }
190  if(m_fillHist){
191  int cvgood=0; for(const auto& vrt:(*wrkVrtSet)) if(vrt.Good)cvgood++;
192  Hists& h = getHists();
193  h.m_hb_rawVrtN->Fill( (float)cvgood, m_w_1);
194  }
195 //
196 //-Clean duplicated 1track vertices if they exist
197 //
199  for(auto &v1t : (*wrkVrtSet)){
200  if(v1t.selTrk.size()!=1 || !v1t.Good)continue;
201  int ind_t=v1t.selTrk[0];
202  if(trkNPairs[ind_t]<2){ v1t.Good=false; continue; } //Remove 1tr-vertex if track crosses only one other track
203  if( xAODwrk->listSelTracks[ind_t]->pt()<m_cutPt*2){ v1t.Good=false; continue; }; //Tighten track_pt cut for 1-track vertex
204  for(auto &vrt :(*wrkVrtSet)){ // Check if the track is present in another vertex, including other 1-track ones
205  if(!vrt.Good || &v1t==&vrt)continue;
206  if(std::find(vrt.selTrk.begin(),vrt.selTrk.end(),ind_t) != vrt.selTrk.end()){ v1t.Good=false; break; }
207  } }
208  }
209 //
210 //-Remove all bad vertices from the working set
211 //
212  int tmpV=0; while( tmpV<(int)(*wrkVrtSet).size() )if( !(*wrkVrtSet)[tmpV].Good ) { (*wrkVrtSet).erase((*wrkVrtSet).begin()+tmpV);} else {tmpV++;}
213  if((*wrkVrtSet).empty())return finalVertices;
214  if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Intermediate Vertices");
215  for( auto &tmpV : (*wrkVrtSet) ) tmpV.projectedVrt=MomProjDist(tmpV.vertex, primVrt, tmpV.vertexMom ); //Setup ProjectedVrt
216 //----------------------------------------------------------------------------
217 
218 //----------------------------------------------------------------------------
219 //
220 // Final check/merge for close vertices
221 //
222  int foundV1=-1, foundV2=-1;
223  std::vector<double> checkedDst(0);
224  double minDistVV=minVrtVrtDist( wrkVrtSet.get(), foundV1, foundV2, checkedDst); //recalculate VV distances
225  if(m_fillHist){
226  Hists& h = getHists();
227  h.m_hb_distVV->Fill( minDistVV, m_w_1);
228  }
229  while ( minDistVV < m_vertexMergeCut) {
230  if(foundV1<foundV2) { int tmp=foundV1; foundV1=foundV2; foundV2=tmp;}
231  double probV=mergeAndRefitVertices( (*wrkVrtSet)[foundV1], (*wrkVrtSet)[foundV2], newvrt, xAODwrk->listSelTracks, *state, 0);
232  ATH_MSG_DEBUG( "Merged vertex prob=" << probV<<" Vrt1="<<foundV1<<" Vrt2="<<foundV2<<" dst="<<minDistVV);
233  if(probV<probVrtMergeLimit){ //--- If merged vertex is bad - try to remove the worst track
234  int pos=std::max_element(newvrt.chi2PerTrk.begin(),newvrt.chi2PerTrk.end())-newvrt.chi2PerTrk.begin();
235  newvrt.detachedTrack=newvrt.selTrk[pos];
236  newvrt.selTrk.erase(newvrt.selTrk.begin()+pos);
237  probV = refitVertex( newvrt, xAODwrk->listSelTracks, *state, false);
238  ATH_MSG_DEBUG( "Attempt to improve prob=" << probV);
239  }
240  if(probV>probVrtMergeLimit && newvrt.vertexMom.M()<m_vrtMassLimit){ // Good merged vertex found
241  newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom);
242  std::swap((*wrkVrtSet)[foundV1],newvrt);
243  (*wrkVrtSet)[foundV2].Good=false; //Drop vertex
244  (*wrkVrtSet)[foundV2].selTrk.clear(); //Clean dropped vertex
245  } else checkedDst.push_back(minDistVV);
246  minDistVV=minVrtVrtDist( wrkVrtSet.get(), foundV1, foundV2, checkedDst);
247  }
248 //
249 // Try to improve vertices with big Chi2 if something went wrong. Just precaution.
250  for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
251  if(!(*wrkVrtSet)[iv].Good ) continue; //don't work on vertex which is already bad
252  if( (*wrkVrtSet)[iv].selTrk.size()<3 ) continue;
253  double tmpProb=TMath::Prob( (*wrkVrtSet)[iv].chi2, 2*(*wrkVrtSet)[iv].selTrk.size()-3 ); //Chi2 of the original vertex
254  if(tmpProb<m_globVrtProbCut){
255  ATH_MSG_DEBUG( "BAD vertex found prob=" << tmpProb);
256  tmpProb=improveVertexChi2( (*wrkVrtSet)[iv], xAODwrk->listSelTracks, *state, false);
257  (*wrkVrtSet)[iv].projectedVrt=MomProjDist((*wrkVrtSet)[iv].vertex, primVrt, (*wrkVrtSet)[iv].vertexMom);
258  }
259  }
260 //
261 //-Modify too heavy vertices
262  for(auto & iv : (*wrkVrtSet)){
263  if( iv.vertexMom.M()>m_vrtMassLimit ) {
264  ATH_MSG_DEBUG( "Heavy vertex found Mass=" << iv.vertexMom.M());
265  int it_bad=mostHeavyTrk(iv,xAODwrk->listSelTracks);
266  if(it_bad>-1){
267  iv.selTrk.erase( iv.selTrk.begin() + it_bad );
268  refitVertex(iv, xAODwrk->listSelTracks, *state, false);
269  iv.projectedVrt=MomProjDist(iv.vertex, primVrt, iv.vertexMom);
270  } } }
271 //--------------------------------------------------------------------------------------------------------
272 // Final vertex selection/cleaning
273 //
274  double signif3D=0., signif2D=0.;
275 
276 //----- Vertices with >1 tracks
277  for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
278  WrkVrt & curVrt=(*wrkVrtSet)[iv];
279  nth=(*wrkVrtSet)[iv].selTrk.size();
280  if(nth == 1) continue; // 1track vertices for later...
281  if(!curVrt.Good ) continue; //don't work on vertex which is already bad
282  (*wrkVrtSet)[iv].Good = false; /* Make all vertices bad for futher selection */
283  if(nth < 1) continue; /* Definitely bad vertices */
284  if((*wrkVrtSet)[iv].projectedVrt<0.) continue; /* Remove vertices behind primary one */
285  if( TMath::Prob( curVrt.chi2, 2*nth-3)<m_globVrtProbCut) continue; /* Bad Chi2 of refitted vertex */
286 //-----------------------------------------------------------------------------------------
287  vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, signif3D);
288  if(m_fillHist){
289  Hists& h = getHists();
290  if(nth==2 && curVrt.vertexCharge==0) h.m_hb_massPiPi1->Fill(curVrt.vertexMom.M(), m_w_1);
291  h.m_hb_sig3DTot->Fill( signif3D, m_w_1);
292  if(nth==2)h.m_hb_sig3D2tr->Fill( signif3D, m_w_1);
293  if(nth >2)h.m_hb_sig3DNtr->Fill( signif3D, m_w_1);
294  }
295 //
296 //--- Check V0s and conversions. Necessity must be checked in physics applications
297 #if 0
298  if(nth==2 && curVrt.vertexCharge==0 && curVrt.detachedTrack<0){
299  double mass_PiPi = curVrt.vertexMom.M();
300  double mass_PPi = massV0(curVrt.trkAtVrt,m_massP,m_massPi);
301  double mass_EE = massV0(curVrt.trkAtVrt,m_massE,m_massE);
302  if(m_fillHist){
303  Hists& h = getHists();
304  h.m_hb_massPiPi->Fill( mass_PiPi, m_w_1);
305  h.m_hb_massPPi ->Fill( mass_PPi, m_w_1);
306  if( curVrt.vertex.perp()>20.)h.m_hb_massEE ->Fill( mass_EE, m_w_1);
307  }
308  if( std::abs(mass_PiPi-m_massK0) < 22.) continue;
309  if( std::abs(mass_PPi-m_massLam) < 8.) continue;
310  if( mass_EE < 60. && curVrt.vertex.perp() > 20.) continue;
311  }
312 #endif
313 //---
314  if(signif3D<m_selVrtSigCut) continue; //Main PV-SV distance quality cut
315  if(curVrt.vertex.perp() > m_maxSVRadiusCut) continue; // Too far from interaction point
316  curVrt.Good = true; /* Vertex is absolutely good */
317  }
318  if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Final Vertices");
319 //-------------------------------------------
320 // Debug ntuple filling and BDT application
321 //
322  std::vector<double> impact,impactError;
323  for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
324  WrkVrt & curVrt=(*wrkVrtSet)[iv];
325  nth=curVrt.selTrk.size();
326  if(!curVrt.Good || nth<2) continue;
327  double minPtT=1.e6, minSig3DT=1.e6, maxSig3DT=0.;
328  int ntrkBC=0,ntrkI=0,sumIBLHits=0,sumBLHits=0;
329  for(i=0;i<nth;i++) {
330  j=curVrt.selTrk[i]; //Track number
331  minPtT=std::min( minPtT, xAODwrk->listSelTracks[j]->pt());
332  m_fitSvc->VKalGetImpact(xAODwrk->listSelTracks[j], primVrt.position(), 1, impact, impactError);
333  double SigR2 = impact[0]*impact[0]/impactError[0];
334  double SigZ2 = impact[1]*impact[1]/impactError[2];
335  minSig3DT=std::min( minSig3DT, sqrt( SigR2 + SigZ2) );
336  maxSig3DT=std::max( maxSig3DT, sqrt( SigR2 + SigZ2) );
337  sumIBLHits += std::max(getIBLHit(xAODwrk->listSelTracks[j]),0);
338  sumBLHits += std::max(getBLHit(xAODwrk->listSelTracks[j]),0);
339  if(m_fillHist) {
340  ntrkBC += getIdHF(xAODwrk->listSelTracks[j]);
341  ntrkI += getG4Inter(xAODwrk->listSelTracks[j]);
342  }
343  }
344  float vProb=TMath::Prob(curVrt.chi2, 2*nth-3);
345  float cosSVPVM=projSV_PV(curVrt.vertex, primVrt, curVrt.vertexMom);
346  float vrtR=curVrt.vertex.perp();
347  TLorentzVector SVPV(curVrt.vertex.x()-primVrt.x(),curVrt.vertex.y()-primVrt.y(),curVrt.vertex.z()-primVrt.z(), 10.);
348  if(m_fillHist){
349  Hists& h = getHists();
350  if( nth>1 ){
351  vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, signif3D);
352  float Dist2D=vrtVrtDist2D(primVrt,curVrt.vertex, curVrt.vertexCov, signif2D);
353  h.m_curTup->NVrtTrk [h.m_curTup->nNVrt] = nth;
354  h.m_curTup->NVrtTrkHF [h.m_curTup->nNVrt] = ntrkBC;
355  h.m_curTup->NVrtTrkI [h.m_curTup->nNVrt] = ntrkI;
356  h.m_curTup->NVrtProb [h.m_curTup->nNVrt] = vProb;
357  h.m_curTup->NVrtSig3D [h.m_curTup->nNVrt] = signif3D;
358  h.m_curTup->NVrtSig2D [h.m_curTup->nNVrt] = signif2D;
359  h.m_curTup->NVrtDist2D[h.m_curTup->nNVrt] = vrtR<20. ? Dist2D : vrtR;
360  h.m_curTup->NVrtM [h.m_curTup->nNVrt] = curVrt.vertexMom.M();
361  h.m_curTup->NVrtPt [h.m_curTup->nNVrt] = curVrt.vertexMom.Pt();
362  h.m_curTup->NVrtEta [h.m_curTup->nNVrt] = SVPV.Eta();
363  h.m_curTup->NVrtIBL [h.m_curTup->nNVrt] = sumIBLHits;
364  h.m_curTup->NVrtBL [h.m_curTup->nNVrt] = sumBLHits;
365  h.m_curTup->NVrtCosSPM[h.m_curTup->nNVrt] = cosSVPVM;
366  h.m_curTup->NVrtCh [h.m_curTup->nNVrt] = curVrt.vertexCharge;
367  h.m_curTup->NVMinPtT [h.m_curTup->nNVrt] = minPtT;
368  h.m_curTup->NVMinS3DT [h.m_curTup->nNVrt] = minSig3DT;
369  h.m_curTup->NVrtBDT [h.m_curTup->nNVrt] = 1.1;
370  h.m_curTup->NVrtHR1 [h.m_curTup->nNVrt] = xAODwrk->listSelTracks[curVrt.selTrk[0]]->radiusOfFirstHit();
371  h.m_curTup->NVrtHR2 [h.m_curTup->nNVrt] = xAODwrk->listSelTracks[curVrt.selTrk[1]]->radiusOfFirstHit();
372  if( h.m_curTup->nNVrt < DevTuple::maxNVrt-1 )h.m_curTup->nNVrt++;
373  }
374  }
375 //-------------------BDT based rejection
376  if(nth==2){
377  float curVrtPt=std::min(curVrt.vertexMom.Pt(), (double)m_vrt2TrPtLimit);
378  float rhit0=xAODwrk->listSelTracks[curVrt.selTrk[0]]->radiusOfFirstHit();
379  float rhit1=xAODwrk->listSelTracks[curVrt.selTrk[1]]->radiusOfFirstHit();
380  std::vector<float> VARS(10);
381  VARS[0]=vProb;
382  VARS[1]=log(curVrtPt);
383  VARS[2]=log(std::max(minPtT,m_cutPt));
384  VARS[3]=log(vrtR<20. ? SVPV.Perp() : vrtR);
385  VARS[4]=log(std::max(minSig3DT,m_trkSigCut));
386  VARS[5]=log(maxSig3DT);
387  VARS[6]=curVrt.vertexMom.M();
388  VARS[7]=sqrt(std::abs(1.-cosSVPVM*cosSVPVM));
389  VARS[8]=SVPV.Eta();
390  VARS[9]=std::max(rhit0,rhit1);
391  float wgtSelect=m_SV2T_BDT->GetGradBoostMVA(VARS);
392  curVrt.BDT=wgtSelect;
393  if(m_fillHist){
394  Hists& h = getHists();
395  h.m_hb_fakeSVBDT->Fill(wgtSelect,1.);
396  h.m_curTup->NVrtBDT[h.m_curTup->nNVrt-1] = wgtSelect;
397  }
398  if(wgtSelect<m_v2tFinBDTCut) {
399  curVrt.Good = false; // Disable 2-track vertex with bad BDT score
400  if(m_multiWithOneTrkVrt){ // Check if linked 1-track vertex exists and disable it
401  for(auto it : curVrt.selTrk){
402  for(auto &vtmp : (*wrkVrtSet)){
403  if(vtmp.selTrk.size()!=1 || (!vtmp.Good)) continue;
404  if(it==vtmp.detachedTrack)vtmp.Good=false;
405  } } }
406  }
407  }
408  } //End vertex set loop
409 //
410 //-- Debug ntuple for 1track vertex is filled here
411 //
413  Hists& h = getHists();
414  for(auto & vrt : (*wrkVrtSet)) {
415  if( !vrt.Good || vrt.selTrk.size() != 1 ) continue; // Good 1track vertices
416  const auto *xaodtp=xAODwrk->listSelTracks[vrt.selTrk[0]];
417  m_fitSvc->VKalGetImpact(xaodtp, primVrt.position(), 1, impact, impactError);
418  double SigR2 = std::abs(impact[0]*impact[0]/impactError[0]);
419  double SigZ2 = std::abs(impact[1]*impact[1]/impactError[2]);
420  float dist2D=vrtVrtDist2D(primVrt,vrt.vertex, vrt.vertexCov, signif2D);
421  h.m_curTup->NVrtTrk [h.m_curTup->nNVrt] = 1;
422  h.m_curTup->NVrtTrkHF [h.m_curTup->nNVrt] = getIdHF(xaodtp);
423  h.m_curTup->NVrtProb [h.m_curTup->nNVrt] = trkNPairs[vrt.selTrk[0]];
424  h.m_curTup->NVrtSig3D [h.m_curTup->nNVrt] = 0.;
425  h.m_curTup->NVrtSig2D [h.m_curTup->nNVrt] = signif2D;
426  h.m_curTup->NVrtDist2D[h.m_curTup->nNVrt] = dist2D;
427  h.m_curTup->NVrtM [h.m_curTup->nNVrt] = vrt.vertexMom.M();
428  h.m_curTup->NVrtPt [h.m_curTup->nNVrt] = vrt.vertexMom.Pt();
429  h.m_curTup->NVrtCosSPM[h.m_curTup->nNVrt] = 0.;
430  h.m_curTup->NVrtCh [h.m_curTup->nNVrt] = vrt.vertexCharge;
431  h.m_curTup->NVMinPtT [h.m_curTup->nNVrt] = xaodtp->pt();
432  h.m_curTup->NVMinS3DT [h.m_curTup->nNVrt] = sqrt(SigR2 + SigZ2);
433  h.m_curTup->NVrtBDT [h.m_curTup->nNVrt] = 1.1;
434  h.m_curTup->NVrtIBL [h.m_curTup->nNVrt] = std::max(getIBLHit(xaodtp),0);
435  h.m_curTup->NVrtBL [h.m_curTup->nNVrt] = std::max(getBLHit (xaodtp),0);
436  if( h.m_curTup->nNVrt < DevTuple::maxNVrt-1 )h.m_curTup->nNVrt++;
437  } }
438 //-------------------------------------------
439 //Sorting and check
440  std::multimap<double,WrkVrt,std::greater<double>> goodVertexMap;
441  int nNtrVrt=0;
442  for(auto & iv : (*wrkVrtSet) ) {
443  nth=iv.selTrk.size();
444  if(nth==1)iv.BDT=-2.; //To move 1-track vertices to the end of the vertex list later
445  double selector=iv.BDT;
446  if(nth==1) selector=iv.BDT+std::min(iv.vertexMom.Pt()*1.e-5,1.);
447  else if(nth>2) selector=iv.BDT+iv.vertexMom.M()*1.e-5;
448  if( iv.Good && nth>0 ) {
449  goodVertexMap.emplace(selector,iv); // add it and sort in the map
450  if(nth>1)nNtrVrt++;
451  }
452  }
453  if(nNtrVrt==0){ //--- No good vertices at all
454  if(m_fillHist) {
455  Hists& h = getHists();
456  h.m_curTup->nNVrt=0;
457  }
458  return finalVertices;
459  }
460 //
461 //-------------------------------------------
462 // Final vertex refit for full covariance matrix and xAOD::Vertex creation
463 //
464  static const SG::AuxElement::Decorator<float> wgtBDT("wgtBDT");
465  static const SG::AuxElement::Decorator<int> nTrksDec("nTracks");
466  static const SG::AuxElement::Decorator<int> vChrgTot("vCharge");
467  int n1trVrt=0; // Final number of good 1-track vertices
468  for(auto & iv : goodVertexMap){
469  WrkVrt & curVrt=iv.second;
470  nth=curVrt.selTrk.size();
471  xAODwrk->tmpListTracks.clear();
472  for(auto t : curVrt.selTrk)xAODwrk->tmpListTracks.push_back( xAODwrk->listSelTracks[t] );
473  if(m_fillHist){
474  Hists& h = getHists();
475  h.m_hb_totmass->Fill(curVrt.vertexMom.M(), m_w_1);
476  h.m_hb_r2d->Fill( curVrt.vertex.perp(), m_w_1);
477  }
478 //--- Re-fit with full error matrix and xAOD::Vertex creation
479  xAOD::Vertex * tmpVertex=nullptr;
480  if(nth>1){ //-- Common case with full refit
481  tmpVertex=m_fitSvc->fit(xAODwrk->tmpListTracks,curVrt.vertex,*state);
482  } else if(nth==1){ //-- Special case for 1-track vertex
483  tmpVertex=new (std::nothrow) xAOD::Vertex();
484  if(!tmpVertex)continue;
485  tmpVertex->makePrivateStore();
486  tmpVertex->setPosition(curVrt.vertex);
487  std::vector<float> floatErrMtx(6);
488  for(int i=0; i<6; i++) floatErrMtx[i]=curVrt.vertexCov[i];
489  tmpVertex->setCovariance(floatErrMtx);
490  tmpVertex->setFitQuality(curVrt.chi2, (float)(nth*2-3));
491  std::vector<Trk::VxTrackAtVertex> & tmpVTAV=tmpVertex->vxTrackAtVertex(); tmpVTAV.clear();
492  AmgSymMatrix(5) CovMtxP;
493  CovMtxP.setIdentity();
494  Trk::Perigee * tmpMeasPer = new (std::nothrow) Trk::Perigee( 0.,0.,
495  curVrt.trkAtVrt[0][0],
496  curVrt.trkAtVrt[0][1],
497  curVrt.trkAtVrt[0][2],
498  Trk::PerigeeSurface(curVrt.vertex),
499  std::move(CovMtxP) );
500  tmpVTAV.emplace_back( 1., tmpMeasPer );
501  ElementLink<xAOD::TrackParticleContainer> TEL; TEL.setElement( xAODwrk->tmpListTracks[0] );
502  const xAOD::TrackParticleContainer* cont = (const xAOD::TrackParticleContainer* ) (xAODwrk->tmpListTracks[0]->container() );
503  TEL.setStorableObject(*cont);
504  tmpVertex->addTrackAtVertex(TEL,1.);
505  n1trVrt++;
506  }
507  if(tmpVertex){
508  wgtBDT (*tmpVertex) =curVrt.BDT;
509  nTrksDec(*tmpVertex) =curVrt.selTrk.size();
510  vChrgTot(*tmpVertex) =curVrt.vertexCharge;
511  finalVertices.push_back(tmpVertex);
512  }
513  }
514  if(m_fillHist){
515  Hists& h = getHists();
516  h.m_hb_goodvrtN->Fill( finalVertices.size()+0.1, m_w_1);
517  h.m_hb_goodvrt1N->Fill( n1trVrt+0.1, m_w_1);
518  }
519 //-----------------------------------------------------------------------------------
520 // Saving of results
521 //
522  return finalVertices;
523 
524  }

◆ improveVertexChi2()

double Rec::NewVrtSecInclusiveTool::improveVertexChi2 ( WrkVrt vertex,
std::vector< const xAOD::TrackParticle * > &  allTracks,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 195 of file MultiUtilities.cxx.

199  {
200 
201  int nTrk=vertex.selTrk.size();
202  if( nTrk<2 )return 0.;
203  double prob=TMath::Prob( vertex.chi2, 2*nTrk-3);
204  //
205  //----Start track removal iterations
206  while(prob<0.01){
207  nTrk=vertex.selTrk.size();
208  if(nTrk==2)return prob;
209  int selT=0;
210  for(int i=0; i<nTrk; i++){ if( vertex.chi2PerTrk[i]>vertex.chi2PerTrk[selT]) selT=i; }
211  vertex.detachedTrack=vertex.selTrk[selT];
212  vertex.selTrk.erase( vertex.selTrk.begin() + selT ); //remove track
213  prob = refitVertex( vertex, allTrackList, istate, ifCovV0);
214  if(prob<0.)return 0.;
215  }
216  return prob;
217  }

◆ initialize()

StatusCode Rec::NewVrtSecInclusiveTool::initialize ( )

Definition at line 139 of file NewVrtSecInclusiveTool.cxx.

139  {
140  ATH_MSG_DEBUG( "Initialising NewVrtSecInclusiveTool" );
141  ATH_CHECK( m_extrapolator.retrieve() );
143  ATH_CHECK( m_fitSvc.retrieve() );
144  ATH_MSG_DEBUG("NewVrtSecInclusiveTool TrkVKalVrtFitter found");
145 
146 //------------------------------------------
147 //
148  if(m_fillHist){
150  ATH_MSG_FATAL("Filling histograms not supported in MT jobs.");
151  return StatusCode::FAILURE;
152  }
153 
154  SmartIF<ITHistSvc> hist_root{service("THistSvc")};
155  if( !hist_root ) ATH_MSG_DEBUG("Could not find THistSvc service");
156  else ATH_MSG_DEBUG("NewVrtSecInclusiveTool Histograms found");
157  std::string histDir;
158  histDir="/NVSI/stat/MultiSVrt"+m_instanceName+"/";
159 
160  m_h = std::make_unique<Hists>();
161  ATH_CHECK( m_h->book (*hist_root, histDir) );
162 
163  m_w_1 = 1.;
164  }
165 
166 //--------------------------------------------------------
167  //std::string fileName="NewVrtSecInclusiveTool/Fake2TrVertexReject.MVA.v01.root"; ///For local calibration file
168  //std::string rootFilePath = PathResolver::find_file(fileName, "DATAPATH"); ///
169  std::string rootFilePath = PathResolver::find_calib_file("NewVrtSecInclusiveTool/"+m_calibFileName);
170  TFile* rootFile = TFile::Open(rootFilePath.c_str(), "READ");
171  if (!rootFile) {
172  ATH_MSG_FATAL("Could not retrieve root file: " << m_calibFileName);
173  return StatusCode::FAILURE;
174  }
175  TTree * training = (TTree*)rootFile->Get("BDT");
176  m_SV2T_BDT = std::make_unique<MVAUtils::BDT>(training);
177 //--------------------------------------------------------
178  return StatusCode::SUCCESS;
179 
180  }

◆ 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()

static const InterfaceID& Rec::IVrtInclusive::interfaceID ( )
inlinestaticinherited

Definition at line 43 of file IVrtInclusive.h.

43 { return IID_IVrtInclusive;}

◆ isPart()

bool Rec::NewVrtSecInclusiveTool::isPart ( const std::deque< long int > &  test,
std::deque< long int >  base 
)
staticprivate

Definition at line 252 of file MultiUtilities.cxx.

254  {
255  for (long int trk : test)
256  if(std::find(base.begin(), base.end(), trk) == base.end()) return false; //element not found => test is not part of base
257  return true;
258  }

◆ massV0()

double Rec::NewVrtSecInclusiveTool::massV0 ( const std::vector< std::vector< double > > &  TrkAtVrt,
double  massP,
double  massPi 
)
staticprivate

Definition at line 176 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

179  {
180  double ap1i=std::abs(TrkAtVrt[0][2]); double ap2i=std::abs(TrkAtVrt[1][2]);
181  CxxUtils::sincos phi1(TrkAtVrt[0][0]);
182  CxxUtils::sincos theta1(TrkAtVrt[0][1]);
183  CxxUtils::sincos phi2(TrkAtVrt[1][0]);
184  CxxUtils::sincos theta2(TrkAtVrt[1][1]);
185  double px = phi1.cs * theta1.sn * ap1i
186  + phi2.cs * theta2.sn * ap2i;
187  double py = phi1.sn * theta1.sn * ap1i
188  + phi2.sn * theta2.sn * ap2i;
189  double pz = theta1.cs * ap1i
190  + theta2.cs * ap2i;
191  double ee= (ap1i > ap2i) ?
192  (std::sqrt(ap1i*ap1i+massP*massP)+std::sqrt(ap2i*ap2i+massPi*massPi)):
193  (std::sqrt(ap2i*ap2i+massP*massP)+std::sqrt(ap1i*ap1i+massPi*massPi));
194  double test=(ee-pz)*(ee+pz)-px*px-py*py;
195  return test>0 ? std::sqrt(test) : 0.;
196  }

◆ mergeAndRefitVertices()

double Rec::NewVrtSecInclusiveTool::mergeAndRefitVertices ( WrkVrt v1,
WrkVrt v2,
WrkVrt newvrt,
std::vector< const xAOD::TrackParticle * > &  AllTrackList,
Trk::IVKalState istate,
int  robKey = 0 
) const
private

Definition at line 151 of file MultiUtilities.cxx.

155  {
156  if(!v1.Good)return -1.; //bad vertex
157  if(!v2.Good)return -1.; //bad vertex
158  std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
159  newvrt.Good=true;
160  int nTrk_V1=v1.selTrk.size();
161  int nTrk_V2=v2.selTrk.size();
162  newvrt.selTrk.resize(nTrk_V1+nTrk_V2);
163  std::copy(v1.selTrk.begin(),v1.selTrk.end(), newvrt.selTrk.begin());
164  std::copy(v2.selTrk.begin(),v2.selTrk.end(), newvrt.selTrk.begin()+nTrk_V1);
165 
167  sort( newvrt.selTrk.begin(), newvrt.selTrk.end() );
168  TransfEnd = unique( newvrt.selTrk.begin(), newvrt.selTrk.end() );
169  newvrt.selTrk.erase( TransfEnd, newvrt.selTrk.end());
170  std::vector<const xAOD::TrackParticle*> fitTrackList(0);
171  for(int it=0; it<(int)newvrt.selTrk.size(); it++)fitTrackList.push_back( AllTrackList[newvrt.selTrk[it]] );
172  m_fitSvc->setApproximateVertex( 0.5*(v1.vertex[0]+v2.vertex[0]),
173  0.5*(v1.vertex[1]+v2.vertex[1]),
174  0.5*(v1.vertex[2]+v2.vertex[2]),
175  istate);
176  m_fitSvc->setRobustness(robKey,istate);
177 
178  StatusCode sc=m_fitSvc->VKalVrtFit(fitTrackList,neutralPartDummy,
179  newvrt.vertex, newvrt.vertexMom, newvrt.vertexCharge, newvrt.vertexCov,
180  newvrt.chi2PerTrk, newvrt.trkAtVrt, newvrt.chi2,
181  istate, false);
182  if( sc.isFailure() ) return -1.;
183  if( newvrt.chi2>500. ) return -1.; //VK protection
184  if( newvrt.chi2PerTrk.size()==2) newvrt.chi2PerTrk[0]=newvrt.chi2PerTrk[1]=newvrt.chi2/2.;
185 
186  m_fitSvc->setRobustness(0,istate); //restore default behaviour
187 
188  return TMath::Prob( newvrt.chi2, 2*newvrt.selTrk.size()-3);
189  }

◆ minVrtVrtDist()

double Rec::NewVrtSecInclusiveTool::minVrtVrtDist ( std::vector< WrkVrt > *  WrkVrtSet,
int &  indexV1,
int &  indexV2,
std::vector< double > &  check 
) const
private

Definition at line 70 of file MultiUtilities.cxx.

72  {
73  V1=V2=-1;
74  double foundMinVrtDst=1000000.;
75 
76  for(int iv=0; iv<(int)wrkVrtSet->size()-1; iv++) {
77  if( (*wrkVrtSet)[iv].selTrk.size()< 2) continue; /* Bad vertices */
78  if(!(*wrkVrtSet)[iv].Good ) continue; /* Bad vertices */
79  for(int jv=iv+1; jv<(int)wrkVrtSet->size(); jv++) {
80  if( (*wrkVrtSet)[jv].selTrk.size()< 2) continue; /* Bad vertices */
81  if(!(*wrkVrtSet)[jv].Good ) continue; /* Bad vertices */
82  double tmp= std::abs((*wrkVrtSet)[iv].vertex.x()-(*wrkVrtSet)[jv].vertex.x())
83  +std::abs((*wrkVrtSet)[iv].vertex.y()-(*wrkVrtSet)[jv].vertex.y())
84  +std::abs((*wrkVrtSet)[iv].vertex.z()-(*wrkVrtSet)[jv].vertex.z());
85  if(tmp>20.) continue;
86  double tmpDst = vrtVrtDist((*wrkVrtSet)[iv].vertex,(*wrkVrtSet)[iv].vertexCov,
87  (*wrkVrtSet)[jv].vertex,(*wrkVrtSet)[jv].vertexCov);
88  if(std::find(checked.begin(),checked.end(),tmpDst) != checked.end()) continue; //Alreasy tried
89  if( tmpDst < foundMinVrtDst){foundMinVrtDst = tmpDst; V1=iv; V2=jv;}
90  }
91  }
92  return foundMinVrtDst;
93  }

◆ momAtVrt()

TLorentzVector Rec::NewVrtSecInclusiveTool::momAtVrt ( const std::vector< double > &  inpTrk) const
private

Definition at line 200 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

202  {
203  double api=1./std::abs(inpTrk[2]);
204  CxxUtils::sincos phi(inpTrk[0]);
205  CxxUtils::sincos theta(inpTrk[1]);
206  double px = phi.cs * theta.sn * api;
207  double py = phi.sn * theta.sn * api;
208  double pz = theta.cs * api;
209  double ee = std::sqrt( px*px + py*py + pz*pz + m_massPi*m_massPi);
210  return {px,py,pz,ee};
211  }

◆ MomProjDist()

double Rec::NewVrtSecInclusiveTool::MomProjDist ( const Amg::Vector3D SV,
const xAOD::Vertex PV,
const TLorentzVector &  Direction 
)
staticprivate

Definition at line 260 of file MultiUtilities.cxx.

262  {
263  Amg::Vector3D vv=SecVrt-primVrt.position();
264  return ( vv.x()*Mom.X()+vv.y()*Mom.Y()+vv.z()*Mom.Z() )/ Mom.P();
265  }

◆ mostHeavyTrk()

int Rec::NewVrtSecInclusiveTool::mostHeavyTrk ( WrkVrt  V,
std::vector< const xAOD::TrackParticle * >  AllTracks 
)
staticprivate

Definition at line 26 of file MultiUtilities.cxx.

28  {
29  int NTrk=V.selTrk.size(), SelT=-1;
30  if(NTrk<3)return -1;
31 //--------------------------------------------------
32  TLorentzVector TSum;
33  for(int i=0; i<NTrk; i++){
34  TSum += AllTracks.at(V.selTrk[i])->p4();
35  }
36  double massMin=1.e9;
37  for(int i=0; i<NTrk; i++){
38  TLorentzVector TSum_m1 = TSum - AllTracks[V.selTrk[i]]->p4();
39  if(TSum_m1.M()<massMin){massMin=TSum_m1.M(); SelT=i;}
40  }
41  return SelT;
42  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

◆ notFromBC()

int Rec::NewVrtSecInclusiveTool::notFromBC ( int  PDGID)
staticprivate

Definition at line 271 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

271  {
272  int noBC=0;
273  if(PDGID<=0)return 1;
274  if(PDGID>600 && PDGID<4000)noBC=1;
275  if(PDGID<400 || PDGID>5600)noBC=1;
276  if(PDGID==513 || PDGID==523 || PDGID==533 || PDGID==543)noBC=1; //Remove tracks from B* (they are in PV)
277  if(PDGID==5114 || PDGID==5214 || PDGID==5224 || PDGID==5314 || PDGID==5324)noBC=1; //Remove tracks from B_Barions* (they are in PV)
278  //if(PDGID==413 || PDGID==423 || PDGID==433 )continue; //Keep tracks from D* (they are from B vertex)
279  //if(PDGID==4114 || PDGID==4214 || PDGID==4224 || PDGID==4314 || PDGID==4324)continue;
280  return noBC;
281  }

◆ nTrkCommon()

int Rec::NewVrtSecInclusiveTool::nTrkCommon ( std::vector< WrkVrt > *  WrkVrtSet,
int  indexV1,
int  indexV2 
)
staticprivate

Definition at line 48 of file MultiUtilities.cxx.

50  {
51  int nTrk_V1 = (*wrkVrtSet).at(V1).selTrk.size(); if( nTrk_V1< 2) return 0; /* Bad vertex */
52  int nTrk_V2 = (*wrkVrtSet).at(V2).selTrk.size(); if( nTrk_V2< 2) return 0; /* Bad vertex */
53  int nTrkCom=0;
54  if(nTrk_V1 < nTrk_V2){
55  for(int i=0; i<nTrk_V1; i++){
56  int trk=(*wrkVrtSet)[V1].selTrk[i];
57  for(int j=0; j<nTrk_V2; j++){ if( trk==(*wrkVrtSet)[V2].selTrk[j]){ nTrkCom++; break;} }
58  }
59  }else{
60  for(int i=0; i<nTrk_V2; i++){
61  int trk=(*wrkVrtSet)[V2].selTrk[i];
62  for(int j=0; j<nTrk_V1; j++){ if( trk==(*wrkVrtSet)[V1].selTrk[j]){ nTrkCom++; break;} }
63  }
64  }
65  return nTrkCom;
66  }

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

◆ PntPntDist()

double Rec::NewVrtSecInclusiveTool::PntPntDist ( const Amg::Vector3D Vrt1,
const Amg::Vector3D Vrt2 
)
staticprivate

Definition at line 148 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

149  {
150  double dx = Vrt1.x()- Vrt2.x();
151  double dy = Vrt1.y()- Vrt2.y();
152  double dz = Vrt1.z()- Vrt2.z();
153  return std::sqrt(dx*dx+dy*dy*dz*dz);
154  }

◆ printWrkSet()

void Rec::NewVrtSecInclusiveTool::printWrkSet ( const std::vector< WrkVrt > *  WrkSet,
const std::string &  name 
) const
private

Definition at line 26 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

26  {
27  int nGoodV=0;
28  if(msgLvl(MSG::INFO)){
29  for(int iv=0; iv<(int)WrkVrtSet->size(); iv++) {
30  msg(MSG::INFO)<<name
31  <<"= "<<(*WrkVrtSet)[iv].vertex[0]
32  <<", "<<(*WrkVrtSet)[iv].vertex[1]
33  <<", "<<(*WrkVrtSet)[iv].vertex[2]
34  <<" NTrk="<<(*WrkVrtSet)[iv].selTrk.size()
35  <<" is good="<<std::boolalpha<<(*WrkVrtSet)[iv].Good<<std::noboolalpha
36  <<" Chi2="<<(*WrkVrtSet)[iv].chi2
37  <<" Mass="<<(*WrkVrtSet)[iv].vertexMom.M()
38  <<" detached="<<(*WrkVrtSet)[iv].detachedTrack
39  <<" proj.dist="<<(*WrkVrtSet)[iv].projectedVrt
40  <<" trk=";
41  for(int kk=0; kk<(int)(*WrkVrtSet)[iv].selTrk.size(); kk++) {
42  msg(MSG::INFO)<<", "<<(*WrkVrtSet)[iv].selTrk[kk];}
43  for(int kk=0; kk<(int)(*WrkVrtSet)[iv].selTrk.size(); kk++) {
44  msg(MSG::INFO)<<", "<<momAtVrt((*WrkVrtSet)[iv].trkAtVrt[kk]).Perp();}
45  msg(MSG::INFO)<<endmsg;
46  if((*WrkVrtSet)[iv].Good)nGoodV++;
47  }
48  msg(MSG::INFO)<<name<<" N="<<nGoodV<<endmsg;
49  }
50  }

◆ projSV_PV()

double Rec::NewVrtSecInclusiveTool::projSV_PV ( const Amg::Vector3D SV,
const xAOD::Vertex PV,
const TLorentzVector &  Direction 
)
staticprivate

Definition at line 53 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

54  {
55  TVector3 SV_PV( SV.x()-PV.x(), SV.y()-PV.y(), SV.z()-PV.z() );
56  return Direction.Vect().Unit()*SV_PV.Unit();
57  }

◆ refineVerticesWithCommonTracks()

double Rec::NewVrtSecInclusiveTool::refineVerticesWithCommonTracks ( WrkVrt v1,
WrkVrt v2,
std::vector< const xAOD::TrackParticle * > &  allTrackList,
Trk::IVKalState istate 
) const
private

Definition at line 100 of file MultiUtilities.cxx.

104  {
105  if(!v1.Good || !v2.Good)return -1.; //bad vertex check for safety
106 
107  int ntv1=v1.selTrk.size();
108  int ntv2=v2.selTrk.size();
109  if( ntv1<2 || ntv2<2 ) return -1.; //for safety
110  double prb_v1=TMath::Prob( v1.chi2, 2*ntv1-3);
111  double prb_v2=TMath::Prob( v2.chi2, 2*ntv2-3);
112  WrkVrt * badV =&v1;
113  WrkVrt * goodV=&v2;
114  bool swap=false;
115  //---- Good vertex selection
116  if(prb_v1>0.01&&prb_v2>0.01){ //Both vertices are good Prob>1%
117  if( ntv1==ntv2 ) {if(prb_v1>prb_v2) swap=true;} //If multiplicities are equal- select better Chi2
118  else {if(ntv1>ntv2) swap=true;}
119  }
120  if(prb_v1<0.01&&prb_v2<0.01){ //Both vertices are bad Prob<1%
121  if(prb_v1>prb_v2) swap=true; // select better Chi2
122  }
123  if(prb_v1>0.01&&prb_v2<0.01){ //Second vertex is bad Prob<1%
124  if(prb_v1>prb_v2) swap=true;
125  }
126  if(swap) {badV =&v2; goodV =&v1;}
127  int badVNtrk=(*badV).selTrk.size();
128  //-----------------
129  unsigned int it=0;
130  while( it<(*badV).selTrk.size() ){
131  int trk=(*badV).selTrk[it];
132  if(std::find((*goodV).selTrk.begin(),(*goodV).selTrk.end(),trk) != (*goodV).selTrk.end()){
133  (*badV).selTrk.erase((*badV).selTrk.begin()+it);
134  (*badV).detachedTrack=trk;
135  } else it++;
136  }
137  if((*badV).selTrk.size()<2){
138  (*badV).Good=false;
139  if((*badV).selTrk.size()==1 && m_multiWithOneTrkVrt){ //Special case if 1-track vertices are allowed
140  (*badV).vertexCharge=allTrackList[(*badV).selTrk.at(0)]->charge();
141  (*badV).vertexMom=allTrackList[(*badV).selTrk.at(0)]->p4();
142  if( badVNtrk>=2 && TMath::Prob((*badV).chi2,2*badVNtrk-3)>0.1 ) (*badV).Good=true; //Accept only if original vertex prob>10%!
143  }
144  return -1.;
145  }
146  return refitVertex((*badV),allTrackList, istate, false);
147  }

◆ refitVertex()

double Rec::NewVrtSecInclusiveTool::refitVertex ( WrkVrt Vrt,
std::vector< const xAOD::TrackParticle * > &  SelectedTracks,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 221 of file MultiUtilities.cxx.

225  {
226  int i,j;
227  int nth = vrt.selTrk.size();
228 
229  if(nth<2) return -1.;
230 
231  std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
232  std::vector<const xAOD::TrackParticle*> listTracks(0);
233  for(i=0;i<nth;i++) {
234  j=vrt.selTrk[i]; /*Track number*/
235  listTracks.push_back( selectedTracks[j] );
236  }
237  vrt.Good = false;
238  vrt.chi2PerTrk.resize(nth);
239  for(i=0;i<nth;i++)vrt.chi2PerTrk[i]=100000.+i; //VK safety
240 
241  m_fitSvc->setApproximateVertex(vrt.vertex[0],vrt.vertex[1],vrt.vertex[2],istate);
242  StatusCode sc=m_fitSvc->VKalVrtFit(listTracks,neutralPartDummy,vrt.vertex,vrt.vertexMom,vrt.vertexCharge,
243  vrt.vertexCov,vrt.chi2PerTrk, vrt.trkAtVrt,vrt.chi2,
244  istate, ifCovV0);
245  if(sc.isSuccess())vrt.Good = true;
246  else {vrt.Good = false; return -1.;}
247  if(vrt.chi2PerTrk.size()==2) vrt.chi2PerTrk[0]=vrt.chi2PerTrk[1]=vrt.chi2/2.;
248  return TMath::Prob( vrt.chi2, 2*nth-1);
249  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ select2TrVrt()

void Rec::NewVrtSecInclusiveTool::select2TrVrt ( std::vector< const xAOD::TrackParticle * > &  SelectedTracks,
const xAOD::Vertex primVrt,
std::map< long int, std::vector< double >> &  vrt,
compatibilityGraph_t compatibilityGraph 
) const
private

Definition at line 31 of file Sel2TrkVertices.cxx.

36  {
37  std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
38  std::vector<const xAOD::TrackParticle*> tracksForFit(2,nullptr);
39  std::vector<double> impact,impactError;
40  std::vector<double> inpMass(2,m_massPi);
41  long int Charge;
42  int i,j;
43  StatusCode sc;
44  Vrt2Tr tmpVrt;
45  std::vector<Vrt2Tr> all2TrVrt(0);
46  TLorentzVector PSum2T;
47  Amg::Vector3D iniVrt(0.,0.,0.);
48 //
49  int NTracks = (int) (selectedTracks.size());
50 //
51 // impact parameters with sign calculations
52 //
54  double signifR=0.,signifZ=0.;
55  std::vector<int> nPixHits(NTracks,0);
56  std::vector<double> trackSignif(NTracks),dRdZratio(NTracks);
57  for (i=0; i<NTracks; i++) {
58  m_fitSvc->VKalGetImpact(selectedTracks[i], primVrt.position(), 1, impact, impactError);
59  signifR = impact[0]/ sqrt(impactError[0]);
60  signifZ = impact[1]/ sqrt(impactError[2]);
61  trackSignif[i] = sqrt( signifR*signifR + signifZ*signifZ);
62  dRdZratio[i] = std::abs(signifR/signifZ);
63  if( !(selectedTracks[i]->summaryValue(nPixelHits,xAOD::numberOfPixelHits)) ) nPixelHits=0;
64  nPixHits[i]=nPixelHits;
65  if(m_fillHist){
66  Hists& h = getHists();
67  h.m_hb_impactR->Fill( signifR, m_w_1);
68  h.m_hb_impactZ->Fill( signifZ, m_w_1);
69  h.m_hb_impactRZ->Fill(signifR, signifZ, m_w_1);
70  h.m_hb_impact->Fill( trackSignif[i], m_w_1);
71  if( i<DevTuple::maxNTrk){
72  Hists& h = getHists();
73  h.m_curTup->pttrk[i]=selectedTracks[i]->pt();
74  h.m_curTup->d0trk[i]=selectedTracks[i]->d0();
75  h.m_curTup->Sig3D[i]=trackSignif[i];
76  h.m_curTup->idHF[i] =getIdHF(selectedTracks[i]);
77  h.m_curTup->dRdZrat[i] =dRdZratio[i];
78  uint8_t TRTHits;
79  if( !(selectedTracks[i]->summaryValue( TRTHits,xAOD::numberOfTRTHits))) TRTHits=0;
80  h.m_curTup->trkTRT[i] =TRTHits;
81  h.m_curTup->etatrk[i] =selectedTracks[i]->eta();
82  }
83  }
84  }
85 
86  if( m_fillHist ){
87  Hists& h = getHists();
88  h.m_curTup->nTrk=NTracks < DevTuple::maxNTrk ? NTracks : DevTuple::maxNTrk ;
89  h.m_curTup->n2Vrt=0;
90  }
91 
92  std::vector<std::vector<std::tuple<int,float>>> trkCount(NTracks);
93  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
94  m_fitSvc->setMassInputParticles( inpMass, *state ); // Use pion masses for fit
95  for (i=0; i<NTracks-1; i++) {
96  if(trackSignif[i]<m_trkSigCut || dRdZratio[i]<m_dRdZRatioCut )continue;
97  for (j=i+1; j<NTracks; j++) {
98  if(trackSignif[j]<m_trkSigCut || dRdZratio[j]<m_dRdZRatioCut )continue;
99  PSum2T=selectedTracks[i]->p4()+selectedTracks[j]->p4();
100  if(PSum2T.M()>1.5*m_vrt2TrMassLimit)continue; //Approximate mass
101  if( std::abs(selectedTracks[i]->eta()-selectedTracks[j]->eta())==0 &&
102  std::abs(selectedTracks[i]->phi()-selectedTracks[j]->phi())==0 &&
103  std::abs(selectedTracks[i]->pt() -selectedTracks[j]->pt())==0 ) continue; //remove duplicated tracks
104  float ihitR = selectedTracks[i]->radiusOfFirstHit();
105  float jhitR = selectedTracks[j]->radiusOfFirstHit();
106  if(std::abs(ihitR-jhitR)>50.)continue; //- FMPs are in very different layers
107 
108  tracksForFit[0]=selectedTracks[i];
109  tracksForFit[1]=selectedTracks[j];
110  double minDZ=0.;
111  sc=m_fitSvc->VKalVrtFitFast(tracksForFit,tmpVrt.fitVertex,minDZ,*state); /* Fast crude estimation*/
112  if( sc.isFailure() ) { /* No initial estimation */
113  iniVrt=primVrt.position();
114  } else {
115  double cosMomVrtDir = projSV_PV(tmpVrt.fitVertex,primVrt,PSum2T);
116  if( cosMomVrtDir>0. ) iniVrt=tmpVrt.fitVertex; /* Good initial estimation */
117  else iniVrt=primVrt.position();
118  }
119  if(nPixHits[i]>0 && nPixHits[j]>0){ if(minDZ> m_fastZSVCut) continue; } // Drop SV candidates with big Z track-track distance.
120  else{ if(minDZ>2.*m_fastZSVCut) continue; } // Drop SV candidates with big Z track-track distance.
121  m_fitSvc->setApproximateVertex(iniVrt.x(), iniVrt.y(), iniVrt.z(),*state);
122  sc=m_fitSvc->VKalVrtFit(tracksForFit, neutralPartDummy, tmpVrt.fitVertex, tmpVrt.momentum, Charge,
123  tmpVrt.errorMatrix, tmpVrt.chi2PerTrk, tmpVrt.trkAtVrt, tmpVrt.chi2, *state, false );
124  if(sc.isFailure()) continue; /* No fit */
125  double Prob2v=TMath::Prob(tmpVrt.chi2,1);
126  if( Prob2v < m_sel2VrtProbCut ) continue;
127  if( tmpVrt.momentum.M()> m_vrt2TrMassLimit ) continue;
128  if( tmpVrt.fitVertex.perp() > m_maxSVRadiusCut) continue; // Too far from interaction point
129  double cosSVPV=projSV_PV(tmpVrt.fitVertex, primVrt, tmpVrt.momentum);
130  TLorentzVector SVPV(tmpVrt.fitVertex.x()-primVrt.x(),
131  tmpVrt.fitVertex.y()-primVrt.y(),
132  tmpVrt.fitVertex.z()-primVrt.z(), 10.);
133  if(m_fillHist){
134  Hists& h = getHists();
135  if(Charge==0){h.m_hb_massPiPi->Fill(tmpVrt.momentum.M(),1.);}
136  h.m_hb_cosSVMom->Fill(cosSVPV,1.);
137  h.m_hb_etaSV->Fill(SVPV.Eta(),1.);
138  }
139  if(cosSVPV<m_cosSVPVCut)continue;
140  if(tmpVrt.momentum.Pt()<1000.)continue;
141  double vrtR=tmpVrt.fitVertex.perp();
142  double vrtRErr=vrtRadiusError(tmpVrt.fitVertex,tmpVrt.errorMatrix );
143 //Check close material layer
144  double dstMatSignif=1.e4;
145  if(m_removeTrkMatSignif>0. && vrtR>20.){
146  if(vrtR<30.){ dstMatSignif=std::abs(vrtR-m_beampipeR)/vrtRErr;}
147  else { dstMatSignif=distToMatLayerSignificance(tmpVrt);} //Material in Pixel volume
148  if(dstMatSignif<m_removeTrkMatSignif)continue;
149  }
150 //
151 // Check pixel hits vs vertex positions.
152  int ihitIBL = getIBLHit(selectedTracks[i]);
153  int jhitIBL = getIBLHit(selectedTracks[j]);
154  if( (ihitIBL==0&&jhitIBL>0) || (ihitIBL>0&&jhitIBL==0) ) continue;
155  int ihitBL = getBLHit (selectedTracks[i]);
156  int jhitBL = getBLHit (selectedTracks[j]);
157 //--Very general cleaning cuts based on ID geometry and applicable to all processes
158  if(tmpVrt.fitVertex.perp()<m_firstPixelLayerR-2.*vrtRErr){
159  if( ihitIBL<1 && ihitBL<1) continue;
160  if( jhitIBL<1 && jhitBL<1) continue;
161  }
162  if( vrtR-std::min(ihitR,jhitR) > 50.) continue; //- FMP is closer to (0,0) than SV itself
163  if(ihitR-vrtR > 180.+2.*vrtRErr)continue; //- Distance FMP-vertex should be less then SCT-Pixel gap
164  if(jhitR-vrtR > 180.+2.*vrtRErr)continue; //- Distance FMP-vertex should be less then SCT-Pixel gap
165 //-------------------------------------------------------
166  if(m_useVertexCleaning){ //More agressive cleaning
167  if(std::abs(ihitR-jhitR)>12.) continue;
168  if( ihitR-vrtR > 36.) continue; // Too big dR between vertex and hit in pixel
169  if( jhitR-vrtR > 36.) continue; // Should be another layer in between
170  if( ihitR-vrtR <-2.*vrtRErr) continue; // Vertex is behind hit in pixel
171  if( jhitR-vrtR <-2.*vrtRErr) continue; // Vertex is behind hit in pixel
172  }
173 //
174 // Debugging and BDT
175  double minPtT = std::min(tracksForFit[0]->pt(),tracksForFit[1]->pt());
176  if( m_fillHist ){
177  Hists& h = getHists();
178  double Sig3D=0.,Sig2D=0., Dist2D=0.;
179  int idisk1=0,idisk2=0,idisk3=0,jdisk1=0,jdisk2=0,jdisk3=0;
180  int sumIBLHits = std::max(ihitIBL,0)+std::max(jhitIBL,0);
181  int sumBLHits = std::max(ihitBL, 0)+std::max(jhitBL, 0);
182  getPixelDiscs(selectedTracks[i],idisk1,idisk2,idisk3);
183  getPixelDiscs(selectedTracks[j],jdisk1,jdisk2,jdisk3);
184  vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Sig3D);
185  Dist2D=vrtVrtDist2D(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Sig2D);
186  h.m_hb_signif3D->Fill(Sig3D,1.);
187  h.m_curTup->VrtTrkHF [h.m_curTup->n2Vrt] = getIdHF(tracksForFit[0])+ getIdHF(tracksForFit[1]);
188  h.m_curTup->VrtTrkI [h.m_curTup->n2Vrt] = getG4Inter(tracksForFit[0])+ getG4Inter(tracksForFit[1]);
189  h.m_curTup->VrtCh [h.m_curTup->n2Vrt] = Charge;
190  h.m_curTup->VrtProb [h.m_curTup->n2Vrt] = Prob2v;
191  h.m_curTup->VrtSig3D [h.m_curTup->n2Vrt] = Sig3D;
192  h.m_curTup->VrtSig2D [h.m_curTup->n2Vrt] = Sig2D;
193  h.m_curTup->VrtDist2D[h.m_curTup->n2Vrt] = vrtR<20. ? Dist2D : vrtR;
194  h.m_curTup->VrtM [h.m_curTup->n2Vrt] = tmpVrt.momentum.M();
195  h.m_curTup->VrtZ [h.m_curTup->n2Vrt] = tmpVrt.fitVertex.z();
196  h.m_curTup->VrtPt [h.m_curTup->n2Vrt] = tmpVrt.momentum.Pt();
197  h.m_curTup->VrtEta [h.m_curTup->n2Vrt] = SVPV.Eta();
198  h.m_curTup->VrtIBL [h.m_curTup->n2Vrt] = sumIBLHits;
199  h.m_curTup->VrtBL [h.m_curTup->n2Vrt] = sumBLHits;
200  h.m_curTup->VrtCosSPM[h.m_curTup->n2Vrt] = cosSVPV;
201  h.m_curTup->VMinPtT [h.m_curTup->n2Vrt] = minPtT;
202  h.m_curTup->VMinS3DT [h.m_curTup->n2Vrt] = std::min(trackSignif[i],trackSignif[j]);
203  h.m_curTup->VMaxS3DT [h.m_curTup->n2Vrt] = std::max(trackSignif[i],trackSignif[j]);
204  h.m_curTup->VrtBDT [h.m_curTup->n2Vrt] = 1.1;
205  h.m_curTup->VrtHR1 [h.m_curTup->n2Vrt] = ihitR;
206  h.m_curTup->VrtHR2 [h.m_curTup->n2Vrt] = jhitR;
207  h.m_curTup->VrtDZ [h.m_curTup->n2Vrt] = minDZ;
208  h.m_curTup->VrtDisk [h.m_curTup->n2Vrt] = idisk1+10*idisk2+20*idisk3+30*jdisk1+40*jdisk2+50*jdisk3;
209  h.m_curTup->VSigMat [h.m_curTup->n2Vrt] = dstMatSignif;
210  if(h.m_curTup->n2Vrt<DevTuple::maxNVrt-1)h.m_curTup->n2Vrt++;
211  }
212 //-------------------BDT based rejection
213  if(tmpVrt.momentum.Pt() > m_vrt2TrPtLimit) continue;
214  std::vector<float> VARS(10);
215  VARS[0]=Prob2v;
216  VARS[1]=log(tmpVrt.momentum.Pt());
217  VARS[2]=log(std::max(minPtT,m_cutPt));
218  VARS[3]=log(vrtR<20. ? SVPV.Perp() : vrtR);
219  VARS[4]=log(std::max(std::min(trackSignif[i],trackSignif[j]),m_trkSigCut));
220  VARS[5]=log(std::max(trackSignif[i],trackSignif[j]));
221  VARS[6]=tmpVrt.momentum.M();
222  VARS[7]=sqrt(std::abs(1.-cosSVPV*cosSVPV));
223  VARS[8]=SVPV.Eta();
224  VARS[9]=std::max(ihitR,jhitR);
225  float wgtSelect=m_SV2T_BDT->GetGradBoostMVA(VARS);
226  if( m_fillHist ) {
227  Hists& h = getHists();
228  h.m_curTup->VrtBDT[h.m_curTup->n2Vrt-1] = wgtSelect;
229  }
230  if(wgtSelect<m_v2tIniBDTCut) continue;
231 //
232 //--- Save good candidate for multi-vertex fit
233 //
234  add_edge(i,j,compatibilityGraph);
235  goodVrt[NTracks*i+j]=std::vector<double>{tmpVrt.fitVertex.x(),tmpVrt.fitVertex.y(),tmpVrt.fitVertex.z()};
236  trkCount[i].emplace_back(j,wgtSelect); trkCount[j].emplace_back(i,wgtSelect);
237  }
238  }
239  //=== Resolve -!----!- case to speed up cluster finding
240  for(int t=0; t<NTracks; t++){
241  if(trkCount[t].size()==2){
242  i=std::get<0>(trkCount[t][0]);
243  j=std::get<0>(trkCount[t][1]);
244  if(trkCount[i].size()==1 && trkCount[j].size()==1 ){
245  if( std::get<1>(trkCount[t][0]) < std::get<1>(trkCount[t][1]) ) {
246  remove_edge(t,i,compatibilityGraph);
247  if(t<i)goodVrt.erase(NTracks*t+i); else goodVrt.erase(NTracks*i+t);
248  trkCount[i].clear();
249  trkCount[t].erase(trkCount[t].begin()+0);
250  } else {
251  remove_edge(t,j,compatibilityGraph);
252  if(t<j)goodVrt.erase(NTracks*t+j); else goodVrt.erase(NTracks*j+t);
253  trkCount[j].clear();
254  trkCount[t].erase(trkCount[t].begin()+1);
255  }
256  }
257  }
258  }
259  //=== Remove isolated 2track vertices
260  for(int t=0; t<NTracks; t++){
261  if(trkCount[t].size()==1){
262  i=std::get<0>(trkCount[t][0]);
263  if(trkCount[i].size()==1){
264  if( std::get<1>(trkCount[t][0]) < m_v2tFinBDTCut ) {
265  remove_edge(t,i,compatibilityGraph);
266  if(t<i)goodVrt.erase(NTracks*t+i); else goodVrt.erase(NTracks*i+t);
267  trkCount[t].clear();
268  trkCount[i].clear();
269  }
270  }
271  }
272  }
273 
274  }

◆ selGoodTrkParticle()

void Rec::NewVrtSecInclusiveTool::selGoodTrkParticle ( workVectorArrxAOD xAODwrk,
const xAOD::Vertex primVrt 
) const
private

Definition at line 21 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/CutTrk.cxx.

24  {
25  std::vector<const xAOD::TrackParticle*>& inpTrk = xAODwrk->inpTrk;
26  std::vector<const xAOD::TrackParticle*>& selectedTracks = xAODwrk->listSelTracks;
27  std::vector<const xAOD::TrackParticle*>::const_iterator i_ntrk;
28  std::vector<double> impact,impactError;
29  std::multimap<double,const xAOD::TrackParticle*> orderedTrk;
30  if(m_fillHist){
31  Hists& h = getHists();
32  h.m_hb_ntrkInput->Fill( inpTrk.size()+0.1, m_w_1);
33  }
34  for (i_ntrk = inpTrk.begin(); i_ntrk < inpTrk.end(); ++i_ntrk) {
35 //
36 //-- Perigee in TrackParticle
37 //
38  if(m_fillHist){
39  Hists& h = getHists();
40  h.m_hb_trkSelect->Fill( 0., m_w_1);
41  }
42  if((*i_ntrk)->numberDoF() == 0) continue; //Protection
43  double trkChi2 = (*i_ntrk)->chiSquared() / (*i_ntrk)->numberDoF();
44  if(trkChi2 > m_cutChi2) continue;
45  if( (*i_ntrk)->pt() < m_cutPt) continue;
46  if(m_fillHist){
47  Hists& h = getHists();
48  h.m_hb_trkSelect->Fill( 1., m_w_1);
49  }
50 
51  const Trk::Perigee mPer=(*i_ntrk)->perigeeParameters() ;
52  const AmgSymMatrix(5) * locCov = mPer.covariance();
53  const double CovTrkMtx00 = (*locCov)(0,0);
54 
55  uint8_t PixelHits,SctHits,BLayHits,TRTHits;
56  if( !((*i_ntrk)->summaryValue(PixelHits,xAOD::numberOfPixelHits)) ) continue; // Track is
57  if( !((*i_ntrk)->summaryValue( SctHits,xAOD::numberOfSCTHits)) ) continue; // definitely
58  if( SctHits<3 ) continue; // bad
59  if( !((*i_ntrk)->summaryValue( TRTHits,xAOD::numberOfTRTHits)) ) continue;
60  if( !((*i_ntrk)->summaryValue(BLayHits,xAOD::numberOfInnermostPixelLayerHits))) BLayHits=0;
61  if(m_fillHist){
62  Hists& h = getHists();
63  h.m_hb_trkSelect->Fill( 2., m_w_1);
64  }
65 
66  Amg::Vector3D perigeePos=mPer.position();
67  double impactD0=sqrt( (perigeePos.x()-primVrt.x())*(perigeePos.x()-primVrt.x())
68  +(perigeePos.y()-primVrt.y())*(perigeePos.y()-primVrt.y()) );
69  double impactZ=perigeePos.z()-primVrt.z();
70  if(m_fillHist){
71  Hists& h = getHists();
72  h.m_hb_trkD0->Fill( impactD0, m_w_1);
73  h.m_hb_trkZ ->Fill( impactZ, m_w_1);
74  }
75  if(std::abs(impactZ)*std::sin((*i_ntrk)->theta())>m_cutZVrt) continue;
76  if(impactD0>m_cutD0Max) continue;
77  if(impactD0<m_cutD0Min) continue;
78  if(m_fillHist){
79  Hists& h = getHists();
80  h.m_hb_trkSelect->Fill( 3., m_w_1);
81  }
82 
83  double bX=xAODwrk->beamX + (perigeePos.z()-xAODwrk->beamZ)*xAODwrk->tanBeamTiltX;
84  double bY=xAODwrk->beamY + (perigeePos.z()-xAODwrk->beamZ)*xAODwrk->tanBeamTiltY;
85  double impactBeam=sqrt( (perigeePos.x()-bX)*(perigeePos.x()-bX) + (perigeePos.y()-bY)*(perigeePos.y()-bY));
86 //----Anti-pileup
87  double signifBeam = impactBeam / sqrt(CovTrkMtx00);
88  if(signifBeam < m_antiPileupSigRCut) continue; // cut against tracks from pileup vertices
89  if(m_fillHist){
90  Hists& h = getHists();
91  h.m_hb_trkSelect->Fill( 4., m_w_1);
92  }
93 //----
94  if(PixelHits < m_cutPixelHits) continue;
95  if(SctHits < m_cutSctHits) continue;
96  if((PixelHits+SctHits) < m_cutSiHits) continue;
97  if(BLayHits < m_cutBLayHits) continue;
98  if(std::abs((*i_ntrk)->eta())<1.9 && TRTHits < m_cutTRTHits) continue; //TRT hits must be present inside TRT
99  if(m_fillHist){
100  Hists& h = getHists();
101  h.m_hb_trkSelect->Fill( 5., m_w_1);
102  }
103 //----
104  orderedTrk.emplace(signifBeam,*i_ntrk);
105  selectedTracks.push_back(*i_ntrk);
106  }
107 //---- Order tracks according to ranks
108  std::map<double,const xAOD::TrackParticle*>::reverse_iterator rt=orderedTrk.rbegin();
109  selectedTracks.resize(orderedTrk.size());
110  for ( int cntt=0; rt!=orderedTrk.rend(); ++rt,++cntt) {selectedTracks[cntt]=(*rt).second;}
111  }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ vrtRadiusError()

double Rec::NewVrtSecInclusiveTool::vrtRadiusError ( const Amg::Vector3D secVrt,
const std::vector< double > &  vrtErr 
)
staticprivate

Definition at line 159 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

160  {
161  double DirX=SecVrt.x(), DirY=SecVrt.y();
162  double Covar = DirX*VrtErr[0]*DirX
163  +2.*DirX*VrtErr[1]*DirY
164  +DirY*VrtErr[2]*DirY;
165  Covar /= DirX*DirX + DirY*DirY;
166  Covar=std::sqrt(std::abs(Covar));
167  if(Covar != Covar) Covar = 0.;
168  return Covar;
169  }

◆ vrtVrtDist() [1/2]

double Rec::NewVrtSecInclusiveTool::vrtVrtDist ( const Amg::Vector3D vrt1,
const std::vector< double > &  vrtErr1,
const Amg::Vector3D vrt2,
const std::vector< double > &  vrtErr2 
)
staticprivate

Definition at line 118 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

121  {
122  double distx = vrt1.x()- vrt2.x();
123  double disty = vrt1.y()- vrt2.y();
124  double distz = vrt1.z()- vrt2.z();
125 
126  AmgSymMatrix(3) primCovMtx; //Create
127  primCovMtx(0,0) = vrtErr1[0]+vrtErr2[0];
128  primCovMtx(0,1) = primCovMtx(1,0) = vrtErr1[1]+vrtErr2[1];
129  primCovMtx(1,1) = vrtErr1[2]+vrtErr2[2];
130  primCovMtx(0,2) = primCovMtx(2,0) = vrtErr1[3]+vrtErr2[3];
131  primCovMtx(1,2) = primCovMtx(2,1) = vrtErr1[4]+vrtErr2[4];
132  primCovMtx(2,2) = vrtErr1[5]+vrtErr2[5];
133 
134  AmgSymMatrix(3) wgtMtx = primCovMtx.inverse();
135 
136  double signif =
137  distx*wgtMtx(0,0)*distx
138  +disty*wgtMtx(1,1)*disty
139  +distz*wgtMtx(2,2)*distz
140  +2.*distx*wgtMtx(0,1)*disty
141  +2.*distx*wgtMtx(0,2)*distz
142  +2.*disty*wgtMtx(1,2)*distz;
143  signif=std::sqrt(std::abs(signif));
144  if(signif != signif) signif = 0.;
145  return signif;
146  }

◆ vrtVrtDist() [2/2]

double Rec::NewVrtSecInclusiveTool::vrtVrtDist ( const xAOD::Vertex primVrt,
const Amg::Vector3D secVrt,
const std::vector< double > &  vrtErr,
double &  signif 
)
staticprivate

Definition at line 59 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

62  {
63  double distx = primVrt.x()- secVrt.x();
64  double disty = primVrt.y()- secVrt.y();
65  double distz = primVrt.z()- secVrt.z();
66 
67 
68  AmgSymMatrix(3) primCovMtx=primVrt.covariancePosition(); //Create
69  primCovMtx(0,0) += secVrtErr[0];
70  primCovMtx(0,1) += secVrtErr[1];
71  primCovMtx(1,0) += secVrtErr[1];
72  primCovMtx(1,1) += secVrtErr[2];
73  primCovMtx(0,2) += secVrtErr[3];
74  primCovMtx(2,0) += secVrtErr[3];
75  primCovMtx(1,2) += secVrtErr[4];
76  primCovMtx(2,1) += secVrtErr[4];
77  primCovMtx(2,2) += secVrtErr[5];
78 
79  AmgSymMatrix(3) wgtMtx = primCovMtx.inverse();
80 
81  signif = distx*wgtMtx(0,0)*distx
82  +disty*wgtMtx(1,1)*disty
83  +distz*wgtMtx(2,2)*distz
84  +2.*distx*wgtMtx(0,1)*disty
85  +2.*distx*wgtMtx(0,2)*distz
86  +2.*disty*wgtMtx(1,2)*distz;
87  signif=std::sqrt(std::abs(signif));
88  if( signif!=signif ) signif = 0.;
89  return std::sqrt(distx*distx+disty*disty+distz*distz);
90  }

◆ vrtVrtDist2D()

double Rec::NewVrtSecInclusiveTool::vrtVrtDist2D ( const xAOD::Vertex primVrt,
const Amg::Vector3D secVrt,
const std::vector< double > &  vrtErr,
double &  signif 
)
staticprivate

Definition at line 92 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

95  {
96  double distx = primVrt.x()- secVrt.x();
97  double disty = primVrt.y()- secVrt.y();
98 
99 
100  AmgSymMatrix(3) primCovMtx=primVrt.covariancePosition(); //Create
101  AmgSymMatrix(2) covMtx;
102  covMtx(0,0) = primCovMtx(0,0) + secVrtErr[0];
103  covMtx(0,1) = primCovMtx(0,1) + secVrtErr[1];
104  covMtx(1,0) = primCovMtx(1,0) + secVrtErr[1];
105  covMtx(1,1) = primCovMtx(1,1) + secVrtErr[2];
106 
107  AmgSymMatrix(2) wgtMtx = covMtx.inverse();
108 
109  signif = distx*wgtMtx(0,0)*distx
110  +disty*wgtMtx(1,1)*disty
111  +2.*distx*wgtMtx(0,1)*disty;
112  signif=std::sqrt(std::abs(signif));
113  if( signif!=signif ) signif = 0.;
114  return std::sqrt(distx*distx+disty*disty);
115  }

Member Data Documentation

◆ m_antiPileupSigRCut

float Rec::NewVrtSecInclusiveTool::m_antiPileupSigRCut {}
private

Definition at line 159 of file NewVrtSecInclusiveTool.h.

◆ m_beampipeR

float Rec::NewVrtSecInclusiveTool::m_beampipeR {}
private

Definition at line 164 of file NewVrtSecInclusiveTool.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> Rec::NewVrtSecInclusiveTool::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 177 of file NewVrtSecInclusiveTool.h.

◆ m_calibFileName

std::string Rec::NewVrtSecInclusiveTool::m_calibFileName
private

Definition at line 173 of file NewVrtSecInclusiveTool.h.

◆ m_chiScale

float Rec::NewVrtSecInclusiveTool::m_chiScale[11] {}
private

Definition at line 279 of file NewVrtSecInclusiveTool.h.

◆ m_cosSVPVCut

float Rec::NewVrtSecInclusiveTool::m_cosSVPVCut {}
private

Definition at line 168 of file NewVrtSecInclusiveTool.h.

◆ m_cutBLayHits

long int Rec::NewVrtSecInclusiveTool::m_cutBLayHits {}
private

Definition at line 144 of file NewVrtSecInclusiveTool.h.

◆ m_cutChi2

double Rec::NewVrtSecInclusiveTool::m_cutChi2 {}
private

Definition at line 150 of file NewVrtSecInclusiveTool.h.

◆ m_cutD0Max

double Rec::NewVrtSecInclusiveTool::m_cutD0Max {}
private

Definition at line 148 of file NewVrtSecInclusiveTool.h.

◆ m_cutD0Min

double Rec::NewVrtSecInclusiveTool::m_cutD0Min {}
private

Definition at line 149 of file NewVrtSecInclusiveTool.h.

◆ m_cutPixelHits

long int Rec::NewVrtSecInclusiveTool::m_cutPixelHits {}
private

Definition at line 141 of file NewVrtSecInclusiveTool.h.

◆ m_cutPt

double Rec::NewVrtSecInclusiveTool::m_cutPt {}
private

Definition at line 146 of file NewVrtSecInclusiveTool.h.

◆ m_cutSctHits

long int Rec::NewVrtSecInclusiveTool::m_cutSctHits {}
private

Definition at line 140 of file NewVrtSecInclusiveTool.h.

◆ m_cutSharedHits

long int Rec::NewVrtSecInclusiveTool::m_cutSharedHits {}
private

Definition at line 145 of file NewVrtSecInclusiveTool.h.

◆ m_cutSiHits

long int Rec::NewVrtSecInclusiveTool::m_cutSiHits {}
private

Definition at line 143 of file NewVrtSecInclusiveTool.h.

◆ m_cutTRTHits

long int Rec::NewVrtSecInclusiveTool::m_cutTRTHits {}
private

Definition at line 142 of file NewVrtSecInclusiveTool.h.

◆ m_cutZVrt

double Rec::NewVrtSecInclusiveTool::m_cutZVrt {}
private

Definition at line 147 of file NewVrtSecInclusiveTool.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_dRdZRatioCut

float Rec::NewVrtSecInclusiveTool::m_dRdZRatioCut {}
private

Definition at line 160 of file NewVrtSecInclusiveTool.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_extrapolator

ToolHandle<Trk::IExtrapolator> Rec::NewVrtSecInclusiveTool::m_extrapolator {this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator"}
private

Definition at line 179 of file NewVrtSecInclusiveTool.h.

◆ m_fastZSVCut

float Rec::NewVrtSecInclusiveTool::m_fastZSVCut {}
private

Definition at line 167 of file NewVrtSecInclusiveTool.h.

◆ m_fillHist

bool Rec::NewVrtSecInclusiveTool::m_fillHist {}
private

Definition at line 170 of file NewVrtSecInclusiveTool.h.

◆ m_firstPixelLayerR

float Rec::NewVrtSecInclusiveTool::m_firstPixelLayerR {}
private

Definition at line 165 of file NewVrtSecInclusiveTool.h.

◆ m_fitSvc

ToolHandle<Trk::TrkVKalVrtFitter> Rec::NewVrtSecInclusiveTool::m_fitSvc
private

Definition at line 180 of file NewVrtSecInclusiveTool.h.

◆ m_globVrtProbCut

double Rec::NewVrtSecInclusiveTool::m_globVrtProbCut {}
private

Definition at line 152 of file NewVrtSecInclusiveTool.h.

◆ m_h

std::unique_ptr<Hists> Rec::NewVrtSecInclusiveTool::m_h
private

Definition at line 137 of file NewVrtSecInclusiveTool.h.

◆ m_instanceName

std::string Rec::NewVrtSecInclusiveTool::m_instanceName
private

Definition at line 188 of file NewVrtSecInclusiveTool.h.

◆ m_massE

double Rec::NewVrtSecInclusiveTool::m_massE {}
private

Definition at line 185 of file NewVrtSecInclusiveTool.h.

◆ m_massK0

double Rec::NewVrtSecInclusiveTool::m_massK0 {}
private

Definition at line 186 of file NewVrtSecInclusiveTool.h.

◆ m_massLam

double Rec::NewVrtSecInclusiveTool::m_massLam {}
private

Definition at line 187 of file NewVrtSecInclusiveTool.h.

◆ m_massP

double Rec::NewVrtSecInclusiveTool::m_massP {}
private

Definition at line 184 of file NewVrtSecInclusiveTool.h.

◆ m_massPi

double Rec::NewVrtSecInclusiveTool::m_massPi {}
private

Definition at line 183 of file NewVrtSecInclusiveTool.h.

◆ m_maxSVRadiusCut

double Rec::NewVrtSecInclusiveTool::m_maxSVRadiusCut {}
private

Definition at line 153 of file NewVrtSecInclusiveTool.h.

◆ m_multiWithOneTrkVrt

bool Rec::NewVrtSecInclusiveTool::m_multiWithOneTrkVrt {}
private

Definition at line 172 of file NewVrtSecInclusiveTool.h.

◆ m_removeTrkMatSignif

float Rec::NewVrtSecInclusiveTool::m_removeTrkMatSignif {}
private

Definition at line 166 of file NewVrtSecInclusiveTool.h.

◆ m_sel2VrtProbCut

double Rec::NewVrtSecInclusiveTool::m_sel2VrtProbCut {}
private

Definition at line 151 of file NewVrtSecInclusiveTool.h.

◆ m_selVrtSigCut

double Rec::NewVrtSecInclusiveTool::m_selVrtSigCut {}
private

Definition at line 154 of file NewVrtSecInclusiveTool.h.

◆ m_SV2T_BDT

std::unique_ptr<MVAUtils::BDT> Rec::NewVrtSecInclusiveTool::m_SV2T_BDT
private

Definition at line 175 of file NewVrtSecInclusiveTool.h.

◆ m_trkSigCut

double Rec::NewVrtSecInclusiveTool::m_trkSigCut {}
private

Definition at line 155 of file NewVrtSecInclusiveTool.h.

◆ m_useVertexCleaning

bool Rec::NewVrtSecInclusiveTool::m_useVertexCleaning {}
private

Definition at line 171 of file NewVrtSecInclusiveTool.h.

◆ m_v2tFinBDTCut

float Rec::NewVrtSecInclusiveTool::m_v2tFinBDTCut {}
private

Definition at line 162 of file NewVrtSecInclusiveTool.h.

◆ m_v2tIniBDTCut

float Rec::NewVrtSecInclusiveTool::m_v2tIniBDTCut {}
private

Definition at line 161 of file NewVrtSecInclusiveTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexMergeCut

float Rec::NewVrtSecInclusiveTool::m_vertexMergeCut {}
private

Definition at line 163 of file NewVrtSecInclusiveTool.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vrt2TrMassLimit

float Rec::NewVrtSecInclusiveTool::m_vrt2TrMassLimit {}
private

Definition at line 157 of file NewVrtSecInclusiveTool.h.

◆ m_vrt2TrPtLimit

float Rec::NewVrtSecInclusiveTool::m_vrt2TrPtLimit {}
private

Definition at line 158 of file NewVrtSecInclusiveTool.h.

◆ m_vrtMassLimit

float Rec::NewVrtSecInclusiveTool::m_vrtMassLimit {}
private

Definition at line 156 of file NewVrtSecInclusiveTool.h.

◆ m_w_1

double Rec::NewVrtSecInclusiveTool::m_w_1 {}
private

Definition at line 99 of file NewVrtSecInclusiveTool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::pixelEndCap2
@ pixelEndCap2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:239
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
base
std::string base
Definition: hcg.cxx:78
Rec::NewVrtSecInclusiveTool::getIdHF
int getIdHF(const xAOD::TrackParticle *TP) const
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:243
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:384
Rec::NewVrtSecInclusiveTool::m_vrtMassLimit
float m_vrtMassLimit
Definition: NewVrtSecInclusiveTool.h:156
Rec::NewVrtSecInclusiveTool::vrtVrtDist2D
static double vrtVrtDist2D(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:92
Rec::NewVrtSecInclusiveTool::refineVerticesWithCommonTracks
double refineVerticesWithCommonTracks(WrkVrt &v1, WrkVrt &v2, std::vector< const xAOD::TrackParticle * > &allTrackList, Trk::IVKalState &istate) const
Definition: MultiUtilities.cxx:100
Rec::NewVrtSecInclusiveTool::notFromBC
static int notFromBC(int PDGID)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:271
xAOD::Vertex_v1::x
float x() const
Returns the x position.
test_pyathena.eta
eta
Definition: test_pyathena.py:10
FlavorTagDiscriminants::OnnxModelVersion::V2
@ V2
Trk::proton
@ proton
Definition: ParticleHypothesis.h:31
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::k0
@ k0
Definition: ParticleHypothesis.h:35
Rec::NewVrtSecInclusiveTool::m_globVrtProbCut
double m_globVrtProbCut
Definition: NewVrtSecInclusiveTool.h:152
Rec::NewVrtSecInclusiveTool::getIBLHit
static int getIBLHit(const xAOD::TrackParticle *Part)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:215
xAOD::Vertex_v1::setFitQuality
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Definition: Vertex_v1.cxx:150
Rec::NewVrtSecInclusiveTool::getBLHit
static int getBLHit(const xAOD::TrackParticle *Part)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:224
test_pyathena.px
px
Definition: test_pyathena.py:18
Rec::NewVrtSecInclusiveTool::m_maxSVRadiusCut
double m_maxSVRadiusCut
Definition: NewVrtSecInclusiveTool.h:153
max
#define max(a, b)
Definition: cfImp.cxx:41
Rec::NewVrtSecInclusiveTool::selGoodTrkParticle
void selGoodTrkParticle(workVectorArrxAOD *xAODwrk, const xAOD::Vertex &primVrt) const
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/CutTrk.cxx:21
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Rec::NewVrtSecInclusiveTool::getVrtSecMulti
std::vector< xAOD::Vertex * > getVrtSecMulti(workVectorArrxAOD *inpParticlesxAOD, const xAOD::Vertex &primVrt, compatibilityGraph_t &compatibilityGraph) const
Definition: VrtSecMulti.cxx:28
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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
Rec::NewVrtSecInclusiveTool::m_cutPixelHits
long int m_cutPixelHits
Definition: NewVrtSecInclusiveTool.h:141
Rec::NewVrtSecInclusiveTool::m_h
std::unique_ptr< Hists > m_h
Definition: NewVrtSecInclusiveTool.h:137
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Rec::NewVrtSecInclusiveTool::m_instanceName
std::string m_instanceName
Definition: NewVrtSecInclusiveTool.h:188
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Rec::NewVrtSecInclusiveTool::m_dRdZRatioCut
float m_dRdZRatioCut
Definition: NewVrtSecInclusiveTool.h:160
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Rec::NewVrtSecInclusiveTool::MomProjDist
static double MomProjDist(const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
Definition: MultiUtilities.cxx:260
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Rec::NewVrtSecInclusiveTool::mergeAndRefitVertices
double mergeAndRefitVertices(WrkVrt &v1, WrkVrt &v2, WrkVrt &newvrt, std::vector< const xAOD::TrackParticle * > &AllTrackList, Trk::IVKalState &istate, int robKey=0) const
Definition: MultiUtilities.cxx:151
Rec::NewVrtSecInclusiveTool::getPixelDiscs
static void getPixelDiscs(const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:234
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:236
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Rec::NewVrtSecInclusiveTool::m_useVertexCleaning
bool m_useVertexCleaning
Definition: NewVrtSecInclusiveTool.h:171
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
covarianceTool.prob
prob
Definition: covarianceTool.py:678
xAOD::Vertex_v1::setCovariance
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
IDTPM::nPixelHits
float nPixelHits(const U &p)
Definition: TrackParametersHelper.h:326
Rec::NewVrtSecInclusiveTool::select2TrVrt
void select2TrVrt(std::vector< const xAOD::TrackParticle * > &SelectedTracks, const xAOD::Vertex &primVrt, std::map< long int, std::vector< double >> &vrt, compatibilityGraph_t &compatibilityGraph) const
Definition: Sel2TrkVertices.cxx:31
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
Rec::NewVrtSecInclusiveTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: NewVrtSecInclusiveTool.h:177
Rec::NewVrtSecInclusiveTool::massV0
static double massV0(const std::vector< std::vector< double > > &TrkAtVrt, double massP, double massPi)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:176
Rec::NewVrtSecInclusiveTool::m_antiPileupSigRCut
float m_antiPileupSigRCut
Definition: NewVrtSecInclusiveTool.h:159
Rec::NewVrtSecInclusiveTool::estimVrtPos
static std::vector< double > estimVrtPos(int nTrk, std::deque< long int > &selTrk, std::map< long int, std::vector< double >> &vrt)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:365
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Rec::NewVrtSecInclusiveTool::m_cutPt
double m_cutPt
Definition: NewVrtSecInclusiveTool.h:146
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Rec::NewVrtSecInclusiveTool::m_cutD0Min
double m_cutD0Min
Definition: NewVrtSecInclusiveTool.h:149
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
Rec::NewVrtSecInclusiveTool::m_removeTrkMatSignif
float m_removeTrkMatSignif
Definition: NewVrtSecInclusiveTool.h:166
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
Rec::NewVrtSecInclusiveTool::m_fitSvc
ToolHandle< Trk::TrkVKalVrtFitter > m_fitSvc
Definition: NewVrtSecInclusiveTool.h:180
Rec::NewVrtSecInclusiveTool::m_multiWithOneTrkVrt
bool m_multiWithOneTrkVrt
Definition: NewVrtSecInclusiveTool.h:172
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::pixelEndCap0
@ pixelEndCap0
three pixel discs (on each side)
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:237
python.changerun.kk
list kk
Definition: changerun.py:41
Rec::NewVrtSecInclusiveTool::mostHeavyTrk
static int mostHeavyTrk(WrkVrt V, std::vector< const xAOD::TrackParticle * > AllTracks)
Definition: MultiUtilities.cxx:26
Rec::NewVrtSecInclusiveTool::m_vrt2TrMassLimit
float m_vrt2TrMassLimit
Definition: NewVrtSecInclusiveTool.h:157
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Rec::NewVrtSecInclusiveTool::DevTuple::maxNTrk
static constexpr int maxNTrk
Definition: NewVrtSecInclusiveTool.h:202
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Rec::NewVrtSecInclusiveTool::m_cutD0Max
double m_cutD0Max
Definition: NewVrtSecInclusiveTool.h:148
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::expectNextToInnermostPixelLayerHit
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
Definition: TrackingPrimitives.h:247
Trk::Layer::surfaceRepresentation
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:342
Rec::NewVrtSecInclusiveTool::m_cutSiHits
long int m_cutSiHits
Definition: NewVrtSecInclusiveTool.h:143
lumiFormat.i
int i
Definition: lumiFormat.py:85
Rec::NewVrtSecInclusiveTool::m_cutSctHits
long int m_cutSctHits
Definition: NewVrtSecInclusiveTool.h:140
Trk::pixelEndCap1
@ pixelEndCap1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:238
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
Rec::NewVrtSecInclusiveTool::m_selVrtSigCut
double m_selVrtSigCut
Definition: NewVrtSecInclusiveTool.h:154
Rec::NewVrtSecInclusiveTool::m_massPi
double m_massPi
Definition: NewVrtSecInclusiveTool.h:183
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
Rec::NewVrtSecInclusiveTool::m_massP
double m_massP
Definition: NewVrtSecInclusiveTool.h:184
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
Rec::NewVrtSecInclusiveTool::m_calibFileName
std::string m_calibFileName
Definition: NewVrtSecInclusiveTool.h:173
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::Layer::nextLayer
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &udir) const
getting the next/previous Layer if registered - unit for direction vector required
Definition: Layer.cxx:175
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
Rec::NewVrtSecInclusiveTool::m_fastZSVCut
float m_fastZSVCut
Definition: NewVrtSecInclusiveTool.h:167
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Rec::NewVrtSecInclusiveTool::m_vrt2TrPtLimit
float m_vrt2TrPtLimit
Definition: NewVrtSecInclusiveTool.h:158
Trk::ParametersBase
Definition: ParametersBase.h:55
xAOD::Vertex_v1::z
float z() const
Returns the z position.
Rec::NewVrtSecInclusiveTool::m_cosSVPVCut
float m_cosSVPVCut
Definition: NewVrtSecInclusiveTool.h:168
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
min
#define min(a, b)
Definition: cfImp.cxx:40
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Rec::NewVrtSecInclusiveTool::m_cutBLayHits
long int m_cutBLayHits
Definition: NewVrtSecInclusiveTool.h:144
Rec::NewVrtSecInclusiveTool::m_massK0
double m_massK0
Definition: NewVrtSecInclusiveTool.h:186
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Rec::NewVrtSecInclusiveTool::m_trkSigCut
double m_trkSigCut
Definition: NewVrtSecInclusiveTool.h:155
Rec::NewVrtSecInclusiveTool::momAtVrt
TLorentzVector momAtVrt(const std::vector< double > &inpTrk) const
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:200
Amg::py
@ py
Definition: GeoPrimitives.h:39
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
Rec::NewVrtSecInclusiveTool::m_v2tIniBDTCut
float m_v2tIniBDTCut
Definition: NewVrtSecInclusiveTool.h:161
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
charge
double charge(const T &p)
Definition: AtlasPID.h:538
Rec::NewVrtSecInclusiveTool::m_sel2VrtProbCut
double m_sel2VrtProbCut
Definition: NewVrtSecInclusiveTool.h:151
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Trk::VxSecVertexInfo
Definition: VxSecVertexInfo.h:63
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
Rec::NewVrtSecInclusiveTool::improveVertexChi2
double improveVertexChi2(WrkVrt &vertex, std::vector< const xAOD::TrackParticle * > &allTracks, Trk::IVKalState &istate, bool ifCovV0) const
Definition: MultiUtilities.cxx:195
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Rec::NewVrtSecInclusiveTool::m_beampipeR
float m_beampipeR
Definition: NewVrtSecInclusiveTool.h:164
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
Rec::NewVrtSecInclusiveTool::compatibilityGraph_t
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS > compatibilityGraph_t
Definition: NewVrtSecInclusiveTool.h:278
Rec::NewVrtSecInclusiveTool::m_w_1
double m_w_1
Definition: NewVrtSecInclusiveTool.h:99
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition: DVL_algorithms.h:135
Rec::NewVrtSecInclusiveTool::m_cutSharedHits
long int m_cutSharedHits
Definition: NewVrtSecInclusiveTool.h:145
Rec::NewVrtSecInclusiveTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: NewVrtSecInclusiveTool.h:179
a
TList * a
Definition: liststreamerinfos.cxx:10
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
Rec::NewVrtSecInclusiveTool::minVrtVrtDist
double minVrtVrtDist(std::vector< WrkVrt > *WrkVrtSet, int &indexV1, int &indexV2, std::vector< double > &check) const
Definition: MultiUtilities.cxx:70
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Rec::NewVrtSecInclusiveTool::vrtVrtDist
static double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:59
Rec::NewVrtSecInclusiveTool::m_firstPixelLayerR
float m_firstPixelLayerR
Definition: NewVrtSecInclusiveTool.h:165
python.BackTrackingConfig.numThreads
int numThreads
Definition: BackTrackingConfig.py:61
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
Rec::NewVrtSecInclusiveTool::m_vertexMergeCut
float m_vertexMergeCut
Definition: NewVrtSecInclusiveTool.h:163
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:47
Rec::NewVrtSecInclusiveTool::getHists
Hists & getHists() const
Definition: NewVrtSecInclusiveTool.cxx:361
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Rec::NewVrtSecInclusiveTool::m_v2tFinBDTCut
float m_v2tFinBDTCut
Definition: NewVrtSecInclusiveTool.h:162
DEBUG
#define DEBUG
Definition: page_access.h:11
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
xAOD::Vertex_v1::y
float y() const
Returns the y position.
Rec::NewVrtSecInclusiveTool::getPreviousParent
static const xAOD::TruthParticle * getPreviousParent(const xAOD::TruthParticle *child, int &ParentPDG)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:282
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DetType::Part
Part
Definition: DetType.h:14
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Trk::Layer::layerMaterialProperties
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
Rec::NewVrtSecInclusiveTool::getG4Inter
static int getG4Inter(const xAOD::TrackParticle *TP)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:294
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Rec::NewVrtSecInclusiveTool::distToMatLayerSignificance
double distToMatLayerSignificance(Vrt2Tr &Vrt) const
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:315
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
Rec::NewVrtSecInclusiveTool::projSV_PV
static double projSV_PV(const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:53
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
calibdata.copy
bool copy
Definition: calibdata.py:27
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
Trk::nonInteractingMuon
@ nonInteractingMuon
Definition: ParticleHypothesis.h:36
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
Rec::NewVrtSecInclusiveTool::m_SV2T_BDT
std::unique_ptr< MVAUtils::BDT > m_SV2T_BDT
Definition: NewVrtSecInclusiveTool.h:175
Rec::NewVrtSecInclusiveTool::vrtRadiusError
static double vrtRadiusError(const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:159
Rec::NewVrtSecInclusiveTool::refitVertex
double refitVertex(WrkVrt &Vrt, std::vector< const xAOD::TrackParticle * > &SelectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
Definition: MultiUtilities.cxx:221
Rec::NewVrtSecInclusiveTool::printWrkSet
void printWrkSet(const std::vector< WrkVrt > *WrkSet, const std::string &name) const
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:26
Rec::NewVrtSecInclusiveTool::m_fillHist
bool m_fillHist
Definition: NewVrtSecInclusiveTool.h:170
Rec::NewVrtSecInclusiveTool::m_cutChi2
double m_cutChi2
Definition: NewVrtSecInclusiveTool.h:150
PlotCalibFromCool.vv
vv
Definition: PlotCalibFromCool.py:716
Rec::NewVrtSecInclusiveTool::DevTuple::maxNVrt
static constexpr int maxNVrt
Definition: NewVrtSecInclusiveTool.h:203
Rec::NewVrtSecInclusiveTool::m_massE
double m_massE
Definition: NewVrtSecInclusiveTool.h:185
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FlavorTagDiscriminants::OnnxModelVersion::V1
@ V1
Rec::NewVrtSecInclusiveTool::m_cutZVrt
double m_cutZVrt
Definition: NewVrtSecInclusiveTool.h:147
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
Rec::NewVrtSecInclusiveTool::m_massLam
double m_massLam
Definition: NewVrtSecInclusiveTool.h:187
Trk::Layer
Definition: Layer.h:73
Rec::NewVrtSecInclusiveTool::nTrkCommon
static int nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, int indexV1, int indexV2)
Definition: MultiUtilities.cxx:48
Rec::NewVrtSecInclusiveTool::m_cutTRTHits
long int m_cutTRTHits
Definition: NewVrtSecInclusiveTool.h:142
xAOD::TruthVertex_v1::incomingParticleLinks
const TPLinks_t & incomingParticleLinks() const
Get all the incoming particles.
Rec::NewVrtSecInclusiveTool::PntPntDist
static double PntPntDist(const Amg::Vector3D &Vrt1, const Amg::Vector3D &Vrt2)
Definition: Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx:148