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

#include <SecVertexMergingTool.h>

Inheritance diagram for Trk::SecVertexMergingTool:
Collaboration diagram for Trk::SecVertexMergingTool:

Public Member Functions

virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 EndOfInitialize. More...
 
 SecVertexMergingTool (const std::string &t, const std::string &n, const IInterface *p)
 constructor More...
 
virtual ~SecVertexMergingTool ()
 destructor More...
 
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > mergeVertexContainer (const xAOD::VertexContainer &MyVxCont) const override
 Merging
More...
 
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 ()
 AlgTool interface methods. 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

bool checkCompatibility (const xAOD::Vertex *vx1, const xAOD::Vertex *vx2) 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

int m_Compatidime
 
float m_minDist
 
ToolHandle< Trk::IVertexFitterm_iVertexFitter
 
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

Author
Maria Ilaria Besana, June 2014

Changes:

David Shope david.nosp@m..ric.nosp@m.hard..nosp@m.shop.nosp@m.e@cer.nosp@m.n.ch (2016-04-26)

EDM Migration to xAOD - remove method using VxCandidate

Definition at line 41 of file SecVertexMergingTool.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

◆ SecVertexMergingTool()

Trk::SecVertexMergingTool::SecVertexMergingTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

constructor

Definition at line 17 of file SecVertexMergingTool.cxx.

18  : AthAlgTool ( t,n,p ),
19  m_Compatidime(1),
20  m_minDist(3),
21  m_iVertexFitter("Trk::AdaptiveVertexFitter", this )
22  {
23  declareInterface<IVertexMergingTool> ( this );
24  declareProperty("VertexFitterTool", m_iVertexFitter);
25  declareProperty("CompatibilityDimension", m_Compatidime, "0 for z0, 1 for d0, 2 for all" ) ;
26  declareProperty("MininumDistance", m_minDist, "in sigma" ) ;
27  }

◆ ~SecVertexMergingTool()

Trk::SecVertexMergingTool::~SecVertexMergingTool ( )
virtualdefault

destructor

Member Function Documentation

◆ checkCompatibility()

bool Trk::SecVertexMergingTool::checkCompatibility ( const xAOD::Vertex vx1,
const xAOD::Vertex vx2 
) const
private

Definition at line 243 of file SecVertexMergingTool.cxx.

245  {
246 
247  float sigma = 100 ;
248 
249  Amg::Vector3D vdif = v1->position() - v2->position() ;
250  AmgSymMatrix(3) vErrs = v1->covariancePosition() + v2->covariancePosition() ;
251  vErrs = vErrs.inverse().eval();
252 
253  if ( m_Compatidime == 2 ) // 3 dimension
254  {
255  sigma = sqrt( vdif.dot( vErrs * vdif ) ) ;
256  } else if ( m_Compatidime == 1 ) // d0
257  {
258  sigma = vdif(0)*vdif(0)*vErrs(0,0) + vdif(1)*vdif(1)*vErrs(1,1) + 2*vdif(0)*vdif(1)*vErrs(0,1) ;
259  sigma = std::sqrt( sigma ) ;
260 
261  } else { // z0
262 
263  sigma = vdif(2)*sqrt( vErrs(2,2) );
264  }
265 
266 // ATH_MSG_DEBUG(" Compatibility/significance when merging vertices : " << sigma );
267  ATH_MSG_DEBUG(" Compatibility/significance when merging vertices : " << sigma );
268 
269  return sigma < m_minDist;
270 
271  }

◆ 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

◆ finalize()

StatusCode Trk::SecVertexMergingTool::finalize ( )
overridevirtual

EndOfInitialize.

Definition at line 45 of file SecVertexMergingTool.cxx.

46  {
47  return StatusCode::SUCCESS;
48  }

◆ initialize()

StatusCode Trk::SecVertexMergingTool::initialize ( )
overridevirtual

Definition at line 33 of file SecVertexMergingTool.cxx.

34  {
35 
36  if ( m_iVertexFitter.retrieve().isFailure() ) {
37  ATH_MSG_ERROR("Failed to retrieve tool " << m_iVertexFitter);
38  return StatusCode::FAILURE;
39  }
40 
41  ATH_MSG_DEBUG("Re-merging tool initialization successful");
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()

static const InterfaceID& Trk::IVertexMergingTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 49 of file Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexMergingTool.h.

49 { return IID_IVertexMergingTool; };

◆ mergeVertexContainer()

std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > Trk::SecVertexMergingTool::mergeVertexContainer ( const xAOD::VertexContainer MyVxCont) const
overridevirtual

Merging

SG::Decorator<std::vector<float> > mDecor_trkWght(

"trkWeight" ) ; SG::Decorator<float> mDecor_trkDOE( "trkDistOverError" ) ; SG::Decorator<float> mDecor_direction( "MomentaDirection" ); SG::Decorator< float > mDecor_HitsFilter( "radiiPattern" );

Implements Trk::IVertexMergingTool.

Definition at line 51 of file SecVertexMergingTool.cxx.

54  {
55 
56  ATH_MSG_DEBUG("Run vertex remerging");
57 
58  // new output containers to be filled
59  xAOD::VertexContainer* NewContainer = new xAOD::VertexContainer();
60  xAOD::VertexAuxContainer* auxNewContainer = new xAOD::VertexAuxContainer();
61  NewContainer->setStore(auxNewContainer);
62 
63  static const SG::Decorator<float> mDecor_sumPt2("sumPt2");
64  static const SG::Decorator<float> mDecor_mass("mass");
65  static const SG::Decorator<float> mDecor_energy("ee");
66  static const SG::Decorator<int> mDecor_nrobbed("nrobbed");
67  static const SG::Decorator<int> mDecor_intrk("NumInputTrk");
68 
69  static const SG::Accessor<float> mAcc_sumPt2("sumPt2");
70  static const SG::Accessor<int> mAcc_momdir ("MomentaDirection");
71  static const SG::Accessor<float> mAcc_mass("mass");
72  static const SG::Accessor<float> mAcc_energy("ee");
73  static const SG::Accessor<int> mAcc_intrk("NumInputTrk");
74  static const SG::Accessor<float> mAcc_radpat("radiiPattern");
75  static const SG::Accessor<std::vector<float> > mAcc_trkwt("trkWeight");
76  static const SG::Accessor<int> mAcc_numtav("NumTrkAtVtx");
77  static const SG::Accessor<std::vector<float> > mAcc_trkdoe("trkDistOverError");
78 
79  bool moreDeco = mAcc_momdir.isAvailable(*MyVxCont.front());
80 
81  if (!moreDeco)
82  ATH_MSG_DEBUG("Missing decoration !!! ");
83 
92  // add remerged flags to all
93  std::vector<bool> remerged(MyVxCont.size(), false);
94 
95  xAOD::VertexContainer::const_iterator beginIter = MyVxCont.begin();
96  xAOD::VertexContainer::const_iterator endIter = MyVxCont.end();
97  unsigned int Ni = 0;
98  for (xAOD::VertexContainer::const_iterator i = beginIter; i != endIter;
99  ++i, Ni++) {
100  xAOD::Vertex* vx = new xAOD::Vertex(**i);
101 
102  if (remerged[Ni])
103  continue; // skip vertices already merged into another
104 
105  std::vector<const xAOD::TrackParticle*> combinedTracks;
106  std::vector<ElementLink<xAOD::TrackParticleContainer>> tpLinks1 =
107  vx->trackParticleLinks();
108  if (!tpLinks1.empty()) {
109  for (const auto& tp_EL : tpLinks1) {
110  const xAOD::TrackParticle* trk = *tp_EL;
111  combinedTracks.push_back(trk);
112  }
113 
114  unsigned int Nj = Ni + 1;
115  bool newmerge = false;
116  for (xAOD::VertexContainer::const_iterator j = i + 1; j != endIter;
117  ++j, Nj++) {
118  const xAOD::Vertex* mergeCand = (*j);
119  if (remerged[Nj])
120  continue;
121 
122  if (newmerge) {
123  combinedTracks.clear();
124  tpLinks1 = vx->trackParticleLinks();
125  if (tpLinks1.empty())
126  break;
127  for (const auto& tp_EL : tpLinks1) {
128  const xAOD::TrackParticle* trk = *tp_EL;
129  combinedTracks.push_back(trk);
130  }
131  newmerge = false;
132  }
133 
134  // not dummy and not already merged into earlier vertex, so consider
135  // it as merging candidate
136  if (!checkCompatibility(vx, mergeCand))
137  continue;
138 
139  ATH_MSG_DEBUG("To merge vertices " << Ni << " and " << Nj);
140  // get all the track particles to fit
141 
142  const std::vector<ElementLink<xAOD::TrackParticleContainer>>
143  tpLinks2 = mergeCand->trackParticleLinks();
144  if (tpLinks2.empty())
145  continue;
146 
147  for (const auto& tp_EL : tpLinks2) {
148  const xAOD::TrackParticle* trk = *tp_EL;
149  combinedTracks.push_back(trk);
150  }
151 
152  ATH_MSG_DEBUG("Tracks input : " << tpLinks1.size() << " + "
153  << tpLinks2.size());
154 
155  // call the fitter -> using xAOD::TrackParticle it should set the
156  // track links for us
157  xAOD::Vertex* mergedVtx = nullptr;
158  // no interface for no constraint and no starting point, so use
159  // starting point of original vertex
160  Amg::Vector3D start(0.5 * (vx->position() + mergeCand->position()));
161  mergedVtx = m_iVertexFitter->fit(combinedTracks, start);
162 
163  ATH_MSG_DEBUG("Merged vertices " << mergedVtx->nTrackParticles());
164 
165  remerged[Nj] = true;
166  remerged[Ni] = true;
167  newmerge = true;
168 
169  // update the decors
170  float pt1 = sqrt(mAcc_sumPt2(*vx));
171  float pt2 = sqrt(mAcc_sumPt2(*mergeCand));
172  float ntrk1 = 1.0 * ((vx->trackParticleLinks()).size());
173  float ntrk2 = 1.0 * ((mergeCand->trackParticleLinks()).size());
174  float wght1 =
175  0.6 * pt1 / (pt1 + pt2) + 0.4 * ntrk1 / (ntrk1 + ntrk2);
176  float wght2 =
177  0.6 * pt2 / (pt1 + pt2) + 0.4 * ntrk2 / (ntrk1 + ntrk2);
178 
180  xAOD::VxType::VertexType typ2 = mergeCand->vertexType();
181  float mas1 = mAcc_mass(*vx);
182  float mas2 = mAcc_mass(*mergeCand);
183  float e1 = mAcc_energy(*vx);
184  float e2 = mAcc_energy(*mergeCand);
185  int inNtrk1 = mAcc_intrk(*vx);
186  int inNtrk2 = mAcc_intrk(*mergeCand);
187 
188  int ntrks = 0;
189  float md1 = 0., md2 = 0., hf1 = 0., hf2 = 0.;
190  std::vector<float> trkW1, trkW2, doe1, doe2;
191  if (moreDeco) {
192  doe1 = mAcc_trkdoe(*vx);
193  doe2 = mAcc_trkdoe(*mergeCand);
194  doe2.insert(doe2.end(), doe1.begin(), doe1.end());
195  md1 = mAcc_momdir(*vx);
196  md2 = mAcc_momdir(*mergeCand);
197  hf1 = mAcc_radpat(*vx);
198  hf2 = mAcc_radpat(*mergeCand);
199  trkW1 = mAcc_trkwt(*vx);
200  trkW2 = mAcc_trkwt(*mergeCand);
201  trkW2.insert(trkW2.end(), trkW1.begin(), trkW1.end());
202  ntrks = mAcc_numtav(*vx) + mAcc_numtav(*mergeCand);
203  }
204 
205  // delete copy of first vertex and then overwrite with merged vertex
206  delete vx;
207  vx = mergedVtx;
208 
209  if (wght1 >= wght2)
210  vx->setVertexType(typ1);
211  else
212  vx->setVertexType(typ2);
213 
214  if (moreDeco) {
215  mAcc_trkdoe(*vx) = doe2;
216  mAcc_momdir(*vx) = wght1 * md1 + wght2 * md2;
217  mAcc_radpat(*vx) = wght1 * hf1 + wght2 * hf2;
218  mAcc_trkwt(*vx) = trkW2;
219  mAcc_numtav(*vx) = ntrks;
220  }
221 
222  mDecor_sumPt2(*vx) = pt1 * pt1 + pt2 * pt2;
223  mDecor_mass(*vx) = wght1 * mas1 + wght2 * mas2;
224  mDecor_energy(*vx) = wght1 * e1 + wght2 * e2;
225  mDecor_nrobbed(*vx) = 0;
226  mDecor_intrk(*vx) = (int)(wght1 * inNtrk1 + wght1 * inNtrk2);
227 
228  } // loop over j
229  } // if vx found partner in compatibility
230 
231  ATH_MSG_DEBUG("Merged sumPt2 " << mAcc_sumPt2(*vx));
232 
233  // whether we merged or not, can add vx to the container
234  if (vx != nullptr)
235  NewContainer->push_back(vx);
236  }
237 
238  return std::make_pair(NewContainer, auxNewContainer);
239 
240  }

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

int Trk::SecVertexMergingTool::m_Compatidime
private

Definition at line 65 of file SecVertexMergingTool.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_iVertexFitter

ToolHandle< Trk::IVertexFitter > Trk::SecVertexMergingTool::m_iVertexFitter
private

Definition at line 67 of file SecVertexMergingTool.h.

◆ m_minDist

float Trk::SecVertexMergingTool::m_minDist
private

Definition at line 66 of file SecVertexMergingTool.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:
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::Accessor< float >
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::Vertex_v1::trackParticleLinks
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
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
Trk::SecVertexMergingTool::m_minDist
float m_minDist
Definition: SecVertexMergingTool.h:66
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
xAOD::VxType::VertexType
VertexType
Vertex types.
Definition: TrackingPrimitives.h:569
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
xAOD::Vertex_v1::setVertexType
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Trk::SecVertexMergingTool::m_iVertexFitter
ToolHandle< Trk::IVertexFitter > m_iVertexFitter
Definition: SecVertexMergingTool.h:67
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator< float >
xAOD::VertexAuxContainer
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Definition: VertexAuxContainer.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
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::SecVertexMergingTool::checkCompatibility
bool checkCompatibility(const xAOD::Vertex *vx1, const xAOD::Vertex *vx2) const
Definition: SecVertexMergingTool.cxx:243
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
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::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
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::SecVertexMergingTool::m_Compatidime
int m_Compatidime
Definition: SecVertexMergingTool.h:65
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528