ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticle_v1.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// Misc includes
6#include <bitset>
7#include <cassert>
8#include <vector>
9#include <stdexcept>
10#include <atomic>
11#include <iostream>
12
13// EDM include(s):
15
16// Local include(s):
22
23
25
30 static std::atomic< bool > uninitCovarianceAccessPrinted = false;
31 if( ! uninitCovarianceAccessPrinted ) {
32 std::cout << "xAOD::TrackParticle WARNING Uninitialised covariance matrix was "
33 "accessed.\n"
34 " Debug it by breaking on "
35 "xAODTrackParticlePrivate::covarianceUnsetHook function calls!"
36 << std::endl;
37 uninitCovarianceAccessPrinted = true;
38 }
39 return;
40 }
41
42}
43
44
45namespace xAOD {
46
48 : IParticle() {
49 // perigeeParameters cache initialized to be empty (default constructor)
50 }
51
53 : IParticle( tp ) {
54 makePrivateStore( tp );
55 // perigeeParameters cache initialized to be empty (default constructor)
56 // assume that this copy will create new cache as needed
57 }
58
60 if(this == &tp) return *this;
61
62 if( ( ! hasStore() ) && ( ! container() ) ) {
64 }
65 this->IParticle::operator=( tp );
66#ifndef XAOD_ANALYSIS
67 // assume that this copy will create new cache as needed
68 m_perigeeParameters.reset();
69#endif // not XAOD_ANALYSIS
70 return *this;
71 }
72
74
75 double TrackParticle_v1::pt() const {
76 return genvecP4().Pt();
77 }
78
79 double TrackParticle_v1::eta() const {
80 return genvecP4().Eta();
81 }
82
84
86 // Codes using a fitter set a hypothesis, and the
87 // particular fitter that was employed..
88 // A mass is never set/stored.
89 //
90 // In the past we were returning the mass of a charged pion always
91 //
92 // This created a confusion on why TrackParticles created by
93 // specific lepton fitter have a pion mass (the leptons per se have the
94 // correct mass). Lets try to remedy this.
96 if (hypo == xAOD::electron) {
97 // Since GX2 also set sometimes the hypo to electron
98 // lets also check for GSF.
99 uint8_t fitter = trackFitter();
100 if (fitter == xAOD::GaussianSumFilter) {
102 }
103 }
104 if (hypo == xAOD::muon) {
106 }
107 // default charged pion
109 }
110
111 double TrackParticle_v1::e() const {
112 return genvecP4().E();
113 }
115 return genvecP4().Rapidity();
116 }
117
121
124 using namespace std;
125 float p = 10.e6; // 10 TeV (default value for very high pt muons, with qOverP==0)
126 if (fabs(qOverP())>0.) p = 1/fabs(qOverP());
127 float thetaT = theta();
128 float phiT = phi();
129 float sinTheta= sin(thetaT);
130 float px = p*sinTheta*cos(phiT);
131 float py = p*sinTheta*sin(phiT);
132 float pz = p*cos(thetaT);
133 float e = pow (m(),2) +
134 pow( px,2) + pow( py,2) + pow( pz,2);
135 p4.SetPxPyPzE( px, py, pz, sqrt(e) );
136 return p4;
137 }
138
139 Type::ObjectType TrackParticle_v1::type() const {
140 return Type::TrackParticle;
141 }
142
145 }
146
149
151
152 static const Accessor< float > acc( "phi" );
153 return acc( *this );
154 }
155
158
160 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, float, timeResolution, setTimeResolution)
161 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, uint8_t, hasValidTime, setHasValidTime )
162
163 DefiningParameters_t TrackParticle_v1::definingParameters() const{
164 DefiningParameters_t tmp;
165 tmp << d0() , z0() , phi0() , theta() , qOverP();
166 return tmp;
167 }
168
169 void TrackParticle_v1::setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP) {
170#ifndef XAOD_ANALYSIS
171 // reset perigee cache if existing
172 if(m_perigeeParameters.isValid()) {
173 m_perigeeParameters.reset();
174 }
175#endif // not XAOD_ANALYSIS
176 static const Accessor< float > acc1( "d0" );
177 acc1( *this ) = d0;
178
179 static const Accessor< float > acc2( "z0" );
180 acc2( *this ) = z0;
181
182 static const Accessor< float > acc3( "phi" );
183 acc3( *this ) = phi0;
184
185 static const Accessor< float > acc4( "theta" );
186 acc4( *this ) = theta;
187
188 static const Accessor< float > acc5( "qOverP" );
189 acc5( *this ) = qOverP;
190
191 return;
192 }
193
194 void TrackParticle_v1::setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP, float time) {
196 setTime(time);
197 return;
198 }
199
201 accCovMatrixDiag( "definingParametersCovMatrixDiag" );
203 accCovMatrixOffDiag( "definingParametersCovMatrixOffDiag" );
204
205 void TrackParticle_v1::setDefiningParametersCovMatrix(const xAOD::ParametersCovMatrix_t& cov){
206
207#ifndef XAOD_ANALYSIS
208 // reset perigee cache if existing
209 if(m_perigeeParameters.isValid()) {
210 m_perigeeParameters.reset();
211 }
212#endif // not XAOD_ANALYSIS
213
214 // Extract the diagonal elements from the matrix.
215 std::vector< float > diagVec;
216 diagVec.reserve( cov.rows() );
217 for( int i = 0; i < cov.rows(); ++i ) {
218 diagVec.push_back( cov( i, i ) );
219 }
220 // Set the variable.
222
223 // Extract the off-diagonal elements from the matrix.
224 std::vector< float > offDiagVec;
225 offDiagVec.reserve( ( ( cov.rows() - 1 ) * cov.rows() ) / 2 );
226 for( int i = 1; i < cov.rows(); ++i ) {
227 for( int j = 0; j < i; ++j ) {
228 float offDiagCoeff = (cov( i, i )>0 && cov( j, j )>0) ? cov( i, j )/sqrt(cov( i, i )*cov( j, j )) : 0;
229 offDiagVec.push_back( offDiagCoeff );
230 }
231 }
232 // Set the variable.
234
235 return;
236 }
237
238 const xAOD::ParametersCovMatrix_t TrackParticle_v1::definingParametersCovMatrix() const {
239
240 std::span<const float> covMatrixDiag;
241 if( accCovMatrixDiag.isAvailable( *this ))
242 covMatrixDiag = std::span<const float>( accCovMatrixDiag( *this ) );
243 std::span<const float> covMatrixOffDiag;
244 if( accCovMatrixOffDiag.isAvailable( *this ))
245 covMatrixOffDiag = std::span<const float>( accCovMatrixOffDiag( *this ) );
246 bool valid = true;
247 auto result = TrackingDetails::definingParametersCovMatrix( covMatrixDiag, covMatrixOffDiag, valid );
249 return result;
250 }
251
253
254 // Create the result matrix.
256 result.setZero();
257
258 // Check if the diagonal elements are available.
259 if( accCovMatrixDiag.isAvailable( *this ) &&
260 ( static_cast< int >( accCovMatrixDiag( *this ).size() ) == result.rows() ) ) {
261
262 result.setIdentity();
263 }
264
265 bool offDiagCompr = definingParametersCovMatrixOffDiagCompr();
266
267 if(!offDiagCompr){
268
269 // Check if the off-diagonal elements are available.
270 if( accCovMatrixOffDiag.isAvailable( *this ) &&
271 ( static_cast< int >( accCovMatrixOffDiag( *this ).size() ) ==
272 ( ( result.rows() * ( result.rows() - 1 ) ) / 2 ) ) ) {
273
274 for( int i = 1; i < result.rows(); ++i ) {
275 for( int j = 0; j < i; ++j ) {
276 result.fillSymmetric( i, j, true );
277 }
278 }
279 }
280
281 }
282
283 else{
284
285 if( accCovMatrixOffDiag.isAvailable( *this ) &&
286 ( static_cast< int >( accCovMatrixOffDiag( *this ).size() ) == COVMATRIX_OFFDIAG_VEC_COMPR_SIZE ) ){
287
288 const covMatrixIndexPairVec& vecPairIndex = covMatrixComprIndexPairs();
289
290 for(const auto& pairIndex : vecPairIndex){
291 covMatrixIndex i = pairIndex.first;
292 covMatrixIndex j = pairIndex.second;
293 result.fillSymmetric( i, j, true );
294 }
295
296 }
297
298 }
299
300 // Return the object.
301 return result;
302 }
303
304 const std::vector< float >& TrackParticle_v1::definingParametersCovMatrixDiagVec() const {
305
306 return accCovMatrixDiag( *this );
307 }
308
310
311 return accCovMatrixOffDiag( *this );
312 }
313
315
316 std::vector< float > vec;
318 Amg::compress(cov,vec);
319 return vec;
320
321 }
322
324
325 if (vec.size() != ParametersCovMatrix_t::RowsAtCompileTime) {
326 throw std::runtime_error(
327 "Setting track definingParametersCovMatrixDiag with vector of size " +
328 std::to_string(vec.size()) + " instead of expected " +
329 std::to_string(ParametersCovMatrix_t::RowsAtCompileTime) +
330 " is not supported");
331 }
332
333 accCovMatrixDiag( *this ) = vec;
334 return;
335 }
336
338
339 bool offDiagCompr = definingParametersCovMatrixOffDiagCompr();
340
341 unsigned int uncompr_size = ( ( ( ParametersCovMatrix_t::RowsAtCompileTime - 1 ) *
342 ParametersCovMatrix_t::RowsAtCompileTime ) / 2 );
343 unsigned int size = offDiagCompr ? COVMATRIX_OFFDIAG_VEC_COMPR_SIZE : uncompr_size;
344
345 if( !(vec.size() == size || vec.size() == uncompr_size) ){ //If off-diagonal elements are already compressed, can either set with uncompressed or compressed vector
346 throw std::runtime_error(
347 "Setting track definingParametersCovMatrixOffDiag with vector of "
348 "size " +
349 std::to_string(vec.size()) + " instead of expected " +
350 std::to_string(size) + " or " + std::to_string(uncompr_size) +
351 " is not supported");
352 }
353
354 accCovMatrixOffDiag( *this ) = vec;
355 return;
356 }
357
359
360 std::span<const float> covMatrixOffDiag;
361 if( accCovMatrixOffDiag.isAvailable( *this ))
362 covMatrixOffDiag = std::span<const float>( accCovMatrixOffDiag( *this ) );
364 }
365
367
368 ParametersCovMatrix_t cov = definingParametersCovMatrix();
369 std::vector< float > offDiagVecCompr;
370 offDiagVecCompr.resize(COVMATRIX_OFFDIAG_VEC_COMPR_SIZE);
371
372 const covMatrixIndexPairVec& vecPairIndex = covMatrixComprIndexPairs();
373
374 for(unsigned int k=0; k<COVMATRIX_OFFDIAG_VEC_COMPR_SIZE; ++k){
375 std::pair<covMatrixIndex,covMatrixIndex> pairIndex = vecPairIndex[k];
376 covMatrixIndex i = pairIndex.first;
377 covMatrixIndex j = pairIndex.second;
378 float offDiagElement = cov(i,i)>0 && cov(j,j)>0 ? cov(i,j)/sqrt(cov(i,i)*cov(j,j)) : 0;
379 offDiagVecCompr[k] = offDiagElement;
380 }
381
382 accCovMatrixOffDiag( *this ) = offDiagVecCompr;
383 return;
384
385 }
386
387
388 //Old schema compatibility
389
390 void TrackParticle_v1::setDefiningParametersCovMatrixVec(const std::vector<float>& cov){
391
392 xAOD::ParametersCovMatrix_t covMatrix;
393 if( !cov.empty() ) Amg::expand( cov.begin(), cov.end(),covMatrix );
394 else covMatrix.setIdentity();
396
397 }
398
402
403 void TrackParticle_v1::setParametersOrigin(float x, float y, float z){
404 static const Accessor< float > acc1( "vx" );
405 acc1( *this ) = x;
406
407 static const Accessor< float > acc2( "vy" );
408 acc2( *this ) = y;
409
410 static const Accessor< float > acc3( "vz" );
411 acc3( *this ) = z;
412 }
413
414#ifndef XAOD_ANALYSIS
416
417 // Require the cache to be valid and check if the cached pointer has been set
418 if(m_perigeeParameters.isValid()){
419 return *(m_perigeeParameters.ptr());
420 }
421 static const Accessor< float > acc1( "d0" );
422 static const Accessor< float > acc2( "z0" );
423 static const Accessor< float > acc3( "phi" );
424 static const Accessor< float > acc4( "theta" );
425 static const Accessor< float > acc5( "qOverP" );
426 static const Accessor< std::vector<float> > acc6( "definingParametersCovMatrix" );
427 ParametersCovMatrix_t cov = ParametersCovMatrix_t(definingParametersCovMatrix());
428 static const Accessor< float > acc7( "beamlineTiltX" );
429 static const Accessor< float > acc8( "beamlineTiltY" );
430
431 if(!acc7.isAvailable( *this ) || !acc8.isAvailable( *this )){
432 Trk::Perigee tmpPerigeeParameters(
433 acc1(*this),
434 acc2(*this),
435 acc3(*this),
436 acc4(*this),
437 acc5(*this),
439 std::move(cov));
440 m_perigeeParameters.set(tmpPerigeeParameters);
441 return *(m_perigeeParameters.ptr());
442 }
443
444 Amg::Translation3D amgtranslation(vx(),vy(),vz());
445 Amg::Transform3D pAmgTransf = amgtranslation * Amg::RotationMatrix3D::Identity();
446 pAmgTransf *= Amg::AngleAxis3D(acc8(*this), Amg::Vector3D(0.,1.,0.));
447 pAmgTransf *= Amg::AngleAxis3D(acc7(*this), Amg::Vector3D(1.,0.,0.));
448 Trk::Perigee tmpPerigeeParameters(acc1(*this),
449 acc2(*this),
450 acc3(*this),
451 acc4(*this),
452 acc5(*this),
453 pAmgTransf,
454 std::move(cov));
455
456 m_perigeeParameters.set(tmpPerigeeParameters);
457 return *(m_perigeeParameters.ptr());
458 }
459#endif // not XAOD_ANALYSIS
460
463
465 static const Accessor< float > acc1( "chiSquared" );
466 acc1( *this ) = chiSquared;
467 static const Accessor< float > acc2( "numberDoF" );
468 acc2( *this ) = numberDoF;
469 }
470
471 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, float, radiusOfFirstHit, setRadiusOfFirstHit)
472 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, uint64_t, identifierOfFirstHit, setIdentifierOfFirstHit)
473
474 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, float, beamlineTiltX, setBeamlineTiltX)
475 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, float, beamlineTiltY, setBeamlineTiltY)
476
478
479 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, uint8_t,numberOfUsedHitsdEdx ,setNumberOfUsedHitsdEdx )
480
481 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TrackParticle_v1, uint8_t,numberOfIBLOverflowsdEdx , setNumberOfIBLOverflowsdEdx)
482
485 static const Accessor< std::vector<uint8_t> > acc( "parameterPosition" );
486 if(! acc.isAvailable( *this )) return 0;
487 return acc(*this).size();
488 }
489
490 const CurvilinearParameters_t TrackParticle_v1::trackParameters(unsigned int index) const{
491 CurvilinearParameters_t tmp;
494 return tmp;
495 }
496
497 void TrackParticle_v1::setTrackParameters(std::vector<std::vector<float> >& parameters){
498 static const Accessor< std::vector < float > > acc1( "parameterX" );
499 static const Accessor< std::vector < float > > acc2( "parameterY" );
500 static const Accessor< std::vector < float > > acc3( "parameterZ" );
501 static const Accessor< std::vector < float > > acc4( "parameterPX" );
502 static const Accessor< std::vector < float > > acc5( "parameterPY" );
503 static const Accessor< std::vector < float > > acc6( "parameterPZ" );
504 static const Accessor< std::vector<uint8_t> > acc7( "parameterPosition" );
505
506 acc1(*this).resize(parameters.size());
507 acc2(*this).resize(parameters.size());
508 acc3(*this).resize(parameters.size());
509 acc4(*this).resize(parameters.size());
510 acc5(*this).resize(parameters.size());
511 acc6(*this).resize(parameters.size());
512 acc7(*this).resize(parameters.size());
513
514 unsigned int index=0;
515 std::vector<std::vector<float> >::const_iterator it=parameters.begin(), itEnd=parameters.end();
516 for (;it!=itEnd;++it,++index){
517 assert((*it).size()==6);
518 acc1(*this).at(index)=(*it).at(0);
519 acc2(*this).at(index)=(*it).at(1);
520 acc3(*this).at(index)=(*it).at(2);
521 acc4(*this).at(index)=(*it).at(3);
522 acc5(*this).at(index)=(*it).at(4);
523 acc6(*this).at(index)=(*it).at(5);
524 }
525 }
526
527 float TrackParticle_v1::parameterX(unsigned int index) const {
528 static const Accessor< std::vector<float> > acc( "parameterX" );
529 return acc(*this).at(index);
530 }
531
532 float TrackParticle_v1::parameterY(unsigned int index) const {
533 static const Accessor< std::vector<float> > acc( "parameterY" );
534 return acc(*this).at(index);
535 }
536
537 float TrackParticle_v1::parameterZ(unsigned int index) const {
538 static const Accessor< std::vector<float> > acc( "parameterZ" );
539 return acc(*this).at(index);
540 }
541
542 float TrackParticle_v1::parameterPX(unsigned int index) const {
543 static const Accessor< std::vector<float> > acc( "parameterPX" );
544 return acc(*this).at(index);
545 }
546
547 float TrackParticle_v1::parameterPY(unsigned int index) const {
548 static const Accessor< std::vector<float> > acc( "parameterPY" );
549 return acc(*this).at(index);
550 }
551
552 float TrackParticle_v1::parameterPZ(unsigned int index) const {
553 static const Accessor< std::vector<float> > acc( "parameterPZ" );
554 return acc(*this).at(index);
555 }
556
557 xAOD::ParametersCovMatrix_t TrackParticle_v1::trackParameterCovarianceMatrix(unsigned int index) const
558 {
559 static const Accessor< std::vector<float> > acc( "trackParameterCovarianceMatrices" );
560 unsigned int offset = index*15;
561 // copy the correct values into the temp matrix
562 xAOD::ParametersCovMatrix_t tmp;
563 std::vector<float>::const_iterator it = acc(*this).begin()+offset;
564 Amg::expand(it,it+15,tmp);
565 return tmp;
566 }
567
568 void TrackParticle_v1::setTrackParameterCovarianceMatrix(unsigned int index, std::vector<float>& cov){
569 assert(cov.size()==15);
570 unsigned int offset = index*15;
571 static const Accessor< std::vector < float > > acc( "trackParameterCovarianceMatrices" );
572 std::vector<float>& v = acc(*this);
573 v.resize(offset+15);
574 std::copy(cov.begin(),cov.end(),v.begin()+offset );
575 }
576
578 {
579 static const Accessor< std::vector<uint8_t> > acc( "parameterPosition" );
580 return static_cast<xAOD::ParameterPosition>(acc(*this).at(index));
581 }
582
584 {
585 size_t maxParameters = numberOfParameters();
586 bool foundParameters=false;
587 for (size_t i=0; i<maxParameters; ++i){
588 if (parameterPosition(i)==position){
589 foundParameters=true;
590 index=i;
591 break;
592 }
593 }
594 return foundParameters;
595 }
596
598 static const Accessor< std::vector<uint8_t> > acc( "parameterPosition" );
599 acc( *this ).at(index) = static_cast<uint8_t>(pos);
600 }
601
602#ifndef XAOD_ANALYSIS
604
605 static const Accessor< std::vector<float> > acc( "trackParameterCovarianceMatrices" );
606 unsigned int offset = index*15;
607 // copy the correct values into the temp matrix
608 ParametersCovMatrix_t cov;
609 auto it = acc(*this).begin()+offset;
610 Amg::expand(it,it+15,cov);
611 // retrieve the parameters to build the curvilinear frame
614 Trk::CurvilinearParameters param(pos,mom,charge(),std::move(cov));
615
616 return param;
617 }
618#endif // not XAOD_ANALYSIS
619
622
624 static const Accessor<uint8_t> acc("trackFitter");
625 acc(*this) = static_cast<uint8_t>(value);
626 }
627
629 static const Accessor<uint8_t> acc("trackFitter");
630 if (!acc.isAvailable(*this)) {
632 }
633 return static_cast<xAOD::TrackFitter>(acc(*this));
634 }
635
636 std::bitset<xAOD::NumberOfTrackRecoInfo> TrackParticle_v1::patternRecoInfo()
637 const {
638 static const Accessor< uint64_t > acc( "patternRecoInfo" );
639 std::bitset<xAOD::NumberOfTrackRecoInfo> tmp(acc(*this));
640 return tmp;
641 }
642
644 static const Accessor< uint64_t > acc( "patternRecoInfo" );
645 acc( *this ) = patternReco;
646 }
647
648 void TrackParticle_v1::setPatternRecognitionInfo(const std::bitset<xAOD::NumberOfTrackRecoInfo>& patternReco) {
649 static const Accessor< uint64_t > acc( "patternRecoInfo" );
650 acc( *this ) = patternReco.to_ullong();
651 }
652
654 static const Accessor<uint8_t> acc("particleHypothesis");
655 acc(*this) = static_cast<uint8_t>(value);
656 }
657
659 static const Accessor<uint8_t> acc("particleHypothesis");
660 if (!acc.isAvailable(*this)) {
661 return xAOD::pion;
662 }
663 return static_cast<xAOD::ParticleHypothesis>(acc(*this));
664 }
665
666 bool TrackParticle_v1::summaryValue(uint8_t& value, const SummaryType &information) const {
668 if( ( ! acc ) || ( ! acc->isAvailable( *this ) ) ) return false;
669 // Retrieve the value:
670 value = ( *acc )( *this );
671 return true;
672 }
673
674 bool TrackParticle_v1::summaryValue(float& value, const SummaryType &information) const {
676 if( ( ! acc ) || ( ! acc->isAvailable( *this ) ) ) return false;
677 // Retrieve the value:
678 value = ( *acc )( *this );
679 return true;
680 }
681
682 void TrackParticle_v1::setSummaryValue(uint8_t& value, const SummaryType &information){
684 // Set the value:
685 ( *acc )( *this ) = value;
686 }
687
688 void TrackParticle_v1::setSummaryValue(float& value, const SummaryType &information){
690 // Set the value:
691 ( *acc )( *this ) = value;
692 }
693
699
700
701#ifndef XAOD_ANALYSIS
709
710 // The accessor:
711 static const ConstAccessor< ElementLink< TrackCollection > > acc( "trackLink" );
712
713 // Check if one of them is available:
714 if( acc.isAvailable( *this ) ) {
715 return acc( *this );
716 }
717
718 // If no Trk::Track link was not set (yet), return a dummy object:
719 static const ElementLink< TrackCollection > dummy;
720 return dummy;
721 }
722
725
726 // The accessor:
727 static const Accessor< ElementLink< TrackCollection > > acc( "trackLink" );
728
729 // Do the deed:
730 acc( *this ) = el;
731 return;
732 }
733
735
736 // The accessor:
737 static const ConstAccessor< ElementLink< TrackCollection > > acc( "trackLink" );
738
739 if( ! acc.isAvailable( *this ) ) {
740 return nullptr;
741 }
742 if( ! acc( *this ).isValid() ) {
743 return nullptr;
744 }
745
746 return *( acc( *this ) );
747 }
748#endif // not XAOD_ANALYSIS
749
751#ifndef XAOD_ANALYSIS
752 m_perigeeParameters.reset();
753#endif // not XAOD_ANALYSIS
754 }
755
756} // namespace xAOD
Scalar theta() const
theta method
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME, SETTER)
Macro creating a setter function with a type conversion.
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
std::vector< size_t > vec
#define AmgSymMatrix(dim)
A number of constexpr particle constants to avoid hardcoding them directly in various places.
Helper functions for TrackingDetails accessors.
#define y
#define x
#define z
constexpr int pow(int base, int exp) noexcept
void makePrivateStore()
Create a new (empty) private store for this object.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
bool hasStore() const
Return true if this object has an associated store.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
const SG::AuxVectorData * container() const
Return the container holding this element.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing the Line to which the Perigee refers to.
IParticle & operator=(const IParticle &)=default
IParticle()=default
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Class describing a TrackParticle.
void setTrackParameterCovarianceMatrix(unsigned int index, std::vector< float > &cov)
Set the cov matrix of the parameter at 'index', using a vector of floats.
void setDefiningParametersCovMatrix(const ParametersCovMatrix_t &cov)
Set the defining parameters covariance matrix.
float z0() const
Returns the parameter.
void setTrackParameters(std::vector< std::vector< float > > &parameters)
Set the parameters via the passed vector of vectors.
const std::vector< float > & definingParametersCovMatrixDiagVec() const
Returns the diagonal elements of the defining parameters covariance matrix.
TrackingDetails::covMatrixIndex covMatrixIndex
float vx() const
The x origin for the parameters.
void setTrackLink(const ElementLink< TrackCollection > &track)
Set the link to the original track.
const ElementLink< TrackCollection > & trackLink() const
Returns a link (which can be invalid) to the Trk::Track which was used to make this TrackParticle.
float theta() const
Returns the parameter, which has range 0 to .
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzM4D< double > > GenVecFourMom_t
Base 4 Momentum type for TrackParticle.
DefiningParameters_t definingParameters() const
Returns a SVector of the Perigee track parameters.
void setDefiningParametersCovMatrixOffDiagVec(const std::vector< float > &vec)
Set the off-diagonal elements of the defining parameters covariance matrix.
bool definingParametersCovMatrixOffDiagCompr() const
float time() const
Returns the time.
void resetCache()
Reset the internal cache of the object.
virtual double m() const override final
The invariant mass of the particle..
TrackParticle_v1 & operator=(const TrackParticle_v1 &tp)
Assignment operator. This can involve creating and copying an Auxilary store, and so should be used s...
bool indexOfParameterAtPosition(unsigned int &index, ParameterPosition position) const
Function to determine if this TrackParticle contains track parameters at a certain position,...
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
void compressDefiningParametersCovMatrixOffDiag()
Delete some off-diagonal elements for compression.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
static const covMatrixIndexPairVec & covMatrixComprIndexPairs()
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
void setParameterPosition(unsigned int index, ParameterPosition pos)
Set the 'position' (i.e. where it is in ATLAS) of the parameter at 'index', using the ParameterPositi...
float parameterPX(unsigned int index) const
Returns the parameter x momentum component, for 'index'.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
float parameterX(unsigned int index) const
Returns the parameter x position, for 'index'.
const Trk::CurvilinearParameters curvilinearParameters(unsigned int index) const
Returns a curvilinear representation of the parameters at 'index'.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
float parameterPY(unsigned int index) const
Returns the parameter y momentum component, for 'index'.
const CurvilinearParameters_t trackParameters(unsigned int index) const
Returns the track parameter vector at 'index'.
float vz() const
The z origin for the parameters.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
std::bitset< NumberOfTrackRecoInfo > patternRecoInfo() const
Access method for pattern recognition algorithm.
virtual double rapidity() const override final
The true rapidity (y) of the particle.
ParametersCovMatrix_t trackParameterCovarianceMatrix(unsigned int index) const
Returns the TrackParticleCovMatrix_t (covariance matrix) at 'index', which corresponds to the paramet...
void setParametersOrigin(float x, float y, float z)
Set the origin for the parameters.
float parameterZ(unsigned int index) const
Returns the parameter z position, for 'index'.
CxxUtils::CachedValue< Trk::Perigee > m_perigeeParameters
Cached MeasuredPerigee, built from this object.
float vy() const
The y origin for the parameters.
xAOD::ParameterPosition parameterPosition(unsigned int index) const
Return the ParameterPosition of the parameters at 'index'.
float d0() const
Returns the parameter.
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
void setDefiningParametersCovMatrixDiagVec(const std::vector< float > &vec)
Set the defining parameters covariance matrix using a length 15 vector.
void setParticleHypothesis(const ParticleHypothesis hypo)
Method for setting the particle type, using the ParticleHypothesis enum.
size_t numberOfParameters() const
Returns the number of additional parameters stored in the TrackParticle.
float qOverP() const
Returns the parameter.
std::vector< float > definingParametersCovMatrixVec() const
Returns the length 6 vector containing the elements of defining parameters covariance matrix.
virtual Type::ObjectType type() const override final
The type of the object as a simple enumeration.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float parameterY(unsigned int index) const
Returns the parameter y position, for 'index'.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector form.
float chiSquared() const
Returns the of the overall track fit.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void setSummaryValue(uint8_t &value, const SummaryType &information)
Set method for TrackSummary values.
static const std::size_t COVMATRIX_OFFDIAG_VEC_COMPR_SIZE
ParametersCovMatrixFilled_t definingParametersCovMatrixFilled() const
Returns a 5x5 matrix describing which elements of the covariance matrix are known.
void setTrackFitter(const TrackFitter fitter)
Method for setting the fitter, using the TrackFitter enum.
void setPatternRecognitionInfo(const std::bitset< xAOD::NumberOfTrackRecoInfo > &patternReco)
Method setting the pattern recognition algorithm, using a bitset.
float charge() const
Returns the charge.
TrackParticle_v1()
Default constructor.
TrackFitter trackFitter() const
Returns the fitter.
const std::vector< float > & definingParametersCovMatrixOffDiagVec() const
Returns the correlation coefficient associated with the off-diagonal elements of the covariance matri...
void setTime(float time)
std::vector< std::pair< covMatrixIndex, covMatrixIndex > > covMatrixIndexPairVec
ParticleHypothesis particleHypothesis() const
Returns the particle hypothesis used for Track fitting.
float phi0() const
Returns the parameter, which has range to .
void setDefiningParametersCovMatrixVec(const std::vector< float > &cov)
float parameterPZ(unsigned int index) const
Returns the parameter z momentum component, for 'index'.
virtual double e() const override final
The total energy of the particle.
Eigen::AngleAxisd AngleAxis3D
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
void expand(std::vector< float >::const_iterator it, std::vector< float >::const_iterator, AmgSymMatrix(N) &covMatrix)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
constexpr double muonMassInMeV
the mass of the muon (in MeV)
constexpr double chargedPionMassInMeV
the mass of the charged pion (in MeV)
constexpr double electronMassInMeV
the mass of the electron (in MeV)
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
Definition index.py:1
STL namespace.
void covarianceUnsetHook()
Function that would be possible to use to debug what client is trying to access covariance matrix fro...
GenVecFourMom_t genvecP4(float qOverP, float thetaT, float phiT, double m)
bool definingParametersCovMatrixOffDiagCompr(std::span< const float > covMatrixOffDiag)
xAOD::ParametersCovMatrix_t definingParametersCovMatrix(std::span< const float > covMatrixDiag, std::span< const float > covMatrixOffDiag, bool &valid)
float charge(float qOverP)
constexpr std::array< std::pair< covMatrixIndex, covMatrixIndex >, COVMATRIX_OFFDIAG_VEC_COMPR_SIZE > covMatrixComprIndexPairs
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static const SG::AuxElement::Accessor< std::vector< float > > accCovMatrixOffDiag("definingParametersCovMatrixOffDiag")
Eigen::Matrix< bool, 5, 5, 0, 5, 5 > ParametersCovMatrixFilled_t
const SG::AuxElement::Accessor< float > * trackSummaryAccessorV1< float >(xAOD::SummaryType type)
const SG::AuxElement::Accessor< uint8_t > * trackSummaryAccessorV1< uint8_t >(xAOD::SummaryType type)
TrackFitter
Enums to identify who created this track and which properties does it have.
@ NumberOfTrackFitters
maximum number of enums
@ GaussianSumFilter
Tracks from Gaussian Sum Filter.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
SummaryType
Enumerates the different types of information stored in Summary.
setEventNumber uint32_t
ParameterPosition
Enum allowing us to know where in ATLAS the parameters are defined.
static const SG::AuxElement::Accessor< std::vector< float > > accCovMatrixDiag("definingParametersCovMatrixDiag")