ATLAS Offline Software
InDetV0FinderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  InDetV0FinderTool.cxx - Description
7  -------------------
8  begin : 20-07-2005
9  authors : Evelina Bouhova-Thacker (Lancaster University), Rob Henderson (Lancater University)
10  email : e.bouhova@cern.ch, r.henderson@lancaster.ac.uk
11  changes : December 2014
12  author : Evelina Bouhova-Thacker <e.bouhova@cern.ch>
13  Changed to use xAOD
14  Changed to receive DataHandles from caller
15 
16  ***************************************************************************/
17 
22 
24 #include "HepPDT/ParticleDataTable.hh"
28 #include <vector>
29 #include <cmath>
30 
31 namespace InDet
32 {
33 
34 InDetV0FinderTool::InDetV0FinderTool(const std::string& t, const std::string& n, const IInterface* p)
35  :
36  AthAlgTool(t,n,p)
37 {
38  declareInterface<InDetV0FinderTool>(this);
39 }
40 
42 
44 {
46 
47  // Get the right vertex fitting tool from ToolSvc
48  if (m_useV0Fitter) {
49  ATH_CHECK( m_iVertexFitter.retrieve() );
50  ATH_MSG_DEBUG( "Retrieved tool " << m_iVertexFitter);
51  } else {
52  ATH_CHECK( m_iVKVertexFitter.retrieve() );
53  ATH_MSG_DEBUG("Retrieved tool " << m_iVKVertexFitter);
54 
55  // Get the VKalVrt Ks vertex fitting tool from ToolSvc
56  ATH_CHECK( m_iKshortFitter.retrieve() );
57  ATH_MSG_DEBUG("Retrieved tool " << m_iKshortFitter);
58 
59  // Get the VKalVrt Lambda vertex fitting tool from ToolSvc
60  ATH_CHECK( m_iLambdaFitter.retrieve() );
61  ATH_MSG_DEBUG( "Retrieved tool " << m_iLambdaFitter);
62 
63  // Get the VKalVrt Lambdabar vertex fitting tool from ToolSvc
64  ATH_CHECK( m_iLambdabarFitter.retrieve() );
65  ATH_MSG_DEBUG("Retrieved tool " << m_iLambdabarFitter);
66  }
67 
68  ATH_CHECK( m_iGammaFitter.retrieve() );
69  ATH_MSG_DEBUG("Retrieved tool " << m_iGammaFitter);
70 
71  // get the Particle Properties Service
72  ATH_CHECK(m_partPropSvc.retrieve());
74 
75  // uploading the V0 tools
76  ATH_CHECK( m_V0Tools.retrieve() );
77  ATH_MSG_DEBUG("Retrieved tool " << m_V0Tools);
78 
79  // Get the TrackToVertex extrapolator tool
80  ATH_CHECK( m_trackToVertexTool.retrieve() );
81 
82  // Get the extrapolator
83  ATH_CHECK( m_extrapolator.retrieve() );
84  ATH_MSG_DEBUG("Retrieved tool ");
85 
86  // Initialize vertex container key
87  ATH_CHECK( m_vertexKey.initialize() );
88 
89  m_v0LinksDecorkeyks = m_ksKey + ".V0Link";
90  m_v0LinksDecorkeylb = m_laKey + ".V0Link";
91  m_v0LinksDecorkeylbb = m_lbKey + ".V0Link";
92  m_v0_ksLinksDecorkey = m_v0Key + ".KshortLink";
93  m_v0_laLinksDecorkey = m_v0Key + ".LambdaLink";
94  m_v0_lbLinksDecorkey = m_v0Key + ".LambdabarLink";
95  ATH_MSG_DEBUG("m_v0_lbLinksDecorkey = " << m_v0_lbLinksDecorkey.key());
96  ATH_MSG_DEBUG("m_v0_laLinksDecorkey = " << m_v0_laLinksDecorkey.key());
97  ATH_MSG_DEBUG("m_v0_ksLinksDecorkey = " << m_v0_ksLinksDecorkey.key());
98  ATH_MSG_DEBUG("m_v0LinksDecorkeyks = " << m_v0LinksDecorkeyks.key());
99  ATH_CHECK( m_v0LinksDecorkeyks.initialize());
100  ATH_CHECK( m_v0LinksDecorkeylb.initialize());
101  ATH_CHECK( m_v0LinksDecorkeylbb.initialize());
102  ATH_CHECK( m_v0_ksLinksDecorkey.initialize());
103  ATH_CHECK( m_v0_laLinksDecorkey.initialize());
104  ATH_CHECK( m_v0_lbLinksDecorkey.initialize());
105 
106  m_mDecor_gfit = m_v0Key + ".gamma_fit";
107  m_mDecor_gmass = m_v0Key + ".gamma_mass";
108  m_mDecor_gmasserr = m_v0Key + ".gamma_massError";
109  m_mDecor_gprob = m_v0Key + ".gamma_probability";
110  ATH_CHECK( m_mDecor_gfit.initialize());
111  ATH_CHECK( m_mDecor_gmass.initialize());
112  ATH_CHECK( m_mDecor_gmasserr.initialize());
113  ATH_CHECK( m_mDecor_gprob.initialize());
114 
117  if(!m_useBeamSpotCond){
118  for (const std::string beam : {"beamPosX", "beamPosY", "beamPosZ"}) {
119  m_beamSpotDecoKey.emplace_back(m_eventInfo_key.key() + "."+beam);
120  }
121  }
123 
124 // Get the track selector tool from ToolSvc
125  ATH_CHECK( m_trkSelector.retrieve() );
126  ATH_MSG_DEBUG("Retrieved tool " << m_trkSelector);
127 
128 // Get the vertex point estimator tool from ToolSvc
129  ATH_CHECK( m_vertexEstimator.retrieve() );
130  ATH_MSG_DEBUG("Retrieved tool " << m_vertexEstimator);
131 
132  const HepPDT::ParticleData* pd_pi = m_particleDataTable->particle(MC::PIPLUS);
133  const HepPDT::ParticleData* pd_p = m_particleDataTable->particle(MC::PROTON);
134  const HepPDT::ParticleData* pd_e = m_particleDataTable->particle(MC::ELECTRON);
135  const HepPDT::ParticleData* pd_K = m_particleDataTable->particle(MC::K0S);
136  const HepPDT::ParticleData* pd_L = m_particleDataTable->particle(MC::LAMBDA0);
137  if (m_masses == 1) {
138  m_masspi = pd_pi->mass();
139  m_massp = pd_p->mass();
140  m_masse = pd_e->mass();
141  m_massK0S = pd_K->mass();
142  m_massLambda = pd_L->mass();
143  }
144 
145  m_events_processed = 0;
146  m_V0s_stored = 0;
147  m_Kshort_stored = 0;
148  m_Lambdabar_stored = 0;
149  m_Lambda_stored = 0;
150  m_Gamma_stored = 0;
151 
152 // making a concrete fitter for the V0Fitter
153  m_concreteVertexFitter = nullptr;
154  if (m_useV0Fitter) {
155  m_concreteVertexFitter = dynamic_cast<Trk::TrkV0VertexFitter * >(&(*m_iVertexFitter));
156  if (m_concreteVertexFitter == nullptr) {
157  ATH_MSG_FATAL("The vertex fitter passed is not a V0 Vertex Fitter");
158  return StatusCode::FAILURE;
159  }
160  }
161 
162  ATH_CHECK(m_RelinkContainers.initialize());
163 
164  ATH_MSG_DEBUG( "Initialization successful" );
165 
166  return StatusCode::SUCCESS;
167 }
168 
170  xAOD::VertexContainer* ksContainer,
171  xAOD::VertexContainer* laContainer,
172  xAOD::VertexContainer* lbContainer,
173  const xAOD::Vertex* primaryVertex,
174  const xAOD::VertexContainer* vertColl,
175  const EventContext& ctx
176  ) const
177 {
178 
179  ATH_MSG_DEBUG( "InDetV0FinderTool::performSearch" );
180  std::vector<const xAOD::TrackParticleContainer*> trackCols;
181  for(const auto &str : m_RelinkContainers){
183  trackCols.push_back(handle.cptr());
184  }
185 
187 
188 // Retrieve track particles from StoreGate
190  if ( !TPC.isValid() )
191  {
192  ATH_MSG_ERROR("Input TrackParticle collection is invalid!");
193  return StatusCode::SUCCESS;
194  }
195  ATH_MSG_DEBUG("Track particle container size " << TPC->size());
196 
197  if (m_use_vertColl) {
198  ATH_MSG_DEBUG("Vertex container size " << vertColl->size());
199  }
200  Amg::Vector3D beamspot;
201  if(m_useBeamSpotCond){
202  auto beamSpotHandle = SG::ReadCondHandle(m_beamSpotKey, ctx);
203  beamspot = beamSpotHandle->beamPos();
204  }else{
208  beamspot = Amg::Vector3D(beamPosX(0), beamPosY(0), beamPosZ(0));
209  }
210 // track preselection
211  std::vector<const xAOD::TrackParticle*> posTracks; posTracks.clear();
212  std::vector<const xAOD::TrackParticle*> negTracks; negTracks.clear();
213  const xAOD::Vertex* vx = nullptr;
214  if (m_pv && primaryVertex) vx = primaryVertex;
215 
216  if (TPC->size() > 1) {
218  for ( tpIt=TPC->begin(); tpIt!=TPC->end(); ++tpIt )
219  {
220  const xAOD::TrackParticle* TP = (*tpIt);
221  double charge = TP->charge();
222 
223  if (m_trkSelector->decision(*TP, vx))
224  {
225  if (m_samesign) {
226  posTracks.push_back(TP);
227  negTracks.push_back(TP);
228  } else {
229  if (charge > 0) {
230  posTracks.push_back(*tpIt);
231  } else {
232  negTracks.push_back(*tpIt);
233  }
234  }
235  }
236  }
237  }
238  ATH_MSG_DEBUG("number of tracks passing preselection, positive " << posTracks.size() << " negative " << negTracks.size());
239 
240  if (!posTracks.empty() && !negTracks.empty())
241  {
243  if (!vertices.isValid())
244  {
245  ATH_MSG_WARNING("Primary vertex container with key " << m_vertexKey.key() << " not found");
246  return StatusCode::SUCCESS;
247  }
248 
259 
260  std::vector<const xAOD::TrackParticle*>::const_iterator tpIt1;
261  std::vector<const xAOD::TrackParticle*>::const_iterator tpIt2;
262  unsigned int i1 = 0;
263  for (tpIt1 = posTracks.begin(); tpIt1 != posTracks.end(); ++tpIt1)
264  {
265  const xAOD::TrackParticle* TP1 = (*tpIt1);
266  uint8_t temp1(0);
267  uint8_t nclus1(0);
268  if ( TP1->summaryValue( temp1 , xAOD::numberOfPixelHits) ) nclus1 += temp1;
269  if ( TP1->summaryValue( temp1 , xAOD::numberOfSCTHits) ) nclus1 += temp1;
270  double pt1 = TP1->pt();
271 
272  const xAOD::Vertex* foundVertex1 { nullptr };
273  if (m_useorigin)
274  {
275  for (const auto *const vx : *vertices)
276  {
277  for (const auto& tpLink : vx->trackParticleLinks())
278  {
279  if (*tpLink == TP1)
280  {
281  foundVertex1 = vx;
282  break;
283  }
284  }
285  if (foundVertex1) break;
286  }
287  }
288  unsigned int i2 = 0;
289  for (tpIt2 = negTracks.begin(); tpIt2 != negTracks.end(); ++tpIt2)
290  {
291  if (*tpIt1 == *tpIt2) continue;
292  if (m_samesign && i1 <= i2) continue;
293 
294  const xAOD::TrackParticle* TP2 = (*tpIt2);
295  uint8_t temp2(0);
296  uint8_t nclus2(0);
297  if ( TP2->summaryValue( temp2 , xAOD::numberOfPixelHits) ) nclus2 += temp2;
298  if ( TP2->summaryValue( temp2 , xAOD::numberOfSCTHits) ) nclus2 += temp2;
299  ATH_MSG_DEBUG("nclus1 " << (int)nclus1 << " nclus2 " << (int)nclus2);
300 
301  if (!m_useTRTplusTRT && nclus1 == 0 && nclus2 == 0) continue;
302  if (!m_useTRTplusSi && (nclus1 == 0 || nclus2 == 0)) continue;
303 
304  double pt2 = TP2->pt();
305 
306  const xAOD::Vertex* foundVertex2 { nullptr };
307  if (m_useorigin)
308  {
309  for (const auto *const vx : *vertices)
310  {
311  for (const auto& tpLink : vx->trackParticleLinks())
312  {
313  if (*tpLink == TP2)
314  {
315  foundVertex2 = vx;
316  break;
317  }
318  }
319  if (foundVertex2) break;
320  }
321  }
322  bool usepair = false;
323  if (!m_useorigin) usepair = true;
324  if (m_useorigin && foundVertex1 == nullptr && foundVertex2 == nullptr) usepair = true;
325  if (!usepair) continue;
326 
327  bool trk_cut1 = false;
328  bool trk_cut2 = false;
329  if (nclus1 != 0) trk_cut1 = true;
330  if (nclus1 == 0 && pt1 >= m_ptTRT) trk_cut1 = true;
331  if (!trk_cut1) continue;
332  if (nclus2 != 0) trk_cut2 = true;
333  if (nclus2 == 0 && pt2 >= m_ptTRT) trk_cut2 = true;
334  if (!trk_cut2) continue;
335 
336 // find a starting point
337  const Trk::Perigee& aPerigee1 = TP1->perigeeParameters();
338  const Trk::Perigee& aPerigee2 = TP2->perigeeParameters();
339  int sflag = 0;
340  int errorcode = 0;
341  Amg::Vector3D startingPoint = m_vertexEstimator->getCirclesIntersectionPoint(&aPerigee1,&aPerigee2,sflag,errorcode);
342  if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
343  bool errorCode = false;
344  if (errorcode == 0 || errorcode == 5 || errorcode == 6 || errorcode == 8) errorCode = true;
345  if (!errorCode) continue;
346 
347  bool d0wrtVertex = true;
348  if (m_use_vertColl) {
349  if ( !d0Pass(TP1,TP2,vertColl, ctx) ) d0wrtVertex = false;
350  }
351  if (!m_use_vertColl && m_pv) {
352  if (primaryVertex) {
353  if ( !d0Pass(TP1,TP2,primaryVertex, ctx) ) d0wrtVertex = false;
354  } else {
355  if ( !d0Pass(TP1,TP2,beamspot, ctx) ) d0wrtVertex = false;
356  }
357  }
358  if (!d0wrtVertex) continue;
359 
360 
361 // pair pre-selection cuts
362  if ( doFit(TP1,TP2,startingPoint, ctx) )
363  {
364  std::vector<const xAOD::TrackParticle*> pairV0;
365  pairV0.clear();
366  pairV0.push_back(TP1);
367  pairV0.push_back(TP2);
368 
369 // vertex fit
370  ATH_MSG_DEBUG("unconstrained fit now");
371 
372  std::unique_ptr<xAOD::Vertex> myVxCandidate;
373  if (m_useV0Fitter) {
374  myVxCandidate = std::unique_ptr<xAOD::Vertex>( m_concreteVertexFitter->fit(pairV0, startingPoint) );
375  } else {
376  myVxCandidate = std::unique_ptr<xAOD::Vertex>( m_iVKVertexFitter->fit(pairV0, startingPoint) );
377  }
378 
379  if (myVxCandidate)
380  {
381  myVxCandidate->setVertexType(xAOD::VxType::V0Vtx);
382  if ( m_V0Tools->vertexProbability(myVxCandidate.get()) >= m_minVertProb )
383  {
384  bool doKshortFit = false;
385  doKshortFit = doMassFit(myVxCandidate.get(),310);
386  bool doLambdaFit = false;
387  doLambdaFit = doMassFit(myVxCandidate.get(),3122);
388  bool doLambdabarFit = false;
389  doLambdabarFit = doMassFit(myVxCandidate.get(),-3122);
390  if (doKshortFit || doLambdaFit || doLambdabarFit)
391  {
392  bool pointAtVert = true;
393  if (m_use_vertColl) {
394  if ( !pointAtVertexColl(myVxCandidate.get(),vertColl) ) pointAtVert = false;
395  }
396  if (!m_use_vertColl && m_pv && primaryVertex) {
397  if ( !pointAtVertex(myVxCandidate.get(),primaryVertex) ) pointAtVert = false;
398  }
399  if (m_doSimpleV0) pointAtVert = true;
400  if (pointAtVert)
401  {
402  Amg::Vector3D vertex = m_V0Tools->vtx(myVxCandidate.get());
403 
404  std::unique_ptr<xAOD::Vertex> myKshort;
405  std::unique_ptr<xAOD::Vertex> myLambda;
406  std::unique_ptr<xAOD::Vertex> myLambdabar;
407  std::unique_ptr<xAOD::Vertex> myGamma;
408  bool foundKshort = false;
409  bool foundLambda = false;
410  bool foundLambdabar = false;
411 
412  if (doKshortFit && !m_doSimpleV0) {
413  myKshort = std::unique_ptr<xAOD::Vertex>( massFit(310, pairV0, vertex) );
414  if (myKshort) {
415  if (m_V0Tools->vertexProbability(myKshort.get()) >= m_minConstrVertProb) {
417  foundKshort = true;
418  }
419  }
420  }
421 
422  if (doLambdaFit && !m_doSimpleV0) {
423  myLambda = std::unique_ptr<xAOD::Vertex>( massFit(3122, pairV0, vertex) );
424  if (myLambda) {
425  if (m_V0Tools->vertexProbability(myLambda.get()) >= m_minConstrVertProb) {
427  foundLambda = true;
428  }
429  }
430  }
431 
432  if (doLambdabarFit && !m_doSimpleV0) {
433  myLambdabar = std::unique_ptr<xAOD::Vertex>( massFit(-3122, pairV0, vertex));
434  if (myLambdabar) {
435  if (m_V0Tools->vertexProbability(myLambdabar.get()) >= m_minConstrVertProb) {
436  myLambdabar->setVertexType(xAOD::VxType::V0Vtx);
437  foundLambdabar = true;
438  }
439  }
440  }
441 
442  bool doGamma = false;
443  int gamma_fit = 0;
444  double gamma_prob = -1., gamma_mass = -1., gamma_massErr = -1.;
445  if (foundKshort || foundLambda || foundLambdabar) doGamma = true;
446 
451 
452  if (m_doSimpleV0 || (!m_doSimpleV0 && doGamma)) {
453  m_V0s_stored++;
454  myVxCandidate->clearTracks();
455  ElementLink<xAOD::TrackParticleContainer> newLink1 = makeLink(*tpIt1, trackCols);
456  ElementLink<xAOD::TrackParticleContainer> newLink2 = makeLink(*tpIt2, trackCols);
457  myVxCandidate->addTrackAtVertex(newLink1);
458  myVxCandidate->addTrackAtVertex(newLink2);
459  v0Container->push_back(myVxCandidate.release());
460 
461  if (foundKshort && !m_doSimpleV0) {
462  m_Kshort_stored++;
463  myKshort->clearTracks();
464  ElementLink<xAOD::TrackParticleContainer> ksLink1 = makeLink(*tpIt1, trackCols);
465  ElementLink<xAOD::TrackParticleContainer> ksLink2 = makeLink(*tpIt2, trackCols);
466  myKshort->addTrackAtVertex(ksLink1);
467  myKshort->addTrackAtVertex(ksLink2);
468  ksContainer->push_back(myKshort.release());
469 
470  v0Link.setElement(v0Container->back());
471  v0Link.setStorableObject(*v0Container);
472  v0LinksDecorks(*(ksContainer->back())) = v0Link;
473 
474  ksLink.setElement(ksContainer->back());
475  ksLink.setStorableObject(*ksContainer);
476  v0_ksLinksDecor(*(v0Container->back())) = ksLink;
477  } else {
478  v0_ksLinksDecor(*(v0Container->back())) = ksLink;
479  }
480  if (foundLambda && !m_doSimpleV0) {
481  m_Lambda_stored++;
482  myLambda->clearTracks();
483  ElementLink<xAOD::TrackParticleContainer> laLink1 = makeLink(*tpIt1, trackCols);
484  ElementLink<xAOD::TrackParticleContainer> laLink2 = makeLink(*tpIt2, trackCols);
485  myLambda->addTrackAtVertex(laLink1);
486  myLambda->addTrackAtVertex(laLink2);
487  laContainer->push_back(myLambda.release());
488 
489  v0Link.setElement(v0Container->back());
490  v0Link.setStorableObject(*v0Container);
491  v0LinksDecorlb(*(laContainer->back())) = v0Link;
492 
493  laLink.setElement(laContainer->back());
494  laLink.setStorableObject(*laContainer);
495  v0_laLinksDecor(*(v0Container->back())) = laLink;
496  } else {
497  v0_laLinksDecor(*(v0Container->back())) = laLink;
498  }
499  if (foundLambdabar && !m_doSimpleV0) {
501  myLambdabar->clearTracks();
502  ElementLink<xAOD::TrackParticleContainer> lbLink1 = makeLink(*tpIt1, trackCols);
503  ElementLink<xAOD::TrackParticleContainer> lbLink2 = makeLink(*tpIt2, trackCols);
504  myLambdabar->addTrackAtVertex(lbLink1);
505  myLambdabar->addTrackAtVertex(lbLink2);
506  lbContainer->push_back(myLambdabar.release());
507 
508  v0Link.setElement(v0Container->back());
509  v0Link.setStorableObject(*v0Container);
510  v0LinksDecorlbb(*(lbContainer->back())) = v0Link;
511 
512  lbLink.setElement(lbContainer->back());
513  lbLink.setStorableObject(*lbContainer);
514  v0_lbLinksDecor(*(v0Container->back())) = lbLink;
515  } else {
516  v0_lbLinksDecor(*(v0Container->back())) = lbLink;
517  }
518  if (doGamma && !m_doSimpleV0) {
519  myGamma = std::unique_ptr<xAOD::Vertex>( massFit(22, pairV0, vertex) );
520  if (myGamma && m_V0Tools->vertexProbability(myGamma.get()) >= m_minConstrVertProb) {
521  gamma_fit = 1;
522  gamma_prob = m_V0Tools->vertexProbability(myGamma.get());
523  gamma_mass = m_V0Tools->invariantMass(myGamma.get(),m_masse,m_masse);
524  gamma_massErr = m_V0Tools->invariantMassError(myGamma.get(),m_masse,m_masse);
525  }
526 
527  mDecor_gfit( *(v0Container->back()) ) = gamma_fit;
528  mDecor_gmass( *(v0Container->back()) ) = gamma_mass;
529  mDecor_gmasserr( *(v0Container->back()) ) = gamma_massErr;
530  mDecor_gprob( *(v0Container->back()) ) = gamma_prob;
531  }
532  }
533 
534  } // pointAtVert
535 
536  } // in mass window (doMassFit)
537 
538  } // chi2 cut failed
539  } else { // unconstrained fit failed
540  ATH_MSG_DEBUG("Fitter failed!");
541  }
542 
543  } // doFit
544 
545  i2++;
546  } // loop over negative tracks
547  i1++;
548  } // loop over positive tracks
549 
550  } // posTracks.size() > 0 && negTracks.size() > 0
551 
552  if (v0Container->empty()) ATH_MSG_DEBUG("No Candidates found. Empty container returned");
553  if (ksContainer->empty()) ATH_MSG_DEBUG("No Kshort Candidates found. Empty container returned");
554  if (laContainer->empty()) ATH_MSG_DEBUG("No Lambda Candidates found. Empty container returned");
555  if (lbContainer->empty()) ATH_MSG_DEBUG("No Lambdabar Candidates found. Empty container returned");
556 
557  return StatusCode::SUCCESS;
558 }
559 
561 {
562  msg(MSG::DEBUG)
563  << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg
564  << "\tSummary" << endmsg
565  << "\tProcessed : " << m_events_processed << " events" << endmsg
566  << "\tStored : " << m_V0s_stored << " V0s" << endmsg
567  << "\tof which : " << m_Kshort_stored << " Kshorts" << endmsg
568  << "\t : " << m_Lambda_stored << " Lambdas" << endmsg
569  << "\t : " << m_Lambdabar_stored << " Lambdabars" << endmsg;
570  msg(MSG::DEBUG) << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg;
571 
572  return StatusCode::SUCCESS;
573 }
574 
575 void InDetV0FinderTool::SGError(const std::string& errService) const
576 {
577  ATH_MSG_FATAL(errService << " not found. Exiting !");
578 }
579 
580 
581 bool InDetV0FinderTool::doFit(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2,
582  Amg::Vector3D &startingPoint, const EventContext& ctx) const
583 {
584  bool pass = false;
585  double srxy = startingPoint.perp();
586  if (srxy <= m_maxsxy)
587  {
588  double massKshort_i=2000001., massLambda_i=2000001., massLambdabar_i=2000001.;
589  const Amg::Vector3D& globalPosition = startingPoint;
590  Trk::PerigeeSurface perigeeSurface(globalPosition);
591  std::vector<std::unique_ptr<const Trk::TrackParameters> > cleanup;
592  const Trk::TrackParameters* extrapolatedPerigee1(nullptr);
593  const Trk::TrackParameters* extrapolatedPerigee2(nullptr);
594  extrapolatedPerigee1 = m_extrapolator->extrapolate(ctx,track1->perigeeParameters(), perigeeSurface).release();
595  if (extrapolatedPerigee1 == nullptr) extrapolatedPerigee1 = &track1->perigeeParameters();
596  else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee1));
597 
598  extrapolatedPerigee2 = m_extrapolator->extrapolate(ctx,track2->perigeeParameters(), perigeeSurface).release();
599  if (extrapolatedPerigee2 == nullptr) extrapolatedPerigee2 = &track2->perigeeParameters();
600  else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee2));
601 
602  if (extrapolatedPerigee1 != nullptr && extrapolatedPerigee2 != nullptr) {
603  massKshort_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_masspi);
604  massLambda_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_massp,m_masspi);
605  massLambdabar_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_massp);
606  if ( ((massKshort_i >= m_uksmin && massKshort_i <= m_uksmax) ||
607  (massLambda_i >= m_ulamin && massLambda_i <= m_ulamax) ||
608  (massLambdabar_i >= m_ulamin && massLambdabar_i <= m_ulamax)) ) pass = true;
609  }
610  }
611 
612  return pass;
613 }
614 
615 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const xAOD::VertexContainer * vertColl, const EventContext& ctx) const
616 {
617  bool pass = false;
618  int count = 0;
619  for (auto vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr )
620  {
621  const xAOD::Vertex* PV = (*vItr);
622  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
623  if (per1 == nullptr) continue;
624  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV->position() );
625  if (per2 == nullptr) continue;
626  double d0_1 = per1->parameters()[Trk::d0];
627  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
628  double d0_2 = per2->parameters()[Trk::d0];
629  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
630  if (std::abs(d0_1/sig_d0_1) > m_d0_cut &&
631  std::abs(d0_2/sig_d0_2) > m_d0_cut) return true;
632  if (++count >= m_maxPV) break;
633  }
634  return pass;
635 }
636 
637 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const xAOD::Vertex* PV, const EventContext& ctx) const
638 {
639  bool pass = false;
640  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
641  if (per1 == nullptr) return pass;
642  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV->position() );
643  if (per2 == nullptr) {
644  return pass;
645  }
646  double d0_1 = per1->parameters()[Trk::d0];
647  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
648  double d0_2 = per2->parameters()[Trk::d0];
649  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
650  if (std::abs(d0_1/sig_d0_1) > m_d0_cut &&
651  std::abs(d0_2/sig_d0_2) > m_d0_cut) pass = true;
652  return pass;
653 }
654 
655 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const Amg::Vector3D& PV, const EventContext& ctx) const
656 {
657  bool pass = false;
658  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV );
659  if (per1 == nullptr) return pass;
660  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV );
661  if (per2 == nullptr) {
662  return pass;
663  }
664  double d0_1 = per1->parameters()[Trk::d0];
665  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
666  double d0_2 = per2->parameters()[Trk::d0];
667  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
668  if (std::abs(d0_1/sig_d0_1) > m_d0_cut && std::abs(d0_2/sig_d0_2) > m_d0_cut) pass = true;
669  return pass;
670 }
671 
672 bool InDetV0FinderTool::pointAtVertex(const xAOD::Vertex* v0, const xAOD::Vertex* PV) const
673 {
674  bool pass = false;
675  double v0lxy = m_V0Tools->lxy(v0,PV);
676  double v0lxyError = m_V0Tools->lxyError(v0,PV);
677  double cos = m_V0Tools->cosTheta(v0,PV);
678  double v0a0xy = m_V0Tools->a0xy(v0,PV);
679  double v0a0z = m_V0Tools->a0z(v0,PV);
680  if (v0lxy/v0lxyError > m_vert_lxy_sig && cos > 0. &&
681  std::abs(v0a0xy) < m_vert_a0xy_cut && std::abs(v0a0z) < m_vert_a0z_cut &&
682  v0lxy < m_vert_lxy_cut) pass = true;
683  return pass;
684 }
685 
687 {
688  bool pass = false;
689  xAOD::VertexContainer::const_iterator vItr = vertColl->begin();
690  for ( vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr ) { if (pointAtVertex(v0,(*vItr))) return true; }
691  return pass;
692 }
693 
694 double InDetV0FinderTool::invariantMass(const Trk::TrackParameters* per1, const Trk::TrackParameters* per2, double m1, double m2)
695 {
696  double e1sq = per1->momentum().mag2() + m1*m1;
697  double e1 = (e1sq>0.) ? sqrt(e1sq) : 0.;
698  double e2sq = per2->momentum().mag2() + m2*m2;
699  double e2 = (e2sq>0.) ? sqrt(e2sq) : 0.;
700  double p = (per1->momentum()+per2->momentum()).mag();
701  double msq = (e1+e2+p)*(e1+e2-p);
702  double mass = (msq>0.) ? sqrt(msq) : 0.;
703  return mass;
704 }
705 
706 bool InDetV0FinderTool::doMassFit(xAOD::Vertex* vxCandidate, int pdgID) const
707 {
708  bool pass = false;
709  double mass = 1000000000.;
710  double error = 1000000001.;
711  bool in_mass_window = false;
712  double winmass_min = 0., winmass_max = 0.;
713 
714  if (pdgID == 310) {
715  winmass_min = m_ksmin;
716  winmass_max = m_ksmax;
717  mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_masspi);
718  error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_masspi);
719  if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
720  } else if (pdgID == 3122 || pdgID == -3122) {
721  winmass_min = m_lamin;
722  winmass_max = m_lamax;
723  if (pdgID == 3122) {
724  mass = m_V0Tools->invariantMass(vxCandidate,m_massp,m_masspi);
725  error = m_V0Tools->invariantMassError(vxCandidate,m_massp,m_masspi);
726  } else if (pdgID == -3122) {
727  mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_massp);
728  error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_massp);
729  }
730  if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
731  }
732  if (in_mass_window) pass = true;
733 
734  return pass;
735 }
736 
737 xAOD::Vertex* InDetV0FinderTool::massFit(int pdgID, const std::vector<const xAOD::TrackParticle*> &pairV0, const Amg::Vector3D &vertex) const
738 {
739  xAOD::Vertex* vxCandidate(nullptr);
740  std::vector<double> masses;
741  if (pdgID == 310) {
742  masses.push_back(m_masspi);
743  masses.push_back(m_masspi);
744  } else if (pdgID == 3122) {
745  masses.push_back(m_massp);
746  masses.push_back(m_masspi);
747  } else if (pdgID == -3122) {
748  masses.push_back(m_masspi);
749  masses.push_back(m_massp);
750  } else if (pdgID == 22) {
751  masses.push_back(m_masse);
752  masses.push_back(m_masse);
753  }
754 
755  if (pdgID == 22) {
756  vxCandidate = m_iGammaFitter->fit(pairV0, vertex);
757  }
758  if (pdgID == 310) {
759  if (m_useV0Fitter) {
760  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massK0S, nullptr, vertex);
761  } else {
762  vxCandidate = m_iKshortFitter->fit(pairV0, vertex);
763  }
764  }
765  if (pdgID == 3122) {
766  if (m_useV0Fitter) {
767  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massLambda, nullptr, vertex);
768  } else {
769  vxCandidate = m_iLambdaFitter->fit(pairV0, vertex);
770  }
771  }
772  if (pdgID == -3122) {
773  if (m_useV0Fitter) {
774  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massLambda, nullptr, vertex);
775  } else {
776  vxCandidate = m_iLambdabarFitter->fit(pairV0, vertex);
777  }
778  }
779 
780  return vxCandidate;
781 }
782 
784  const std::vector<const xAOD::TrackParticleContainer*>& trackcols) const
785 {
787  Link.setElement(tp);
788  bool elementSet = false;
789  if(trackcols.empty()){
790  Link.setStorableObject( *dynamic_cast<const xAOD::TrackParticleContainer*>( tp->container() ) );
791  elementSet = true;
792  } else {
793  for(const xAOD::TrackParticleContainer* trkcol : trackcols){
794  auto itr = std::find(trkcol->begin(), trkcol->end(), tp);
795  if(itr != trkcol->end()){
796  Link.setStorableObject(*trkcol, true);
797  elementSet = true;
798  break;
799  }
800  }
801  }
802  if(!elementSet) ATH_MSG_ERROR("Track was not found when linking");
803  return Link;
804 }
805 
806 
807 }//end of namespace InDet
808 
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
InDet::InDetV0FinderTool::m_vertexEstimator
PublicToolHandle< InDet::VertexPointEstimator > m_vertexEstimator
Definition: InDetV0FinderTool.h:139
V0Tools.h
InDet::InDetV0FinderTool::m_useorigin
BooleanProperty m_useorigin
= true only using tracks that have no vertex association (true)
Definition: InDetV0FinderTool.h:147
InDet::InDetV0FinderTool::m_ulamax
DoubleProperty m_ulamax
max Lambda mass, unconstrained fit (1200.
Definition: InDetV0FinderTool.h:166
InDet::InDetV0FinderTool::m_minVertProb
DoubleProperty m_minVertProb
Minimum vertex probability (0.0001)
Definition: InDetV0FinderTool.h:172
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::InDetV0FinderTool::m_beamSpotDecoKey
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamSpotDecoKey
Definition: InDetV0FinderTool.h:223
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDet::InDetV0FinderTool::m_mDecor_gprob
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gprob
Definition: InDetV0FinderTool.h:219
InDet::InDetV0FinderTool::m_massp
DoubleProperty m_massp
proton mass (938.272 MeV)
Definition: InDetV0FinderTool.h:157
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
InDet::InDetV0FinderTool::m_V0s_stored
std::atomic< unsigned int > m_V0s_stored
Definition: InDetV0FinderTool.h:181
InDet::InDetV0FinderTool::performSearch
StatusCode performSearch(xAOD::VertexContainer *v0Container, xAOD::VertexContainer *ksContainer, xAOD::VertexContainer *laContainer, xAOD::VertexContainer *lbContainer, const xAOD::Vertex *vertex, const xAOD::VertexContainer *vertColl, const EventContext &ctx) const
Definition: InDetV0FinderTool.cxx:180
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
InDet::InDetV0FinderTool::m_laKey
Gaudi::Property< std::string > m_laKey
Definition: InDetV0FinderTool.h:228
InDet::InDetV0FinderTool::m_uksmax
DoubleProperty m_uksmax
max Kshort mass, unconstrained fit (600.
Definition: InDetV0FinderTool.h:164
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::InDetV0FinderTool::m_masspi
DoubleProperty m_masspi
pion mass (139.57 MeV)
Definition: InDetV0FinderTool.h:156
xAOD::VxType::V0Vtx
@ V0Vtx
Vertex from V0 decay.
Definition: TrackingPrimitives.h:575
xAOD::Vertex_v1::trackParticleLinks
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
InDet::InDetV0FinderTool::m_uksmin
DoubleProperty m_uksmin
min Kshort mass, unconstrained fit (400.
Definition: InDetV0FinderTool.h:163
InDet::InDetV0FinderTool::m_ptTRT
DoubleProperty m_ptTRT
Minimum pT for TRT tracks (700.
Definition: InDetV0FinderTool.h:161
InDet::InDetV0FinderTool::m_lbKey
Gaudi::Property< std::string > m_lbKey
Definition: InDetV0FinderTool.h:230
InDet::InDetV0FinderTool::doMassFit
bool doMassFit(xAOD::Vertex *vxCandidate, int pdgID) const
Definition: InDetV0FinderTool.cxx:717
ParticleTest.tp
tp
Definition: ParticleTest.py:25
InDet::InDetV0FinderTool::m_v0LinksDecorkeylbb
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylbb
Definition: InDetV0FinderTool.h:211
InDet::InDetV0FinderTool::m_mDecor_gmasserr
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmasserr
Definition: InDetV0FinderTool.h:218
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
InDet::InDetV0FinderTool::m_vert_a0xy_cut
DoubleProperty m_vert_a0xy_cut
V0 |a0xy| wrt a vertex (<3.)
Definition: InDetV0FinderTool.h:177
InDet::InDetV0FinderTool::m_maxPV
Gaudi::Property< int > m_maxPV
Definition: InDetV0FinderTool.h:232
InDet::InDetV0FinderTool::~InDetV0FinderTool
~InDetV0FinderTool()
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::InDetV0FinderTool::m_useV0Fitter
BooleanProperty m_useV0Fitter
= true if using TrkV0Fitter, = false if using VKalVert (true)
Definition: InDetV0FinderTool.h:153
InDet::InDetV0FinderTool::m_concreteVertexFitter
const Trk::TrkV0VertexFitter * m_concreteVertexFitter
Definition: InDetV0FinderTool.h:205
InDet::InDetV0FinderTool::m_doSimpleV0
BooleanProperty m_doSimpleV0
= true equivalent to the old InDetSimpleV0Finder (false)
Definition: InDetV0FinderTool.h:146
InDet::InDetV0FinderTool::m_use_vertColl
BooleanProperty m_use_vertColl
= true select tracks wrt a vertex collection (false)
Definition: InDetV0FinderTool.h:150
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TrkVKalVrtFitter.h
InDet::InDetV0FinderTool::m_ksmin
DoubleProperty m_ksmin
min Kshort mass (400.
Definition: InDetV0FinderTool.h:167
InDet::InDetV0FinderTool::m_d0_cut
DoubleProperty m_d0_cut
track d0 significance wrt a vertex (>2.)
Definition: InDetV0FinderTool.h:174
InDet::InDetV0FinderTool::m_partPropSvc
ServiceHandle< IPartPropSvc > m_partPropSvc
Definition: InDetV0FinderTool.h:236
InDet::InDetV0FinderTool::finalize
StatusCode finalize()
Definition: InDetV0FinderTool.cxx:571
InDet::InDetV0FinderTool::m_vert_lxy_cut
DoubleProperty m_vert_lxy_cut
V0 lxy V0 lxy (<500.)
Definition: InDetV0FinderTool.h:176
InDet::InDetV0FinderTool::invariantMass
static double invariantMass(const Trk::TrackParameters *per1, const Trk::TrackParameters *per2, double m1, double m2)
Definition: InDetV0FinderTool.cxx:705
xAOD::Vertex_v1::setVertexType
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
InDet::InDetV0FinderTool::m_particleDataTable
const HepPDT::ParticleDataTable * m_particleDataTable
Definition: InDetV0FinderTool.h:144
InDet::InDetV0FinderTool::m_vertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Definition: InDetV0FinderTool.h:207
xAOD::Vertex_v1::addTrackAtVertex
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
Definition: Vertex_v1.cxx:314
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
python.changerun.m1
m1
Definition: changerun.py:32
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
InDet::InDetV0FinderTool::m_events_processed
std::atomic< unsigned int > m_events_processed
Definition: InDetV0FinderTool.h:180
InDet::InDetV0FinderTool::m_iKshortFitter
PublicToolHandle< Trk::IVertexFitter > m_iKshortFitter
Definition: InDetV0FinderTool.h:125
parseMapping.v0
def v0
Definition: parseMapping.py:149
InDet::InDetV0FinderTool::m_Kshort_stored
std::atomic< unsigned int > m_Kshort_stored
Definition: InDetV0FinderTool.h:182
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::InDetV0FinderTool::m_Lambdabar_stored
std::atomic< unsigned int > m_Lambdabar_stored
Definition: InDetV0FinderTool.h:184
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
InDet::InDetV0FinderTool::m_iLambdabarFitter
PublicToolHandle< Trk::IVertexFitter > m_iLambdabarFitter
Definition: InDetV0FinderTool.h:129
WriteDecorHandle.h
Handle class for adding a decoration to an object.
InDet::InDetV0FinderTool::m_iVertexFitter
PublicToolHandle< Trk::IVertexFitter > m_iVertexFitter
Definition: InDetV0FinderTool.h:121
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::InDetV0FinderTool::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: InDetV0FinderTool.h:221
InDetV0FinderTool.h
InDet::InDetV0FinderTool::m_trackToVertexTool
PublicToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Definition: InDetV0FinderTool.h:135
xAOD::Vertex_v1::clearTracks
void clearTracks()
Remove all tracks from the vertex.
Definition: Vertex_v1.cxx:331
InDet::InDetV0FinderTool::m_v0_lbLinksDecorkey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_lbLinksDecorkey
Definition: InDetV0FinderTool.h:214
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::InDetV0FinderTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: InDetV0FinderTool.h:222
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::InDetV0FinderTool::m_errmass
DoubleProperty m_errmass
Maximum mass error (100.
Definition: InDetV0FinderTool.h:171
InDet::InDetV0FinderTool::m_v0_ksLinksDecorkey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_ksLinksDecorkey
Definition: InDetV0FinderTool.h:212
InDet::InDetV0FinderTool::m_masses
IntegerProperty m_masses
= 1 if using PDG values, = 2 if user set (1)
Definition: InDetV0FinderTool.h:155
InDet::InDetV0FinderTool::m_mDecor_gmass
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmass
Definition: InDetV0FinderTool.h:217
jobOptions.beam
beam
Definition: jobOptions.SuperChic_ALP2.py:16
InDet::InDetV0FinderTool::m_v0_laLinksDecorkey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_laLinksDecorkey
Definition: InDetV0FinderTool.h:213
InDet::InDetV0FinderTool::initialize
StatusCode initialize()
Definition: InDetV0FinderTool.cxx:54
InDet::InDetV0FinderTool::m_maxsxy
DoubleProperty m_maxsxy
Maximum Rxy of starting point (1000.
Definition: InDetV0FinderTool.h:162
InDet::InDetV0FinderTool::m_ulamin
DoubleProperty m_ulamin
min Lambda mass, unconstrained fit (1000.
Definition: InDetV0FinderTool.h:165
InDet::InDetV0FinderTool::InDetV0FinderTool
InDetV0FinderTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: InDetV0FinderTool.cxx:45
InDet::InDetV0FinderTool::doFit
bool doFit(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, Amg::Vector3D &startingPoint, const EventContext &ctx) const
Definition: InDetV0FinderTool.cxx:592
Trk::d0
@ d0
Definition: ParamDefs.h:63
InDet::InDetV0FinderTool::m_v0Key
Gaudi::Property< std::string > m_v0Key
Definition: InDetV0FinderTool.h:226
InDet::InDetV0FinderTool::m_useBeamSpotCond
Gaudi::Property< bool > m_useBeamSpotCond
Definition: InDetV0FinderTool.h:224
charge
double charge(const T &p)
Definition: AtlasPID.h:538
InDet::InDetV0FinderTool::makeLink
ElementLink< xAOD::TrackParticleContainer > makeLink(const xAOD::TrackParticle *, const std::vector< const xAOD::TrackParticleContainer * > &) const
Definition: InDetV0FinderTool.cxx:794
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
InDet::InDetV0FinderTool::m_useTRTplusTRT
BooleanProperty m_useTRTplusTRT
= use TRT+TRT pairs (true)
Definition: InDetV0FinderTool.h:151
InDet::InDetV0FinderTool::m_iLambdaFitter
PublicToolHandle< Trk::IVertexFitter > m_iLambdaFitter
Definition: InDetV0FinderTool.h:127
InDet::InDetV0FinderTool::m_v0LinksDecorkeyks
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeyks
Definition: InDetV0FinderTool.h:209
InDet::InDetV0FinderTool::pointAtVertex
bool pointAtVertex(const xAOD::Vertex *v0, const xAOD::Vertex *PV) const
Definition: InDetV0FinderTool.cxx:683
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::InDetV0FinderTool::d0Pass
bool d0Pass(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, const xAOD::VertexContainer *vertColl, const EventContext &ctx) const
Definition: InDetV0FinderTool.cxx:626
InDet::InDetV0FinderTool::m_vert_a0z_cut
DoubleProperty m_vert_a0z_cut
V0 |a0z| wrt a vertex (<15.)
Definition: InDetV0FinderTool.h:178
TrkV0VertexFitter.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
InDet::InDetV0FinderTool::m_lamin
DoubleProperty m_lamin
min Lambda mass (1000.
Definition: InDetV0FinderTool.h:169
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
Trk::TrkV0VertexFitter::fit
virtual xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &vectorTrk, const Amg::Vector3D &startingPoint) const override
Interface for xAOD::TrackParticle with Amg::Vector3D starting point.
Definition: TrkV0VertexFitter.cxx:83
InDet::InDetV0FinderTool::m_massLambda
DoubleProperty m_massLambda
Lambda mass (1115.68 MeV)
Definition: InDetV0FinderTool.h:160
InDet::InDetV0FinderTool::pointAtVertexColl
bool pointAtVertexColl(xAOD::Vertex *v0, const xAOD::VertexContainer *vertColl) const
Definition: InDetV0FinderTool.cxx:697
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDet::InDetV0FinderTool::m_useTRTplusSi
BooleanProperty m_useTRTplusSi
= use TRT+Si pairs (true)
Definition: InDetV0FinderTool.h:152
InDet::InDetV0FinderTool::m_lamax
DoubleProperty m_lamax
max Lambda mass (1200.
Definition: InDetV0FinderTool.h:170
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDet::InDetV0FinderTool::m_samesign
BooleanProperty m_samesign
= true select tracks with same sign (false)
Definition: InDetV0FinderTool.h:148
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::InDetV0FinderTool::m_Gamma_stored
std::atomic< unsigned int > m_Gamma_stored
Definition: InDetV0FinderTool.h:185
InDet::InDetV0FinderTool::m_ksKey
Gaudi::Property< std::string > m_ksKey
Definition: InDetV0FinderTool.h:227
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetV0FinderTool::m_minConstrVertProb
DoubleProperty m_minConstrVertProb
Minimum vertex probability for constrained fit (0.0001)
Definition: InDetV0FinderTool.h:173
InDet::InDetV0FinderTool::m_trackParticleKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey
Definition: InDetV0FinderTool.h:118
InDet::InDetV0FinderTool::m_pv
BooleanProperty m_pv
= true select tracks wrt primary vertex (false)
Definition: InDetV0FinderTool.h:149
InDet::InDetV0FinderTool::massFit
xAOD::Vertex * massFit(int pdgID, const std::vector< const xAOD::TrackParticle * > &pairV0, const Amg::Vector3D &vertex) const
Definition: InDetV0FinderTool.cxx:748
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
InDet::InDetV0FinderTool::SGError
void SGError(const std::string &errService) const
Definition: InDetV0FinderTool.cxx:586
ReadDecorHandle.h
Handle class for reading a decoration on an object.
InDet::InDetV0FinderTool::m_masse
DoubleProperty m_masse
electron mass (0.510999 MeV)
Definition: InDetV0FinderTool.h:158
str
Definition: BTagTrackIpAccessor.cxx:11
InDet::InDetV0FinderTool::m_vert_lxy_sig
DoubleProperty m_vert_lxy_sig
V0 lxy significance wrt a vertex (>2.)
Definition: InDetV0FinderTool.h:175
Trk::TrkV0VertexFitter
This class implements a vertex fitting algorithm optimised for V0 finding.
Definition: TrkV0VertexFitter.h:40
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDet::InDetV0FinderTool::m_massK0S
DoubleProperty m_massK0S
Kshort mass (497.672 MeV)
Definition: InDetV0FinderTool.h:159
InDet::InDetV0FinderTool::m_mDecor_gfit
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gfit
Definition: InDetV0FinderTool.h:216
InDet::InDetV0FinderTool::m_trkSelector
PublicToolHandle< Trk::ITrackSelectorTool > m_trkSelector
Definition: InDetV0FinderTool.h:137
AthAlgTool
Definition: AthAlgTool.h:26
InDet::InDetV0FinderTool::m_ksmax
DoubleProperty m_ksmax
max Kshort mass (600.
Definition: InDetV0FinderTool.h:168
InDet::InDetV0FinderTool::m_iGammaFitter
PublicToolHandle< Trk::IVertexFitter > m_iGammaFitter
Definition: InDetV0FinderTool.h:131
InDet::InDetV0FinderTool::m_V0Tools
PublicToolHandle< Trk::V0Tools > m_V0Tools
Definition: InDetV0FinderTool.h:133
error
Definition: IImpactPoint3dEstimator.h:70
InDet::InDetV0FinderTool::m_v0LinksDecorkeylb
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylb
Definition: InDetV0FinderTool.h:210
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrackingPrimitives.h
InDet::InDetV0FinderTool::m_RelinkContainers
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_RelinkContainers
Definition: InDetV0FinderTool.h:233
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
InDet::InDetV0FinderTool::m_extrapolator
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: InDetV0FinderTool.h:141
HepMCHelpers.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SUSY_SimplifiedModel_PreInclude.masses
dictionary masses
Definition: SUSY_SimplifiedModel_PreInclude.py:7
InDet::InDetV0FinderTool::m_Lambda_stored
std::atomic< unsigned int > m_Lambda_stored
Definition: InDetV0FinderTool.h:183
InDet::InDetV0FinderTool::m_iVKVertexFitter
PublicToolHandle< Trk::IVertexFitter > m_iVKVertexFitter
Definition: InDetV0FinderTool.h:123