ATLAS Offline Software
InDetV0FinderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 
24 
27 
29 
30 #include "GaudiKernel/IPartPropSvc.h"
31 
33 #include "HepPDT/ParticleDataTable.hh"
38 #include <vector>
39 #include <cmath>
40 
41 namespace InDet
42 {
43 
44 InDetV0FinderTool::InDetV0FinderTool(const std::string& t, const std::string& n, const IInterface* p)
45  :
46  AthAlgTool(t,n,p),
47  m_iVertexFitter("Trk::V0VertexFitter"),
48  m_iVKVertexFitter("Trk::TrkVKalVrtFitter"),
49  m_iKshortFitter("Trk::TrkVKalVrtFitter"),
50  m_iLambdaFitter("Trk::TrkVKalVrtFitter"),
51  m_iLambdabarFitter("Trk::TrkVKalVrtFitter"),
52  m_iGammaFitter("Trk::TrkVKalVrtFitter"),
53  m_V0Tools("Trk::V0Tools"),
54  m_trackToVertexTool("Reco::TrackToVertex"),
55  m_trkSelector("InDet::TrackSelectorTool"),
56  m_vertexEstimator("InDet::VertexPointEstimator"),
57  m_extrapolator("Trk::Extrapolator"),
58  m_particleDataTable(nullptr),
59  m_doSimpleV0(false),
60  m_useorigin(true),
61  m_samesign(false),
62  m_pv(false),
63  m_use_vertColl(false),
64  m_useTRTplusTRT(false),
65  m_useTRTplusSi(false),
66  m_useV0Fitter(false),
67  m_masses(1),
68  m_masspi(139.57),
69  m_massp(938.272),
70  m_masse(0.510999),
71  m_massK0S(497.672),
72  m_massLambda(1115.68),
73  m_ptTRT(700.),
74  m_maxsxy(1000.),
75  m_uksmin(400.),
76  m_uksmax(600.),
77  m_ulamin(1000.),
78  m_ulamax(1200.),
79  m_ksmin(400.),
80  m_ksmax(600.),
81  m_lamin(1000.),
82  m_lamax(1200.),
83  m_errmass(100.),
84  m_minVertProb(0.0001),
85  m_minConstrVertProb(0.0001),
86  m_d0_cut(2.),
87  m_vert_lxy_sig(2.),
88  m_vert_lxy_cut(500.),
89  m_vert_a0xy_cut(3.),
90  m_vert_a0z_cut(15.)
91 {
92  declareInterface<InDetV0FinderTool>(this);
93  declareProperty("VertexFitterTool", m_iVertexFitter);
94  declareProperty("VKVertexFitterTool", m_iVKVertexFitter);
95  declareProperty("KshortFitterTool", m_iKshortFitter);
96  declareProperty("LambdaFitterTool", m_iLambdaFitter);
97  declareProperty("LambdabarFitterTool", m_iLambdabarFitter);
98  declareProperty("GammaFitterTool", m_iGammaFitter);
99  declareProperty("V0Tools",m_V0Tools);
100  declareProperty("TrackToVertexTool",m_trackToVertexTool);
101  declareProperty("TrackSelectorTool", m_trkSelector);
102  declareProperty("VertexPointEstimator", m_vertexEstimator);
103  declareProperty("Extrapolator", m_extrapolator);
104  declareProperty("doSimpleV0", m_doSimpleV0);
105  declareProperty("useorigin", m_useorigin);
106  declareProperty("AddSameSign", m_samesign);
107  declareProperty("trkSelPV", m_pv);
108  declareProperty("useVertexCollection", m_use_vertColl);
109  declareProperty("useTRTplusTRT", m_useTRTplusTRT);
110  declareProperty("useTRTplusSi", m_useTRTplusSi);
111  declareProperty("useV0Fitter", m_useV0Fitter);
112  declareProperty("masses", m_masses);
113  declareProperty("masspi", m_masspi);
114  declareProperty("massp", m_massp);
115  declareProperty("masse", m_masse);
116  declareProperty("massK0S", m_massK0S);
117  declareProperty("massLambda", m_massLambda);
118  declareProperty("ptTRT", m_ptTRT);
119  declareProperty("maxsxy", m_maxsxy);
120  declareProperty("uksmin", m_uksmin);
121  declareProperty("uksmax", m_uksmax);
122  declareProperty("ulamin", m_ulamin);
123  declareProperty("ulamax", m_ulamax);
124  declareProperty("ksmin", m_ksmin);
125  declareProperty("ksmax", m_ksmax);
126  declareProperty("lamin", m_lamin);
127  declareProperty("lamax", m_lamax);
128  declareProperty("errmass", m_errmass);
129  declareProperty("minVertProb", m_minVertProb);
130  declareProperty("minConstrVertProb", m_minConstrVertProb);
131  declareProperty("d0_cut", m_d0_cut );
132  declareProperty("vert_lxy_sig", m_vert_lxy_sig );
133  declareProperty("vert_lxy_cut", m_vert_lxy_cut );
134  declareProperty("vert_a0xy_cut", m_vert_a0xy_cut );
135  declareProperty("vert_a0z_cut", m_vert_a0z_cut );
136 
137  declareProperty("V0Linkks", m_v0LinksDecorkeyks);
138  declareProperty("V0Linklb", m_v0LinksDecorkeylb);
139  declareProperty("V0Linklbb", m_v0LinksDecorkeylbb);
140  declareProperty("KshortLink", m_v0_ksLinksDecorkey);
141  declareProperty("LambdaLink", m_v0_laLinksDecorkey);
142  declareProperty("LambdabarLink", m_v0_lbLinksDecorkey);
143 
144  declareProperty("gamma_fit", m_mDecor_gfit);
145  declareProperty("gamma_mass", m_mDecor_gmass);
146  declareProperty("gamma_massError", m_mDecor_gmasserr);
147  declareProperty("gamma_probability", m_mDecor_gprob);
148 }
149 
151 
153 {
155 
156  // Get the right vertex fitting tool from ToolSvc
157  if (m_useV0Fitter) {
158  ATH_CHECK( m_iVertexFitter.retrieve() );
159  ATH_MSG_DEBUG( "Retrieved tool " << m_iVertexFitter);
160  } else {
161  ATH_CHECK( m_iVKVertexFitter.retrieve() );
162  ATH_MSG_DEBUG("Retrieved tool " << m_iVKVertexFitter);
163 
164  // Get the VKalVrt Ks vertex fitting tool from ToolSvc
165  ATH_CHECK( m_iKshortFitter.retrieve() );
166  ATH_MSG_DEBUG("Retrieved tool " << m_iKshortFitter);
167 
168  // Get the VKalVrt Lambda vertex fitting tool from ToolSvc
169  ATH_CHECK( m_iLambdaFitter.retrieve() );
170  ATH_MSG_DEBUG( "Retrieved tool " << m_iLambdaFitter);
171 
172  // Get the VKalVrt Lambdabar vertex fitting tool from ToolSvc
173  ATH_CHECK( m_iLambdabarFitter.retrieve() );
174  ATH_MSG_DEBUG("Retrieved tool " << m_iLambdabarFitter);
175  }
176 
177  ATH_CHECK( m_iGammaFitter.retrieve() );
178  ATH_MSG_DEBUG("Retrieved tool " << m_iGammaFitter);
179 
180  // get the Particle Properties Service
181  IPartPropSvc* partPropSvc = nullptr;
182  ATH_CHECK( service("PartPropSvc", partPropSvc, true) );
183  m_particleDataTable = partPropSvc->PDT();
184 
185  // uploading the V0 tools
186  ATH_CHECK( m_V0Tools.retrieve() );
187  ATH_MSG_DEBUG("Retrieved tool " << m_V0Tools);
188 
189  // Get the TrackToVertex extrapolator tool
190  ATH_CHECK( m_trackToVertexTool.retrieve() );
191 
192  // Get the extrapolator
193  ATH_CHECK( m_extrapolator.retrieve() );
194  ATH_MSG_DEBUG("Retrieved tool ");
195 
196  // Initialize vertex container key
197  ATH_CHECK( m_vertexKey.initialize() );
198 
199  m_v0LinksDecorkeyks = m_ksKey + ".V0Link";
200  m_v0LinksDecorkeylb = m_laKey + ".V0Link";
201  m_v0LinksDecorkeylbb = m_lbKey + ".V0Link";
202  m_v0_ksLinksDecorkey = m_v0Key + ".KshortLink";
203  m_v0_laLinksDecorkey = m_v0Key + ".LambdaLink";
204  m_v0_lbLinksDecorkey = m_v0Key + ".LambdabarLink";
205  ATH_MSG_DEBUG("m_v0_lbLinksDecorkey = " << m_v0_lbLinksDecorkey.key());
206  ATH_MSG_DEBUG("m_v0_laLinksDecorkey = " << m_v0_laLinksDecorkey.key());
207  ATH_MSG_DEBUG("m_v0_ksLinksDecorkey = " << m_v0_ksLinksDecorkey.key());
208  ATH_MSG_DEBUG("m_v0LinksDecorkeyks = " << m_v0LinksDecorkeyks.key());
209  ATH_CHECK( m_v0LinksDecorkeyks.initialize());
210  ATH_CHECK( m_v0LinksDecorkeylb.initialize());
211  ATH_CHECK( m_v0LinksDecorkeylbb.initialize());
212  ATH_CHECK( m_v0_ksLinksDecorkey.initialize());
213  ATH_CHECK( m_v0_laLinksDecorkey.initialize());
214  ATH_CHECK( m_v0_lbLinksDecorkey.initialize());
215 
216  m_mDecor_gfit = m_v0Key + ".gamma_fit";
217  m_mDecor_gmass = m_v0Key + ".gamma_mass";
218  m_mDecor_gmasserr = m_v0Key + ".gamma_massError";
219  m_mDecor_gprob = m_v0Key + ".gamma_probability";
220  ATH_CHECK( m_mDecor_gfit.initialize());
221  ATH_CHECK( m_mDecor_gmass.initialize());
222  ATH_CHECK( m_mDecor_gmasserr.initialize());
223  ATH_CHECK( m_mDecor_gprob.initialize());
224 
227  if(!m_useBeamSpotCond){
228  for (const std::string beam : {"beamPosX", "beamPosY", "beamPosZ"}) {
229  m_beamSpotDecoKey.emplace_back(m_eventInfo_key.key() + "."+beam);
230  }
231  }
233 
234 // Get the track selector tool from ToolSvc
235  ATH_CHECK( m_trkSelector.retrieve() );
236  ATH_MSG_DEBUG("Retrieved tool " << m_trkSelector);
237 
238 // Get the vertex point estimator tool from ToolSvc
239  ATH_CHECK( m_vertexEstimator.retrieve() );
240  ATH_MSG_DEBUG("Retrieved tool " << m_vertexEstimator);
241 
242  const HepPDT::ParticleData* pd_pi = m_particleDataTable->particle(MC::PIPLUS);
243  const HepPDT::ParticleData* pd_p = m_particleDataTable->particle(MC::PROTON);
244  const HepPDT::ParticleData* pd_e = m_particleDataTable->particle(MC::ELECTRON);
245  const HepPDT::ParticleData* pd_K = m_particleDataTable->particle(MC::K0S);
246  const HepPDT::ParticleData* pd_L = m_particleDataTable->particle(MC::LAMBDA0);
247  if (m_masses == 1) {
248  m_masspi = pd_pi->mass();
249  m_massp = pd_p->mass();
250  m_masse = pd_e->mass();
251  m_massK0S = pd_K->mass();
252  m_massLambda = pd_L->mass();
253  }
254 
255  m_events_processed = 0;
256  m_V0s_stored = 0;
257  m_Kshort_stored = 0;
258  m_Lambdabar_stored = 0;
259  m_Lambda_stored = 0;
260  m_Gamma_stored = 0;
261 
262 // making a concrete fitter for the V0Fitter
263  m_concreteVertexFitter = nullptr;
264  if (m_useV0Fitter) {
265  m_concreteVertexFitter = dynamic_cast<Trk::TrkV0VertexFitter * >(&(*m_iVertexFitter));
266  if (m_concreteVertexFitter == nullptr) {
267  ATH_MSG_FATAL("The vertex fitter passed is not a V0 Vertex Fitter");
268  return StatusCode::FAILURE;
269  }
270  }
271 
272  ATH_CHECK(m_RelinkContainers.initialize());
273 
274  ATH_MSG_DEBUG( "Initialization successful" );
275 
276  return StatusCode::SUCCESS;
277 }
278 
280  xAOD::VertexContainer* ksContainer,
281  xAOD::VertexContainer* laContainer,
282  xAOD::VertexContainer* lbContainer,
283  const xAOD::Vertex* primaryVertex,
284  const xAOD::VertexContainer* vertColl,
285  const EventContext& ctx
286  ) const
287 {
288 
289  ATH_MSG_DEBUG( "InDetV0FinderTool::performSearch" );
290  std::vector<const xAOD::TrackParticleContainer*> trackCols;
291  for(const auto &str : m_RelinkContainers){
293  trackCols.push_back(handle.cptr());
294  }
295 
297 
298 // Retrieve track particles from StoreGate
300  if ( !TPC.isValid() )
301  {
302  ATH_MSG_ERROR("Input TrackParticle collection is invalid!");
303  return StatusCode::SUCCESS;
304  }
305  ATH_MSG_DEBUG("Track particle container size " << TPC->size());
306 
307  if (m_use_vertColl) {
308  ATH_MSG_DEBUG("Vertex container size " << vertColl->size());
309  }
310  Amg::Vector3D beamspot;
311  if(m_useBeamSpotCond){
312  auto beamSpotHandle = SG::ReadCondHandle(m_beamSpotKey, ctx);
313  beamspot = beamSpotHandle->beamPos();
314  }else{
318  beamspot = Amg::Vector3D(beamPosX(0), beamPosY(0), beamPosZ(0));
319  }
320 // track preselection
321  std::vector<const xAOD::TrackParticle*> posTracks; posTracks.clear();
322  std::vector<const xAOD::TrackParticle*> negTracks; negTracks.clear();
323  const xAOD::Vertex* vx = nullptr;
324  if (m_pv && primaryVertex) vx = primaryVertex;
325 
326  if (TPC->size() > 1) {
328  for ( tpIt=TPC->begin(); tpIt!=TPC->end(); ++tpIt )
329  {
330  const xAOD::TrackParticle* TP = (*tpIt);
331  double charge = TP->charge();
332 
333  if (m_trkSelector->decision(*TP, vx))
334  {
335  if (m_samesign) {
336  posTracks.push_back(TP);
337  negTracks.push_back(TP);
338  } else {
339  if (charge > 0) {
340  posTracks.push_back(*tpIt);
341  } else {
342  negTracks.push_back(*tpIt);
343  }
344  }
345  }
346  }
347  }
348  ATH_MSG_DEBUG("number of tracks passing preselection, positive " << posTracks.size() << " negative " << negTracks.size());
349 
350  if (!posTracks.empty() && !negTracks.empty())
351  {
353  if (!vertices.isValid())
354  {
355  ATH_MSG_WARNING("Primary vertex container with key " << m_vertexKey.key() << " not found");
356  return StatusCode::SUCCESS;
357  }
358 
369 
370  std::vector<const xAOD::TrackParticle*>::const_iterator tpIt1;
371  std::vector<const xAOD::TrackParticle*>::const_iterator tpIt2;
372  unsigned int i1 = 0;
373  for (tpIt1 = posTracks.begin(); tpIt1 != posTracks.end(); ++tpIt1)
374  {
375  const xAOD::TrackParticle* TP1 = (*tpIt1);
376  uint8_t temp1(0);
377  uint8_t nclus1(0);
378  if ( TP1->summaryValue( temp1 , xAOD::numberOfPixelHits) ) nclus1 += temp1;
379  if ( TP1->summaryValue( temp1 , xAOD::numberOfSCTHits) ) nclus1 += temp1;
380  double pt1 = TP1->pt();
381 
382  const xAOD::Vertex* foundVertex1 { nullptr };
383  if (m_useorigin)
384  {
385  for (const auto *const vx : *vertices)
386  {
387  for (const auto& tpLink : vx->trackParticleLinks())
388  {
389  if (*tpLink == TP1)
390  {
391  foundVertex1 = vx;
392  break;
393  }
394  }
395  if (foundVertex1) break;
396  }
397  }
398  unsigned int i2 = 0;
399  for (tpIt2 = negTracks.begin(); tpIt2 != negTracks.end(); ++tpIt2)
400  {
401  if (*tpIt1 == *tpIt2) continue;
402  if (m_samesign && i1 <= i2) continue;
403 
404  const xAOD::TrackParticle* TP2 = (*tpIt2);
405  uint8_t temp2(0);
406  uint8_t nclus2(0);
407  if ( TP2->summaryValue( temp2 , xAOD::numberOfPixelHits) ) nclus2 += temp2;
408  if ( TP2->summaryValue( temp2 , xAOD::numberOfSCTHits) ) nclus2 += temp2;
409  ATH_MSG_DEBUG("nclus1 " << (int)nclus1 << " nclus2 " << (int)nclus2);
410 
411  if (!m_useTRTplusTRT && nclus1 == 0 && nclus2 == 0) continue;
412  if (!m_useTRTplusSi && (nclus1 == 0 || nclus2 == 0)) continue;
413 
414  double pt2 = TP2->pt();
415 
416  const xAOD::Vertex* foundVertex2 { nullptr };
417  if (m_useorigin)
418  {
419  for (const auto *const vx : *vertices)
420  {
421  for (const auto& tpLink : vx->trackParticleLinks())
422  {
423  if (*tpLink == TP2)
424  {
425  foundVertex2 = vx;
426  break;
427  }
428  }
429  if (foundVertex2) break;
430  }
431  }
432  bool usepair = false;
433  if (!m_useorigin) usepair = true;
434  if (m_useorigin && foundVertex1 == nullptr && foundVertex2 == nullptr) usepair = true;
435  if (!usepair) continue;
436 
437  bool trk_cut1 = false;
438  bool trk_cut2 = false;
439  if (nclus1 != 0) trk_cut1 = true;
440  if (nclus1 == 0 && pt1 >= m_ptTRT) trk_cut1 = true;
441  if (!trk_cut1) continue;
442  if (nclus2 != 0) trk_cut2 = true;
443  if (nclus2 == 0 && pt2 >= m_ptTRT) trk_cut2 = true;
444  if (!trk_cut2) continue;
445 
446 // find a starting point
447  const Trk::Perigee& aPerigee1 = TP1->perigeeParameters();
448  const Trk::Perigee& aPerigee2 = TP2->perigeeParameters();
449  int sflag = 0;
450  int errorcode = 0;
451  Amg::Vector3D startingPoint = m_vertexEstimator->getCirclesIntersectionPoint(&aPerigee1,&aPerigee2,sflag,errorcode);
452  if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
453  bool errorCode = false;
454  if (errorcode == 0 || errorcode == 5 || errorcode == 6 || errorcode == 8) errorCode = true;
455  if (!errorCode) continue;
456 
457  bool d0wrtVertex = true;
458  if (m_use_vertColl) {
459  if ( !d0Pass(TP1,TP2,vertColl, ctx) ) d0wrtVertex = false;
460  }
461  if (!m_use_vertColl && m_pv) {
462  if (primaryVertex) {
463  if ( !d0Pass(TP1,TP2,primaryVertex, ctx) ) d0wrtVertex = false;
464  } else {
465  if ( !d0Pass(TP1,TP2,beamspot, ctx) ) d0wrtVertex = false;
466  }
467  }
468  if (!d0wrtVertex) continue;
469 
470 
471 // pair pre-selection cuts
472  if ( doFit(TP1,TP2,startingPoint, ctx) )
473  {
474  std::vector<const xAOD::TrackParticle*> pairV0;
475  pairV0.clear();
476  pairV0.push_back(TP1);
477  pairV0.push_back(TP2);
478 
479 // vertex fit
480  ATH_MSG_DEBUG("unconstrained fit now");
481 
482  std::unique_ptr<xAOD::Vertex> myVxCandidate;
483  if (m_useV0Fitter) {
484  myVxCandidate = std::unique_ptr<xAOD::Vertex>( m_concreteVertexFitter->fit(pairV0, startingPoint) );
485  } else {
486  myVxCandidate = std::unique_ptr<xAOD::Vertex>( m_iVKVertexFitter->fit(pairV0, startingPoint) );
487  }
488 
489  if (myVxCandidate)
490  {
491  myVxCandidate->setVertexType(xAOD::VxType::V0Vtx);
492  if ( m_V0Tools->vertexProbability(myVxCandidate.get()) >= m_minVertProb )
493  {
494  bool doKshortFit = false;
495  doKshortFit = doMassFit(myVxCandidate.get(),310);
496  bool doLambdaFit = false;
497  doLambdaFit = doMassFit(myVxCandidate.get(),3122);
498  bool doLambdabarFit = false;
499  doLambdabarFit = doMassFit(myVxCandidate.get(),-3122);
500  if (doKshortFit || doLambdaFit || doLambdabarFit)
501  {
502  bool pointAtVert = true;
503  if (m_use_vertColl) {
504  if ( !pointAtVertexColl(myVxCandidate.get(),vertColl) ) pointAtVert = false;
505  }
506  if (!m_use_vertColl && m_pv && primaryVertex) {
507  if ( !pointAtVertex(myVxCandidate.get(),primaryVertex) ) pointAtVert = false;
508  }
509  if (m_doSimpleV0) pointAtVert = true;
510  if (pointAtVert)
511  {
512  Amg::Vector3D vertex = m_V0Tools->vtx(myVxCandidate.get());
513 
514  std::unique_ptr<xAOD::Vertex> myKshort;
515  std::unique_ptr<xAOD::Vertex> myLambda;
516  std::unique_ptr<xAOD::Vertex> myLambdabar;
517  std::unique_ptr<xAOD::Vertex> myGamma;
518  bool foundKshort = false;
519  bool foundLambda = false;
520  bool foundLambdabar = false;
521 
522  if (doKshortFit && !m_doSimpleV0) {
523  myKshort = std::unique_ptr<xAOD::Vertex>( massFit(310, pairV0, vertex) );
524  if (myKshort) {
525  if (m_V0Tools->vertexProbability(myKshort.get()) >= m_minConstrVertProb) {
527  foundKshort = true;
528  }
529  }
530  }
531 
532  if (doLambdaFit && !m_doSimpleV0) {
533  myLambda = std::unique_ptr<xAOD::Vertex>( massFit(3122, pairV0, vertex) );
534  if (myLambda) {
535  if (m_V0Tools->vertexProbability(myLambda.get()) >= m_minConstrVertProb) {
537  foundLambda = true;
538  }
539  }
540  }
541 
542  if (doLambdabarFit && !m_doSimpleV0) {
543  myLambdabar = std::unique_ptr<xAOD::Vertex>( massFit(-3122, pairV0, vertex));
544  if (myLambdabar) {
545  if (m_V0Tools->vertexProbability(myLambdabar.get()) >= m_minConstrVertProb) {
546  myLambdabar->setVertexType(xAOD::VxType::V0Vtx);
547  foundLambdabar = true;
548  }
549  }
550  }
551 
552  bool doGamma = false;
553  int gamma_fit = 0;
554  double gamma_prob = -1., gamma_mass = -1., gamma_massErr = -1.;
555  if (foundKshort || foundLambda || foundLambdabar) doGamma = true;
556 
561 
562  if (m_doSimpleV0 || (!m_doSimpleV0 && doGamma)) {
563  m_V0s_stored++;
564  myVxCandidate->clearTracks();
565  ElementLink<xAOD::TrackParticleContainer> newLink1 = makeLink(*tpIt1, trackCols);
566  ElementLink<xAOD::TrackParticleContainer> newLink2 = makeLink(*tpIt2, trackCols);
567  myVxCandidate->addTrackAtVertex(newLink1);
568  myVxCandidate->addTrackAtVertex(newLink2);
569  v0Container->push_back(myVxCandidate.release());
570 
571  if (foundKshort && !m_doSimpleV0) {
572  m_Kshort_stored++;
573  myKshort->clearTracks();
574  ElementLink<xAOD::TrackParticleContainer> ksLink1 = makeLink(*tpIt1, trackCols);
575  ElementLink<xAOD::TrackParticleContainer> ksLink2 = makeLink(*tpIt2, trackCols);
576  myKshort->addTrackAtVertex(ksLink1);
577  myKshort->addTrackAtVertex(ksLink2);
578  ksContainer->push_back(myKshort.release());
579 
580  v0Link.setElement(v0Container->back());
581  v0Link.setStorableObject(*v0Container);
582  v0LinksDecorks(*(ksContainer->back())) = v0Link;
583 
584  ksLink.setElement(ksContainer->back());
585  ksLink.setStorableObject(*ksContainer);
586  v0_ksLinksDecor(*(v0Container->back())) = ksLink;
587  } else {
588  v0_ksLinksDecor(*(v0Container->back())) = ksLink;
589  }
590  if (foundLambda && !m_doSimpleV0) {
591  m_Lambda_stored++;
592  myLambda->clearTracks();
593  ElementLink<xAOD::TrackParticleContainer> laLink1 = makeLink(*tpIt1, trackCols);
594  ElementLink<xAOD::TrackParticleContainer> laLink2 = makeLink(*tpIt2, trackCols);
595  myLambda->addTrackAtVertex(laLink1);
596  myLambda->addTrackAtVertex(laLink2);
597  laContainer->push_back(myLambda.release());
598 
599  v0Link.setElement(v0Container->back());
600  v0Link.setStorableObject(*v0Container);
601  v0LinksDecorlb(*(laContainer->back())) = v0Link;
602 
603  laLink.setElement(laContainer->back());
604  laLink.setStorableObject(*laContainer);
605  v0_laLinksDecor(*(v0Container->back())) = laLink;
606  } else {
607  v0_laLinksDecor(*(v0Container->back())) = laLink;
608  }
609  if (foundLambdabar && !m_doSimpleV0) {
611  myLambdabar->clearTracks();
612  ElementLink<xAOD::TrackParticleContainer> lbLink1 = makeLink(*tpIt1, trackCols);
613  ElementLink<xAOD::TrackParticleContainer> lbLink2 = makeLink(*tpIt2, trackCols);
614  myLambdabar->addTrackAtVertex(lbLink1);
615  myLambdabar->addTrackAtVertex(lbLink2);
616  lbContainer->push_back(myLambdabar.release());
617 
618  v0Link.setElement(v0Container->back());
619  v0Link.setStorableObject(*v0Container);
620  v0LinksDecorlbb(*(lbContainer->back())) = v0Link;
621 
622  lbLink.setElement(lbContainer->back());
623  lbLink.setStorableObject(*lbContainer);
624  v0_lbLinksDecor(*(v0Container->back())) = lbLink;
625  } else {
626  v0_lbLinksDecor(*(v0Container->back())) = lbLink;
627  }
628  if (doGamma && !m_doSimpleV0) {
629  myGamma = std::unique_ptr<xAOD::Vertex>( massFit(22, pairV0, vertex) );
630  if (myGamma && m_V0Tools->vertexProbability(myGamma.get()) >= m_minConstrVertProb) {
631  gamma_fit = 1;
632  gamma_prob = m_V0Tools->vertexProbability(myGamma.get());
633  gamma_mass = m_V0Tools->invariantMass(myGamma.get(),m_masse,m_masse);
634  gamma_massErr = m_V0Tools->invariantMassError(myGamma.get(),m_masse,m_masse);
635  }
636 
637  mDecor_gfit( *(v0Container->back()) ) = gamma_fit;
638  mDecor_gmass( *(v0Container->back()) ) = gamma_mass;
639  mDecor_gmasserr( *(v0Container->back()) ) = gamma_massErr;
640  mDecor_gprob( *(v0Container->back()) ) = gamma_prob;
641  }
642  }
643 
644  } // pointAtVert
645 
646  } // in mass window (doMassFit)
647 
648  } // chi2 cut failed
649  } else { // unconstrained fit failed
650  ATH_MSG_DEBUG("Fitter failed!");
651  }
652 
653  } // doFit
654 
655  i2++;
656  } // loop over negative tracks
657  i1++;
658  } // loop over positive tracks
659 
660  } // posTracks.size() > 0 && negTracks.size() > 0
661 
662  if (v0Container->empty()) ATH_MSG_DEBUG("No Candidates found. Empty container returned");
663  if (ksContainer->empty()) ATH_MSG_DEBUG("No Kshort Candidates found. Empty container returned");
664  if (laContainer->empty()) ATH_MSG_DEBUG("No Lambda Candidates found. Empty container returned");
665  if (lbContainer->empty()) ATH_MSG_DEBUG("No Lambdabar Candidates found. Empty container returned");
666 
667  return StatusCode::SUCCESS;
668 }
669 
671 {
672  msg(MSG::DEBUG)
673  << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg
674  << "\tSummary" << endmsg
675  << "\tProcessed : " << m_events_processed << " events" << endmsg
676  << "\tStored : " << m_V0s_stored << " V0s" << endmsg
677  << "\tof which : " << m_Kshort_stored << " Kshorts" << endmsg
678  << "\t : " << m_Lambda_stored << " Lambdas" << endmsg
679  << "\t : " << m_Lambdabar_stored << " Lambdabars" << endmsg;
680  msg(MSG::DEBUG) << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg;
681 
682  return StatusCode::SUCCESS;
683 }
684 
685 void InDetV0FinderTool::SGError(const std::string& errService) const
686 {
687  ATH_MSG_FATAL(errService << " not found. Exiting !");
688 }
689 
690 
691 bool InDetV0FinderTool::doFit(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2,
692  Amg::Vector3D &startingPoint, const EventContext& ctx) const
693 {
694  bool pass = false;
695  double srxy = startingPoint.perp();
696  if (srxy <= m_maxsxy)
697  {
698  double massKshort_i=2000001., massLambda_i=2000001., massLambdabar_i=2000001.;
699  const Amg::Vector3D& globalPosition = startingPoint;
700  Trk::PerigeeSurface perigeeSurface(globalPosition);
701  std::vector<std::unique_ptr<const Trk::TrackParameters> > cleanup;
702  const Trk::TrackParameters* extrapolatedPerigee1(nullptr);
703  const Trk::TrackParameters* extrapolatedPerigee2(nullptr);
704  extrapolatedPerigee1 = m_extrapolator->extrapolate(ctx,track1->perigeeParameters(), perigeeSurface).release();
705  if (extrapolatedPerigee1 == nullptr) extrapolatedPerigee1 = &track1->perigeeParameters();
706  else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee1));
707 
708  extrapolatedPerigee2 = m_extrapolator->extrapolate(ctx,track2->perigeeParameters(), perigeeSurface).release();
709  if (extrapolatedPerigee2 == nullptr) extrapolatedPerigee2 = &track2->perigeeParameters();
710  else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee2));
711 
712  if (extrapolatedPerigee1 != nullptr && extrapolatedPerigee2 != nullptr) {
713  massKshort_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_masspi);
714  massLambda_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_massp,m_masspi);
715  massLambdabar_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_massp);
716  if ( ((massKshort_i >= m_uksmin && massKshort_i <= m_uksmax) ||
717  (massLambda_i >= m_ulamin && massLambda_i <= m_ulamax) ||
718  (massLambdabar_i >= m_ulamin && massLambdabar_i <= m_ulamax)) ) pass = true;
719  }
720  }
721 
722  return pass;
723 }
724 
725 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const xAOD::VertexContainer * vertColl, const EventContext& ctx) const
726 {
727  bool pass = false;
728  int count = 0;
729  for (auto vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr )
730  {
731  const xAOD::Vertex* PV = (*vItr);
732  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
733  if (per1 == nullptr) continue;
734  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV->position() );
735  if (per2 == nullptr) continue;
736  double d0_1 = per1->parameters()[Trk::d0];
737  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
738  double d0_2 = per2->parameters()[Trk::d0];
739  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
740  if (std::abs(d0_1/sig_d0_1) > m_d0_cut &&
741  std::abs(d0_2/sig_d0_2) > m_d0_cut) return true;
742  if (++count >= m_maxPV) break;
743  }
744  return pass;
745 }
746 
747 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const xAOD::Vertex* PV, const EventContext& ctx) const
748 {
749  bool pass = false;
750  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
751  if (per1 == nullptr) return pass;
752  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV->position() );
753  if (per2 == nullptr) {
754  return pass;
755  }
756  double d0_1 = per1->parameters()[Trk::d0];
757  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
758  double d0_2 = per2->parameters()[Trk::d0];
759  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
760  if (std::abs(d0_1/sig_d0_1) > m_d0_cut &&
761  std::abs(d0_2/sig_d0_2) > m_d0_cut) pass = true;
762  return pass;
763 }
764 
765 bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const Amg::Vector3D& PV, const EventContext& ctx) const
766 {
767  bool pass = false;
768  auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV );
769  if (per1 == nullptr) return pass;
770  auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV );
771  if (per2 == nullptr) {
772  return pass;
773  }
774  double d0_1 = per1->parameters()[Trk::d0];
775  double sig_d0_1 = sqrt((*per1->covariance())(0,0));
776  double d0_2 = per2->parameters()[Trk::d0];
777  double sig_d0_2 = sqrt((*per2->covariance())(0,0));
778  if (std::abs(d0_1/sig_d0_1) > m_d0_cut && std::abs(d0_2/sig_d0_2) > m_d0_cut) pass = true;
779  return pass;
780 }
781 
782 bool InDetV0FinderTool::pointAtVertex(const xAOD::Vertex* v0, const xAOD::Vertex* PV) const
783 {
784  bool pass = false;
785  double v0lxy = m_V0Tools->lxy(v0,PV);
786  double v0lxyError = m_V0Tools->lxyError(v0,PV);
787  double cos = m_V0Tools->cosTheta(v0,PV);
788  double v0a0xy = m_V0Tools->a0xy(v0,PV);
789  double v0a0z = m_V0Tools->a0z(v0,PV);
790  if (v0lxy/v0lxyError > m_vert_lxy_sig && cos > 0. &&
791  std::abs(v0a0xy) < m_vert_a0xy_cut && std::abs(v0a0z) < m_vert_a0z_cut &&
792  v0lxy < m_vert_lxy_cut) pass = true;
793  return pass;
794 }
795 
797 {
798  bool pass = false;
799  xAOD::VertexContainer::const_iterator vItr = vertColl->begin();
800  for ( vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr ) { if (pointAtVertex(v0,(*vItr))) return true; }
801  return pass;
802 }
803 
804 double InDetV0FinderTool::invariantMass(const Trk::TrackParameters* per1, const Trk::TrackParameters* per2, double m1, double m2)
805 {
806  double e1sq = per1->momentum().mag2() + m1*m1;
807  double e1 = (e1sq>0.) ? sqrt(e1sq) : 0.;
808  double e2sq = per2->momentum().mag2() + m2*m2;
809  double e2 = (e2sq>0.) ? sqrt(e2sq) : 0.;
810  double p = (per1->momentum()+per2->momentum()).mag();
811  double msq = (e1+e2+p)*(e1+e2-p);
812  double mass = (msq>0.) ? sqrt(msq) : 0.;
813  return mass;
814 }
815 
816 bool InDetV0FinderTool::doMassFit(xAOD::Vertex* vxCandidate, int pdgID) const
817 {
818  bool pass = false;
819  double mass = 1000000000.;
820  double error = 1000000001.;
821  bool in_mass_window = false;
822  double winmass_min = 0., winmass_max = 0.;
823 
824  if (pdgID == 310) {
825  winmass_min = m_ksmin;
826  winmass_max = m_ksmax;
827  mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_masspi);
828  error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_masspi);
829  if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
830  } else if (pdgID == 3122 || pdgID == -3122) {
831  winmass_min = m_lamin;
832  winmass_max = m_lamax;
833  if (pdgID == 3122) {
834  mass = m_V0Tools->invariantMass(vxCandidate,m_massp,m_masspi);
835  error = m_V0Tools->invariantMassError(vxCandidate,m_massp,m_masspi);
836  } else if (pdgID == -3122) {
837  mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_massp);
838  error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_massp);
839  }
840  if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
841  }
842  if (in_mass_window) pass = true;
843 
844  return pass;
845 }
846 
847 xAOD::Vertex* InDetV0FinderTool::massFit(int pdgID, const std::vector<const xAOD::TrackParticle*> &pairV0, const Amg::Vector3D &vertex) const
848 {
849  xAOD::Vertex* vxCandidate(nullptr);
850  std::vector<double> masses;
851  if (pdgID == 310) {
852  masses.push_back(m_masspi);
853  masses.push_back(m_masspi);
854  } else if (pdgID == 3122) {
855  masses.push_back(m_massp);
856  masses.push_back(m_masspi);
857  } else if (pdgID == -3122) {
858  masses.push_back(m_masspi);
859  masses.push_back(m_massp);
860  } else if (pdgID == 22) {
861  masses.push_back(m_masse);
862  masses.push_back(m_masse);
863  }
864 
865  if (pdgID == 22) {
866  vxCandidate = m_iGammaFitter->fit(pairV0, vertex);
867  }
868  if (pdgID == 310) {
869  if (m_useV0Fitter) {
870  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massK0S, nullptr, vertex);
871  } else {
872  vxCandidate = m_iKshortFitter->fit(pairV0, vertex);
873  }
874  }
875  if (pdgID == 3122) {
876  if (m_useV0Fitter) {
877  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massLambda, nullptr, vertex);
878  } else {
879  vxCandidate = m_iLambdaFitter->fit(pairV0, vertex);
880  }
881  }
882  if (pdgID == -3122) {
883  if (m_useV0Fitter) {
884  vxCandidate = m_concreteVertexFitter->fit(pairV0, masses, m_massLambda, nullptr, vertex);
885  } else {
886  vxCandidate = m_iLambdabarFitter->fit(pairV0, vertex);
887  }
888  }
889 
890  return vxCandidate;
891 }
892 
894  const std::vector<const xAOD::TrackParticleContainer*>& trackcols) const
895 {
897  Link.setElement(tp);
898  bool elementSet = false;
899  if(trackcols.empty()){
900  Link.setStorableObject( *dynamic_cast<const xAOD::TrackParticleContainer*>( tp->container() ) );
901  elementSet = true;
902  } else {
903  for(const xAOD::TrackParticleContainer* trkcol : trackcols){
904  auto itr = std::find(trkcol->begin(), trkcol->end(), tp);
905  if(itr != trkcol->end()){
906  Link.setStorableObject(*trkcol, true);
907  elementSet = true;
908  break;
909  }
910  }
911  }
912  if(!elementSet) ATH_MSG_ERROR("Track was not found when linking");
913  return Link;
914 }
915 
916 
917 }//end of namespace InDet
918 
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
V0Tools.h
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:212
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:208
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
InDet::InDetV0FinderTool::m_V0s_stored
std::atomic< unsigned int > m_V0s_stored
Definition: InDetV0FinderTool.h:170
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:290
InDet::InDetV0FinderTool::m_iLambdaFitter
ToolHandle< Trk::IVertexFitter > m_iLambdaFitter
Definition: InDetV0FinderTool.h:125
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDet::InDetV0FinderTool::m_vert_lxy_sig
double m_vert_lxy_sig
V0 lxy significance wrt a vertex (>2.)
Definition: InDetV0FinderTool.h:164
VertexPointEstimator.h
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
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
InDet::InDetV0FinderTool::m_maxsxy
double m_maxsxy
Maximum Rxy of starting point (1000.
Definition: InDetV0FinderTool.h:151
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
InDet::InDetV0FinderTool::m_laKey
Gaudi::Property< std::string > m_laKey
Definition: InDetV0FinderTool.h:217
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
InDet::InDetV0FinderTool::m_pv
bool m_pv
= true select tracks wrt primary vertex (false)
Definition: InDetV0FinderTool.h:139
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
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_lbKey
Gaudi::Property< std::string > m_lbKey
Definition: InDetV0FinderTool.h:219
InDet::InDetV0FinderTool::m_useTRTplusTRT
bool m_useTRTplusTRT
= use TRT+TRT pairs (true)
Definition: InDetV0FinderTool.h:141
InDet::InDetV0FinderTool::doMassFit
bool doMassFit(xAOD::Vertex *vxCandidate, int pdgID) const
Definition: InDetV0FinderTool.cxx:827
ParticleTest.tp
tp
Definition: ParticleTest.py:25
InDet::InDetV0FinderTool::m_v0LinksDecorkeylbb
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylbb
Definition: InDetV0FinderTool.h:200
InDet::InDetV0FinderTool::m_errmass
double m_errmass
Maximum mass error (100.
Definition: InDetV0FinderTool.h:160
InDet::InDetV0FinderTool::m_mDecor_gmasserr
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmasserr
Definition: InDetV0FinderTool.h:207
IExtrapolator.h
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
InDet::InDetV0FinderTool::m_lamax
double m_lamax
max Lambda mass (1200.
Definition: InDetV0FinderTool.h:159
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
InDet::InDetV0FinderTool::m_maxPV
Gaudi::Property< int > m_maxPV
Definition: InDetV0FinderTool.h:221
InDet::InDetV0FinderTool::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Definition: InDetV0FinderTool.h:129
InDet::InDetV0FinderTool::m_massK0S
double m_massK0S
Kshort mass (497.672 MeV)
Definition: InDetV0FinderTool.h:148
InDet::InDetV0FinderTool::~InDetV0FinderTool
~InDetV0FinderTool()
InDet::InDetV0FinderTool::m_minConstrVertProb
double m_minConstrVertProb
Minimum vertex probability for constrained fit (0.0001)
Definition: InDetV0FinderTool.h:162
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_uksmin
double m_uksmin
min Kshort mass, unconstrained fit (400.
Definition: InDetV0FinderTool.h:152
InDet::InDetV0FinderTool::m_concreteVertexFitter
const Trk::TrkV0VertexFitter * m_concreteVertexFitter
Definition: InDetV0FinderTool.h:194
InDet::InDetV0FinderTool::m_d0_cut
double m_d0_cut
track d0 significance wrt a vertex (>2.)
Definition: InDetV0FinderTool.h:163
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
InDet::InDetV0FinderTool::m_massLambda
double m_massLambda
Lambda mass (1115.68 MeV)
Definition: InDetV0FinderTool.h:149
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TrkVKalVrtFitter.h
InDet::InDetV0FinderTool::finalize
StatusCode finalize()
Definition: InDetV0FinderTool.cxx:681
InDet::InDetV0FinderTool::m_masse
double m_masse
electron mass (0.510999 MeV)
Definition: InDetV0FinderTool.h:147
InDet::InDetV0FinderTool::invariantMass
static double invariantMass(const Trk::TrackParameters *per1, const Trk::TrackParameters *per2, double m1, double m2)
Definition: InDetV0FinderTool.cxx:815
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:134
InDet::InDetV0FinderTool::m_vertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Definition: InDetV0FinderTool.h:196
InDet::InDetV0FinderTool::m_ksmax
double m_ksmax
max Kshort mass (600.
Definition: InDetV0FinderTool.h:157
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
InDet::InDetV0FinderTool::m_V0Tools
ToolHandle< Trk::V0Tools > m_V0Tools
Definition: InDetV0FinderTool.h:128
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
InDet::InDetV0FinderTool::m_vert_lxy_cut
double m_vert_lxy_cut
V0 lxy V0 lxy (<500.)
Definition: InDetV0FinderTool.h:165
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_ptTRT
double m_ptTRT
Minimum pT for TRT tracks (700.
Definition: InDetV0FinderTool.h:150
InDet::InDetV0FinderTool::m_events_processed
std::atomic< unsigned int > m_events_processed
Definition: InDetV0FinderTool.h:169
parseMapping.v0
def v0
Definition: parseMapping.py:149
InDet::InDetV0FinderTool::m_Kshort_stored
std::atomic< unsigned int > m_Kshort_stored
Definition: InDetV0FinderTool.h:171
InDet::InDetV0FinderTool::m_minVertProb
double m_minVertProb
Minimum vertex probability (0.0001)
Definition: InDetV0FinderTool.h:161
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:173
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WriteDecorHandle.h
Handle class for adding a decoration to an object.
InDet::InDetV0FinderTool::m_ksmin
double m_ksmin
min Kshort mass (400.
Definition: InDetV0FinderTool.h:156
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::InDetV0FinderTool::m_masses
int m_masses
= 1 if using PDG values, = 2 if user set (1)
Definition: InDetV0FinderTool.h:144
InDet::InDetV0FinderTool::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: InDetV0FinderTool.h:210
InDetV0FinderTool.h
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:203
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:211
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
InDet::InDetV0FinderTool::m_iGammaFitter
ToolHandle< Trk::IVertexFitter > m_iGammaFitter
Definition: InDetV0FinderTool.h:127
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::InDetV0FinderTool::m_v0_ksLinksDecorkey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_ksLinksDecorkey
Definition: InDetV0FinderTool.h:201
InDet::InDetV0FinderTool::m_mDecor_gmass
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmass
Definition: InDetV0FinderTool.h:206
jobOptions.beam
beam
Definition: jobOptions.SuperChic_ALP2.py:16
InDet::InDetV0FinderTool::m_v0_laLinksDecorkey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_laLinksDecorkey
Definition: InDetV0FinderTool.h:202
InDet::InDetV0FinderTool::initialize
StatusCode initialize()
Definition: InDetV0FinderTool.cxx:163
InDet::InDetV0FinderTool::m_use_vertColl
bool m_use_vertColl
= true select tracks wrt a vertex collection (false)
Definition: InDetV0FinderTool.h:140
ITrackToVertex.h
InDet::InDetV0FinderTool::m_iKshortFitter
ToolHandle< Trk::IVertexFitter > m_iKshortFitter
Definition: InDetV0FinderTool.h:124
InDet::InDetV0FinderTool::InDetV0FinderTool
InDetV0FinderTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: InDetV0FinderTool.cxx:55
InDet::InDetV0FinderTool::doFit
bool doFit(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, Amg::Vector3D &startingPoint, const EventContext &ctx) const
Definition: InDetV0FinderTool.cxx:702
InDet::InDetV0FinderTool::m_useV0Fitter
bool m_useV0Fitter
= true if using TrkV0Fitter, = false if using VKalVert (true)
Definition: InDetV0FinderTool.h:143
Trk::d0
@ d0
Definition: ParamDefs.h:69
InDet::InDetV0FinderTool::m_v0Key
Gaudi::Property< std::string > m_v0Key
Definition: InDetV0FinderTool.h:215
InDet::InDetV0FinderTool::m_useBeamSpotCond
Gaudi::Property< bool > m_useBeamSpotCond
Definition: InDetV0FinderTool.h:213
InDet::InDetV0FinderTool::m_trkSelector
ToolHandle< Trk::ITrackSelectorTool > m_trkSelector
Definition: InDetV0FinderTool.h:130
charge
double charge(const T &p)
Definition: AtlasPID.h:494
InDet::InDetV0FinderTool::makeLink
ElementLink< xAOD::TrackParticleContainer > makeLink(const xAOD::TrackParticle *, const std::vector< const xAOD::TrackParticleContainer * > &) const
Definition: InDetV0FinderTool.cxx:904
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
InDet::InDetV0FinderTool::m_v0LinksDecorkeyks
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeyks
Definition: InDetV0FinderTool.h:198
InDet::InDetV0FinderTool::m_lamin
double m_lamin
min Lambda mass (1000.
Definition: InDetV0FinderTool.h:158
InDet::InDetV0FinderTool::m_useorigin
bool m_useorigin
= true only using tracks that have no vertex association (true)
Definition: InDetV0FinderTool.h:137
InDet::InDetV0FinderTool::pointAtVertex
bool pointAtVertex(const xAOD::Vertex *v0, const xAOD::Vertex *PV) const
Definition: InDetV0FinderTool.cxx:793
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IVertexFitter.h
InDet::InDetV0FinderTool::d0Pass
bool d0Pass(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, const xAOD::VertexContainer *vertColl, const EventContext &ctx) const
Definition: InDetV0FinderTool.cxx:736
InDet::InDetV0FinderTool::m_ulamax
double m_ulamax
max Lambda mass, unconstrained fit (1200.
Definition: InDetV0FinderTool.h:155
InDet::InDetV0FinderTool::m_vert_a0z_cut
double m_vert_a0z_cut
V0 |a0z| wrt a vertex (<15.)
Definition: InDetV0FinderTool.h:167
TrkV0VertexFitter.h
InDet::InDetV0FinderTool::m_iLambdabarFitter
ToolHandle< Trk::IVertexFitter > m_iLambdabarFitter
Definition: InDetV0FinderTool.h:126
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
InDet::InDetV0FinderTool::m_vert_a0xy_cut
double m_vert_a0xy_cut
V0 |a0xy| wrt a vertex (<3.)
Definition: InDetV0FinderTool.h:166
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
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_samesign
bool m_samesign
= true select tracks with same sign (false)
Definition: InDetV0FinderTool.h:138
VertexContainer.h
InDet::InDetV0FinderTool::pointAtVertexColl
bool pointAtVertexColl(xAOD::Vertex *v0, const xAOD::VertexContainer *vertColl) const
Definition: InDetV0FinderTool.cxx:807
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
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::InDetV0FinderTool::m_Gamma_stored
std::atomic< unsigned int > m_Gamma_stored
Definition: InDetV0FinderTool.h:174
InDet::InDetV0FinderTool::m_ksKey
Gaudi::Property< std::string > m_ksKey
Definition: InDetV0FinderTool.h:216
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetV0FinderTool::m_iVertexFitter
ToolHandle< Trk::IVertexFitter > m_iVertexFitter
Definition: InDetV0FinderTool.h:122
InDet::InDetV0FinderTool::m_trackParticleKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey
Definition: InDetV0FinderTool.h:119
InDet::InDetV0FinderTool::massFit
xAOD::Vertex * massFit(int pdgID, const std::vector< const xAOD::TrackParticle * > &pairV0, const Amg::Vector3D &vertex) const
Definition: InDetV0FinderTool.cxx:858
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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:696
ReadDecorHandle.h
Handle class for reading a decoration on an object.
InDet::InDetV0FinderTool::m_doSimpleV0
bool m_doSimpleV0
= true equivalent to the old InDetSimpleV0Finder (false)
Definition: InDetV0FinderTool.h:136
str
Definition: BTagTrackIpAccessor.cxx:11
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_mDecor_gfit
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gfit
Definition: InDetV0FinderTool.h:205
AthAlgTool
Definition: AthAlgTool.h:26
InDet::InDetV0FinderTool::m_iVKVertexFitter
ToolHandle< Trk::IVertexFitter > m_iVKVertexFitter
Definition: InDetV0FinderTool.h:123
ITrackSelectorTool.h
InDet::InDetV0FinderTool::m_uksmax
double m_uksmax
max Kshort mass, unconstrained fit (600.
Definition: InDetV0FinderTool.h:153
InDet::InDetV0FinderTool::m_ulamin
double m_ulamin
min Lambda mass, unconstrained fit (1000.
Definition: InDetV0FinderTool.h:154
error
Definition: IImpactPoint3dEstimator.h:70
InDet::InDetV0FinderTool::m_v0LinksDecorkeylb
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylb
Definition: InDetV0FinderTool.h:199
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:222
InDet::InDetV0FinderTool::m_vertexEstimator
ToolHandle< InDet::VertexPointEstimator > m_vertexEstimator
Definition: InDetV0FinderTool.h:131
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:25
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
InDet::InDetV0FinderTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: InDetV0FinderTool.h:132
InDet::InDetV0FinderTool::m_useTRTplusSi
bool m_useTRTplusSi
= use TRT+Si pairs (true)
Definition: InDetV0FinderTool.h:142
HepMCHelpers.h
InDet::InDetV0FinderTool::m_masspi
double m_masspi
pion mass (139.57 MeV)
Definition: InDetV0FinderTool.h:145
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDet::InDetV0FinderTool::m_massp
double m_massp
proton mass (938.272 MeV)
Definition: InDetV0FinderTool.h:146
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:172