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

#include <MSVVariablesFactory.h>

Inheritance diagram for Analysis::MSVVariablesFactory:
Collaboration diagram for Analysis::MSVVariablesFactory:

Public Member Functions

 MSVVariablesFactory (const std::string &name, const std::string &n, const IInterface *p)
 
virtual ~MSVVariablesFactory ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode fillMSVVariables (const xAOD::Jet &, xAOD::BTagging *BTag, const Trk::VxSecVKalVertexInfo *myInfoVKal, xAOD::VertexContainer *btagVertex, const xAOD::Vertex &PV, std::string basename) const override
 
virtual StatusCode createMSVContainer (const xAOD::Jet &, const Trk::VxSecVKalVertexInfo *myInfoVKal, xAOD::VertexContainer *btagVertex, const xAOD::Vertex &PV) const override
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

double get3DSignificance (const xAOD::Vertex *priVertex, std::vector< const xAOD::Vertex * > &secVertex, const Amg::Vector3D jetDirection) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

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 23 of file MSVVariablesFactory.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

◆ MSVVariablesFactory()

Analysis::MSVVariablesFactory::MSVVariablesFactory ( const std::string &  name,
const std::string &  n,
const IInterface *  p 
)

Definition at line 39 of file MSVVariablesFactory.cxx.

41  :
42  AthAlgTool(name, n,p)
43  {
44  declareInterface<IMSVVariablesFactory>(this);
45  }

◆ ~MSVVariablesFactory()

virtual Analysis::MSVVariablesFactory::~MSVVariablesFactory ( )
virtualdefault

Member Function Documentation

◆ createMSVContainer()

StatusCode Analysis::MSVVariablesFactory::createMSVContainer ( const xAOD::Jet myJet,
const Trk::VxSecVKalVertexInfo myInfoVKal,
xAOD::VertexContainer btagVertex,
const xAOD::Vertex PV 
) const
overridevirtual

Implements Analysis::IMSVVariablesFactory.

Definition at line 57 of file MSVVariablesFactory.cxx.

59  {
60 
61  Amg::Vector3D jet_V3(myJet.p4().Px(), myJet.p4().Py(), myJet.p4().Pz());
62  float jetenergy=0.;
63  const xAOD::Vertex* priVtx = &PrimaryVtx;
64  std::vector< ElementLink< xAOD::VertexContainer > > MSVVertexLinks;
65  const std::vector<xAOD::Vertex*> myVertices = myVertexInfoVKal->vertices();
66  if(myVertices.empty()){
67  ATH_MSG_DEBUG("#BTAG# no MSV vertices...fill default values only... ");
77  return StatusCode::SUCCESS;
78  }
79 
80  jetenergy = myVertexInfoVKal->energyTrkInJet();
81 
82  for (const auto& vertex : myVertexInfoVKal->vertices()){
84  //additional info per vertex
85  double sumpx = 0.0;
86  double sumpy = 0.0;
87  double sumpz = 0.0;
88  double sume = 0.0;
89  const std::vector<ElementLink<xAOD::TrackParticleContainer> > myTrackLinks = vertex->trackParticleLinks();
90  if (myTrackLinks.empty()) {
91  ATH_MSG_WARNING("#BTAG# No Track Links attached to the track at the sec vertex... ");
92  }
93  int npsec = 0;
94  const std::vector<Trk::VxTrackAtVertex> myTracks=vertex->vxTrackAtVertex();
95  if (!myTracks.empty()) {
96  npsec=myTracks.size();
97  for (const auto& track : myTracks) {
98  const Trk::Perigee* perigee = dynamic_cast<const Trk::Perigee*>(track.perigeeAtVertex());
99  if(perigee){
100  sumpx += perigee->momentum().x();
101  sumpy += perigee->momentum().y();
102  sumpz += perigee->momentum().z();
103  sume += std::hypot(perigee->momentum().mag(), 139.5702);
104  }else{
105  ATH_MSG_WARNING("#BTAG# perigee for VxTrackAtVertex not found");
106  }
107  }
108  }
109 
110  CLHEP::HepLorentzVector vtxp4(sumpx,sumpy,sumpz,sume);
111  float efrac = (jetenergy>0) ? vtxp4.e()/jetenergy : 0;
115  xAOD::SecVtxHelper::setVtxpt(vertex, vtxp4.perp());
118 
119  ATH_MSG_DEBUG("#BTAG# mass per vertex = "<<vtxp4.m());
120  double localdistnrm = 0;
121  std::vector<const xAOD::Vertex*> vecVtxHolder;
122  vecVtxHolder.push_back(vertex);
123 
124  ATH_MSG_DEBUG("Factory PVX x = " << priVtx->x() << " y = " << priVtx->y() << " z = " << priVtx->z());
125  if (priVtx) {
126  localdistnrm = get3DSignificance(priVtx, vecVtxHolder, jet_V3);
127  } else {
128  ATH_MSG_WARNING("#BTAG# Tagging requested, but no primary vertex supplied.");
129  }
131  //track links,
132  vertex->setTrackParticleLinks(myTrackLinks);
133 
134  } //end loop vertexcontainer
135 
136  return StatusCode::SUCCESS;
137  }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ 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

◆ fillMSVVariables()

StatusCode Analysis::MSVVariablesFactory::fillMSVVariables ( const xAOD::Jet myJet,
xAOD::BTagging BTag,
const Trk::VxSecVKalVertexInfo myInfoVKal,
xAOD::VertexContainer btagVertex,
const xAOD::Vertex PV,
std::string  basename 
) const
overridevirtual

Implements Analysis::IMSVVariablesFactory.

Definition at line 139 of file MSVVariablesFactory.cxx.

143  {
144 
145  Amg::Vector3D jet_V3(myJet.p4().Px(), myJet.p4().Py(), myJet.p4().Pz());
146  int nvsec = 0;
147  float jetenergy = 0.;
148  int n2t = 0;
149  float distnrm = 0.;
150  const xAOD::Vertex* priVtx = &PrimaryVtx;
151  std::vector< ElementLink< xAOD::VertexContainer > > MSVVertexLinks;
152  const std::vector<xAOD::Vertex*> myVertices = myVertexInfoVKal->vertices();
153  if(myVertices.empty()){
154  ATH_MSG_DEBUG("#BTAG# no MSV vertices...fill default values only... ");
155  BTag->setVariable<int>(basename, "N2Tpair", n2t);
156  BTag->setVariable<float>(basename, "energyTrkInJet", jetenergy);
157  BTag->setVariable<int>(basename, "nvsec", nvsec);
158  BTag->setVariable<float>(basename, "normdist", distnrm);
159  BTag->setVariable<std::vector<ElementLink<xAOD::VertexContainer> > >(basename, "vertices", MSVVertexLinks);
160  BTag->setDynVxELName(basename, "vertices");
170  return StatusCode::SUCCESS;
171  }
172 
173  jetenergy = myVertexInfoVKal->energyTrkInJet();
174  n2t = myVertexInfoVKal->n2trackvertices();
175  BTag->setVariable<int>(basename, "N2Tpair", n2t);
176  BTag->setVariable<float>(basename, "energyTrkInJet", jetenergy);
177 
178  std::vector<const xAOD::Vertex*> vecVertices;
179  for (const auto& vertex : myVertexInfoVKal->vertices()) {
181  //additional info per vertex
182  vecVertices.push_back(vertex);
183  double sumpx = 0.0;
184  double sumpy = 0.0;
185  double sumpz = 0.0;
186  double sume = 0.0;
187  const std::vector<ElementLink<xAOD::TrackParticleContainer> > myTrackLinks = vertex->trackParticleLinks();
188  if (myTrackLinks.empty()) {
189  ATH_MSG_WARNING("#BTAG# No Track Links attached to the track at the sec vertex... ");
190  }
191  int npsec = 0;
192  const std::vector<Trk::VxTrackAtVertex> myTracks=vertex->vxTrackAtVertex();
193  if (!myTracks.empty()) {
194  npsec=myTracks.size();
195  for (const auto& track : myTracks) {
196  const Trk::Perigee* perigee = dynamic_cast<const Trk::Perigee*>(track.perigeeAtVertex());
197  if(perigee){
198  sumpx += perigee->momentum().x();
199  sumpy += perigee->momentum().y();
200  sumpz += perigee->momentum().z();
201  sume += std::hypot(perigee->momentum().mag(), 139.5702);
202  }else{
203  ATH_MSG_WARNING("#BTAG# perigee for VxTrackAtVertex not found");
204  }
205  }
206  }
207 
208  CLHEP::HepLorentzVector vtxp4(sumpx,sumpy,sumpz,sume);
209  float efrac = (jetenergy>0) ? vtxp4.e()/jetenergy : 0;
213  xAOD::SecVtxHelper::setVtxpt(vertex, vtxp4.perp());
216 
217  ATH_MSG_DEBUG("#BTAG# mass per vertex = "<<vtxp4.m());
218  double localdistnrm = 0;
219  std::vector<const xAOD::Vertex*> vecVtxHolder;
220  vecVtxHolder.push_back(vertex);
221 
222  ATH_MSG_DEBUG("Factory PVX x = " << priVtx->x() << " y = " << priVtx->y() << " z = " << priVtx->z());
223  if (priVtx) {
224  localdistnrm = get3DSignificance(priVtx, vecVtxHolder, jet_V3);
225  } else {
226  ATH_MSG_WARNING("#BTAG# Tagging requested, but no primary vertex supplied.");
227  }
229  //track links,
230  vertex->setTrackParticleLinks(myTrackLinks);
231 
233  linkBTagVertex.toContainedElement(*VertexContainer, vertex);
234  MSVVertexLinks.push_back(linkBTagVertex);
235  } //end loop vertexcontainer
236 
237  BTag->setVariable<std::vector<ElementLink<xAOD::VertexContainer> > >(basename, "vertices", MSVVertexLinks);
238  BTag->setDynVxELName(basename, "vertices");
239 
240  if (priVtx) {
241  distnrm = get3DSignificance(priVtx, vecVertices, jet_V3);
242  } else {
243  ATH_MSG_WARNING("#BTAG# Tagging requested, but no primary vertex supplied.");
244  distnrm=0.;
245  }
246  nvsec = vecVertices.size();
247  BTag->setVariable<int>(basename, "nvsec", nvsec);
248  BTag->setVariable<float>(basename, "normdist", distnrm);
249 
250  return StatusCode::SUCCESS;
251 
252  }

◆ finalize()

StatusCode Analysis::MSVVariablesFactory::finalize ( )
overridevirtual

Implements Analysis::IMSVVariablesFactory.

Definition at line 52 of file MSVVariablesFactory.cxx.

52  {
53  ATH_MSG_DEBUG(" Finalization of MSVVariablesFactory succesfull");
54  return StatusCode::SUCCESS;
55  }

◆ get3DSignificance()

double Analysis::MSVVariablesFactory::get3DSignificance ( const xAOD::Vertex priVertex,
std::vector< const xAOD::Vertex * > &  secVertex,
const Amg::Vector3D  jetDirection 
) const
private

Definition at line 254 of file MSVVariablesFactory.cxx.

257  {
258 
259  if(!secVertex.size()) return 0;
260  std::vector<Amg::Vector3D> positions;
261  std::vector<AmgSymMatrix(3)> weightMatrices;
262  Amg::Vector3D weightTimesPosition(0.,0.,0.);
263  AmgSymMatrix(3) sumWeights;
264  sumWeights.setZero();
265 
266  for (const auto& vertex : secVertex) {
267  positions.push_back(vertex->position());
268  weightMatrices.push_back(vertex->covariancePosition().inverse());
269  weightTimesPosition += weightMatrices.back() * positions.back();
270  sumWeights += weightMatrices.back();
271  }
272 
273  bool invertible;
274  AmgSymMatrix(3) meanCovariance;
275  meanCovariance.setZero();
276  sumWeights.computeInverseWithCheck(meanCovariance, invertible);
277  if (!invertible) {
278  ATH_MSG_WARNING("#BTAG# Could not invert sum of sec vtx matrices");
279  return 0.;
280  }
281  Amg::Vector3D meanPosition = meanCovariance * weightTimesPosition;
282  AmgSymMatrix(3) covariance = meanCovariance + priVertex->covariancePosition();
283 
284  double Lx = meanPosition[0]-priVertex->position().x();
285  double Ly = meanPosition[1]-priVertex->position().y();
286  double Lz = meanPosition[2]-priVertex->position().z();
287 
288  const double decaylength = sqrt(Lx*Lx + Ly*Ly + Lz*Lz);
289  const double inv_decaylength = 1. / decaylength;
290  double dLdLx = Lx * inv_decaylength;
291  double dLdLy = Ly * inv_decaylength;
292  double dLdLz = Lz * inv_decaylength;
293  double decaylength_err = sqrt(dLdLx*dLdLx*covariance(0,0) +
294  dLdLy*dLdLy*covariance(1,1) +
295  dLdLz*dLdLz*covariance(2,2) +
296  2.*dLdLx*dLdLy*covariance(0,1) +
297  2.*dLdLx*dLdLz*covariance(0,2) +
298  2.*dLdLy*dLdLz*covariance(1,2));
299 
300  double decaylength_significance = 0.;
301  if (decaylength_err != 0.) decaylength_significance = decaylength/decaylength_err;
302  double L_proj_jetDir = jetDirection.x()*Lx + jetDirection.y()*Ly + jetDirection.z()*Lz;
303  if (L_proj_jetDir < 0.) decaylength_significance *= -1.;
304 
305  return decaylength_significance;
306 
307  }

◆ initialize()

StatusCode Analysis::MSVVariablesFactory::initialize ( )
overridevirtual

Implements Analysis::IMSVVariablesFactory.

Definition at line 47 of file MSVVariablesFactory.cxx.

47  {
48  ATH_MSG_DEBUG(" Initialization of MSVVariablesFactory succesfull");
49  return StatusCode::SUCCESS;
50  }

◆ 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& Analysis::IMSVVariablesFactory::interfaceID ( )
inlinestaticinherited

Definition at line 49 of file IMSVVariablesFactory.h.

49 { return IID_IMSVVariablesFactory; };

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

Member Data Documentation

◆ 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_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:
xAOD::Vertex_v1::x
float x() const
Returns the x position.
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
xAOD::SecVtxHelper::setVtxNtrk
void setVtxNtrk(xAOD::Vertex *, int value)
Definition: SecVtxHelper.cxx:48
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::SecVtxHelper::setEnergyFraction
void setEnergyFraction(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:33
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
x
#define x
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
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
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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.
xAOD::SecVtxHelper::setVtxpt
void setVtxpt(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:62
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
xAOD::SecVtxHelper::setVtxeta
void setVtxeta(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:76
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::SecVtxHelper::setVtxphi
void setVtxphi(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:90
xAOD::SecVtxHelper::setVtxnormDist
void setVtxnormDist(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:104
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::Jet_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Jet_v1.cxx:71
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::Vertex_v1::y
float y() const
Returns the y position.
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
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
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAODType::BTag
@ BTag
The object is a b-tagging object.
Definition: ObjectType.h:60
xAOD::SecVtxHelper::setVertexMass
void setVertexMass(xAOD::Vertex *, float value)
Definition: SecVtxHelper.cxx:18
Analysis::MSVVariablesFactory::get3DSignificance
double get3DSignificance(const xAOD::Vertex *priVertex, std::vector< const xAOD::Vertex * > &secVertex, const Amg::Vector3D jetDirection) const
Definition: MSVVariablesFactory.cxx:255
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
beamspotman.basename
basename
Definition: beamspotman.py:640