ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
InDet::ConversionPostSelector Class Reference

#include <ConversionPostSelector.h>

Inheritance diagram for InDet::ConversionPostSelector:
Collaboration diagram for InDet::ConversionPostSelector:

Public Member Functions

 ConversionPostSelector (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ConversionPostSelector ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
bool selectConversionCandidate (xAOD::Vertex *myCandidate, int flag, std::vector< Amg::Vector3D > &trkL) const
 Conversion candidate post-fit selectors. More...
 
bool selectSecVtxCandidate (xAOD::Vertex *myCandidate, int flag, std::vector< Amg::Vector3D > &trkL, int &) const
 
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 ()
 
static void decorateVertex (xAOD::Vertex &vertex, float inv_mass, float pt1, float pt2, float fR, float deltaPhiVtxTrk)
 Decorate vertices with values used in post selector. More...
 

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

CLHEP::HepLorentzVector fourP (const Trk::TrackParameters &, const Trk::TrackParameters &, double, bool) const
 Compute the four-momentum of a particle according to a mass hypothesis. More...
 
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...
 

Private Attributes

std::vector< double > m_maxChi2
 Properties for track selection: all cuts are ANDed. More...
 
std::vector< double > m_invMassCut
 Chi2 cut. More...
 
std::vector< double > m_fitMomentum
 Invariant mass cut. More...
 
std::vector< double > m_minRadius
 Converted photon reconstructed momentum at vertex cut. More...
 
double m_minPt
 Converted photon reconstructed vertex radial position cut. More...
 
double m_maxdR
 Pt of the two participating tracks at the vertex. More...
 
double m_maxPhiVtxTrk
 Distance of first track hit- reconstructed vertex radial position. More...
 
bool m_decorateVertices
 Maximum difference in phi between reconstructed vertex and track at vertex. More...
 
double m_massK0
 Decorate vertices with values used for vertex selection. More...
 
double m_sigmaK0
 
double m_massLambda
 
double m_sigmaLambda
 
int m_nsig
 
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

This class selects tracks for conversion finder

Author
Tatjana Lenz , Thomas Koffas

Definition at line 28 of file ConversionPostSelector.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

◆ ConversionPostSelector()

InDet::ConversionPostSelector::ConversionPostSelector ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 30 of file ConversionPostSelector.cxx.

34  m_minPt{0},
35  m_maxdR{-10000.},
36  m_maxPhiVtxTrk{0.2},
37  m_decorateVertices{true},
38  m_massK0{497.672},
39  m_sigmaK0{8.5},
40  m_massLambda{1115.683},
41  m_sigmaLambda{3.5},
42  m_nsig{5} {
43 
44  m_maxChi2.push_back(35.);
45  m_maxChi2.push_back(25.);
46  m_maxChi2.push_back(20.);
47 
48  m_invMassCut.push_back(10000.);
49  m_invMassCut.push_back(10000.);
50  m_invMassCut.push_back(10000.);
51 
52  m_fitMomentum.push_back(0.);
53  m_fitMomentum.push_back(0.);
54  m_fitMomentum.push_back(0.);
55 
56  m_minRadius.push_back(-10000.);
57  m_minRadius.push_back(-10000.);
58  m_minRadius.push_back(-10000.);
59 
60  declareInterface<ConversionPostSelector>(this);
61  declareProperty("MaxChi2Vtx", m_maxChi2);
62  declareProperty("MaxInvariantMass", m_invMassCut);
63  declareProperty("MinFitMomentum", m_fitMomentum);
64  declareProperty("MinRadius", m_minRadius);
65  declareProperty("MinPt", m_minPt);
66  declareProperty("MaxdR", m_maxdR);
67  declareProperty("MaxPhiVtxTrk", m_maxPhiVtxTrk);
68  declareProperty("NSigma", m_nsig);
69  declareProperty("DecorateVertices", m_decorateVertices);
70  }

◆ ~ConversionPostSelector()

InDet::ConversionPostSelector::~ConversionPostSelector ( )
virtualdefault

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  }

◆ decorateVertex()

void InDet::ConversionPostSelector::decorateVertex ( xAOD::Vertex vertex,
float  inv_mass,
float  pt1,
float  pt2,
float  fR,
float  deltaPhiVtxTrk 
)
static

Decorate vertices with values used in post selector.

Definition at line 312 of file ConversionPostSelector.cxx.

318  {
319  static const SG::AuxElement::Accessor<float> accMass("mass");
320  accMass(vertex) = inv_mass;
321  static const SG::AuxElement::Accessor<float> accPt1("pt1");
322  accPt1(vertex) = pt1;
323  static const SG::AuxElement::Accessor<float> accPt2("pt2");
324  accPt2(vertex) = pt2;
325  static const SG::AuxElement::Accessor<float> accMinRfirstHit("minRfirstHit");
326  accMinRfirstHit(vertex) = fR;
327  static const SG::AuxElement::Accessor<float> accDeltaPhiVtxTrk("deltaPhiVtxTrk");
328  accDeltaPhiVtxTrk(vertex) = deltaPhiVtxTrk;
329  }

◆ 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 InDet::ConversionPostSelector::finalize ( )
overridevirtual

Definition at line 82 of file ConversionPostSelector.cxx.

82  {
83  return StatusCode::SUCCESS;
84  }

◆ fourP()

CLHEP::HepLorentzVector InDet::ConversionPostSelector::fourP ( const Trk::TrackParameters per1,
const Trk::TrackParameters per2,
double  mass,
bool  isBar 
) const
private

Compute the four-momentum of a particle according to a mass hypothesis.


Definition at line 276 of file ConversionPostSelector.cxx.

280  {
281  CLHEP::HepLorentzVector momentum;
282  Amg::Vector3D sum_mom = per1.momentum() + per2.momentum();
283  double mp1 = 0.; double mp2 = 0.;
284  if(mass==m_massK0) {
287  }else{
288  if(!isBar){
289  if(per1.charge()>0) {
292  } else {
295  }
296  }else{
297  if(per1.charge()>0) {
300  } else {
303  }
304  }
305  }
306  double ee = std::sqrt(mp1 + per1.momentum().mag2()) + std::sqrt(mp2 + per2.momentum().mag2());
307  momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee);
308  return momentum;
309  }

◆ initialize()

StatusCode InDet::ConversionPostSelector::initialize ( )
overridevirtual

Definition at line 78 of file ConversionPostSelector.cxx.

78  {
79  return StatusCode::SUCCESS;
80  }

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

const InterfaceID & InDet::ConversionPostSelector::interfaceID ( )
static

Definition at line 74 of file ConversionPostSelector.cxx.

74  {
75  return IID_IConversionPostSelector;
76  }

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

◆ selectConversionCandidate()

bool InDet::ConversionPostSelector::selectConversionCandidate ( xAOD::Vertex myCandidate,
int  flag,
std::vector< Amg::Vector3D > &  trkL 
) const

Conversion candidate post-fit selectors.

Return true if the argument track fulfills the selection

Definition at line 86 of file ConversionPostSelector.cxx.

87  {
88  bool pass = true;
89 
90  //Determine the cuts
91  double maxChi2 = 1000.;
92  double invMassCut = 1000.;
93  double fitMomentum = 0.;
94  double radius = 1000.;
95 
96  if(flag==0) { // Si+Si
97  maxChi2 = m_maxChi2[0] ; //Vertex fit chi2 cut
98  invMassCut = m_invMassCut[0] ; //Fit invariant mass cut
99  fitMomentum = m_fitMomentum[0]; //Photon fitted momentum
100  radius = m_minRadius[0] ; //Minimum acceptable radius of conversion vertex
101  }
102  if(flag==1) { // Si+TRT
103  maxChi2 = m_maxChi2[1] ; //Vertex fit chi2 cut
104  invMassCut = m_invMassCut[1] ; //Fit invariant mass cut
105  fitMomentum = m_fitMomentum[1]; //Photon fitted momentum
106  radius = m_minRadius[1] ; //Minimum acceptable radius of conversion vertex
107  }
108  if(flag==2) { // TRT+TRT
109  maxChi2 = m_maxChi2[2] ; //Vertex fit chi2 cut
110  invMassCut = m_invMassCut[2] ; //Fit invariant mass cut
111  fitMomentum = m_fitMomentum[2]; //Photon fitted momentum
112  radius = m_minRadius[2] ; //Minimum acceptable radius of conversion vertex
113  }
114 
115  //chi2 cut
116  if (vertex->nTrackParticles() != 2) {
117  ATH_MSG_DEBUG("Incorrect number of tracks used in conversion fit.");
118  pass = false;
119  } else {
120 
121  float reducedChi2 = vertex->chiSquared()/vertex->numberDoF();
122  if (reducedChi2 > maxChi2) pass = false;
123  if (reducedChi2 > maxChi2) pass = false;
124 
125  //Minimum radius cut
126  double vtxR = vertex->position().perp();
127  if(vtxR < radius) pass = false;
128 
129  // Parameters at vertex
130  std::vector< Trk::VxTrackAtVertex >& trkAtVx = vertex->vxTrackAtVertex();
131  if (trkAtVx.size() != 2 ||
132  !trkAtVx[0].perigeeAtVertex() ||
133  !trkAtVx[1].perigeeAtVertex())
134  {
135  ATH_MSG_DEBUG("VxTrackAtVertex or perigeeAtVertex not available");
136  return false;
137  }
138  const Trk::TrackParameters& perigee1 = *(trkAtVx[0].perigeeAtVertex());
139  const Trk::TrackParameters& perigee2 = *(trkAtVx[1].perigeeAtVertex());
140 
141  //invariant mass
142  CLHEP::HepLorentzVector momentum;
143  Amg::Vector3D sum_mom = perigee1.momentum() + perigee2.momentum();
145  double ee = std::sqrt(m2 + perigee1.momentum().mag2()) + std::sqrt(m2 + perigee2.momentum().mag2());
146  momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee);
147  double inv_mass = momentum.m();
148  double photonP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y());
149  double pt1 = perigee1.pT(); double pt2 = perigee2.pT();
150 
151  if (pt1<m_minPt || pt2<m_minPt) pass = false;
152  if (std::fabs(inv_mass) > invMassCut) pass = false;
153  if (photonP < fitMomentum) pass = false;
154 
155  double fR = 1000.;
156  std::vector<Amg::Vector3D>::const_iterator ipb=trkL.begin();
157  std::vector<Amg::Vector3D>::const_iterator ipbe=trkL.end();
158  for(; ipb!=ipbe;++ipb){
159  double tmpfR = (*ipb).perp();
160  if(tmpfR<fR) fR = tmpfR;
161  }
162  if(flag==1 && fR-vtxR<m_maxdR) pass = false;
163 
164  double PhiVtxTrk = vertex->position().phi() - perigee1.parameters()[Trk::phi0];
165  if (PhiVtxTrk < -M_PI) PhiVtxTrk += twopi;
166  if (PhiVtxTrk > M_PI) PhiVtxTrk -= twopi;
167  if (std::fabs(PhiVtxTrk)>m_maxPhiVtxTrk) pass = false;
168 
169  if (pass && m_decorateVertices)
170  {
171  ATH_MSG_DEBUG("Decorating vertex with values used in post selector");
172  decorateVertex(*vertex, inv_mass, pt1, pt2, fR, std::fabs(PhiVtxTrk) );
173  }
174 
175  }
176  return pass;
177  }

◆ selectSecVtxCandidate()

bool InDet::ConversionPostSelector::selectSecVtxCandidate ( xAOD::Vertex myCandidate,
int  flag,
std::vector< Amg::Vector3D > &  trkL,
int &  type 
) const

Definition at line 180 of file ConversionPostSelector.cxx.

185  {
186  bool pass = true;
187  bool isK0 = false;
188  bool isLambda = false;
189  bool isLambdaBar = false;
190  int kind = -1;
191 
192  //Determine the cuts
193  double maxChi2 = 1000.;
194  double fitMomentum = 0.;
195  double radius = 1000.;
196 
197  if(flag==0) {
198  maxChi2 = m_maxChi2[0] ; //Vertex fit chi2 cut
199  fitMomentum = m_fitMomentum[0]; //Photon fitted momentum
200  radius = m_minRadius[0] ; //Minimum acceptable radius of conversion vertex
201  }
202  if(flag==1) {
203  maxChi2 = m_maxChi2[1] ; //Vertex fit chi2 cut
204  fitMomentum = m_fitMomentum[1]; //Photon fitted momentum
205  radius = m_minRadius[1] ; //Minimum acceptable radius of conversion vertex
206  }
207  if(flag==2) {
208  maxChi2 = m_maxChi2[2] ; //Vertex fit chi2 cut
209  fitMomentum = m_fitMomentum[2]; //Photon fitted momentum
210  radius = m_minRadius[2] ; //Minimum acceptable radius of conversion vertex
211  }
212 
213  //chi2 cut
214 
215  if (vertex->nTrackParticles() != 2) {
216  ATH_MSG_DEBUG("Incorrect number of tracks used in conversion fit.");
217  pass = false;
218  } else {
219  float reducedChi2 = vertex->chiSquared()/vertex->numberDoF();
220  if (reducedChi2 > maxChi2) pass = false;
221 
222  //Minimum radius cut
223  double vtxR = vertex->position().perp();
224  if(vtxR < radius) pass = false;
225 
226  // Parameters at vertex
227  std::vector< Trk::VxTrackAtVertex >& trkAtVx = vertex->vxTrackAtVertex();
228  if (trkAtVx.size() != 2 ||
229  !trkAtVx[0].perigeeAtVertex() ||
230  !trkAtVx[1].perigeeAtVertex())
231  {
232  ATH_MSG_DEBUG("VxTrackAtVertex or perigeeAtVertex not available");
233  return false;
234  }
235  const Trk::TrackParameters& perigee1 = *(trkAtVx[0].perigeeAtVertex());
236  const Trk::TrackParameters& perigee2 = *(trkAtVx[1].perigeeAtVertex());
237 
238  double pt1 = perigee1.pT(); double pt2 = perigee2.pT();
239  if (pt1<m_minPt || pt2<m_minPt) pass = false;
240 
241  double fR = 1000.;
242  std::vector<Amg::Vector3D>::const_iterator ipb=trkL.begin();
243  std::vector<Amg::Vector3D>::const_iterator ipbe=trkL.end();
244  for(; ipb!=ipbe;++ipb){
245  double tmpfR = (*ipb).perp();
246  if(tmpfR<fR) fR = tmpfR;
247  }
248  if(flag==1 && fR-vtxR<m_maxdR) pass = false;
249 
250  //invariant mass. First assume K0, if failed assume Lambda
251  CLHEP::HepLorentzVector momentumK0 = fourP(perigee1,perigee2,m_massK0,false);
252  double inv_massK0 = momentumK0.m();
253  if (std::fabs(inv_massK0-m_massK0) <= m_nsig*m_sigmaK0) isK0 = true;
254  CLHEP::HepLorentzVector momentumL = fourP(perigee1,perigee2,m_massLambda,false);
255  double inv_massL = momentumL.m();
256  if (std::fabs(inv_massL-m_massLambda) <= m_nsig*m_sigmaLambda) isLambda = true;
257  CLHEP::HepLorentzVector momentumLb = fourP(perigee1,perigee2,m_massLambda,true);
258  double inv_massLb = momentumLb.m();
259  if (std::fabs(inv_massLb-m_massLambda) <= m_nsig*m_sigmaLambda) isLambdaBar = true;
260  if (!isLambdaBar && !isLambda && !isK0) pass = false;
261  CLHEP::HepLorentzVector momentum;
262  if(isK0 && isLambda && !isLambdaBar) {momentum = momentumK0; kind = 110;}
263  if(isK0 && isLambdaBar && !isLambda) {momentum = momentumK0; kind = 101;}
264  if(isK0 && !isLambda && !isLambdaBar) {momentum = momentumK0; kind = 100;}
265  if(!isK0 && isLambda && !isLambdaBar) {momentum = momentumL; kind = 10;}
266  if(!isK0 && isLambdaBar && !isLambda) {momentum = momentumLb; kind = 1;}
267  if(!isK0 && isLambda && isLambdaBar) {momentum = momentumL; kind = 11;}
268  double particleP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y());
269  if (particleP < fitMomentum) pass = false;
270  }
271  type = kind;
272  return pass;
273  }

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

Member Data Documentation

◆ m_decorateVertices

bool InDet::ConversionPostSelector::m_decorateVertices
private

Maximum difference in phi between reconstructed vertex and track at vertex.

Definition at line 66 of file ConversionPostSelector.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_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_fitMomentum

std::vector<double> InDet::ConversionPostSelector::m_fitMomentum
private

Invariant mass cut.


Definition at line 61 of file ConversionPostSelector.h.

◆ m_invMassCut

std::vector<double> InDet::ConversionPostSelector::m_invMassCut
private

Chi2 cut.


Definition at line 60 of file ConversionPostSelector.h.

◆ m_massK0

double InDet::ConversionPostSelector::m_massK0
private

Decorate vertices with values used for vertex selection.

Masses and mass ranges for different V0 hypotheses

Definition at line 70 of file ConversionPostSelector.h.

◆ m_massLambda

double InDet::ConversionPostSelector::m_massLambda
private

Definition at line 72 of file ConversionPostSelector.h.

◆ m_maxChi2

std::vector<double> InDet::ConversionPostSelector::m_maxChi2
private

Properties for track selection: all cuts are ANDed.

Definition at line 59 of file ConversionPostSelector.h.

◆ m_maxdR

double InDet::ConversionPostSelector::m_maxdR
private

Pt of the two participating tracks at the vertex.

Definition at line 64 of file ConversionPostSelector.h.

◆ m_maxPhiVtxTrk

double InDet::ConversionPostSelector::m_maxPhiVtxTrk
private

Distance of first track hit- reconstructed vertex radial position.


Definition at line 65 of file ConversionPostSelector.h.

◆ m_minPt

double InDet::ConversionPostSelector::m_minPt
private

Converted photon reconstructed vertex radial position cut.


Definition at line 63 of file ConversionPostSelector.h.

◆ m_minRadius

std::vector<double> InDet::ConversionPostSelector::m_minRadius
private

Converted photon reconstructed momentum at vertex cut.


Definition at line 62 of file ConversionPostSelector.h.

◆ m_nsig

int InDet::ConversionPostSelector::m_nsig
private

Definition at line 74 of file ConversionPostSelector.h.

◆ m_sigmaK0

double InDet::ConversionPostSelector::m_sigmaK0
private

Definition at line 71 of file ConversionPostSelector.h.

◆ m_sigmaLambda

double InDet::ConversionPostSelector::m_sigmaLambda
private

Definition at line 73 of file ConversionPostSelector.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.


The documentation for this class was generated from the following files:
Trk::proton
@ proton
Definition: ParticleHypothesis.h:31
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
InDet::ConversionPostSelector::fourP
CLHEP::HepLorentzVector fourP(const Trk::TrackParameters &, const Trk::TrackParameters &, double, bool) const
Compute the four-momentum of a particle according to a mass hypothesis.
Definition: ConversionPostSelector.cxx:276
InDet::ConversionPostSelector::m_invMassCut
std::vector< double > m_invMassCut
Chi2 cut.
Definition: ConversionPostSelector.h:60
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::ParametersBase::charge
double charge() const
Returns the charge.
InDet::ConversionPostSelector::m_minRadius
std::vector< double > m_minRadius
Converted photon reconstructed momentum at vertex cut.
Definition: ConversionPostSelector.h:62
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
M_PI
#define M_PI
Definition: ActiveFraction.h: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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDet::ConversionPostSelector::m_minPt
double m_minPt
Converted photon reconstructed vertex radial position cut.
Definition: ConversionPostSelector.h:63
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
InDet::ConversionPostSelector::m_maxChi2
std::vector< double > m_maxChi2
Properties for track selection: all cuts are ANDed.
Definition: ConversionPostSelector.h:59
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
InDet::ConversionPostSelector::m_sigmaLambda
double m_sigmaLambda
Definition: ConversionPostSelector.h:73
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
master.flag
bool flag
Definition: master.py:29
InDet::ConversionPostSelector::decorateVertex
static void decorateVertex(xAOD::Vertex &vertex, float inv_mass, float pt1, float pt2, float fR, float deltaPhiVtxTrk)
Decorate vertices with values used in post selector.
Definition: ConversionPostSelector.cxx:312
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::ConversionPostSelector::m_decorateVertices
bool m_decorateVertices
Maximum difference in phi between reconstructed vertex and track at vertex.
Definition: ConversionPostSelector.h:66
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
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:53
twopi
constexpr double twopi
Definition: VertexPointEstimator.cxx:16
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
InDet::ConversionPostSelector::m_fitMomentum
std::vector< double > m_fitMomentum
Invariant mass cut.
Definition: ConversionPostSelector.h:61
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
InDet::ConversionPostSelector::m_maxdR
double m_maxdR
Pt of the two participating tracks at the vertex.
Definition: ConversionPostSelector.h:64
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
InDet::ConversionPostSelector::m_massLambda
double m_massLambda
Definition: ConversionPostSelector.h:72
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::ConversionPostSelector::m_massK0
double m_massK0
Decorate vertices with values used for vertex selection.
Definition: ConversionPostSelector.h:70
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
InDet::ConversionPostSelector::m_sigmaK0
double m_sigmaK0
Definition: ConversionPostSelector.h:71
InDet::ConversionPostSelector::m_maxPhiVtxTrk
double m_maxPhiVtxTrk
Distance of first track hit- reconstructed vertex radial position.
Definition: ConversionPostSelector.h:65
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDet::ConversionPostSelector::m_nsig
int m_nsig
Definition: ConversionPostSelector.h:74
Trk::phi0
@ phi0
Definition: ParamDefs.h:71
fitman.k
k
Definition: fitman.py:528