ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static 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 ()=default
 
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

DoubleArrayProperty m_maxChi2 {this, "MaxChi2Vtx", {35., 25., 20.}, "Chi2 cut"}
 Properties for track selection: all cuts are ANDed. More...
 
DoubleArrayProperty m_invMassCut {this, "MaxInvariantMass", {10000., 10000., 10000.}, "Invariant mass cut"}
 
DoubleArrayProperty m_fitMomentum
 
DoubleArrayProperty m_minRadius
 
DoubleProperty m_minPt
 
DoubleProperty m_maxdR
 
DoubleProperty m_maxPhiVtxTrk
 
BooleanProperty m_decorateVertices
 
IntegerProperty m_nsig {this, "NSigma", 5}
 
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
 

Static Private Attributes

static constexpr double m_massK0 = 497.672
 Masses and mass ranges for different V0 hypotheses. More...
 
static constexpr double m_sigmaK0 = 8.5
 
static constexpr double m_massLambda = 1115.683
 
static constexpr double m_sigmaLambda = 3.5
 

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.

33  : AthAlgTool(type, name, parent) {
34  declareInterface<ConversionPostSelector>(this);
35  }

◆ ~ConversionPostSelector()

virtual 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 275 of file ConversionPostSelector.cxx.

281  {
282  static const SG::AuxElement::Accessor<float> accMass("mass");
283  accMass(vertex) = inv_mass;
284  static const SG::AuxElement::Accessor<float> accPt1("pt1");
285  accPt1(vertex) = pt1;
286  static const SG::AuxElement::Accessor<float> accPt2("pt2");
287  accPt2(vertex) = pt2;
288  static const SG::AuxElement::Accessor<float> accMinRfirstHit("minRfirstHit");
289  accMinRfirstHit(vertex) = fR;
290  static const SG::AuxElement::Accessor<float> accDeltaPhiVtxTrk("deltaPhiVtxTrk");
291  accDeltaPhiVtxTrk(vertex) = deltaPhiVtxTrk;
292  }

◆ 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 45 of file ConversionPostSelector.cxx.

45  {
46  return StatusCode::SUCCESS;
47  }

◆ 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 239 of file ConversionPostSelector.cxx.

243  {
244  CLHEP::HepLorentzVector momentum;
245  Amg::Vector3D sum_mom = per1.momentum() + per2.momentum();
246  double mp1 = 0.; double mp2 = 0.;
247  if(mass==m_massK0) {
250  }else{
251  if(!isBar){
252  if(per1.charge()>0) {
255  } else {
258  }
259  }else{
260  if(per1.charge()>0) {
263  } else {
266  }
267  }
268  }
269  double ee = std::sqrt(mp1 + per1.momentum().mag2()) + std::sqrt(mp2 + per2.momentum().mag2());
270  momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee);
271  return momentum;
272  }

◆ initialize()

StatusCode InDet::ConversionPostSelector::initialize ( )
overridevirtual

Definition at line 41 of file ConversionPostSelector.cxx.

41  {
42  return StatusCode::SUCCESS;
43  }

◆ 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 37 of file ConversionPostSelector.cxx.

37  {
38  return IID_IConversionPostSelector;
39  }

◆ 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 49 of file ConversionPostSelector.cxx.

50  {
51  bool pass = true;
52 
53  //Determine the cuts
54  double maxChi2 = 1000.;
55  double invMassCut = 1000.;
56  double fitMomentum = 0.;
57  double radius = 1000.;
58 
59  if(flag==0) { // Si+Si
60  maxChi2 = m_maxChi2[0] ; //Vertex fit chi2 cut
61  invMassCut = m_invMassCut[0] ; //Fit invariant mass cut
62  fitMomentum = m_fitMomentum[0]; //Photon fitted momentum
63  radius = m_minRadius[0] ; //Minimum acceptable radius of conversion vertex
64  }
65  if(flag==1) { // Si+TRT
66  maxChi2 = m_maxChi2[1] ; //Vertex fit chi2 cut
67  invMassCut = m_invMassCut[1] ; //Fit invariant mass cut
68  fitMomentum = m_fitMomentum[1]; //Photon fitted momentum
69  radius = m_minRadius[1] ; //Minimum acceptable radius of conversion vertex
70  }
71  if(flag==2) { // TRT+TRT
72  maxChi2 = m_maxChi2[2] ; //Vertex fit chi2 cut
73  invMassCut = m_invMassCut[2] ; //Fit invariant mass cut
74  fitMomentum = m_fitMomentum[2]; //Photon fitted momentum
75  radius = m_minRadius[2] ; //Minimum acceptable radius of conversion vertex
76  }
77 
78  //chi2 cut
79  if (vertex->nTrackParticles() != 2) {
80  ATH_MSG_DEBUG("Incorrect number of tracks used in conversion fit.");
81  pass = false;
82  } else {
83 
84  float reducedChi2 = vertex->chiSquared()/vertex->numberDoF();
85  if (reducedChi2 > maxChi2) pass = false;
86  if (reducedChi2 > maxChi2) pass = false;
87 
88  //Minimum radius cut
89  double vtxR = vertex->position().perp();
90  if(vtxR < radius) pass = false;
91 
92  // Parameters at vertex
93  std::vector< Trk::VxTrackAtVertex >& trkAtVx = vertex->vxTrackAtVertex();
94  if (trkAtVx.size() != 2 ||
95  !trkAtVx[0].perigeeAtVertex() ||
96  !trkAtVx[1].perigeeAtVertex())
97  {
98  ATH_MSG_DEBUG("VxTrackAtVertex or perigeeAtVertex not available");
99  return false;
100  }
101  const Trk::TrackParameters& perigee1 = *(trkAtVx[0].perigeeAtVertex());
102  const Trk::TrackParameters& perigee2 = *(trkAtVx[1].perigeeAtVertex());
103 
104  //invariant mass
105  CLHEP::HepLorentzVector momentum;
106  Amg::Vector3D sum_mom = perigee1.momentum() + perigee2.momentum();
108  double ee = std::sqrt(m2 + perigee1.momentum().mag2()) + std::sqrt(m2 + perigee2.momentum().mag2());
109  momentum.setPx(sum_mom.x()); momentum.setPy(sum_mom.y()); momentum.setPz(sum_mom.z()); momentum.setE(ee);
110  double inv_mass = momentum.m();
111  double photonP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y());
112  double pt1 = perigee1.pT(); double pt2 = perigee2.pT();
113 
114  if (pt1<m_minPt || pt2<m_minPt) pass = false;
115  if (std::fabs(inv_mass) > invMassCut) pass = false;
116  if (photonP < fitMomentum) pass = false;
117 
118  double fR = 1000.;
119  std::vector<Amg::Vector3D>::const_iterator ipb=trkL.begin();
120  std::vector<Amg::Vector3D>::const_iterator ipbe=trkL.end();
121  for(; ipb!=ipbe;++ipb){
122  double tmpfR = (*ipb).perp();
123  if(tmpfR<fR) fR = tmpfR;
124  }
125  if(flag==1 && fR-vtxR<m_maxdR) pass = false;
126 
127  double PhiVtxTrk = vertex->position().phi() - perigee1.parameters()[Trk::phi0];
128  if (PhiVtxTrk < -M_PI) PhiVtxTrk += twopi;
129  if (PhiVtxTrk > M_PI) PhiVtxTrk -= twopi;
130  if (std::fabs(PhiVtxTrk)>m_maxPhiVtxTrk) pass = false;
131 
132  if (pass && m_decorateVertices)
133  {
134  ATH_MSG_DEBUG("Decorating vertex with values used in post selector");
135  decorateVertex(*vertex, inv_mass, pt1, pt2, fR, std::fabs(PhiVtxTrk) );
136  }
137 
138  }
139  return pass;
140  }

◆ selectSecVtxCandidate()

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

Definition at line 143 of file ConversionPostSelector.cxx.

148  {
149  bool pass = true;
150  bool isK0 = false;
151  bool isLambda = false;
152  bool isLambdaBar = false;
153  int kind = -1;
154 
155  //Determine the cuts
156  double maxChi2 = 1000.;
157  double fitMomentum = 0.;
158  double radius = 1000.;
159 
160  if(flag==0) {
161  maxChi2 = m_maxChi2[0] ; //Vertex fit chi2 cut
162  fitMomentum = m_fitMomentum[0]; //Photon fitted momentum
163  radius = m_minRadius[0] ; //Minimum acceptable radius of conversion vertex
164  }
165  if(flag==1) {
166  maxChi2 = m_maxChi2[1] ; //Vertex fit chi2 cut
167  fitMomentum = m_fitMomentum[1]; //Photon fitted momentum
168  radius = m_minRadius[1] ; //Minimum acceptable radius of conversion vertex
169  }
170  if(flag==2) {
171  maxChi2 = m_maxChi2[2] ; //Vertex fit chi2 cut
172  fitMomentum = m_fitMomentum[2]; //Photon fitted momentum
173  radius = m_minRadius[2] ; //Minimum acceptable radius of conversion vertex
174  }
175 
176  //chi2 cut
177 
178  if (vertex->nTrackParticles() != 2) {
179  ATH_MSG_DEBUG("Incorrect number of tracks used in conversion fit.");
180  pass = false;
181  } else {
182  float reducedChi2 = vertex->chiSquared()/vertex->numberDoF();
183  if (reducedChi2 > maxChi2) pass = false;
184 
185  //Minimum radius cut
186  double vtxR = vertex->position().perp();
187  if(vtxR < radius) pass = false;
188 
189  // Parameters at vertex
190  std::vector< Trk::VxTrackAtVertex >& trkAtVx = vertex->vxTrackAtVertex();
191  if (trkAtVx.size() != 2 ||
192  !trkAtVx[0].perigeeAtVertex() ||
193  !trkAtVx[1].perigeeAtVertex())
194  {
195  ATH_MSG_DEBUG("VxTrackAtVertex or perigeeAtVertex not available");
196  return false;
197  }
198  const Trk::TrackParameters& perigee1 = *(trkAtVx[0].perigeeAtVertex());
199  const Trk::TrackParameters& perigee2 = *(trkAtVx[1].perigeeAtVertex());
200 
201  double pt1 = perigee1.pT(); double pt2 = perigee2.pT();
202  if (pt1<m_minPt || pt2<m_minPt) pass = false;
203 
204  double fR = 1000.;
205  std::vector<Amg::Vector3D>::const_iterator ipb=trkL.begin();
206  std::vector<Amg::Vector3D>::const_iterator ipbe=trkL.end();
207  for(; ipb!=ipbe;++ipb){
208  double tmpfR = (*ipb).perp();
209  if(tmpfR<fR) fR = tmpfR;
210  }
211  if(flag==1 && fR-vtxR<m_maxdR) pass = false;
212 
213  //invariant mass. First assume K0, if failed assume Lambda
214  CLHEP::HepLorentzVector momentumK0 = fourP(perigee1,perigee2,m_massK0,false);
215  double inv_massK0 = momentumK0.m();
216  if (std::fabs(inv_massK0-m_massK0) <= m_nsig*m_sigmaK0) isK0 = true;
217  CLHEP::HepLorentzVector momentumL = fourP(perigee1,perigee2,m_massLambda,false);
218  double inv_massL = momentumL.m();
219  if (std::fabs(inv_massL-m_massLambda) <= m_nsig*m_sigmaLambda) isLambda = true;
220  CLHEP::HepLorentzVector momentumLb = fourP(perigee1,perigee2,m_massLambda,true);
221  double inv_massLb = momentumLb.m();
222  if (std::fabs(inv_massLb-m_massLambda) <= m_nsig*m_sigmaLambda) isLambdaBar = true;
223  if (!isLambdaBar && !isLambda && !isK0) pass = false;
224  CLHEP::HepLorentzVector momentum;
225  if(isK0 && isLambda && !isLambdaBar) {momentum = momentumK0; kind = 110;}
226  if(isK0 && isLambdaBar && !isLambda) {momentum = momentumK0; kind = 101;}
227  if(isK0 && !isLambda && !isLambdaBar) {momentum = momentumK0; kind = 100;}
228  if(!isK0 && isLambda && !isLambdaBar) {momentum = momentumL; kind = 10;}
229  if(!isK0 && isLambdaBar && !isLambda) {momentum = momentumLb; kind = 1;}
230  if(!isK0 && isLambda && isLambdaBar) {momentum = momentumL; kind = 11;}
231  double particleP = std::sqrt(momentum.x()*momentum.x() + momentum.y()*momentum.y());
232  if (particleP < fitMomentum) pass = false;
233  }
234  type = kind;
235  return pass;
236  }

◆ 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

BooleanProperty InDet::ConversionPostSelector::m_decorateVertices
private
Initial value:
{this, "DecorateVertices", true,
"Decorate vertices with values used for vertex selection"}

Definition at line 75 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

DoubleArrayProperty InDet::ConversionPostSelector::m_fitMomentum
private
Initial value:
{this, "MinFitMomentum", {0., 0., 0.},
"Converted photon reconstructed momentum at vertex cut"}

Definition at line 63 of file ConversionPostSelector.h.

◆ m_invMassCut

DoubleArrayProperty InDet::ConversionPostSelector::m_invMassCut {this, "MaxInvariantMass", {10000., 10000., 10000.}, "Invariant mass cut"}
private

Definition at line 61 of file ConversionPostSelector.h.

◆ m_massK0

constexpr double InDet::ConversionPostSelector::m_massK0 = 497.672
staticconstexprprivate

Masses and mass ranges for different V0 hypotheses.

Definition at line 80 of file ConversionPostSelector.h.

◆ m_massLambda

constexpr double InDet::ConversionPostSelector::m_massLambda = 1115.683
staticconstexprprivate

Definition at line 82 of file ConversionPostSelector.h.

◆ m_maxChi2

DoubleArrayProperty InDet::ConversionPostSelector::m_maxChi2 {this, "MaxChi2Vtx", {35., 25., 20.}, "Chi2 cut"}
private

Properties for track selection: all cuts are ANDed.

Definition at line 59 of file ConversionPostSelector.h.

◆ m_maxdR

DoubleProperty InDet::ConversionPostSelector::m_maxdR
private
Initial value:
{this, "MaxdR", -10000.,
"Distance of first track hit- reconstructed vertex radial position"}

Definition at line 71 of file ConversionPostSelector.h.

◆ m_maxPhiVtxTrk

DoubleProperty InDet::ConversionPostSelector::m_maxPhiVtxTrk
private
Initial value:
{this, "MaxPhiVtxTrk", 0.2,
"Maximum difference in phi between reconstructed vertex and track at vertex"}

Definition at line 73 of file ConversionPostSelector.h.

◆ m_minPt

DoubleProperty InDet::ConversionPostSelector::m_minPt
private
Initial value:
{this, "MinPt", 0.,
"Pt of the two participating tracks at the vertex"}

Definition at line 69 of file ConversionPostSelector.h.

◆ m_minRadius

DoubleArrayProperty InDet::ConversionPostSelector::m_minRadius
private
Initial value:
{this, "MinRadius", {-10000., -10000., -10000.},
"Converted photon reconstructed vertex radial position cut"}

Definition at line 66 of file ConversionPostSelector.h.

◆ m_nsig

IntegerProperty InDet::ConversionPostSelector::m_nsig {this, "NSigma", 5}
private

Definition at line 84 of file ConversionPostSelector.h.

◆ m_sigmaK0

constexpr double InDet::ConversionPostSelector::m_sigmaK0 = 8.5
staticconstexprprivate

Definition at line 81 of file ConversionPostSelector.h.

◆ m_sigmaLambda

constexpr double InDet::ConversionPostSelector::m_sigmaLambda = 3.5
staticconstexprprivate

Definition at line 83 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:239
InDet::ConversionPostSelector::m_maxPhiVtxTrk
DoubleProperty m_maxPhiVtxTrk
Definition: ConversionPostSelector.h:73
Trk::ParametersBase::charge
double charge() const
Returns the charge.
InDet::ConversionPostSelector::m_massK0
static constexpr double m_massK0
Masses and mass ranges for different V0 hypotheses.
Definition: ConversionPostSelector.h:80
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
InDet::ConversionPostSelector::m_decorateVertices
BooleanProperty m_decorateVertices
Definition: ConversionPostSelector.h:75
AthCommonDataStore::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
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
InDet::ConversionPostSelector::m_minPt
DoubleProperty m_minPt
Definition: ConversionPostSelector.h:69
InDet::ConversionPostSelector::m_sigmaLambda
static constexpr double m_sigmaLambda
Definition: ConversionPostSelector.h:83
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::ConversionPostSelector::m_sigmaK0
static constexpr double m_sigmaK0
Definition: ConversionPostSelector.h:81
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
InDet::ConversionPostSelector::m_maxdR
DoubleProperty m_maxdR
Definition: ConversionPostSelector.h:71
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:275
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
InDet::ConversionPostSelector::m_maxChi2
DoubleArrayProperty m_maxChi2
Properties for track selection: all cuts are ANDed.
Definition: ConversionPostSelector.h:60
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
InDet::ConversionPostSelector::m_minRadius
DoubleArrayProperty m_minRadius
Definition: ConversionPostSelector.h:67
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.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDet::ConversionPostSelector::m_nsig
IntegerProperty m_nsig
Definition: ConversionPostSelector.h:84
InDet::ConversionPostSelector::m_massLambda
static constexpr double m_massLambda
Definition: ConversionPostSelector.h:82
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
InDet::ConversionPostSelector::m_fitMomentum
DoubleArrayProperty m_fitMomentum
Definition: ConversionPostSelector.h:64
InDet::ConversionPostSelector::m_invMassCut
DoubleArrayProperty m_invMassCut
Definition: ConversionPostSelector.h:62
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
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
fitman.k
k
Definition: fitman.py:528