ATLAS Offline Software
Loading...
Searching...
No Matches
InDetV0FinderTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 handles from caller
15
16 ***************************************************************************/
17
22
28#include <vector>
29#include <cmath>
30#include <stdexcept>
31
32namespace InDet
33{
34
35InDetV0FinderTool::InDetV0FinderTool(const std::string& t, const std::string& n, const IInterface* p)
36 :
37 AthAlgTool(t,n,p)
38{
39 declareInterface<InDetV0FinderTool>(this);
40}
41
43
45{
46 ATH_CHECK( m_trackParticleKey.initialize() );
47
48 // Get the right vertex fitting tool from ToolSvc
49 if (m_useV0Fitter) {
50 ATH_CHECK( m_iVertexFitter.retrieve() );
51 ATH_MSG_DEBUG( "Retrieved tool " << m_iVertexFitter);
52 } else {
53 ATH_CHECK( m_iVKVertexFitter.retrieve() );
54 ATH_MSG_DEBUG("Retrieved tool " << m_iVKVertexFitter);
55
56 // Get the VKalVrt Ks vertex fitting tool from ToolSvc
57 ATH_CHECK( m_iKshortFitter.retrieve() );
58 ATH_MSG_DEBUG("Retrieved tool " << m_iKshortFitter);
59
60 // Get the VKalVrt Lambda vertex fitting tool from ToolSvc
61 ATH_CHECK( m_iLambdaFitter.retrieve() );
62 ATH_MSG_DEBUG( "Retrieved tool " << m_iLambdaFitter);
63
64 // Get the VKalVrt Lambdabar vertex fitting tool from ToolSvc
65 ATH_CHECK( m_iLambdabarFitter.retrieve() );
66 ATH_MSG_DEBUG("Retrieved tool " << m_iLambdabarFitter);
67 }
68
69 ATH_CHECK( m_iGammaFitter.retrieve() );
70 ATH_MSG_DEBUG("Retrieved tool " << m_iGammaFitter);
71
72
73
74 // uploading the V0 tools
75 ATH_CHECK( m_V0Tools.retrieve() );
76 ATH_MSG_DEBUG("Retrieved tool " << m_V0Tools);
77
78 // Get the TrackToVertex extrapolator tool
79 ATH_CHECK( m_trackToVertexTool.retrieve() );
80
81 // Get the extrapolator
82 ATH_CHECK( m_extrapolator.retrieve() );
83 ATH_MSG_DEBUG("Retrieved tool ");
84
85 // Initialize vertex container key
86 ATH_CHECK( m_vertexKey.initialize() );
87
88 m_v0LinksDecorkeyks = m_ksKey + ".V0Link";
89 m_v0LinksDecorkeylb = m_laKey + ".V0Link";
90 m_v0LinksDecorkeylbb = m_lbKey + ".V0Link";
91 m_v0_ksLinksDecorkey = m_v0Key + ".KshortLink";
92 m_v0_laLinksDecorkey = m_v0Key + ".LambdaLink";
93 m_v0_lbLinksDecorkey = m_v0Key + ".LambdabarLink";
94 ATH_MSG_DEBUG("m_v0_lbLinksDecorkey = " << m_v0_lbLinksDecorkey.key());
95 ATH_MSG_DEBUG("m_v0_laLinksDecorkey = " << m_v0_laLinksDecorkey.key());
96 ATH_MSG_DEBUG("m_v0_ksLinksDecorkey = " << m_v0_ksLinksDecorkey.key());
97 ATH_MSG_DEBUG("m_v0LinksDecorkeyks = " << m_v0LinksDecorkeyks.key());
98 ATH_CHECK( m_v0LinksDecorkeyks.initialize());
99 ATH_CHECK( m_v0LinksDecorkeylb.initialize());
100 ATH_CHECK( m_v0LinksDecorkeylbb.initialize());
101 ATH_CHECK( m_v0_ksLinksDecorkey.initialize());
102 ATH_CHECK( m_v0_laLinksDecorkey.initialize());
103 ATH_CHECK( m_v0_lbLinksDecorkey.initialize());
104
105 m_mDecor_gfit = m_v0Key + ".gamma_fit";
106 m_mDecor_gmass = m_v0Key + ".gamma_mass";
107 m_mDecor_gmasserr = m_v0Key + ".gamma_massError";
108 m_mDecor_gprob = m_v0Key + ".gamma_probability";
109 ATH_CHECK( m_mDecor_gfit.initialize());
110 ATH_CHECK( m_mDecor_gmass.initialize());
111 ATH_CHECK( m_mDecor_gmasserr.initialize());
112 ATH_CHECK( m_mDecor_gprob.initialize());
113
114 m_v0_BDTScore = m_v0Key + ".BDTScore";
115
116 ATH_MSG_DEBUG("m_v0_BDTScore = " << m_v0_BDTScore.key());
117 ATH_CHECK( m_v0_BDTScore.initialize());
118
119
120 if (m_useBDT){
121 std::string BDTPathName = "InDetV0FinderTool/BDT/v1/" + m_BDTFile;
122 std::string fullPathToFile = PathResolverFindCalibFile(BDTPathName);
123 ATH_MSG_DEBUG("Using BDT File: " << fullPathToFile);
124 std::unique_ptr<TFile> rootFile(TFile::Open(fullPathToFile.c_str(), "READ"));
125 std::string strBDTName = "xgboost";
126 std::unique_ptr<TTree> training( (TTree*)rootFile->Get(strBDTName.c_str()) );
127 m_BDT = std::make_unique<MVAUtils::BDT>(training.get());
128 }
129
133
134// Get the track selector tool from ToolSvc
135 ATH_CHECK( m_trkSelector.retrieve() );
136 ATH_MSG_DEBUG("Retrieved tool " << m_trkSelector);
137
138// Get the vertex point estimator tool from ToolSvc
139 ATH_CHECK( m_vertexEstimator.retrieve() );
140 ATH_MSG_DEBUG("Retrieved tool " << m_vertexEstimator);
141
142 if (m_masses == 1) {
143 auto gendata = std::make_shared<GenData>();
144 m_masspi = gendata->particleMass(MC::PIPLUS).value();
145 m_massp = gendata->particleMass(MC::PROTON).value();
146 m_masse = gendata->particleMass(MC::ELECTRON).value();
147 m_massK0S = gendata->particleMass(MC::K0S).value();
148 m_massLambda = gendata->particleMass(MC::LAMBDA0).value();
149 }
150
152 m_V0s_stored = 0;
153 m_Kshort_stored = 0;
155 m_Lambda_stored = 0;
156 m_Gamma_stored = 0;
157
158// making a concrete fitter for the V0Fitter
159 m_concreteVertexFitter = nullptr;
160 if (m_useV0Fitter) {
161 m_concreteVertexFitter = dynamic_cast<Trk::TrkV0VertexFitter * >(&(*m_iVertexFitter));
162 if (m_concreteVertexFitter == nullptr) {
163 ATH_MSG_FATAL("The vertex fitter passed is not a V0 Vertex Fitter");
164 return StatusCode::FAILURE;
165 }
166 }
167
168 ATH_CHECK(m_RelinkContainers.initialize());
169
170 ATH_MSG_DEBUG( "Initialization successful" );
171
172 return StatusCode::SUCCESS;
173}
174
176 xAOD::VertexContainer* ksContainer,
177 xAOD::VertexContainer* laContainer,
178 xAOD::VertexContainer* lbContainer,
179 const xAOD::Vertex* primaryVertex,
180 const xAOD::VertexContainer* vertColl,
181 const EventContext& ctx
182 ) const
183{
184
185 ATH_MSG_DEBUG( "InDetV0FinderTool::performSearch" );
186 std::vector<const xAOD::TrackParticleContainer*> trackCols;
187 for(const auto &str : m_RelinkContainers){
189 trackCols.push_back(handle.cptr());
190 }
191
193
194 //Retrieve vertices for overlap removal
196 if (!vertices.isValid())
197 {
198 ATH_MSG_WARNING("Primary vertex container with key " << m_vertexKey.key() << " not found");
199 return StatusCode::SUCCESS;
200 }
201
202// Retrieve track particles from StoreGate
204 if ( !TPC.isValid() )
205 {
206 ATH_MSG_ERROR("Input TrackParticle collection is invalid!");
207 return StatusCode::SUCCESS;
208 }
209 ATH_MSG_DEBUG("Track particle container size " << TPC->size());
210
211 if (m_use_vertColl) {
212 ATH_MSG_DEBUG("Vertex container size " << vertColl->size());
213 }
214 Amg::Vector3D beamspot;
216 auto beamSpotHandle = SG::ReadCondHandle(m_beamSpotKey, ctx);
217 beamspot = beamSpotHandle->beamPos();
218 }else{
222 beamspot = Amg::Vector3D(beamPosX(0), beamPosY(0), beamPosZ(0));
223 }
224// track preselection
225 std::vector<const xAOD::TrackParticle*> posTracks; posTracks.clear();
226 std::vector<const xAOD::TrackParticle*> negTracks; negTracks.clear();
227 const xAOD::Vertex* vx = nullptr;
228 if (m_pv && primaryVertex) vx = primaryVertex;
229
230 if (TPC->size() > 1) {
232 for ( tpIt=TPC->begin(); tpIt!=TPC->end(); ++tpIt )
233 {
234 const xAOD::TrackParticle* TP = (*tpIt);
235 double charge = TP->charge();
236
237 if (m_trkSelector->decision(*TP, vx) || (!m_useTrkSel))
238 {
239 //PV Track Overlap Selections
240 const xAOD::Vertex* foundVertex { nullptr };
241 if (m_useorigin)
242 {
243 for (const auto *const vx : *vertices)
244 {
245 for (const auto& tpLink : vx->trackParticleLinks())
246 {
247 if (*tpLink == TP)
248 {
249 foundVertex = vx;
250 break;
251 }
252 }
253 if (foundVertex) break;
254 }
255 }
256 bool useTrack = false;
257 if (!m_useorigin) useTrack = true;
258 if (m_useorigin && foundVertex == nullptr) useTrack = true;
259 if (!useTrack) continue;
260
261
262 //d0 Selections
263 bool d0wrtVertex = true;
264 if (m_use_vertColl) {
265 if ( !d0Pass(TP,vertColl, ctx) ) d0wrtVertex = false;
266 }
267 if (!m_use_vertColl && m_pv) {
268 if (primaryVertex) {
269 if ( !d0Pass(TP,primaryVertex, ctx) ) d0wrtVertex = false;
270 } else {
271 if ( !d0Pass(TP,beamspot, ctx) ) d0wrtVertex = false;
272 }
273 }
274 if (!d0wrtVertex) continue;
275
276 if (m_samesign) {
277 posTracks.push_back(TP);
278 negTracks.push_back(TP);
279 } else {
280 if (charge > 0) {
281 posTracks.push_back(*tpIt);
282 } else {
283 negTracks.push_back(*tpIt);
284 }
285 }
286 }
287 }
288 }
289 ATH_MSG_DEBUG("number of tracks passing preselection, positive " << posTracks.size() << " negative " << negTracks.size());
290
291 if (!posTracks.empty() && !negTracks.empty())
292 {
293
294
305
307
308 std::vector<const xAOD::TrackParticle*>::const_iterator tpIt1;
309 std::vector<const xAOD::TrackParticle*>::const_iterator tpIt2;
310 unsigned int i1 = 0;
311 for (tpIt1 = posTracks.begin(); tpIt1 != posTracks.end(); ++tpIt1)
312 {
313 const xAOD::TrackParticle* TP1 = (*tpIt1);
314 uint8_t temp1(0);
315 uint8_t nclus1(0);
316 if ( TP1->summaryValue( temp1 , xAOD::numberOfPixelHits) ) nclus1 += temp1;
317 if ( TP1->summaryValue( temp1 , xAOD::numberOfSCTHits) ) nclus1 += temp1;
318 double pt1 = TP1->pt();
319
320 unsigned int i2 = 0;
321 for (tpIt2 = negTracks.begin(); tpIt2 != negTracks.end(); ++tpIt2)
322 {
323 if (*tpIt1 == *tpIt2) continue;
324 if (m_samesign && i1 <= i2) continue;
325
326 const xAOD::TrackParticle* TP2 = (*tpIt2);
327 uint8_t temp2(0);
328 uint8_t nclus2(0);
329 if ( TP2->summaryValue( temp2 , xAOD::numberOfPixelHits) ) nclus2 += temp2;
330 if ( TP2->summaryValue( temp2 , xAOD::numberOfSCTHits) ) nclus2 += temp2;
331 ATH_MSG_DEBUG("nclus1 " << (int)nclus1 << " nclus2 " << (int)nclus2);
332
333 if (!m_useTRTplusTRT && nclus1 == 0 && nclus2 == 0) continue;
334 if (!m_useTRTplusSi && (nclus1 == 0 || nclus2 == 0)) continue;
335
336 double pt2 = TP2->pt();
337
338 bool trk_cut1 = false;
339 bool trk_cut2 = false;
340 if (nclus1 != 0) trk_cut1 = true;
341 if (nclus1 == 0 && pt1 >= m_ptTRT) trk_cut1 = true;
342 if (!trk_cut1) continue;
343 if (nclus2 != 0) trk_cut2 = true;
344 if (nclus2 == 0 && pt2 >= m_ptTRT) trk_cut2 = true;
345 if (!trk_cut2) continue;
346
347// find a starting point
348 const Trk::Perigee& aPerigee1 = TP1->perigeeParameters();
349 const Trk::Perigee& aPerigee2 = TP2->perigeeParameters();
350 int sflag = 0;
351 int errorcode = 0;
352 Amg::Vector3D startingPoint = m_vertexEstimator->getCirclesIntersectionPoint(&aPerigee1,&aPerigee2,sflag,errorcode);
353 if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
354 bool errorCode = false;
355 if (errorcode == 0 || errorcode == 5 || errorcode == 6 || errorcode == 8) errorCode = true;
356 if (!errorCode) continue;
357
358 //re-do d0 selection if using m_use_vertColl to ensure both tracks pass for the SAME vertex
359 bool d0wrtVertex = true;
360 if (m_use_vertColl) {
361 if ( !d0Pass(TP1,TP2,vertColl, ctx) ) d0wrtVertex = false;
362 }
363 if (!d0wrtVertex) continue;
364
365
366// pair pre-selection cuts
367 if ( doFit(TP1,TP2,startingPoint, ctx) )
368 {
369 std::vector<const xAOD::TrackParticle*> pairV0;
370 pairV0.clear();
371 pairV0.push_back(TP1);
372 pairV0.push_back(TP2);
373
374// vertex fit
375 ATH_MSG_DEBUG("unconstrained fit now");
376
377 std::unique_ptr<xAOD::Vertex> myVxCandidate;
378 if (m_useV0Fitter) {
379 myVxCandidate = m_concreteVertexFitter->fit(ctx, pairV0, startingPoint);
380 } else {
381 myVxCandidate = m_iVKVertexFitter->fit(ctx, pairV0, startingPoint);
382 }
383
384 if (myVxCandidate)
385 {
386 myVxCandidate->setVertexType(xAOD::VxType::V0Vtx);
387 if ( (m_V0Tools->vertexProbability(myVxCandidate.get()) >= m_minVertProb) || (m_useBDT) ) // If using BDT selections, it makes VertProb Selections
388 {
389 bool doKshortFit = false;
390 doKshortFit = doMassFit(myVxCandidate.get(),310);
391 bool doLambdaFit = false;
392 doLambdaFit = doMassFit(myVxCandidate.get(),3122);
393 bool doLambdabarFit = false;
394 doLambdabarFit = doMassFit(myVxCandidate.get(),-3122);
395 float score = 0; // BDT score variable
396 if (doKshortFit || doLambdaFit || doLambdabarFit)
397 {
398 bool pointAtVert = true;
399 if (m_use_vertColl) {
400 if ( !pointAtVertexColl(myVxCandidate.get(),vertColl,score) ) pointAtVert = false;
401 }
402 if (!m_use_vertColl && m_pv && primaryVertex) {
403 if ( !pointAtVertex(myVxCandidate.get(),primaryVertex,score) ) pointAtVert = false;
404 }
405 if (m_doSimpleV0) pointAtVert = true;
406 if (pointAtVert)
407 {
408 Amg::Vector3D vertex = m_V0Tools->vtx(myVxCandidate.get());
409
410 std::unique_ptr<xAOD::Vertex> myKshort;
411 std::unique_ptr<xAOD::Vertex> myLambda;
412 std::unique_ptr<xAOD::Vertex> myLambdabar;
413 std::unique_ptr<xAOD::Vertex> myGamma;
414 bool foundKshort = false;
415 bool foundLambda = false;
416 bool foundLambdabar = false;
417
418 if (doKshortFit && !m_doSimpleV0) {
419 myKshort = massFit(ctx, 310, pairV0, vertex);
420 if (myKshort) {
421 if (m_V0Tools->vertexProbability(myKshort.get()) >= m_minConstrVertProb) {
422 myKshort->setVertexType(xAOD::VxType::V0Vtx);
423 foundKshort = true;
424 }
425 }
426 }
427
428 if (doLambdaFit && !m_doSimpleV0) {
429 myLambda = massFit(ctx, 3122, pairV0, vertex);
430 if (myLambda) {
431 if (m_V0Tools->vertexProbability(myLambda.get()) >= m_minConstrVertProb) {
432 myLambda->setVertexType(xAOD::VxType::V0Vtx);
433 foundLambda = true;
434 }
435 }
436 }
437
438 if (doLambdabarFit && !m_doSimpleV0) {
439 myLambdabar = massFit(ctx, -3122, pairV0, vertex);
440 if (myLambdabar) {
441 if (m_V0Tools->vertexProbability(myLambdabar.get()) >= m_minConstrVertProb) {
442 myLambdabar->setVertexType(xAOD::VxType::V0Vtx);
443 foundLambdabar = true;
444 }
445 }
446 }
447
448 bool doGamma = false;
449 int gamma_fit = 0;
450 double gamma_prob = -1., gamma_mass = -1., gamma_massErr = -1.;
451 if (foundKshort || foundLambda || foundLambdabar) doGamma = true;
452
457
458 if (m_doSimpleV0 || (!m_doSimpleV0 && doGamma)) {
459 m_V0s_stored++;
460 myVxCandidate->clearTracks();
461 ElementLink<xAOD::TrackParticleContainer> newLink1 = makeLink(*tpIt1, trackCols);
462 ElementLink<xAOD::TrackParticleContainer> newLink2 = makeLink(*tpIt2, trackCols);
463 myVxCandidate->addTrackAtVertex(newLink1);
464 myVxCandidate->addTrackAtVertex(newLink2);
465 v0Container->push_back(myVxCandidate.release());
466
467 v0_BDTScore( *(v0Container->back()) ) = score;// decorate w/ bdt score
468
469 if (foundKshort && !m_doSimpleV0) {
471 myKshort->clearTracks();
472 ElementLink<xAOD::TrackParticleContainer> ksLink1 = makeLink(*tpIt1, trackCols);
473 ElementLink<xAOD::TrackParticleContainer> ksLink2 = makeLink(*tpIt2, trackCols);
474 myKshort->addTrackAtVertex(ksLink1);
475 myKshort->addTrackAtVertex(ksLink2);
476 ksContainer->push_back(myKshort.release());
477
478 v0Link.setElement(v0Container->back());
479 v0Link.setStorableObject(*v0Container);
480 v0LinksDecorks(*(ksContainer->back())) = v0Link;
481
482 ksLink.setElement(ksContainer->back());
483 ksLink.setStorableObject(*ksContainer);
484 v0_ksLinksDecor(*(v0Container->back())) = ksLink;
485 } else {
486 v0_ksLinksDecor(*(v0Container->back())) = ksLink;
487 }
488 if (foundLambda && !m_doSimpleV0) {
490 myLambda->clearTracks();
491 ElementLink<xAOD::TrackParticleContainer> laLink1 = makeLink(*tpIt1, trackCols);
492 ElementLink<xAOD::TrackParticleContainer> laLink2 = makeLink(*tpIt2, trackCols);
493 myLambda->addTrackAtVertex(laLink1);
494 myLambda->addTrackAtVertex(laLink2);
495 laContainer->push_back(myLambda.release());
496
497 v0Link.setElement(v0Container->back());
498 v0Link.setStorableObject(*v0Container);
499 v0LinksDecorlb(*(laContainer->back())) = v0Link;
500
501 laLink.setElement(laContainer->back());
502 laLink.setStorableObject(*laContainer);
503 v0_laLinksDecor(*(v0Container->back())) = laLink;
504 } else {
505 v0_laLinksDecor(*(v0Container->back())) = laLink;
506 }
507 if (foundLambdabar && !m_doSimpleV0) {
509 myLambdabar->clearTracks();
510 ElementLink<xAOD::TrackParticleContainer> lbLink1 = makeLink(*tpIt1, trackCols);
511 ElementLink<xAOD::TrackParticleContainer> lbLink2 = makeLink(*tpIt2, trackCols);
512 myLambdabar->addTrackAtVertex(lbLink1);
513 myLambdabar->addTrackAtVertex(lbLink2);
514 lbContainer->push_back(myLambdabar.release());
515
516 v0Link.setElement(v0Container->back());
517 v0Link.setStorableObject(*v0Container);
518 v0LinksDecorlbb(*(lbContainer->back())) = v0Link;
519
520 lbLink.setElement(lbContainer->back());
521 lbLink.setStorableObject(*lbContainer);
522 v0_lbLinksDecor(*(v0Container->back())) = lbLink;
523 } else {
524 v0_lbLinksDecor(*(v0Container->back())) = lbLink;
525 }
526 if (doGamma && !m_doSimpleV0) {
527 myGamma = massFit(ctx, 22, pairV0, vertex);
528 if (myGamma && m_V0Tools->vertexProbability(myGamma.get()) >= m_minConstrVertProb) {
529 gamma_fit = 1;
530 gamma_prob = m_V0Tools->vertexProbability(myGamma.get());
531 gamma_mass = m_V0Tools->invariantMass(myGamma.get(),m_masse,m_masse);
532 gamma_massErr = m_V0Tools->invariantMassError(myGamma.get(),m_masse,m_masse);
533 }
534
535 mDecor_gfit( *(v0Container->back()) ) = gamma_fit;
536 mDecor_gmass( *(v0Container->back()) ) = gamma_mass;
537 mDecor_gmasserr( *(v0Container->back()) ) = gamma_massErr;
538 mDecor_gprob( *(v0Container->back()) ) = gamma_prob;
539 }
540 }
541
542 } // pointAtVert
543
544 } // in mass window (doMassFit)
545
546 } // chi2 cut failed
547 } else { // unconstrained fit failed
548 ATH_MSG_DEBUG("Fitter failed!");
549 }
550
551 } // doFit
552
553 i2++;
554 } // loop over negative tracks
555 i1++;
556 } // loop over positive tracks
557
558 } // posTracks.size() > 0 && negTracks.size() > 0
559
560 if (v0Container->empty()) ATH_MSG_DEBUG("No Candidates found. Empty container returned");
561 if (ksContainer->empty()) ATH_MSG_DEBUG("No Kshort Candidates found. Empty container returned");
562 if (laContainer->empty()) ATH_MSG_DEBUG("No Lambda Candidates found. Empty container returned");
563 if (lbContainer->empty()) ATH_MSG_DEBUG("No Lambdabar Candidates found. Empty container returned");
564
565 return StatusCode::SUCCESS;
566}
567
569{
570 msg(MSG::DEBUG)
571 << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg
572 << "\tSummary" << endmsg
573 << "\tProcessed : " << m_events_processed << " events" << endmsg
574 << "\tStored : " << m_V0s_stored << " V0s" << endmsg
575 << "\tof which : " << m_Kshort_stored << " Kshorts" << endmsg
576 << "\t : " << m_Lambda_stored << " Lambdas" << endmsg
577 << "\t : " << m_Lambdabar_stored << " Lambdabars" << endmsg;
578 msg(MSG::DEBUG) << "----------------------------------------------------------------------------------------------------------------------------------------------" << endmsg;
579
580 return StatusCode::SUCCESS;
581}
582
583void InDetV0FinderTool::SGError(const std::string& errService) const
584{
585 ATH_MSG_FATAL(errService << " not found. Exiting !");
586}
587
588
590 Amg::Vector3D &startingPoint, const EventContext& ctx) const
591{
592 bool pass = false;
593 double srxy = startingPoint.perp();
594 if (srxy <= m_maxsxy)
595 {
596 double massKshort_i=2000001., massLambda_i=2000001., massLambdabar_i=2000001.;
597 const Amg::Vector3D& globalPosition = startingPoint;
598 Trk::PerigeeSurface perigeeSurface(globalPosition);
599 std::vector<std::unique_ptr<const Trk::TrackParameters> > cleanup;
600 const Trk::TrackParameters* extrapolatedPerigee1(nullptr);
601 const Trk::TrackParameters* extrapolatedPerigee2(nullptr);
602 extrapolatedPerigee1 = m_extrapolator->extrapolate(ctx,track1->perigeeParameters(), perigeeSurface).release();
603 if (extrapolatedPerigee1 == nullptr) extrapolatedPerigee1 = &track1->perigeeParameters();
604 else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee1));
605
606 extrapolatedPerigee2 = m_extrapolator->extrapolate(ctx,track2->perigeeParameters(), perigeeSurface).release();
607 if (extrapolatedPerigee2 == nullptr) extrapolatedPerigee2 = &track2->perigeeParameters();
608 else cleanup.push_back(std::unique_ptr<const Trk::TrackParameters>(extrapolatedPerigee2));
609
610 if (extrapolatedPerigee1 != nullptr && extrapolatedPerigee2 != nullptr) {
611 massKshort_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_masspi);
612 massLambda_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_massp,m_masspi);
613 massLambdabar_i = invariantMass(extrapolatedPerigee1,extrapolatedPerigee2,m_masspi,m_massp);
614 if ( ((massKshort_i >= m_uksmin && massKshort_i <= m_uksmax) ||
615 (massLambda_i >= m_ulamin && massLambda_i <= m_ulamax) ||
616 (massLambdabar_i >= m_ulamin && massLambdabar_i <= m_ulamax)) ) pass = true;
617 }
618 }
619
620 return pass;
621}
622
623bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::TrackParticle* track2, const xAOD::VertexContainer * vertColl, const EventContext& ctx) const
624{
625 bool pass = false;
626 int count = 0;
627 bool hasInnerPixHit1 = true;
628 bool hasInnerPixHit2 = true;
630 SG::AuxElement::ConstAccessor<uint8_t> numberOfInnermostPixelLayerHits("numberOfInnermostPixelLayerHits");
631 uint8_t nInnerHits1 = numberOfInnermostPixelLayerHits(*track1);
632 if (nInnerHits1 == 0) hasInnerPixHit1 = false;
633 uint8_t nInnerHits2 = numberOfInnermostPixelLayerHits(*track2);
634 if (nInnerHits2 == 0) hasInnerPixHit2 = false;
635 }
636 for (auto vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr )
637 {
638 const xAOD::Vertex* PV = (*vItr);
639 auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
640 if (per1 == nullptr) continue;
641 auto per2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, PV->position() );
642 if (per2 == nullptr) continue;
643 double d0_1 = per1->parameters()[Trk::d0];
644 double sig_d0_1 = sqrt((*per1->covariance())(0,0));
645 double delta_z0_1 = track1->z0() + track1->vz() - PV->z();
646 double d0_2 = per2->parameters()[Trk::d0];
647 double sig_d0_2 = sqrt((*per2->covariance())(0,0));
648 double delta_z0_2 = track2->z0() + track2->vz() - PV->z();
649 bool IP_check1 = (std::abs(d0_1/sig_d0_1) > m_d0_cut) || !hasInnerPixHit1;
650 IP_check1 &= std::abs(d0_1) < m_max_d0_cut;
651 IP_check1 &= std::abs(delta_z0_1) < m_max_z0_cut;
652 bool IP_check2 = (std::abs(d0_2/sig_d0_2) > m_d0_cut) || !hasInnerPixHit2;
653 IP_check2 &= std::abs(d0_2) < m_max_d0_cut;
654 IP_check2 &= std::abs(delta_z0_2) < m_max_z0_cut;
655 if (IP_check1 && IP_check2) return true;
656 if (++count >= m_maxPV) break;
657 }
658 return pass;
659}
660
661bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::VertexContainer * vertColl, const EventContext& ctx) const
662{
663 bool pass = false;
664 int count = 0;
665 bool hasInnerPixHit1 = true;
667 SG::AuxElement::ConstAccessor<uint8_t> numberOfInnermostPixelLayerHits("numberOfInnermostPixelLayerHits");
668 uint8_t nInnerHits1 = numberOfInnermostPixelLayerHits(*track1);
669 if (nInnerHits1 == 0) hasInnerPixHit1 = false;
670 }
671 for (auto vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr )
672 {
673 const xAOD::Vertex* PV = (*vItr);
674 auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
675 if (per1 == nullptr) continue;
676 double d0_1 = per1->parameters()[Trk::d0];
677 double sig_d0_1 = sqrt((*per1->covariance())(0,0));
678 double delta_z0_1 = track1->z0() + track1->vz() - PV->z();
679 if (((std::abs(d0_1/sig_d0_1) > m_d0_cut) ||
680 (!hasInnerPixHit1)) &&
681 (std::abs(d0_1) < m_max_d0_cut) &&
682 (std::abs(delta_z0_1) < m_max_z0_cut)) return true;
683 if (++count >= m_maxPV) break;
684 }
685 return pass;
686}
687
688bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const xAOD::Vertex* PV, const EventContext& ctx) const
689{
690 bool pass = false;
691 bool hasInnerPixHit1 = true;
693 SG::AuxElement::ConstAccessor<uint8_t> numberOfInnermostPixelLayerHits("numberOfInnermostPixelLayerHits");
694 uint8_t nInnerHits1 = numberOfInnermostPixelLayerHits(*track1);
695 if (nInnerHits1 == 0) hasInnerPixHit1 = false;
696 }
697 auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV->position() );
698 if (per1 == nullptr) return pass;
699 double d0_1 = per1->parameters()[Trk::d0];
700 double sig_d0_1 = sqrt((*per1->covariance())(0,0));
701 double delta_z0_1 = track1->z0() + track1->vz() - PV->z();
702 if (((std::abs(d0_1/sig_d0_1) > m_d0_cut) ||
703 (!hasInnerPixHit1)) &&
704 (std::abs(d0_1) < m_max_d0_cut) &&
705 (std::abs(delta_z0_1) < m_max_z0_cut)) pass = true;
706 return pass;
707}
708
709bool InDetV0FinderTool::d0Pass(const xAOD::TrackParticle* track1, const Amg::Vector3D& PV, const EventContext& ctx) const
710{
711 bool pass = false;
712 bool hasInnerPixHit1 = true;
714 SG::AuxElement::ConstAccessor<uint8_t> numberOfInnermostPixelLayerHits("numberOfInnermostPixelLayerHits");
715 uint8_t nInnerHits1 = numberOfInnermostPixelLayerHits(*track1);
716 if (nInnerHits1 == 0) hasInnerPixHit1 = false;
717 }
718 auto per1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, PV );
719 if (per1 == nullptr) return pass;
720 double d0_1 = per1->parameters()[Trk::d0];
721 double sig_d0_1 = sqrt((*per1->covariance())(0,0));
722 double delta_z0_1 = track1->z0() + track1->vz() - PV.z();
723 if (((std::abs(d0_1/sig_d0_1) > m_d0_cut) ||
724 (!hasInnerPixHit1)) &&
725 (std::abs(d0_1) < m_max_d0_cut) &&
726 (std::abs(delta_z0_1) < m_max_z0_cut)) pass = true;
727 return pass;
728}
729
730bool InDetV0FinderTool::pointAtVertex(const xAOD::Vertex* v0, const xAOD::Vertex* PV, float &score) const
731{
732 bool pass = false;
733 float v0lxy = m_V0Tools->lxy(v0,PV);
734 float v0lxyError = m_V0Tools->lxyError(v0,PV);
735 float cos = m_V0Tools->cosTheta(v0,PV);
736 float v0a0xy = m_V0Tools->a0xy(v0,PV);
737 float v0a0z = m_V0Tools->a0z(v0,PV);
738 if (m_useBDT){
739 float prob = m_V0Tools->vertexProbability(v0);
740 float nLogProb = 999999;
741 if (prob>0) nLogProb = -1*log10f(prob); //bdt model uses the log, not the raw value
742 if (v0lxyError == 0.){
743 throw std::runtime_error("v0lxyError is zero in division.");
744 }
745 std::vector<float> bdt_vars = {
746 nLogProb,
747 std::abs(v0a0xy),
748 std::abs(v0a0z),
749 v0lxy,
750 v0lxy/v0lxyError,
751 cos};
752 float this_Score=m_BDT->GetClassification(bdt_vars);
753 if (this_Score > score) {
754 score = this_Score;
755 }
756 if (score > m_BDTCut){
757 pass = true;
758 }
759 }
760 else if ((v0lxyError != 0.) && (v0lxy/v0lxyError > m_vert_lxy_sig) && (cos > m_vert_cos_cut) &&
761 (std::abs(v0a0xy) < m_vert_a0xy_cut) && (std::abs(v0a0z) < m_vert_a0z_cut) &&
762 (v0lxy < m_vert_lxy_cut)) pass = true;
763 return pass;
764}
765
766bool InDetV0FinderTool::pointAtVertexColl(xAOD::Vertex* v0, const xAOD::VertexContainer * vertColl, float &score) const
767{
768 bool pass = false;
770 for ( vItr=vertColl->begin(); vItr!=vertColl->end(); ++vItr ) { if (pointAtVertex(v0,(*vItr),score)) pass = true; }
771 return pass;
772}
773
774double InDetV0FinderTool::invariantMass(const Trk::TrackParameters* per1, const Trk::TrackParameters* per2, double m1, double m2)
775{
776 double e1sq = per1->momentum().mag2() + m1*m1;
777 double e1 = (e1sq>0.) ? sqrt(e1sq) : 0.;
778 double e2sq = per2->momentum().mag2() + m2*m2;
779 double e2 = (e2sq>0.) ? sqrt(e2sq) : 0.;
780 double p = (per1->momentum()+per2->momentum()).mag();
781 double msq = (e1+e2+p)*(e1+e2-p);
782 double mass = (msq>0.) ? sqrt(msq) : 0.;
783 return mass;
784}
785
786bool InDetV0FinderTool::doMassFit(xAOD::Vertex* vxCandidate, int pdgID) const
787{
788 bool pass = false;
789 double mass = 1000000000.;
790 double error = 1000000001.;
791 bool in_mass_window = false;
792 double winmass_min = 0., winmass_max = 0.;
793
794 if (pdgID == 310) {
795 winmass_min = m_ksmin;
796 winmass_max = m_ksmax;
797 mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_masspi);
798 error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_masspi);
799 if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
800 } else if (pdgID == 3122 || pdgID == -3122) {
801 winmass_min = m_lamin;
802 winmass_max = m_lamax;
803 if (pdgID == 3122) {
804 mass = m_V0Tools->invariantMass(vxCandidate,m_massp,m_masspi);
805 error = m_V0Tools->invariantMassError(vxCandidate,m_massp,m_masspi);
806 } else if (pdgID == -3122) {
807 mass = m_V0Tools->invariantMass(vxCandidate,m_masspi,m_massp);
808 error = m_V0Tools->invariantMassError(vxCandidate,m_masspi,m_massp);
809 }
810 if (mass >= winmass_min && mass <= winmass_max && error <= m_errmass) in_mass_window = true;
811 }
812 if (in_mass_window) pass = true;
813
814 return pass;
815}
816
817std::unique_ptr<xAOD::Vertex> InDetV0FinderTool::massFit(const EventContext& ctx, int pdgID, const std::vector<const xAOD::TrackParticle*> &pairV0, const Amg::Vector3D &vertex) const
818{
819 std::unique_ptr<xAOD::Vertex> vxCandidate;
820 std::vector<double> masses;
821 if (pdgID == 310) {
822 masses.push_back(m_masspi);
823 masses.push_back(m_masspi);
824 } else if (pdgID == 3122) {
825 masses.push_back(m_massp);
826 masses.push_back(m_masspi);
827 } else if (pdgID == -3122) {
828 masses.push_back(m_masspi);
829 masses.push_back(m_massp);
830 } else if (pdgID == 22) {
831 masses.push_back(m_masse);
832 masses.push_back(m_masse);
833 }
834
835 if (pdgID == 22) {
836 vxCandidate = m_iGammaFitter->fit(ctx, pairV0, vertex);
837 }
838 if (pdgID == 310) {
839 if (m_useV0Fitter) {
840 vxCandidate = m_concreteVertexFitter->fit(ctx, pairV0, masses, m_massK0S, nullptr, vertex);
841 } else {
842 vxCandidate = m_iKshortFitter->fit(ctx, pairV0, vertex);
843 }
844 }
845 if (pdgID == 3122) {
846 if (m_useV0Fitter) {
847 vxCandidate = m_concreteVertexFitter->fit(ctx, pairV0, masses, m_massLambda, nullptr, vertex);
848 } else {
849 vxCandidate = m_iLambdaFitter->fit(ctx, pairV0, vertex);
850 }
851 }
852 if (pdgID == -3122) {
853 if (m_useV0Fitter) {
854 vxCandidate = m_concreteVertexFitter->fit(ctx, pairV0, masses, m_massLambda, nullptr, vertex);
855 } else {
856 vxCandidate = m_iLambdabarFitter->fit(ctx, pairV0, vertex);
857 }
858 }
859
860 return vxCandidate;
861}
862
864 const std::vector<const xAOD::TrackParticleContainer*>& trackcols) const
865{
867 Link.setElement(tp);
868 bool elementSet = false;
869 if(trackcols.empty()){
870 Link.setStorableObject( *static_cast<const xAOD::TrackParticleContainer*>( tp->container() ) );
871 elementSet = true;
872 } else {
873 for(const xAOD::TrackParticleContainer* trkcol : trackcols){
874 auto itr = std::find(trkcol->begin(), trkcol->end(), tp);
875 if(itr != trkcol->end()){
876 Link.setStorableObject(*trkcol, true);
877 elementSet = true;
878 break;
879 }
880 }
881 }
882 if(!elementSet) ATH_MSG_ERROR("Track was not found when linking");
883 return Link;
884}
885
886
887}//end of namespace InDet
888
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_FATAL(x,...)
double charge(const T &p)
Definition AtlasPID.h:1003
ATLAS-specific HepMC functions.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
bool doMassFit(xAOD::Vertex *vxCandidate, int pdgID) const
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeyks
BooleanProperty m_useTRTplusSi
= use TRT+Si pairs (true)
BooleanProperty m_useorigin
= true only using tracks that have no vertex association (true)
DoubleProperty m_masspi
pion mass (139.57 MeV)
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_lbLinksDecorkey
const Trk::TrkV0VertexFitter * m_concreteVertexFitter
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gfit
std::atomic< unsigned int > m_events_processed
void SGError(const std::string &errService) const
std::atomic< unsigned int > m_Kshort_stored
DoubleProperty m_vert_cos_cut
V0 cos(theta) angle between displacement and momentum (>0.).
DoubleProperty m_d0_cut
track d0 significance wrt a vertex (>2.)
DoubleProperty m_ksmin
min Kshort mass (400.
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gprob
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylbb
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_RelinkContainers
DoubleProperty m_ulamax
max Lambda mass, unconstrained fit (1200.
DoubleProperty m_ksmax
max Kshort mass (600.
DoubleProperty m_vert_a0z_cut
V0 |a0z| wrt a vertex (<15.).
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Gaudi::Property< int > m_maxPV
DoubleProperty m_lamax
max Lambda mass (1200.
bool pointAtVertex(const xAOD::Vertex *v0, const xAOD::Vertex *PV, float &score) const
PublicToolHandle< Trk::IVertexFitter > m_iLambdabarFitter
bool pointAtVertexColl(xAOD::Vertex *v0, const xAOD::VertexContainer *vertColl, float &score) const
DoubleProperty m_vert_a0xy_cut
V0 |a0xy| wrt a vertex (<3.).
std::atomic< unsigned int > m_Lambda_stored
PublicToolHandle< Trk::ITrackSelectorTool > m_trkSelector
BooleanProperty m_doSimpleV0
= true equivalent to the old InDetSimpleV0Finder (false)
DoubleProperty m_max_z0_cut
track |z0| wrt a vertex (<999999.)
DoubleProperty m_minVertProb
Minimum vertex probability (0.0001).
BooleanProperty m_use_innerPixHits
= true select allows tracks with no innermost pixel layer hits to always pass d0 significance cut (fa...
PublicToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
PublicToolHandle< Trk::IVertexFitter > m_iKshortFitter
BooleanProperty m_samesign
= true select tracks with same sign (false)
DoubleProperty m_massLambda
Lambda mass (1115.68 MeV).
DoubleProperty m_ulamin
min Lambda mass, unconstrained fit (1000.
PublicToolHandle< Trk::IVertexFitter > m_iVKVertexFitter
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmass
static double invariantMass(const Trk::TrackParameters *per1, const Trk::TrackParameters *per2, double m1, double m2)
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
DoubleProperty m_uksmax
max Kshort mass, unconstrained fit (600.
std::unique_ptr< xAOD::Vertex > massFit(const EventContext &ctx, int pdgID, const std::vector< const xAOD::TrackParticle * > &pairV0, const Amg::Vector3D &vertex) const
BooleanProperty m_useBDT
= true uses BDT selections in place of rectangular pointAtVertex + minVertProb
Gaudi::Property< std::string > m_lbKey
PublicToolHandle< Trk::IVertexFitter > m_iGammaFitter
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_ksLinksDecorkey
IntegerProperty m_masses
= 1 if using PDG values, = 2 if user set (1)
std::atomic< unsigned int > m_Gamma_stored
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > m_beamSpotDecoKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0LinksDecorkeylb
BooleanProperty m_pv
= true select tracks wrt primary vertex (false)
Gaudi::Property< std::string > m_ksKey
PublicToolHandle< InDet::VertexPointEstimator > m_vertexEstimator
DoubleProperty m_maxsxy
Maximum Rxy of starting point (1000.
std::unique_ptr< MVAUtils::BDT > m_BDT
PublicToolHandle< Trk::IVertexFitter > m_iLambdaFitter
DoubleProperty m_BDTCut
BDT Score threshold.
std::atomic< unsigned int > m_V0s_stored
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
DoubleProperty m_uksmin
min Kshort mass, unconstrained fit (400.
BooleanProperty m_useTRTplusTRT
= use TRT+TRT pairs (true)
PublicToolHandle< Trk::V0Tools > m_V0Tools
Gaudi::Property< std::string > m_v0Key
DoubleProperty m_vert_lxy_sig
V0 lxy significance wrt a vertex (>2.).
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
DoubleProperty m_masse
electron mass (0.510999 MeV)
ElementLink< xAOD::TrackParticleContainer > makeLink(const xAOD::TrackParticle *, const std::vector< const xAOD::TrackParticleContainer * > &) const
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_BDTScore
DoubleProperty m_vert_lxy_cut
V0 lxy V0 lxy (<500.).
BooleanProperty m_use_vertColl
= true select tracks wrt a vertex collection (false)
DoubleProperty m_minConstrVertProb
Minimum vertex probability for constrained fit (0.0001).
DoubleProperty m_max_d0_cut
track |d0| wrt a vertex (<999999.)
StringProperty m_BDTFile
Filename of mvaUtils model file, located in /InDetV0FinderTool/BDT/v1/.
PublicToolHandle< Trk::IVertexFitter > m_iVertexFitter
BooleanProperty m_useV0Fitter
= true if using TrkV0Fitter, = false if using VKalVert (true)
InDetV0FinderTool(const std::string &t, const std::string &n, const IInterface *p)
DoubleProperty m_massK0S
Kshort mass (497.672 MeV).
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_mDecor_gmasserr
DoubleProperty m_lamin
min Lambda mass (1000.
DoubleProperty m_ptTRT
Minimum pT for TRT tracks (700.
bool doFit(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, Amg::Vector3D &startingPoint, const EventContext &ctx) const
BooleanProperty m_useTrkSel
= true uses TrackSelectorTool
bool d0Pass(const xAOD::TrackParticle *track1, const xAOD::TrackParticle *track2, const xAOD::VertexContainer *vertColl, const EventContext &ctx) const
Gaudi::Property< std::string > m_laKey
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_v0_laLinksDecorkey
DoubleProperty m_massp
proton mass (938.272 MeV)
std::atomic< unsigned int > m_Lambdabar_stored
Gaudi::Property< bool > m_useBeamSpotCond
DoubleProperty m_errmass
Maximum mass error (100.
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
const Amg::Vector3D & momentum() const
Access method for the momentum.
Class describing the Line to which the Perigee refers to.
This class implements a vertex fitting algorithm optimised for V0 finding.
float z0() const
Returns the parameter.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
float vz() const
The z origin for the parameters.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float charge() const
Returns the charge.
float z() const
Returns the z position.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
const Amg::Vector3D & position() const
Returns the 3-pos.
bool doFit
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
Eigen::Matrix< double, 3, 1 > Vector3D
Primary Vertex Finder.
static const int ELECTRON
static const int K0S
static const int PIPLUS
static const int LAMBDA0
static const int PROTON
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ d0
Definition ParamDefs.h:63
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ V0Vtx
Vertex from V0 decay.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].