ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
Trk::GXFTrajectory Class Reference

Internal representation of the track, used in the track fit. More...

#include <GXFTrajectory.h>

Collaboration diagram for Trk::GXFTrajectory:

Public Member Functions

 GXFTrajectory ()
 
 GXFTrajectory (const GXFTrajectory &rhs)
 
GXFTrajectoryoperator= (const GXFTrajectory &rhs)
 
 GXFTrajectory (GXFTrajectory &&rhs)=default
 
GXFTrajectoryoperator= (GXFTrajectory &&rhs)=default
 
 ~GXFTrajectory ()=default
 
bool addMeasurementState (std::unique_ptr< GXFTrackState >, int index=-1)
 
void addMaterialState (std::unique_ptr< GXFTrackState >, int index=-1)
 
void addBasicState (std::unique_ptr< GXFTrackState >, int index=-1)
 
void setReferenceParameters (std::unique_ptr< const TrackParameters >)
 
void setScatteringAngles (std::vector< std::pair< double, double > > &)
 
void setBrems (std::vector< double > &)
 
void setNumberOfPerigeeParameters (int)
 
void setConverged (bool)
 
void reset ()
 
void setPrefit (int)
 
void setOutlier (int, bool isoutlier=true)
 
void setPrevChi2 (double)
 
void setChi2 (double)
 
void setMass (double)
 
void conditionalSetCalorimeterEnergyLossState (GXFTrackState *)
 
std::pair< GXFTrackState *, GXFTrackState * > findFirstLastMeasurement (void)
 
bool hasKink (void)
 
int numberOfScatterers () const
 
void setNumberOfScatterers (int)
 
int numberOfBrems () const
 
void setNumberOfBrems (int)
 
int numberOfUpstreamStates () const
 
int numberOfUpstreamScatterers () const
 
int numberOfUpstreamBrems () const
 
int numberOfPerigeeParameters () const
 
int numberOfFitParameters () const
 
int numberOfSiliconHits () const
 
int numberOfTRTPrecHits () const
 
int numberOfTRTTubeHits () const
 
int numberOfTRTHits () const
 
int numberOfHits () const
 
int numberOfPseudoMeasurements () const
 
int numberOfOutliers () const
 
void updateTRTHitCount (int index, float oldError)
 
const std::vector< std::unique_ptr< GXFTrackState > > & trackStates () const
 
std::vector< std::unique_ptr< GXFTrackState > > & trackStates ()
 
std::vector< std::pair< double, double > > & scatteringAngles ()
 
std::vector< std::pair< double, double > > & scatteringSigmas ()
 
std::vector< double > & brems ()
 
const TrackParametersreferenceParameters ()
 
bool converged () const
 
int prefit () const
 
void resetReferenceParameters ()
 
double chi2 () const
 
double prevchi2 () const
 
int nDOF () const
 
Amg::VectorXresiduals ()
 
Amg::VectorXerrors ()
 
Amg::MatrixXweightedResidualDerivatives ()
 
double totalX0 () const
 
double totalEnergyLoss () const
 
double mass () const
 
GXFTrackStatecaloElossState ()
 
std::vector< std::pair< const Layer *, const Layer * > > & upstreamMaterialLayers ()
 
void resetCovariances (void)
 
std::unique_ptr< const FitQualityquality (void) const
 

Public Attributes

bool m_straightline
 
MagneticFieldProperties m_fieldprop = Trk::FullField
 

Private Attributes

std::vector< std::unique_ptr< GXFTrackState > > m_states
 The vector of track states, i.e. More...
 
int m_ndof
 
double m_chi2
 
double m_prevchi2
 
int m_nperpars
 
int m_nscatterers
 
int m_ncaloscatterers
 
int m_nbrems
 
int m_nupstreamstates
 
int m_nupstreamscatterers
 
int m_nupstreamcaloscatterers
 
int m_nupstreambrems
 
int m_nhits
 
int m_noutl
 
int m_nsihits
 
int m_ntrthits
 
int m_ntrtprechits
 
int m_ntrttubehits
 
int m_npseudo
 
int m_nmeasoutl
 
std::unique_ptr< const TrackParametersm_refpar
 
bool m_converged
 
std::vector< std::pair< double, double > > m_scatteringangles
 
std::vector< std::pair< double, double > > m_scatteringsigmas
 
std::vector< double > m_brems
 
Amg::VectorX m_res
 
Amg::VectorX m_errors
 
Amg::MatrixX m_weightresderiv
 
double m_totx0
 
double m_toteloss
 
double m_mass
 
int m_prefit
 
GXFTrackStatem_caloelossstate
 
std::vector< std::pair< const Layer *, const Layer * > > m_upstreammat
 

Detailed Description

Internal representation of the track, used in the track fit.

Author
thijs.nosp@m..cor.nosp@m.nelis.nosp@m.sen@.nosp@m.cern..nosp@m.ch

Definition at line 31 of file GXFTrajectory.h.

Constructor & Destructor Documentation

◆ GXFTrajectory() [1/3]

Trk::GXFTrajectory::GXFTrajectory ( )

Definition at line 15 of file GXFTrajectory.cxx.

15  {
16  m_straightline = true;
17  m_ndof = 0;
18  m_nperpars = -1;
19  m_nscatterers = 0;
21  m_nbrems = 0;
25  m_nupstreambrems = 0;
26  m_nsihits = 0;
27  m_ntrthits = 0;
28  m_ntrtprechits = 0;
29  m_ntrttubehits = 0;
30  m_npseudo = 0;
31  m_nhits = 0;
32  m_noutl = 0;
33  m_nmeasoutl = 0;
34  m_chi2 = 0;
35  m_prevchi2 = 0;
36  m_converged = false;
37  m_prefit = 0;
38  m_refpar.reset(nullptr);
39  m_totx0 = 0;
40  m_toteloss = 0;
41  m_mass = 0;
42  m_caloelossstate = nullptr;
43  }

◆ GXFTrajectory() [2/3]

Trk::GXFTrajectory::GXFTrajectory ( const GXFTrajectory rhs)

Definition at line 45 of file GXFTrajectory.cxx.

46  : m_straightline (rhs.m_straightline),
47  m_fieldprop (rhs.m_fieldprop),
48  m_ndof (rhs.m_ndof),
49  m_chi2 (rhs.m_chi2),
50  m_prevchi2 (rhs.m_prevchi2),
51  m_nperpars (rhs.m_nperpars),
52  m_nscatterers (rhs.m_nscatterers),
53  m_ncaloscatterers (rhs.m_ncaloscatterers),
54  m_nbrems (rhs.m_nbrems),
55  m_nupstreamstates (rhs.m_nupstreamstates),
56  m_nupstreamscatterers (rhs.m_nupstreamscatterers),
57  m_nupstreamcaloscatterers (rhs.m_nupstreamcaloscatterers),
58  m_nupstreambrems (rhs.m_nupstreambrems),
59  m_nhits (rhs.m_nhits),
60  m_noutl (rhs.m_noutl),
61  m_nsihits (rhs.m_nsihits),
62  m_ntrthits (rhs.m_ntrthits),
63  m_ntrtprechits (rhs.m_ntrtprechits),
64  m_ntrttubehits (rhs.m_ntrttubehits),
65  m_npseudo (rhs.m_npseudo),
66  m_nmeasoutl (rhs.m_nmeasoutl),
67  m_refpar(rhs.m_refpar != nullptr ? rhs.m_refpar->clone() : nullptr),
68  m_converged (rhs.m_converged),
69  m_scatteringangles (rhs.m_scatteringangles),
70  m_scatteringsigmas (rhs.m_scatteringsigmas),
71  m_brems (rhs.m_brems),
72  m_res (rhs.m_res),
73  m_errors (rhs.m_errors),
74  m_weightresderiv (rhs.m_weightresderiv),
75  m_totx0 (rhs.m_totx0),
76  m_toteloss (rhs.m_toteloss),
77  m_mass (rhs.m_mass),
78  m_prefit (rhs.m_prefit),
79  m_caloelossstate (nullptr),
80  m_upstreammat (rhs.m_upstreammat)
81  {
82 
83  m_states.reserve(rhs.m_states.size());
84  for (const std::unique_ptr<GXFTrackState> & i : rhs.m_states) {
85  m_states.emplace_back(std::make_unique<GXFTrackState>(*i));
86  }
87 
88  if (rhs.m_caloelossstate != nullptr) {
89  for (auto & state : m_states) {
91  }
92  }
93  }

◆ GXFTrajectory() [3/3]

Trk::GXFTrajectory::GXFTrajectory ( GXFTrajectory &&  rhs)
default

◆ ~GXFTrajectory()

Trk::GXFTrajectory::~GXFTrajectory ( )
default

Member Function Documentation

◆ addBasicState()

void Trk::GXFTrajectory::addBasicState ( std::unique_ptr< GXFTrackState state,
int  index = -1 
)

Definition at line 266 of file GXFTrajectory.cxx.

266  {
267  if (index == -1) {
268  m_states.push_back(std::move(state));
269  } else {
270  m_states.insert(m_states.begin() + index, std::move(state));
271  }
272  }

◆ addMaterialState()

void Trk::GXFTrajectory::addMaterialState ( std::unique_ptr< GXFTrackState state,
int  index = -1 
)

Definition at line 224 of file GXFTrajectory.cxx.

224  {
225  GXFMaterialEffects *meff = state->materialEffects();
226 
227  if (state->getStateType(TrackStateOnSurface::Scatterer)) {
228  m_nscatterers++;
229 
230  if (meff->deltaE() == 0) {
232  }
233  }
234 
235  if (meff->sigmaDeltaE() > 0) {
236  m_nbrems++;
238  }
239 
240  m_toteloss += std::abs(meff->deltaE());
241  m_totx0 += meff->x0();
242 
243  if (index == -1) {
244  m_states.push_back(std::move(state));
245 
246  if (meff->sigmaDeltaE() > 0) {
247  m_brems.push_back(meff->delta_p());
248  }
249  } else {
250  m_states.insert(m_states.begin() + index, std::move(state));
251  int previousbrems = 0;
252 
253  for (int i = 0; i < index; i++) {
254  if ((m_states[i]->materialEffects() != nullptr)
255  && m_states[i]->materialEffects()->sigmaDeltaE() > 0) {
256  previousbrems++;
257  }
258  }
259 
260  if (meff->sigmaDeltaE() > 0) {
261  m_brems.insert(m_brems.begin() + previousbrems, meff->delta_p());
262  }
263  }
264  }

◆ addMeasurementState()

bool Trk::GXFTrajectory::addMeasurementState ( std::unique_ptr< GXFTrackState state,
int  index = -1 
)

Definition at line 166 of file GXFTrajectory.cxx.

166  {
167  if (!m_states.empty() && (m_states.back()->measurement() != nullptr)) {
168  const MeasurementBase *meas = m_states.back()->measurement();
169  const MeasurementBase *meas2 = state->measurement();
170 
171  if (
172  &meas->associatedSurface() == &meas2->associatedSurface() &&
173  meas->localParameters().parameterKey() == meas2->localParameters().parameterKey() &&
174  state->measurementType() != TrackState::MM
175  ) {
176  return false;
177  }
178  }
179 
180  int nmeas = 0;
181  double *errors = state->measurementErrors();
182 
183  for (int i = 0; i < 5; i++) {
184  if (errors[i] > 0) {
185  nmeas++;
186  }
187  }
188 
189  if (state->getStateType(TrackStateOnSurface::Measurement)) {
190  m_ndof += nmeas;
191  } else {
192  m_nmeasoutl += nmeas;
193  m_noutl++;
194  }
195 
196  if (state->measurementType() != TrackState::Pseudo) {
197  m_nhits++;
198  }
199 
200  if (state->measurementType() == TrackState::Pixel
201  || state->measurementType() == TrackState::SCT) {
202  m_nsihits++;
203  }
204 
205  if (state->measurementType() == TrackState::TRT) {
206  m_ntrthits++;
207  if (errors[0]<1) m_ntrtprechits++;
208  if (errors[0]>1) m_ntrttubehits++;
209  }
210 
211  if (state->measurementType() == TrackState::Pseudo) {
212  m_npseudo++;
213  }
214 
215  if (index == -1) {
216  m_states.push_back(std::move(state));
217  } else {
218  m_states.insert(m_states.begin() + index, std::move(state));
219  }
220 
221  return true;
222  }

◆ brems()

std::vector< double > & Trk::GXFTrajectory::brems ( )

Definition at line 552 of file GXFTrajectory.cxx.

552  {
553  return m_brems;
554  }

◆ caloElossState()

GXFTrackState * Trk::GXFTrajectory::caloElossState ( )

Definition at line 639 of file GXFTrajectory.cxx.

639  {
640  return m_caloelossstate;
641  }

◆ chi2()

double Trk::GXFTrajectory::chi2 ( ) const

Definition at line 503 of file GXFTrajectory.cxx.

503  {
504  return m_chi2;
505  }

◆ conditionalSetCalorimeterEnergyLossState()

void Trk::GXFTrajectory::conditionalSetCalorimeterEnergyLossState ( GXFTrackState state)

Definition at line 148 of file GXFTrajectory.cxx.

148  {
149  constexpr double perpThreshold = 1400;
150  constexpr double zThreshold = 3700;
151 
152  const GXFMaterialEffects *meff = state->materialEffects();
153  const TrackParameters *par = state->trackParameters();
154 
155  if (
156  meff != nullptr &&
157  par != nullptr &&
158  meff->sigmaDeltaE() > 0 &&
159  meff->sigmaDeltaPhi() == 0 &&
160  (par->position().perp() > perpThreshold || std::abs(par->position().z()) > zThreshold)
161  ) {
162  m_caloelossstate = state;
163  }
164  }

◆ converged()

bool Trk::GXFTrajectory::converged ( ) const

Definition at line 422 of file GXFTrajectory.cxx.

422  {
423  return m_converged;
424  }

◆ errors()

Amg::VectorX & Trk::GXFTrajectory::errors ( )

Definition at line 602 of file GXFTrajectory.cxx.

602  {
603  if (m_errors.size() == 0) {
605  }
606  return m_errors;
607  }

◆ findFirstLastMeasurement()

std::pair< GXFTrackState *, GXFTrackState * > Trk::GXFTrajectory::findFirstLastMeasurement ( void  )

Definition at line 648 of file GXFTrajectory.cxx.

648  {
649  GXFTrackState *firstmeasstate = nullptr;
650  GXFTrackState *lastmeasstate = nullptr;
651 
652  for (std::unique_ptr<GXFTrackState> & hit : trackStates()) {
653  if (hit->measurement() != nullptr) {
654  if (firstmeasstate == nullptr) {
655  firstmeasstate = hit.get();
656  }
657  lastmeasstate = hit.get();
658  }
659  }
660 
661  if (firstmeasstate == nullptr) {
662  throw std::logic_error("no first measurement.");
663  }
664 
665  return std::make_pair(firstmeasstate, lastmeasstate);
666  }

◆ hasKink()

bool Trk::GXFTrajectory::hasKink ( void  )

Definition at line 668 of file GXFTrajectory.cxx.

668  {
669  for (auto & hit : trackStates()) {
670  if (
671  hit->measurementType() == TrackState::Pseudo &&
672  hit->getStateType(TrackStateOnSurface::Outlier)
673  ) {
674  continue;
675  }
676 
677  if (
678  (hit->materialEffects() != nullptr) &&
679  hit->materialEffects()->isKink()
680  ) {
681  return true;
682  }
683  }
684 
685  return false;
686  }

◆ mass()

double Trk::GXFTrajectory::mass ( ) const

Definition at line 630 of file GXFTrajectory.cxx.

630  {
631  return m_mass;
632  }

◆ nDOF()

int Trk::GXFTrajectory::nDOF ( ) const

Definition at line 519 of file GXFTrajectory.cxx.

519  {
520  return m_ndof;
521  }

◆ numberOfBrems()

int Trk::GXFTrajectory::numberOfBrems ( ) const

Definition at line 469 of file GXFTrajectory.cxx.

469  {
470  return m_nbrems;
471  }

◆ numberOfFitParameters()

int Trk::GXFTrajectory::numberOfFitParameters ( ) const

Definition at line 496 of file GXFTrajectory.cxx.

496  {
497  if (m_prefit == 1) {
499  }
500  return m_nperpars + numberOfBrems() + 2 * numberOfScatterers();
501  }

◆ numberOfHits()

int Trk::GXFTrajectory::numberOfHits ( ) const

Definition at line 430 of file GXFTrajectory.cxx.

430  {
431  return m_nhits;
432  }

◆ numberOfOutliers()

int Trk::GXFTrajectory::numberOfOutliers ( ) const

Definition at line 434 of file GXFTrajectory.cxx.

434  {
435  return m_noutl;
436  }

◆ numberOfPerigeeParameters()

int Trk::GXFTrajectory::numberOfPerigeeParameters ( ) const

Definition at line 492 of file GXFTrajectory.cxx.

492  {
493  return m_nperpars;
494  }

◆ numberOfPseudoMeasurements()

int Trk::GXFTrajectory::numberOfPseudoMeasurements ( ) const

Definition at line 454 of file GXFTrajectory.cxx.

454  {
455  return m_npseudo;
456  }

◆ numberOfScatterers()

int Trk::GXFTrajectory::numberOfScatterers ( ) const

Definition at line 458 of file GXFTrajectory.cxx.

458  {
459  if (m_prefit != 0) {
460  return m_ncaloscatterers;
461  }
462  return m_nscatterers;
463  }

◆ numberOfSiliconHits()

int Trk::GXFTrajectory::numberOfSiliconHits ( ) const

Definition at line 438 of file GXFTrajectory.cxx.

438  {
439  return m_nsihits;
440  }

◆ numberOfTRTHits()

int Trk::GXFTrajectory::numberOfTRTHits ( ) const

Definition at line 442 of file GXFTrajectory.cxx.

442  {
443  return m_ntrthits;
444  }

◆ numberOfTRTPrecHits()

int Trk::GXFTrajectory::numberOfTRTPrecHits ( ) const

Definition at line 446 of file GXFTrajectory.cxx.

446  {
447  return m_ntrtprechits;
448  }

◆ numberOfTRTTubeHits()

int Trk::GXFTrajectory::numberOfTRTTubeHits ( ) const

Definition at line 450 of file GXFTrajectory.cxx.

450  {
451  return m_ntrttubehits;
452  }

◆ numberOfUpstreamBrems()

int Trk::GXFTrajectory::numberOfUpstreamBrems ( ) const

Definition at line 488 of file GXFTrajectory.cxx.

488  {
489  return m_nupstreambrems;
490  }

◆ numberOfUpstreamScatterers()

int Trk::GXFTrajectory::numberOfUpstreamScatterers ( ) const

Definition at line 481 of file GXFTrajectory.cxx.

481  {
482  if (m_prefit == 0) {
483  return m_nupstreamscatterers;
484  }
486  }

◆ numberOfUpstreamStates()

int Trk::GXFTrajectory::numberOfUpstreamStates ( ) const

Definition at line 477 of file GXFTrajectory.cxx.

477  {
478  return m_nupstreamstates;
479  }

◆ operator=() [1/2]

GXFTrajectory & Trk::GXFTrajectory::operator= ( const GXFTrajectory rhs)

Definition at line 95 of file GXFTrajectory.cxx.

95  {
96  if (this != &rhs) {
97  m_straightline = rhs.m_straightline;
98  m_fieldprop = rhs.m_fieldprop;
99  m_ndof = rhs.m_ndof;
100  m_nperpars = rhs.m_nperpars;
101  m_nscatterers = rhs.m_nscatterers;
102  m_ncaloscatterers = rhs.m_ncaloscatterers;
103  m_nbrems = rhs.m_nbrems;
104  m_nupstreamstates = rhs.m_nupstreamstates;
105  m_nupstreamscatterers = rhs.m_nupstreamscatterers;
106  m_nupstreamcaloscatterers = rhs.m_nupstreamcaloscatterers;
107  m_nupstreambrems = rhs.m_nupstreambrems;
108  m_nsihits = rhs.m_nsihits;
109  m_ntrthits = rhs.m_ntrthits;
110  m_ntrtprechits = rhs.m_ntrtprechits;
111  m_ntrttubehits = rhs.m_ntrttubehits;
112  m_nhits = rhs.m_nhits;
113  m_npseudo = rhs.m_npseudo;
114  m_noutl = rhs.m_noutl;
115  m_nmeasoutl = rhs.m_nmeasoutl;
116  m_chi2 = rhs.m_chi2;
117  m_prevchi2 = rhs.m_prevchi2;
118  m_converged = rhs.m_converged;
119  m_prefit = rhs.m_prefit;
120  m_refpar.reset(rhs.m_refpar != nullptr ? rhs.m_refpar->clone() : nullptr);
121 
122  m_states.clear();
123  for (const std::unique_ptr<GXFTrackState> & i : rhs.m_states) {
124  m_states.push_back(std::make_unique<GXFTrackState>(*i));
125  }
126 
127  m_scatteringangles = rhs.m_scatteringangles;
128  m_scatteringsigmas = rhs.m_scatteringsigmas;
129  m_brems = rhs.m_brems;
130  m_res = rhs.m_res;
131  m_errors = rhs.m_errors;
132  m_weightresderiv = rhs.m_weightresderiv;
133  m_totx0 = rhs.m_totx0;
134  m_toteloss = rhs.m_toteloss;
135  m_mass = rhs.m_mass;
136  m_caloelossstate = nullptr;
137 
138  if (rhs.m_caloelossstate != nullptr) {
139  for (auto & state : m_states) {
141  }
142  }
143  m_upstreammat = rhs.m_upstreammat;
144  }
145  return *this;
146  }

◆ operator=() [2/2]

GXFTrajectory& Trk::GXFTrajectory::operator= ( GXFTrajectory &&  rhs)
default

◆ prefit()

int Trk::GXFTrajectory::prefit ( ) const

Definition at line 426 of file GXFTrajectory.cxx.

426  {
427  return m_prefit;
428  }

◆ prevchi2()

double Trk::GXFTrajectory::prevchi2 ( ) const

Definition at line 507 of file GXFTrajectory.cxx.

507  {
508  return m_prevchi2;
509  }

◆ quality()

std::unique_ptr< const FitQuality > Trk::GXFTrajectory::quality ( void  ) const

Definition at line 694 of file GXFTrajectory.cxx.

694  {
695  return std::make_unique<const FitQuality>(chi2(), nDOF());
696  }

◆ referenceParameters()

const TrackParameters * Trk::GXFTrajectory::referenceParameters ( )

Definition at line 343 of file GXFTrajectory.cxx.

343  {
344  return m_refpar.get();
345  }

◆ reset()

void Trk::GXFTrajectory::reset ( )

Definition at line 412 of file GXFTrajectory.cxx.

412  {
413  m_res.resize(0);
414  m_weightresderiv.resize(0, 0);
415  m_errors.resize(0);
416  m_scatteringangles.clear();
417  m_scatteringsigmas.clear();
418  m_converged = false;
419  m_refpar.reset(nullptr);
420  }

◆ resetCovariances()

void Trk::GXFTrajectory::resetCovariances ( void  )

Definition at line 688 of file GXFTrajectory.cxx.

688  {
689  for (std::unique_ptr<GXFTrackState> & hit : trackStates()) {
690  hit->setTrackCovariance(nullptr);
691  }
692  }

◆ resetReferenceParameters()

void Trk::GXFTrajectory::resetReferenceParameters ( )

Definition at line 347 of file GXFTrajectory.cxx.

347  {
348  m_refpar.reset(nullptr);
349  }

◆ residuals()

Amg::VectorX & Trk::GXFTrajectory::residuals ( )

Definition at line 595 of file GXFTrajectory.cxx.

595  {
596  if (m_res.size() == 0) {
598  }
599  return m_res;
600  }

◆ scatteringAngles()

std::vector< std::pair< double, double > > & Trk::GXFTrajectory::scatteringAngles ( )

Definition at line 523 of file GXFTrajectory.cxx.

523  {
524  if (m_scatteringangles.empty() && numberOfScatterers() > 0) {
525  m_scatteringsigmas.clear();
528  for (auto & state : m_states) {
529  if ((*state).getStateType(TrackStateOnSurface::Scatterer)
530  && ((m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
531  double scatphi = (*state).materialEffects()->deltaPhi();
532  double scattheta = (*state).materialEffects()->deltaTheta();
533  m_scatteringangles.emplace_back(scatphi, scattheta);
534  double sigmascatphi = (*state).materialEffects()->sigmaDeltaPhi();
535  double sigmascattheta = (*state).materialEffects()->sigmaDeltaTheta();
537  emplace_back(sigmascatphi, sigmascattheta);
538  }
539  }
540  }
541  return m_scatteringangles;
542  }

◆ scatteringSigmas()

std::vector< std::pair< double, double > > & Trk::GXFTrajectory::scatteringSigmas ( )

Definition at line 545 of file GXFTrajectory.cxx.

545  {
546  if (m_scatteringsigmas.empty() && numberOfScatterers() > 0) {
548  }
549  return m_scatteringsigmas;
550  }

◆ setBrems()

void Trk::GXFTrajectory::setBrems ( std::vector< double > &  brems)

Definition at line 574 of file GXFTrajectory.cxx.

574  {
575  // if (m_prefit==1) return;
576  m_brems = brems;
577  int bremno = 0;
578  for (auto & state : m_states) {
579  if (((*state).materialEffects() != nullptr)
580  && (*state).materialEffects()->sigmaDeltaE() > 0) {
581  (*state).materialEffects()->setdelta_p(m_brems[bremno]);
582  bremno++;
583  }
584  }
585  }

◆ setChi2()

void Trk::GXFTrajectory::setChi2 ( double  chi2)

Definition at line 511 of file GXFTrajectory.cxx.

511  {
512  m_chi2 = chi2;
513  }

◆ setConverged()

void Trk::GXFTrajectory::setConverged ( bool  isconverged)

Definition at line 408 of file GXFTrajectory.cxx.

408  {
409  m_converged = isconverged;
410  }

◆ setMass()

void Trk::GXFTrajectory::setMass ( double  mass)

Definition at line 635 of file GXFTrajectory.cxx.

635  {
636  m_mass = mass;
637  }

◆ setNumberOfBrems()

void Trk::GXFTrajectory::setNumberOfBrems ( int  nbrem)

Definition at line 473 of file GXFTrajectory.cxx.

473  {
474  m_nbrems = nbrem;
475  }

◆ setNumberOfPerigeeParameters()

void Trk::GXFTrajectory::setNumberOfPerigeeParameters ( int  nperpar)

Definition at line 351 of file GXFTrajectory.cxx.

351  {
352  m_ndof -= nperpar;
353  m_nperpars = nperpar;
354  }

◆ setNumberOfScatterers()

void Trk::GXFTrajectory::setNumberOfScatterers ( int  nscat)

Definition at line 465 of file GXFTrajectory.cxx.

465  {
466  m_nscatterers = nscat;
467  }

◆ setOutlier()

void Trk::GXFTrajectory::setOutlier ( int  index,
bool  isoutlier = true 
)

Definition at line 356 of file GXFTrajectory.cxx.

356  {
357  if (isoutlier && m_states[index]->getStateType(TrackStateOnSurface::Outlier)) {
358  return;
359  }
360 
361  if (!isoutlier && m_states[index]->getStateType(TrackStateOnSurface::Measurement)) {
362  return;
363  }
364 
365  int nmeas = 0;
366  double *errors = m_states[index]->measurementErrors();
367 
368  for (int i = 0; i < 5; i++) {
369  if (errors[i] > 0) {
370  nmeas++;
371  }
372  }
373 
374  if (isoutlier) {
375  m_ndof -= nmeas;
376  m_states[index]->resetStateType(TrackStateOnSurface::Outlier);
377  m_nmeasoutl += nmeas;
378  m_noutl++;
379  m_states[index]->setFitQuality({});
380  } else {
381  m_ndof += nmeas;
383  m_nmeasoutl -= nmeas;
384  m_noutl--;
385  }
386  }

◆ setPrefit()

void Trk::GXFTrajectory::setPrefit ( int  isprefit)

Definition at line 404 of file GXFTrajectory.cxx.

404  {
405  m_prefit = isprefit;
406  }

◆ setPrevChi2()

void Trk::GXFTrajectory::setPrevChi2 ( double  chi2)

Definition at line 515 of file GXFTrajectory.cxx.

515  {
516  m_prevchi2 = chi2;
517  }

◆ setReferenceParameters()

void Trk::GXFTrajectory::setReferenceParameters ( std::unique_ptr< const TrackParameters per)

Definition at line 274 of file GXFTrajectory.cxx.

274  {
275  if (m_refpar != nullptr) {
276  m_refpar = std::move(per);
277  } else {
278  m_refpar = std::move(per);
280 
281  std::vector<std::unique_ptr<GXFTrackState>>::iterator it = m_states.begin();
282  std::vector<std::unique_ptr<GXFTrackState>>::iterator it2 = m_states.begin();
283 
284  while (it2 != m_states.end()) {
285  double distance = 0;
286  bool isdownstream = false;
287 
288  if ((**it2).trackParameters() != nullptr) {
289  distance = ((**it2).position() - m_refpar->position()).mag();
290  double inprod = m_refpar->momentum().dot((**it2).position() - m_refpar->position());
291 
292  if (inprod > 0) {
293  isdownstream = true;
294  }
295  } else {
296  DistanceSolution distsol = (**it2).associatedSurface().straightLineDistanceEstimate(m_refpar->position(),m_refpar->momentum().unit());
297 
298  if (distsol.numberOfSolutions() == 1) {
299  distance = distsol.first();
300  } else if (distsol.numberOfSolutions() == 2) {
301  distance =
302  std::abs(distsol.first()) < std::abs(distsol.second()) ?
303  distsol.first() :
304  distsol.second();
305  }
306 
307  if (distance > 0) {
308  isdownstream = true;
309  }
310 
311  distance = fabs(distance);
312  }
313 
314  if (isdownstream) {
315  it = it2;
316  break;
317  }
318 
320 
321  if (
322  (**it2).getStateType(TrackStateOnSurface::Scatterer) &&
323  (**it2).materialEffects()->sigmaDeltaTheta() != 0
324  ) {
326 
327  if ((**it2).materialEffects()->deltaE() == 0) {
329  }
330  }
331  if (
332  ((**it2).materialEffects() != nullptr) &&
333  (**it2).materialEffects()->sigmaDeltaE() > 0
334  ) {
336  }
337 
338  ++it2;
339  }
340  }
341  }

◆ setScatteringAngles()

void Trk::GXFTrajectory::setScatteringAngles ( std::vector< std::pair< double, double > > &  scatteringangles)

Definition at line 558 of file GXFTrajectory.cxx.

559  {
560  m_scatteringangles = scatteringangles;
561  int scatno = 0;
562  for (auto & state : m_states) {
563  if ((*state).getStateType(TrackStateOnSurface::Scatterer)
564  && ((m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
565  double scatphi = scatteringangles[scatno].first;
566  double scattheta = scatteringangles[scatno].second;
567  (*state).materialEffects()->setScatteringAngles(scatphi, scattheta);
568  scatno++;
569  }
570  }
571  }

◆ totalEnergyLoss()

double Trk::GXFTrajectory::totalEnergyLoss ( ) const

Definition at line 625 of file GXFTrajectory.cxx.

625  {
626  return m_toteloss;
627  }

◆ totalX0()

double Trk::GXFTrajectory::totalX0 ( ) const

Definition at line 620 of file GXFTrajectory.cxx.

620  {
621  return m_totx0;
622  }

◆ trackStates() [1/2]

std::vector< std::unique_ptr< GXFTrackState > > & Trk::GXFTrajectory::trackStates ( )

Definition at line 591 of file GXFTrajectory.cxx.

591  {
592  return m_states;
593  }

◆ trackStates() [2/2]

const std::vector< std::unique_ptr< GXFTrackState > > & Trk::GXFTrajectory::trackStates ( ) const

Definition at line 587 of file GXFTrajectory.cxx.

587  {
588  return m_states;
589  }

◆ updateTRTHitCount()

void Trk::GXFTrajectory::updateTRTHitCount ( int  index,
float  oldError 
)

Definition at line 388 of file GXFTrajectory.cxx.

388  {
389  double error = (m_states[index]->measurementErrors())[0];
390  if (m_states[index]->getStateType(TrackStateOnSurface::Outlier)) {
391  if (oldError<1) { m_ntrtprechits--; }
392  else {m_ntrttubehits--; }
393  }
394  if (error>1 && oldError<1) { // was precison, became tube
395  m_ntrttubehits++;
396  m_ntrtprechits--;
397  }
398  else if (error<1 && oldError>1) { // was tube, became precision
399  m_ntrttubehits--;
400  m_ntrtprechits++;
401  }
402  }

◆ upstreamMaterialLayers()

std::vector< std::pair< const Layer *, const Layer * > > & Trk::GXFTrajectory::upstreamMaterialLayers ( )

Definition at line 644 of file GXFTrajectory.cxx.

644  {
645  return m_upstreammat;
646  }

◆ weightedResidualDerivatives()

Amg::MatrixX & Trk::GXFTrajectory::weightedResidualDerivatives ( )

Definition at line 609 of file GXFTrajectory.cxx.

609  {
610  if (m_weightresderiv.size() == 0) {
611  m_weightresderiv.setZero(
614  );
615  }
616  return m_weightresderiv;
617  }

Member Data Documentation

◆ m_brems

std::vector<double> Trk::GXFTrajectory::m_brems
private

Definition at line 139 of file GXFTrajectory.h.

◆ m_caloelossstate

GXFTrackState* Trk::GXFTrajectory::m_caloelossstate
private

Definition at line 147 of file GXFTrajectory.h.

◆ m_chi2

double Trk::GXFTrajectory::m_chi2
private

Definition at line 117 of file GXFTrajectory.h.

◆ m_converged

bool Trk::GXFTrajectory::m_converged
private

Definition at line 136 of file GXFTrajectory.h.

◆ m_errors

Amg::VectorX Trk::GXFTrajectory::m_errors
private

Definition at line 141 of file GXFTrajectory.h.

◆ m_fieldprop

MagneticFieldProperties Trk::GXFTrajectory::m_fieldprop = Trk::FullField

Definition at line 112 of file GXFTrajectory.h.

◆ m_mass

double Trk::GXFTrajectory::m_mass
private

Definition at line 145 of file GXFTrajectory.h.

◆ m_nbrems

int Trk::GXFTrajectory::m_nbrems
private

Definition at line 122 of file GXFTrajectory.h.

◆ m_ncaloscatterers

int Trk::GXFTrajectory::m_ncaloscatterers
private

Definition at line 121 of file GXFTrajectory.h.

◆ m_ndof

int Trk::GXFTrajectory::m_ndof
private

Definition at line 116 of file GXFTrajectory.h.

◆ m_nhits

int Trk::GXFTrajectory::m_nhits
private

Definition at line 127 of file GXFTrajectory.h.

◆ m_nmeasoutl

int Trk::GXFTrajectory::m_nmeasoutl
private

Definition at line 134 of file GXFTrajectory.h.

◆ m_noutl

int Trk::GXFTrajectory::m_noutl
private

Definition at line 128 of file GXFTrajectory.h.

◆ m_nperpars

int Trk::GXFTrajectory::m_nperpars
private

Definition at line 119 of file GXFTrajectory.h.

◆ m_npseudo

int Trk::GXFTrajectory::m_npseudo
private

Definition at line 133 of file GXFTrajectory.h.

◆ m_nscatterers

int Trk::GXFTrajectory::m_nscatterers
private

Definition at line 120 of file GXFTrajectory.h.

◆ m_nsihits

int Trk::GXFTrajectory::m_nsihits
private

Definition at line 129 of file GXFTrajectory.h.

◆ m_ntrthits

int Trk::GXFTrajectory::m_ntrthits
private

Definition at line 130 of file GXFTrajectory.h.

◆ m_ntrtprechits

int Trk::GXFTrajectory::m_ntrtprechits
private

Definition at line 131 of file GXFTrajectory.h.

◆ m_ntrttubehits

int Trk::GXFTrajectory::m_ntrttubehits
private

Definition at line 132 of file GXFTrajectory.h.

◆ m_nupstreambrems

int Trk::GXFTrajectory::m_nupstreambrems
private

Definition at line 126 of file GXFTrajectory.h.

◆ m_nupstreamcaloscatterers

int Trk::GXFTrajectory::m_nupstreamcaloscatterers
private

Definition at line 125 of file GXFTrajectory.h.

◆ m_nupstreamscatterers

int Trk::GXFTrajectory::m_nupstreamscatterers
private

Definition at line 124 of file GXFTrajectory.h.

◆ m_nupstreamstates

int Trk::GXFTrajectory::m_nupstreamstates
private

Definition at line 123 of file GXFTrajectory.h.

◆ m_prefit

int Trk::GXFTrajectory::m_prefit
private

Definition at line 146 of file GXFTrajectory.h.

◆ m_prevchi2

double Trk::GXFTrajectory::m_prevchi2
private

Definition at line 118 of file GXFTrajectory.h.

◆ m_refpar

std::unique_ptr<const TrackParameters> Trk::GXFTrajectory::m_refpar
private

Definition at line 135 of file GXFTrajectory.h.

◆ m_res

Amg::VectorX Trk::GXFTrajectory::m_res
private

Definition at line 140 of file GXFTrajectory.h.

◆ m_scatteringangles

std::vector< std::pair < double, double > > Trk::GXFTrajectory::m_scatteringangles
private

Definition at line 137 of file GXFTrajectory.h.

◆ m_scatteringsigmas

std::vector< std::pair < double, double > > Trk::GXFTrajectory::m_scatteringsigmas
private

Definition at line 138 of file GXFTrajectory.h.

◆ m_states

std::vector<std::unique_ptr<GXFTrackState> > Trk::GXFTrajectory::m_states
private

The vector of track states, i.e.

measurements, scatterers, brem points, and holes

Definition at line 115 of file GXFTrajectory.h.

◆ m_straightline

bool Trk::GXFTrajectory::m_straightline

Definition at line 111 of file GXFTrajectory.h.

◆ m_toteloss

double Trk::GXFTrajectory::m_toteloss
private

Definition at line 144 of file GXFTrajectory.h.

◆ m_totx0

double Trk::GXFTrajectory::m_totx0
private

Definition at line 143 of file GXFTrajectory.h.

◆ m_upstreammat

std::vector< std::pair < const Layer *, const Layer *> > Trk::GXFTrajectory::m_upstreammat
private

Definition at line 148 of file GXFTrajectory.h.

◆ m_weightresderiv

Amg::MatrixX Trk::GXFTrajectory::m_weightresderiv
private

Definition at line 142 of file GXFTrajectory.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::GXFTrajectory::m_nupstreamstates
int m_nupstreamstates
Definition: GXFTrajectory.h:123
Trk::GXFTrajectory::m_upstreammat
std::vector< std::pair< const Layer *, const Layer * > > m_upstreammat
Definition: GXFTrajectory.h:148
Trk::GXFTrajectory::m_refpar
std::unique_ptr< const TrackParameters > m_refpar
Definition: GXFTrajectory.h:135
Trk::GXFTrajectory::m_ndof
int m_ndof
Definition: GXFTrajectory.h:116
Trk::GXFTrajectory::numberOfScatterers
int numberOfScatterers() const
Definition: GXFTrajectory.cxx:458
Trk::TrackState::Pixel
@ Pixel
Definition: TrackStateDefs.h:28
Trk::GXFTrajectory::m_nperpars
int m_nperpars
Definition: GXFTrajectory.h:119
Trk::GXFTrajectory::m_scatteringangles
std::vector< std::pair< double, double > > m_scatteringangles
Definition: GXFTrajectory.h:137
Trk::TrackState::TRT
@ TRT
Definition: TrackStateDefs.h:30
Trk::GXFTrajectory::numberOfFitParameters
int numberOfFitParameters() const
Definition: GXFTrajectory.cxx:496
Trk::GXFTrajectory::brems
std::vector< double > & brems()
Definition: GXFTrajectory.cxx:552
Trk::GXFTrajectory::m_res
Amg::VectorX m_res
Definition: GXFTrajectory.h:140
index
Definition: index.py:1
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Trk::GXFTrajectory::m_states
std::vector< std::unique_ptr< GXFTrackState > > m_states
The vector of track states, i.e.
Definition: GXFTrajectory.h:115
Trk::GXFTrajectory::m_errors
Amg::VectorX m_errors
Definition: GXFTrajectory.h:141
Trk::TrackParameters
ParametersBase< 5, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:24
Trk::GXFTrajectory::m_mass
double m_mass
Definition: GXFTrajectory.h:145
Trk::GXFTrajectory::nDOF
int nDOF() const
Definition: GXFTrajectory.cxx:519
Trk::TrackState::MM
@ MM
Definition: TrackStateDefs.h:42
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
Trk::GXFTrajectory::m_noutl
int m_noutl
Definition: GXFTrajectory.h:128
Trk::GXFTrajectory::m_nupstreambrems
int m_nupstreambrems
Definition: GXFTrajectory.h:126
Trk::GXFTrajectory::m_totx0
double m_totx0
Definition: GXFTrajectory.h:143
Trk::GXFTrajectory::m_toteloss
double m_toteloss
Definition: GXFTrajectory.h:144
Trk::GXFTrajectory::numberOfBrems
int numberOfBrems() const
Definition: GXFTrajectory.cxx:469
Trk::GXFTrajectory::m_converged
bool m_converged
Definition: GXFTrajectory.h:136
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trk::GXFTrajectory::m_straightline
bool m_straightline
Definition: GXFTrajectory.h:111
Trk::TrackState::Pseudo
@ Pseudo
Definition: TrackStateDefs.h:35
Trk::GXFTrajectory::m_nsihits
int m_nsihits
Definition: GXFTrajectory.h:129
Trk::GXFTrajectory::m_nmeasoutl
int m_nmeasoutl
Definition: GXFTrajectory.h:134
Trk::GXFTrajectory::m_prefit
int m_prefit
Definition: GXFTrajectory.h:146
Trk::GXFTrajectory::m_nscatterers
int m_nscatterers
Definition: GXFTrajectory.h:120
Trk::GXFTrajectory::m_chi2
double m_chi2
Definition: GXFTrajectory.h:117
Trk::GXFTrajectory::m_nupstreamscatterers
int m_nupstreamscatterers
Definition: GXFTrajectory.h:124
Trk::GXFTrajectory::mass
double mass() const
Definition: GXFTrajectory.cxx:630
Trk::GXFTrajectory::m_nupstreamcaloscatterers
int m_nupstreamcaloscatterers
Definition: GXFTrajectory.h:125
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Trk::GXFTrajectory::m_nbrems
int m_nbrems
Definition: GXFTrajectory.h:122
Trk::GXFTrajectory::m_scatteringsigmas
std::vector< std::pair< double, double > > m_scatteringsigmas
Definition: GXFTrajectory.h:138
Trk::GXFTrajectory::scatteringAngles
std::vector< std::pair< double, double > > & scatteringAngles()
Definition: GXFTrajectory.cxx:523
Trk::GXFTrajectory::errors
Amg::VectorX & errors()
Definition: GXFTrajectory.cxx:602
Trk::GXFTrajectory::m_prevchi2
double m_prevchi2
Definition: GXFTrajectory.h:118
Trk::GXFTrajectory::m_nhits
int m_nhits
Definition: GXFTrajectory.h:127
DeMoScan.index
string index
Definition: DeMoScan.py:362
Trk::GXFTrajectory::m_ncaloscatterers
int m_ncaloscatterers
Definition: GXFTrajectory.h:121
Trk::GXFTrajectory::m_ntrthits
int m_ntrthits
Definition: GXFTrajectory.h:130
Trk::GXFTrajectory::m_ntrttubehits
int m_ntrttubehits
Definition: GXFTrajectory.h:132
Trk::TrackStateOnSurface::Scatterer
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Definition: TrackStateOnSurface.h:113
Trk::GXFTrajectory::m_ntrtprechits
int m_ntrtprechits
Definition: GXFTrajectory.h:131
Trk::GXFTrajectory::m_caloelossstate
GXFTrackState * m_caloelossstate
Definition: GXFTrajectory.h:147
Trk::TrackState::SCT
@ SCT
Definition: TrackStateDefs.h:29
Trk::GXFTrajectory::m_fieldprop
MagneticFieldProperties m_fieldprop
Definition: GXFTrajectory.h:112
Trk::GXFTrajectory::m_brems
std::vector< double > m_brems
Definition: GXFTrajectory.h:139
error
Definition: IImpactPoint3dEstimator.h:70
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
Trk::GXFTrajectory::m_weightresderiv
Amg::MatrixX m_weightresderiv
Definition: GXFTrajectory.h:142
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:25
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::GXFTrajectory::trackStates
const std::vector< std::unique_ptr< GXFTrackState > > & trackStates() const
Definition: GXFTrajectory.cxx:587
Trk::GXFTrajectory::m_npseudo
int m_npseudo
Definition: GXFTrajectory.h:133
Trk::GXFTrajectory::chi2
double chi2() const
Definition: GXFTrajectory.cxx:503
Trk::GXFTrajectory::conditionalSetCalorimeterEnergyLossState
void conditionalSetCalorimeterEnergyLossState(GXFTrackState *)
Definition: GXFTrajectory.cxx:148