Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 543 of file GXFTrajectory.cxx.

543  {
544  return m_brems;
545  }

◆ caloElossState()

GXFTrackState * Trk::GXFTrajectory::caloElossState ( )

Definition at line 630 of file GXFTrajectory.cxx.

630  {
631  return m_caloelossstate;
632  }

◆ chi2()

double Trk::GXFTrajectory::chi2 ( ) const

Definition at line 494 of file GXFTrajectory.cxx.

494  {
495  return m_chi2;
496  }

◆ 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 413 of file GXFTrajectory.cxx.

413  {
414  return m_converged;
415  }

◆ errors()

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

Definition at line 593 of file GXFTrajectory.cxx.

593  {
594  if (m_errors.size() == 0) {
596  }
597  return m_errors;
598  }

◆ findFirstLastMeasurement()

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

Definition at line 639 of file GXFTrajectory.cxx.

639  {
640  GXFTrackState *firstmeasstate = nullptr;
641  GXFTrackState *lastmeasstate = nullptr;
642 
643  for (std::unique_ptr<GXFTrackState> & hit : trackStates()) {
644  if (hit->measurement() != nullptr) {
645  if (firstmeasstate == nullptr) {
646  firstmeasstate = hit.get();
647  }
648  lastmeasstate = hit.get();
649  }
650  }
651 
652  if (firstmeasstate == nullptr) {
653  throw std::logic_error("no first measurement.");
654  }
655 
656  return std::make_pair(firstmeasstate, lastmeasstate);
657  }

◆ hasKink()

bool Trk::GXFTrajectory::hasKink ( void  )

Definition at line 659 of file GXFTrajectory.cxx.

659  {
660  for (auto & hit : trackStates()) {
661  if (
662  hit->measurementType() == TrackState::Pseudo &&
663  hit->getStateType(TrackStateOnSurface::Outlier)
664  ) {
665  continue;
666  }
667 
668  if (
669  (hit->materialEffects() != nullptr) &&
670  hit->materialEffects()->isKink()
671  ) {
672  return true;
673  }
674  }
675 
676  return false;
677  }

◆ mass()

double Trk::GXFTrajectory::mass ( ) const

Definition at line 621 of file GXFTrajectory.cxx.

621  {
622  return m_mass;
623  }

◆ nDOF()

int Trk::GXFTrajectory::nDOF ( ) const

Definition at line 510 of file GXFTrajectory.cxx.

510  {
511  return m_ndof;
512  }

◆ numberOfBrems()

int Trk::GXFTrajectory::numberOfBrems ( ) const

Definition at line 460 of file GXFTrajectory.cxx.

460  {
461  return m_nbrems;
462  }

◆ numberOfFitParameters()

int Trk::GXFTrajectory::numberOfFitParameters ( ) const

Definition at line 487 of file GXFTrajectory.cxx.

487  {
488  if (m_prefit == 1) {
490  }
491  return m_nperpars + numberOfBrems() + 2 * numberOfScatterers();
492  }

◆ numberOfHits()

int Trk::GXFTrajectory::numberOfHits ( ) const

Definition at line 421 of file GXFTrajectory.cxx.

421  {
422  return m_nhits;
423  }

◆ numberOfOutliers()

int Trk::GXFTrajectory::numberOfOutliers ( ) const

Definition at line 425 of file GXFTrajectory.cxx.

425  {
426  return m_noutl;
427  }

◆ numberOfPerigeeParameters()

int Trk::GXFTrajectory::numberOfPerigeeParameters ( ) const

Definition at line 483 of file GXFTrajectory.cxx.

483  {
484  return m_nperpars;
485  }

◆ numberOfPseudoMeasurements()

int Trk::GXFTrajectory::numberOfPseudoMeasurements ( ) const

Definition at line 445 of file GXFTrajectory.cxx.

445  {
446  return m_npseudo;
447  }

◆ numberOfScatterers()

int Trk::GXFTrajectory::numberOfScatterers ( ) const

Definition at line 449 of file GXFTrajectory.cxx.

449  {
450  if (m_prefit != 0) {
451  return m_ncaloscatterers;
452  }
453  return m_nscatterers;
454  }

◆ numberOfSiliconHits()

int Trk::GXFTrajectory::numberOfSiliconHits ( ) const

Definition at line 429 of file GXFTrajectory.cxx.

429  {
430  return m_nsihits;
431  }

◆ numberOfTRTHits()

int Trk::GXFTrajectory::numberOfTRTHits ( ) const

Definition at line 433 of file GXFTrajectory.cxx.

433  {
434  return m_ntrthits;
435  }

◆ numberOfTRTPrecHits()

int Trk::GXFTrajectory::numberOfTRTPrecHits ( ) const

Definition at line 437 of file GXFTrajectory.cxx.

437  {
438  return m_ntrtprechits;
439  }

◆ numberOfTRTTubeHits()

int Trk::GXFTrajectory::numberOfTRTTubeHits ( ) const

Definition at line 441 of file GXFTrajectory.cxx.

441  {
442  return m_ntrttubehits;
443  }

◆ numberOfUpstreamBrems()

int Trk::GXFTrajectory::numberOfUpstreamBrems ( ) const

Definition at line 479 of file GXFTrajectory.cxx.

479  {
480  return m_nupstreambrems;
481  }

◆ numberOfUpstreamScatterers()

int Trk::GXFTrajectory::numberOfUpstreamScatterers ( ) const

Definition at line 472 of file GXFTrajectory.cxx.

472  {
473  if (m_prefit == 0) {
474  return m_nupstreamscatterers;
475  }
477  }

◆ numberOfUpstreamStates()

int Trk::GXFTrajectory::numberOfUpstreamStates ( ) const

Definition at line 468 of file GXFTrajectory.cxx.

468  {
469  return m_nupstreamstates;
470  }

◆ 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 417 of file GXFTrajectory.cxx.

417  {
418  return m_prefit;
419  }

◆ prevchi2()

double Trk::GXFTrajectory::prevchi2 ( ) const

Definition at line 498 of file GXFTrajectory.cxx.

498  {
499  return m_prevchi2;
500  }

◆ quality()

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

Definition at line 685 of file GXFTrajectory.cxx.

685  {
686  return std::make_unique<const FitQuality>(chi2(), nDOF());
687  }

◆ referenceParameters()

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

Definition at line 334 of file GXFTrajectory.cxx.

334  {
335  return m_refpar.get();
336  }

◆ reset()

void Trk::GXFTrajectory::reset ( )

Definition at line 403 of file GXFTrajectory.cxx.

403  {
404  m_res.resize(0);
405  m_weightresderiv.resize(0, 0);
406  m_errors.resize(0);
407  m_scatteringangles.clear();
408  m_scatteringsigmas.clear();
409  m_converged = false;
410  m_refpar.reset(nullptr);
411  }

◆ resetCovariances()

void Trk::GXFTrajectory::resetCovariances ( void  )

Definition at line 679 of file GXFTrajectory.cxx.

679  {
680  for (std::unique_ptr<GXFTrackState> & hit : trackStates()) {
681  hit->setTrackCovariance(nullptr);
682  }
683  }

◆ resetReferenceParameters()

void Trk::GXFTrajectory::resetReferenceParameters ( )

Definition at line 338 of file GXFTrajectory.cxx.

338  {
339  m_refpar.reset(nullptr);
340  }

◆ residuals()

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

Definition at line 586 of file GXFTrajectory.cxx.

586  {
587  if (m_res.size() == 0) {
589  }
590  return m_res;
591  }

◆ scatteringAngles()

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

Definition at line 514 of file GXFTrajectory.cxx.

514  {
515  if (m_scatteringangles.empty() && numberOfScatterers() > 0) {
516  m_scatteringsigmas.clear();
519  for (auto & state : m_states) {
520  if ((*state).getStateType(TrackStateOnSurface::Scatterer)
521  && ((m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
522  double scatphi = (*state).materialEffects()->deltaPhi();
523  double scattheta = (*state).materialEffects()->deltaTheta();
524  m_scatteringangles.emplace_back(scatphi, scattheta);
525  double sigmascatphi = (*state).materialEffects()->sigmaDeltaPhi();
526  double sigmascattheta = (*state).materialEffects()->sigmaDeltaTheta();
528  emplace_back(sigmascatphi, sigmascattheta);
529  }
530  }
531  }
532  return m_scatteringangles;
533  }

◆ scatteringSigmas()

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

Definition at line 536 of file GXFTrajectory.cxx.

536  {
537  if (m_scatteringsigmas.empty() && numberOfScatterers() > 0) {
539  }
540  return m_scatteringsigmas;
541  }

◆ setBrems()

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

Definition at line 565 of file GXFTrajectory.cxx.

565  {
566  // if (m_prefit==1) return;
567  m_brems = brems;
568  int bremno = 0;
569  for (auto & state : m_states) {
570  if (((*state).materialEffects() != nullptr)
571  && (*state).materialEffects()->sigmaDeltaE() > 0) {
572  (*state).materialEffects()->setdelta_p(m_brems[bremno]);
573  bremno++;
574  }
575  }
576  }

◆ setChi2()

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

Definition at line 502 of file GXFTrajectory.cxx.

502  {
503  m_chi2 = chi2;
504  }

◆ setConverged()

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

Definition at line 399 of file GXFTrajectory.cxx.

399  {
400  m_converged = isconverged;
401  }

◆ setMass()

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

Definition at line 626 of file GXFTrajectory.cxx.

626  {
627  m_mass = mass;
628  }

◆ setNumberOfBrems()

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

Definition at line 464 of file GXFTrajectory.cxx.

464  {
465  m_nbrems = nbrem;
466  }

◆ setNumberOfPerigeeParameters()

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

Definition at line 342 of file GXFTrajectory.cxx.

342  {
343  m_ndof -= nperpar;
344  m_nperpars = nperpar;
345  }

◆ setNumberOfScatterers()

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

Definition at line 456 of file GXFTrajectory.cxx.

456  {
457  m_nscatterers = nscat;
458  }

◆ setOutlier()

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

Definition at line 347 of file GXFTrajectory.cxx.

347  {
348  if (isoutlier && m_states[index]->getStateType(TrackStateOnSurface::Outlier)) {
349  return;
350  }
351 
352  if (!isoutlier && m_states[index]->getStateType(TrackStateOnSurface::Measurement)) {
353  return;
354  }
355 
356  int nmeas = 0;
357  double *errors = m_states[index]->measurementErrors();
358 
359  for (int i = 0; i < 5; i++) {
360  if (errors[i] > 0) {
361  nmeas++;
362  }
363  }
364 
365  if (isoutlier) {
366  m_ndof -= nmeas;
367  m_states[index]->resetStateType(TrackStateOnSurface::Outlier);
368  m_nmeasoutl += nmeas;
369  m_noutl++;
370  m_states[index]->setFitQuality({});
371  } else {
372  m_ndof += nmeas;
374  m_nmeasoutl -= nmeas;
375  m_noutl--;
376  }
377  }

◆ setPrefit()

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

Definition at line 395 of file GXFTrajectory.cxx.

395  {
396  m_prefit = isprefit;
397  }

◆ setPrevChi2()

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

Definition at line 506 of file GXFTrajectory.cxx.

506  {
507  m_prevchi2 = chi2;
508  }

◆ 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  return;
278  }
279 
280  m_refpar = std::move(per);
281 
282  m_nupstreamstates = 0;
285  m_nupstreambrems = 0;
286 
287  for (const auto & state : m_states) {
288  if (state->trackParameters() != nullptr) {
289  const double inprod = m_refpar->momentum().dot(state->position() - m_refpar->position());
290 
291  if (inprod > 0) {
292  return;
293  }
294  } else {
295  const DistanceSolution distsol =
296  state->associatedSurface().straightLineDistanceEstimate(m_refpar->position(), m_refpar->momentum().unit());
297 
298  double distance = 0;
299  if (distsol.numberOfSolutions() == 1) {
300  distance = distsol.first();
301  } else if (distsol.numberOfSolutions() == 2) {
302  distance =
303  std::abs(distsol.first()) < std::abs(distsol.second()) ?
304  distsol.first() :
305  distsol.second();
306  }
307 
308  if (distance > 0) {
309  return;
310  }
311  }
312 
314 
315  const GXFMaterialEffects *meff = state->materialEffects();
316 
317  if (
318  state->getStateType(TrackStateOnSurface::Scatterer) &&
319  meff->sigmaDeltaTheta() != 0
320  ) {
322 
323  if (meff->deltaE() == 0) {
325  }
326  }
327 
328  if (meff != nullptr && meff->sigmaDeltaE() > 0) {
330  }
331  }
332  }

◆ setScatteringAngles()

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

Definition at line 549 of file GXFTrajectory.cxx.

550  {
551  m_scatteringangles = scatteringangles;
552  int scatno = 0;
553  for (auto & state : m_states) {
554  if ((*state).getStateType(TrackStateOnSurface::Scatterer)
555  && ((m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
556  double scatphi = scatteringangles[scatno].first;
557  double scattheta = scatteringangles[scatno].second;
558  (*state).materialEffects()->setScatteringAngles(scatphi, scattheta);
559  scatno++;
560  }
561  }
562  }

◆ totalEnergyLoss()

double Trk::GXFTrajectory::totalEnergyLoss ( ) const

Definition at line 616 of file GXFTrajectory.cxx.

616  {
617  return m_toteloss;
618  }

◆ totalX0()

double Trk::GXFTrajectory::totalX0 ( ) const

Definition at line 611 of file GXFTrajectory.cxx.

611  {
612  return m_totx0;
613  }

◆ trackStates() [1/2]

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

Definition at line 582 of file GXFTrajectory.cxx.

582  {
583  return m_states;
584  }

◆ trackStates() [2/2]

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

Definition at line 578 of file GXFTrajectory.cxx.

578  {
579  return m_states;
580  }

◆ updateTRTHitCount()

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

Definition at line 379 of file GXFTrajectory.cxx.

379  {
380  double error = (m_states[index]->measurementErrors())[0];
381  if (m_states[index]->getStateType(TrackStateOnSurface::Outlier)) {
382  if (oldError<1) { m_ntrtprechits--; }
383  else {m_ntrttubehits--; }
384  }
385  if (error>1 && oldError<1) { // was precison, became tube
386  m_ntrttubehits++;
387  m_ntrtprechits--;
388  }
389  else if (error<1 && oldError>1) { // was tube, became precision
390  m_ntrttubehits--;
391  m_ntrtprechits++;
392  }
393  }

◆ upstreamMaterialLayers()

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

Definition at line 635 of file GXFTrajectory.cxx.

635  {
636  return m_upstreammat;
637  }

◆ weightedResidualDerivatives()

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

Definition at line 600 of file GXFTrajectory.cxx.

600  {
601  if (m_weightresderiv.size() == 0) {
602  m_weightresderiv.setZero(
605  );
606  }
607  return m_weightresderiv;
608  }

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:
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:449
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:487
Trk::GXFTrajectory::brems
std::vector< double > & brems()
Definition: GXFTrajectory.cxx:543
Trk::GXFTrajectory::m_res
Amg::VectorX m_res
Definition: GXFTrajectory.h:140
index
Definition: index.py:1
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::GXFTrajectory::m_mass
double m_mass
Definition: GXFTrajectory.h:145
Trk::GXFTrajectory::nDOF
int nDOF() const
Definition: GXFTrajectory.cxx:510
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:460
Trk::GXFTrajectory::m_converged
bool m_converged
Definition: GXFTrajectory.h:136
lumiFormat.i
int i
Definition: lumiFormat.py:85
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:621
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::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
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:514
Trk::GXFTrajectory::errors
Amg::VectorX & errors()
Definition: GXFTrajectory.cxx:593
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:364
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
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:578
Trk::GXFTrajectory::m_npseudo
int m_npseudo
Definition: GXFTrajectory.h:133
Trk::GXFTrajectory::chi2
double chi2() const
Definition: GXFTrajectory.cxx:494
Trk::GXFTrajectory::conditionalSetCalorimeterEnergyLossState
void conditionalSetCalorimeterEnergyLossState(GXFTrackState *)
Definition: GXFTrajectory.cxx:148