ATLAS Offline Software
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::TwoTrackVrtBDTSelector Class Reference

#include <TwoTrackVrtBDTSelector.h>

Inheritance diagram for Rec::TwoTrackVrtBDTSelector:
Collaboration diagram for Rec::TwoTrackVrtBDTSelector:

Public Member Functions

 TwoTrackVrtBDTSelector (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TwoTrackVrtBDTSelector ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
bool isgood (const std::pair< const xAOD::TrackParticle *, const xAOD::TrackParticle * > tracks, const xAOD::Vertex &candV, std::pair< ROOT::Math::XYZTVector, ROOT::Math::XYZTVector > moms, const xAOD::Vertex &tPV) const final
 
bool isgood (const std::pair< const xAOD::TrackParticle *, const xAOD::TrackParticle * > tracks, const xAOD::Vertex &candV, std::pair< ROOT::Math::XYZTVector, ROOT::Math::XYZTVector > moms, const xAOD::Vertex &tPV, float &quality) 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, V, H > &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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &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 double vrtRadiusError (const Amg::Vector3D &secVrt, const std::vector< float > &vrtErr)
 
static int getIBLHit (const xAOD::TrackParticle *Part)
 
static int getBLHit (const xAOD::TrackParticle *Part)
 

Private Attributes

Gaudi::Property< float > m_vrt2TrMassLimit {this,"Vrt2TrMassLimit",4000., "Maximal allowed mass for 2-track vertices" }
 
Gaudi::Property< float > m_vrt2TrPtMin {this, "Vrt2TrPtMin", 1000., "Minimal allowed Pt for 2-track vertices." }
 
Gaudi::Property< float > m_vrt2TrPtMax {this, "Vrt2TrPtMax", 5.e5, "Maximal allowed Pt for 2-track vertices. Calibration limit" }
 
Gaudi::Property< float > m_sel2VrtProbCut {this, "Sel2VrtProbCut", 0.02, "Cut on probability of 2-track vertex for initial selection" }
 
Gaudi::Property< float > m_maxSVRadiusCut {this, "MaxSVRadiusCut", 140., "Cut on maximal radius of SV (def = Pixel detector size)" }
 
Gaudi::Property< float > m_cosSVPVCut {this, "cosSVPVCut", 0., "Cut on cos of angle between SV-PV and full vertex momentum" }
 
Gaudi::Property< bool > m_do2TrkIBLChecks {this, "do2TrkIBLChecks", true, "IBL and B-layer hit requrirements based on the position of 2-track DV." }
 
Gaudi::Property< bool > m_useVertexCleaning {this, "useVertexCleaning", true, "Clean vertices by requiring pixel hit presence according to vertex position" }
 
Gaudi::Property< float > m_firstPixelLayerR {this, "FirstPixelLayerR", 32.0,"Radius of the first Pixel layer" }
 
Gaudi::Property< float > m_v2tBDTCut {this, "v2tBDTCut", -0.5, "BDT cut to select 2-track vertices" }
 
Gaudi::Property< std::string > m_calibFileName {this, "CalibFileName", "Fake2TrVertexReject.MVA.v02.root", " MVA calibration file for 2-track fake vertices removal" }
 
std::unique_ptr< MVAUtils::BDTm_SV2T_BDT
 
ToolHandle< Trk::TrkVKalVrtFitterm_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool", "Vertex Fitter tool for 2-track selector"}
 
double m_massPi {}
 
double m_massP {}
 
double m_massE {}
 
std::string m_instanceName {}
 
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 36 of file TwoTrackVrtBDTSelector.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TwoTrackVrtBDTSelector()

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

Definition at line 26 of file TwoTrackVrtBDTSelector.cxx.

28  :
30  m_SV2T_BDT(nullptr),
32  {
33 //
34 // Declare additional interface
35 //
36  declareInterface< ITwoTrackVertexSelector >(this);
37 //
41  }

◆ ~TwoTrackVrtBDTSelector()

Rec::TwoTrackVrtBDTSelector::~TwoTrackVrtBDTSelector ( )
virtual

Definition at line 44 of file TwoTrackVrtBDTSelector.cxx.

44  {
45  ATH_MSG_DEBUG("TwoTrackVertBDTSelector destructor called");
46  }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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; }

◆ 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::TwoTrackVrtBDTSelector::finalize ( )

Definition at line 70 of file TwoTrackVrtBDTSelector.cxx.

71  {
72  ATH_MSG_DEBUG("TwoTrackVrtBDTSelector finalize()");
73  return StatusCode::SUCCESS;
74  }

◆ getBLHit()

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

Definition at line 183 of file TwoTrackVrtBDTSelector.cxx.

184  {
185  uint8_t BLhit,BLexp;
186  if(!Part->summaryValue( BLexp, xAOD::expectNextToInnermostPixelLayerHit) ) BLexp = 0;
187  if( BLexp==0 ) return -1;
188  if(!Part->summaryValue( BLhit, xAOD::numberOfNextToInnermostPixelLayerHits) ) BLhit = 0;
189  if(BLhit) return 1;
190  else return 0;
191  }

◆ getIBLHit()

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

Definition at line 174 of file TwoTrackVrtBDTSelector.cxx.

175  {
176  uint8_t IBLhit,IBLexp;
177  if(!Part->summaryValue( IBLexp, xAOD::expectInnermostPixelLayerHit) ) IBLexp = 0;
178  if( IBLexp==0 ) return -1;
179  if(!Part->summaryValue( IBLhit, xAOD::numberOfInnermostPixelLayerHits) ) IBLhit = 0;
180  if(IBLhit) return 1;
181  else return 0;
182  }

◆ initialize()

StatusCode Rec::TwoTrackVrtBDTSelector::initialize ( )

Definition at line 49 of file TwoTrackVrtBDTSelector.cxx.

49  {
50  ATH_MSG_DEBUG( "Initialising TwoTrackVrtBDTSelector" );
51 
52  ATH_CHECK( m_fitSvc.retrieve() );
53 //--------------------------------------------------------
54  //std::string fileName="NewVrtSecInclusiveTool/Fake2TrVertexReject.MVA.v01.root"; ///For local calibration file
55  //std::string rootFilePath = PathResolver::find_file(fileName, "DATAPATH"); ///
56  std::string rootFilePath = PathResolver::find_calib_file("NewVrtSecInclusiveTool/"+m_calibFileName);
57  std::unique_ptr<TFile> rootFile(TFile::Open(rootFilePath.c_str(), "READ"));
58  if (!rootFile) {
59  ATH_MSG_FATAL("Could not retrieve root file: " << m_calibFileName);
60  return StatusCode::FAILURE;
61  }
62  std::unique_ptr<TTree> training((TTree*)rootFile->Get("BDT"));
63  m_SV2T_BDT = std::make_unique<MVAUtils::BDT>(training.get());
64 //--------------------------------------------------------
65  return StatusCode::SUCCESS;
66  }

◆ 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::ITwoTrackVertexSelector::interfaceID ( )
inlinestaticinherited

Definition at line 35 of file ITwoTrackVertexSelector.h.

35 { return IID_ITwoTrackVertexSelector;}

◆ isgood() [1/2]

bool Rec::TwoTrackVrtBDTSelector::isgood ( const std::pair< const xAOD::TrackParticle *, const xAOD::TrackParticle * >  tracks,
const xAOD::Vertex candV,
std::pair< ROOT::Math::XYZTVector, ROOT::Math::XYZTVector >  moms,
const xAOD::Vertex tPV 
) const
finalvirtual

Implements Rec::ITwoTrackVertexSelector.

Definition at line 77 of file TwoTrackVrtBDTSelector.cxx.

81  {
82  float quality;
83  return isgood(iTrks, candV, moms,tPV,quality);
84  }

◆ isgood() [2/2]

bool Rec::TwoTrackVrtBDTSelector::isgood ( const std::pair< const xAOD::TrackParticle *, const xAOD::TrackParticle * >  tracks,
const xAOD::Vertex candV,
std::pair< ROOT::Math::XYZTVector, ROOT::Math::XYZTVector >  moms,
const xAOD::Vertex tPV,
float &  quality 
) const
finalvirtual

Implements Rec::ITwoTrackVertexSelector.

Definition at line 86 of file TwoTrackVrtBDTSelector.cxx.

91  {
92  quality=-99.;
93  double Prob2v=TMath::Prob(candV.chiSquared(),1);
94  if( Prob2v < m_sel2VrtProbCut ) return false; // Vertex probability check
95  double vrtR=candV.position().perp();
96  auto sumMom=moms.first+moms.second;
97  if( sumMom.M() > m_vrt2TrMassLimit ) return false; // Invariant mass check
98  if( vrtR > m_maxSVRadiusCut) return false; // Too far from interaction point
99  if( sumMom.Pt() < m_vrt2TrPtMin) return false; // Summary momentum > minimal allowed 2-track vertex pt
100  if( sumMom.Pt() > m_vrt2TrPtMax) return false; // Maximal allowed 2-track vertex Pt
101 
102  ROOT::Math::XYZVector vSVPV(candV.x()-tPV.x(),candV.y()-tPV.y(),candV.z()-tPV.z());
103  double cosSVPV=vSVPV.Unit().Dot(sumMom.Vect().Unit());
104  if(cosSVPV < m_cosSVPVCut) return false; // Angle between tV-PV direction and summary momentum
105 
106 
107  double vrtRErr=vrtRadiusError(candV.position(),candV.covariance() );
108 //
109 // Check pixel hits vs vertex positions.
110  int ihitIBL = getIBLHit(iTrks.first);
111  int jhitIBL = getIBLHit(iTrks.second);
112  if( m_do2TrkIBLChecks && ( (ihitIBL==0&&jhitIBL>0) || (ihitIBL>0&&jhitIBL==0) ) ) return false;
113  int ihitBL = getBLHit (iTrks.first);
114  int jhitBL = getBLHit (iTrks.second);
115 //--Very general cleaning cuts based on ID geometry and applicable to all processes
116  if( m_do2TrkIBLChecks && vrtR<m_firstPixelLayerR-2.*vrtRErr ){
117  if( ihitIBL<1 && ihitBL<1) return false;
118  if( jhitIBL<1 && jhitBL<1) return false;
119  }
120  float ihitR = iTrks.first->radiusOfFirstHit();
121  float jhitR = iTrks.second->radiusOfFirstHit();
122  if(std::abs(ihitR-jhitR)>50.)return false; //- FMPs are in very different layers
123  if( vrtR-std::min(ihitR,jhitR) > 50.) return false; //- FMP is closer to (0,0) than SV itself
124  if(ihitR-vrtR > 180.+2.*vrtRErr)return false; //- Distance FMP-vertex should be less then SCT-Pixel gap
125  if(jhitR-vrtR > 180.+2.*vrtRErr)return false; //- Distance FMP-vertex should be less then SCT-Pixel gap
126 //-------------------------------------------------------
127  if(m_useVertexCleaning){ //More agressive cleaning
128  if(std::abs(ihitR-jhitR)>12.) return false;
129  if( ihitR-vrtR > 36.) return false; // Too big dR between vertex and hit in pixel
130  if( jhitR-vrtR > 36.) return false; // Should be another layer in between
131  if( ihitR-vrtR <-2.*vrtRErr) return false; // Vertex is behind hit in pixel
132  if( jhitR-vrtR <-2.*vrtRErr) return false; // Vertex is behind hit in pixel
133  }
134 //-------------------BDT based rejection
135  std::vector<double> impact,impactError;
136  m_fitSvc->VKalGetImpact( iTrks.first, tPV.position(), 1, impact, impactError);
137  float trk1Signif = sqrt( impact[0]*impact[0]/impactError[0] + impact[1]*impact[1]/impactError[2]);
138  m_fitSvc->VKalGetImpact( iTrks.second, tPV.position(), 1, impact, impactError);
139  float trk2Signif = sqrt( impact[0]*impact[0]/impactError[0] + impact[1]*impact[1]/impactError[2]);
140  float minPtT = std::min(iTrks.first->pt(),iTrks.second->pt());
141  std::vector<float> VARS(10);
142  VARS[0]=Prob2v;
143  VARS[1]=log(sumMom.Pt());
144  VARS[2]=log(minPtT);
145  VARS[3]=log(vrtR<20. ? vSVPV.Rho() : vrtR);
146  VARS[4]=log(std::min(trk1Signif,trk2Signif));
147  VARS[5]=log(std::max(trk1Signif,trk2Signif));
148  VARS[6]=sumMom.M();
149  VARS[7]=sqrt(std::abs(1.-cosSVPV*cosSVPV));
150  VARS[8]=vSVPV.Eta();
151  VARS[9]=std::max(ihitR,jhitR);
152  quality=m_SV2T_BDT->GetGradBoostMVA(VARS);
153  if(quality<m_v2tBDTCut) return false; // BDT rejection
154 
155  return true;
156  }

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

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

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

◆ 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::TwoTrackVrtBDTSelector::vrtRadiusError ( const Amg::Vector3D secVrt,
const std::vector< float > &  vrtErr 
)
staticprivate

Definition at line 161 of file TwoTrackVrtBDTSelector.cxx.

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

Member Data Documentation

◆ m_calibFileName

Gaudi::Property<std::string> Rec::TwoTrackVrtBDTSelector::m_calibFileName {this, "CalibFileName", "Fake2TrVertexReject.MVA.v02.root", " MVA calibration file for 2-track fake vertices removal" }
private

Definition at line 78 of file TwoTrackVrtBDTSelector.h.

◆ m_cosSVPVCut

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_cosSVPVCut {this, "cosSVPVCut", 0., "Cut on cos of angle between SV-PV and full vertex momentum" }
private

Definition at line 69 of file TwoTrackVrtBDTSelector.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_do2TrkIBLChecks

Gaudi::Property<bool> Rec::TwoTrackVrtBDTSelector::m_do2TrkIBLChecks {this, "do2TrkIBLChecks", true, "IBL and B-layer hit requrirements based on the position of 2-track DV." }
private

Definition at line 72 of file TwoTrackVrtBDTSelector.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_firstPixelLayerR

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_firstPixelLayerR {this, "FirstPixelLayerR", 32.0,"Radius of the first Pixel layer" }
private

Definition at line 74 of file TwoTrackVrtBDTSelector.h.

◆ m_fitSvc

ToolHandle<Trk::TrkVKalVrtFitter> Rec::TwoTrackVrtBDTSelector::m_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool", "Vertex Fitter tool for 2-track selector"}
private

Definition at line 82 of file TwoTrackVrtBDTSelector.h.

◆ m_instanceName

std::string Rec::TwoTrackVrtBDTSelector::m_instanceName {}
private

Definition at line 91 of file TwoTrackVrtBDTSelector.h.

◆ m_massE

double Rec::TwoTrackVrtBDTSelector::m_massE {}
private

Definition at line 90 of file TwoTrackVrtBDTSelector.h.

◆ m_massP

double Rec::TwoTrackVrtBDTSelector::m_massP {}
private

Definition at line 89 of file TwoTrackVrtBDTSelector.h.

◆ m_massPi

double Rec::TwoTrackVrtBDTSelector::m_massPi {}
private

Definition at line 88 of file TwoTrackVrtBDTSelector.h.

◆ m_maxSVRadiusCut

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_maxSVRadiusCut {this, "MaxSVRadiusCut", 140., "Cut on maximal radius of SV (def = Pixel detector size)" }
private

Definition at line 68 of file TwoTrackVrtBDTSelector.h.

◆ m_sel2VrtProbCut

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_sel2VrtProbCut {this, "Sel2VrtProbCut", 0.02, "Cut on probability of 2-track vertex for initial selection" }
private

Definition at line 67 of file TwoTrackVrtBDTSelector.h.

◆ m_SV2T_BDT

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

Definition at line 80 of file TwoTrackVrtBDTSelector.h.

◆ m_useVertexCleaning

Gaudi::Property<bool> Rec::TwoTrackVrtBDTSelector::m_useVertexCleaning {this, "useVertexCleaning", true, "Clean vertices by requiring pixel hit presence according to vertex position" }
private

Definition at line 73 of file TwoTrackVrtBDTSelector.h.

◆ m_v2tBDTCut

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_v2tBDTCut {this, "v2tBDTCut", -0.5, "BDT cut to select 2-track vertices" }
private

Definition at line 77 of file TwoTrackVrtBDTSelector.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vrt2TrMassLimit

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_vrt2TrMassLimit {this,"Vrt2TrMassLimit",4000., "Maximal allowed mass for 2-track vertices" }
private

Definition at line 64 of file TwoTrackVrtBDTSelector.h.

◆ m_vrt2TrPtMax

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_vrt2TrPtMax {this, "Vrt2TrPtMax", 5.e5, "Maximal allowed Pt for 2-track vertices. Calibration limit" }
private

Definition at line 66 of file TwoTrackVrtBDTSelector.h.

◆ m_vrt2TrPtMin

Gaudi::Property<float> Rec::TwoTrackVrtBDTSelector::m_vrt2TrPtMin {this, "Vrt2TrPtMin", 1000., "Minimal allowed Pt for 2-track vertices." }
private

Definition at line 65 of file TwoTrackVrtBDTSelector.h.


The documentation for this class was generated from the following files:
Rec::TwoTrackVrtBDTSelector::m_useVertexCleaning
Gaudi::Property< bool > m_useVertexCleaning
Definition: TwoTrackVrtBDTSelector.h:73
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:235
xAOD::Vertex_v1::x
float x() const
Returns the x position.
Trk::proton
@ proton
Definition: ParticleHypothesis.h:34
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Rec::TwoTrackVrtBDTSelector::m_massP
double m_massP
Definition: TwoTrackVrtBDTSelector.h:89
Rec::TwoTrackVrtBDTSelector::isgood
bool isgood(const std::pair< const xAOD::TrackParticle *, const xAOD::TrackParticle * > tracks, const xAOD::Vertex &candV, std::pair< ROOT::Math::XYZTVector, ROOT::Math::XYZTVector > moms, const xAOD::Vertex &tPV) const final
Definition: TwoTrackVrtBDTSelector.cxx:77
Rec::TwoTrackVrtBDTSelector::m_cosSVPVCut
Gaudi::Property< float > m_cosSVPVCut
Definition: TwoTrackVrtBDTSelector.h:69
Rec::TwoTrackVrtBDTSelector::m_calibFileName
Gaudi::Property< std::string > m_calibFileName
Definition: TwoTrackVrtBDTSelector.h:78
Rec::TwoTrackVrtBDTSelector::m_vrt2TrPtMin
Gaudi::Property< float > m_vrt2TrPtMin
Definition: TwoTrackVrtBDTSelector.h:65
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
Rec::TwoTrackVrtBDTSelector::m_fitSvc
ToolHandle< Trk::TrkVKalVrtFitter > m_fitSvc
Definition: TwoTrackVrtBDTSelector.h:82
Rec::TwoTrackVrtBDTSelector::m_sel2VrtProbCut
Gaudi::Property< float > m_sel2VrtProbCut
Definition: TwoTrackVrtBDTSelector.h:67
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
Rec::TwoTrackVrtBDTSelector::m_maxSVRadiusCut
Gaudi::Property< float > m_maxSVRadiusCut
Definition: TwoTrackVrtBDTSelector.h:68
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
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:237
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Rec::TwoTrackVrtBDTSelector::m_SV2T_BDT
std::unique_ptr< MVAUtils::BDT > m_SV2T_BDT
Definition: TwoTrackVrtBDTSelector.h:80
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Rec::TwoTrackVrtBDTSelector::m_instanceName
std::string m_instanceName
Definition: TwoTrackVrtBDTSelector.h:91
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Rec::TwoTrackVrtBDTSelector::m_firstPixelLayerR
Gaudi::Property< float > m_firstPixelLayerR
Definition: TwoTrackVrtBDTSelector.h:74
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
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:248
Trk::electron
@ electron
Definition: ParticleHypothesis.h:30
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
Trk::pion
@ pion
Definition: ParticleHypothesis.h:32
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::Vertex_v1::z
float z() const
Returns the z position.
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:56
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:249
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Rec::TwoTrackVrtBDTSelector::m_vrt2TrPtMax
Gaudi::Property< float > m_vrt2TrPtMax
Definition: TwoTrackVrtBDTSelector.h:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Rec::TwoTrackVrtBDTSelector::m_do2TrkIBLChecks
Gaudi::Property< bool > m_do2TrkIBLChecks
Definition: TwoTrackVrtBDTSelector.h:72
Rec::TwoTrackVrtBDTSelector::m_massPi
double m_massPi
Definition: TwoTrackVrtBDTSelector.h:88
Rec::TwoTrackVrtBDTSelector::vrtRadiusError
static double vrtRadiusError(const Amg::Vector3D &secVrt, const std::vector< float > &vrtErr)
Definition: TwoTrackVrtBDTSelector.cxx:161
xAOD::Vertex_v1::covariance
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
Rec::TwoTrackVrtBDTSelector::m_massE
double m_massE
Definition: TwoTrackVrtBDTSelector.h:90
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::Vertex_v1::chiSquared
float chiSquared() const
Returns the of the vertex fit as float.
h
python.TrackLeptonConfig.quality
quality
Definition: TrackLeptonConfig.py:16
xAOD::Vertex_v1::y
float y() const
Returns the y position.
Rec::TwoTrackVrtBDTSelector::m_v2tBDTCut
Gaudi::Property< float > m_v2tBDTCut
Definition: TwoTrackVrtBDTSelector.h:77
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DetType::Part
Part
Definition: DetType.h:14
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Rec::TwoTrackVrtBDTSelector::m_vrt2TrMassLimit
Gaudi::Property< float > m_vrt2TrMassLimit
Definition: TwoTrackVrtBDTSelector.h:64
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
Rec::TwoTrackVrtBDTSelector::getBLHit
static int getBLHit(const xAOD::TrackParticle *Part)
Definition: TwoTrackVrtBDTSelector.cxx:183
Rec::TwoTrackVrtBDTSelector::getIBLHit
static int getIBLHit(const xAOD::TrackParticle *Part)
Definition: TwoTrackVrtBDTSelector.cxx:174
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:238