Internal representation of the track, used in the track fit.
More...
#include <GXFTrajectory.h>
|
| | GXFTrajectory () |
| | GXFTrajectory (const GXFTrajectory &rhs) |
| GXFTrajectory & | operator= (const GXFTrajectory &rhs) |
| | GXFTrajectory (GXFTrajectory &&rhs)=default |
| GXFTrajectory & | operator= (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 TrackParameters * | referenceParameters () |
| bool | converged () const |
| int | prefit () const |
| void | resetReferenceParameters () |
| double | chi2 () const |
| double | prevchi2 () const |
| int | nDOF () const |
| Amg::VectorX & | residuals () |
| Amg::VectorX & | errors () |
| Amg::MatrixX & | weightedResidualDerivatives () |
| double | totalX0 () const |
| double | totalEnergyLoss () const |
| double | mass () const |
| GXFTrackState * | caloElossState () |
| std::vector< std::pair< const Layer *, const Layer * > > & | upstreamMaterialLayers () |
| void | resetCovariances (void) |
| std::unique_ptr< const FitQuality > | quality (void) const |
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.
◆ GXFTrajectory() [1/3]
| Trk::GXFTrajectory::GXFTrajectory |
( |
| ) |
|
Definition at line 15 of file GXFTrajectory.cxx.
15 {
43 }
int m_nupstreamscatterers
int m_nupstreamcaloscatterers
GXFTrackState * m_caloelossstate
std::unique_ptr< const TrackParameters > m_refpar
◆ GXFTrajectory() [2/3]
Definition at line 45 of file GXFTrajectory.cxx.
67 m_refpar(rhs.m_refpar !=
nullptr ? rhs.m_refpar->clone() :
nullptr),
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) {
91 }
92 }
93 }
std::vector< std::unique_ptr< GXFTrackState > > m_states
The vector of track states, i.e.
std::vector< std::pair< const Layer *, const Layer * > > m_upstreammat
Amg::MatrixX m_weightresderiv
void conditionalSetCalorimeterEnergyLossState(GXFTrackState *)
MagneticFieldProperties m_fieldprop
std::vector< std::pair< double, double > > m_scatteringangles
std::vector< std::pair< double, double > > m_scatteringsigmas
std::vector< double > m_brems
◆ GXFTrajectory() [3/3]
◆ ~GXFTrajectory()
| Trk::GXFTrajectory::~GXFTrajectory |
( |
| ) |
|
|
default |
◆ 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 {
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
229
230 if (meff->deltaE() == 0) {
232 }
233 }
234
235 if (meff->sigmaDeltaE() > 0) {
238 }
239
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 {
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) {
262 }
263 }
264 }
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
◆ addMeasurementState()
| bool Trk::GXFTrajectory::addMeasurementState |
( |
std::unique_ptr< GXFTrackState > | state, |
|
|
int | index = -1 ) |
Definition at line 166 of file GXFTrajectory.cxx.
166 {
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() &&
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++) {
185 nmeas++;
186 }
187 }
188
191 } else {
194 }
195
198 }
199
203 }
204
209 }
210
213 }
214
215 if (index == -1) {
216 m_states.push_back(std::move(state));
217 } else {
219 }
220
221 return true;
222 }
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
◆ brems()
| std::vector< double > & Trk::GXFTrajectory::brems |
( |
| ) |
|
◆ caloElossState()
◆ chi2()
| double Trk::GXFTrajectory::chi2 |
( |
| ) |
const |
◆ 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();
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 ) {
163 }
164 }
ParametersBase< TrackParametersDim, Charged > TrackParameters
◆ converged()
| bool Trk::GXFTrajectory::converged |
( |
| ) |
const |
◆ errors()
◆ findFirstLastMeasurement()
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 }
const std::vector< std::unique_ptr< GXFTrackState > > & trackStates() const
◆ hasKink()
| bool Trk::GXFTrajectory::hasKink |
( |
void | | ) |
|
Definition at line 659 of file GXFTrajectory.cxx.
659 {
661 if (
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 }
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
◆ mass()
| double Trk::GXFTrajectory::mass |
( |
| ) |
const |
◆ nDOF()
| int Trk::GXFTrajectory::nDOF |
( |
| ) |
const |
◆ numberOfBrems()
| int Trk::GXFTrajectory::numberOfBrems |
( |
| ) |
const |
◆ numberOfFitParameters()
| int Trk::GXFTrajectory::numberOfFitParameters |
( |
| ) |
const |
◆ numberOfHits()
| int Trk::GXFTrajectory::numberOfHits |
( |
| ) |
const |
◆ numberOfOutliers()
| int Trk::GXFTrajectory::numberOfOutliers |
( |
| ) |
const |
◆ numberOfPerigeeParameters()
| int Trk::GXFTrajectory::numberOfPerigeeParameters |
( |
| ) |
const |
◆ numberOfPseudoMeasurements()
| int Trk::GXFTrajectory::numberOfPseudoMeasurements |
( |
| ) |
const |
◆ numberOfScatterers()
| int Trk::GXFTrajectory::numberOfScatterers |
( |
| ) |
const |
◆ numberOfSiliconHits()
| int Trk::GXFTrajectory::numberOfSiliconHits |
( |
| ) |
const |
◆ numberOfTRTHits()
| int Trk::GXFTrajectory::numberOfTRTHits |
( |
| ) |
const |
◆ numberOfTRTPrecHits()
| int Trk::GXFTrajectory::numberOfTRTPrecHits |
( |
| ) |
const |
◆ numberOfTRTTubeHits()
| int Trk::GXFTrajectory::numberOfTRTTubeHits |
( |
| ) |
const |
◆ numberOfUpstreamBrems()
| int Trk::GXFTrajectory::numberOfUpstreamBrems |
( |
| ) |
const |
◆ numberOfUpstreamScatterers()
| int Trk::GXFTrajectory::numberOfUpstreamScatterers |
( |
| ) |
const |
◆ numberOfUpstreamStates()
| int Trk::GXFTrajectory::numberOfUpstreamStates |
( |
| ) |
const |
◆ operator=() [1/2]
Definition at line 95 of file GXFTrajectory.cxx.
95 {
96 if (this != &rhs) {
120 m_refpar.reset(rhs.m_refpar !=
nullptr ? rhs.m_refpar->clone() :
nullptr);
121
123 for (const std::unique_ptr<GXFTrackState> & i : rhs.m_states) {
124 m_states.push_back(std::make_unique<GXFTrackState>(*i));
125 }
126
137
138 if (rhs.m_caloelossstate != nullptr) {
141 }
142 }
144 }
145 return *this;
146 }
◆ operator=() [2/2]
◆ prefit()
| int Trk::GXFTrajectory::prefit |
( |
| ) |
const |
◆ prevchi2()
| double Trk::GXFTrajectory::prevchi2 |
( |
| ) |
const |
◆ quality()
| std::unique_ptr< const FitQuality > Trk::GXFTrajectory::quality |
( |
void | | ) |
const |
◆ referenceParameters()
◆ reset()
| void Trk::GXFTrajectory::reset |
( |
| ) |
|
◆ 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 |
( |
| ) |
|
◆ residuals()
◆ scatteringAngles()
| std::vector< std::pair< double, double > > & Trk::GXFTrajectory::scatteringAngles |
( |
| ) |
|
Definition at line 514 of file GXFTrajectory.cxx.
514 {
521 && ((
m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
522 const double scatphi = (*state).materialEffects()->deltaPhi();
523 const double scattheta = (*state).materialEffects()->deltaTheta();
525 const double sigmascatphi = (*state).materialEffects()->sigmaDeltaPhi();
526 const double sigmascattheta = (*state).materialEffects()->sigmaDeltaTheta();
528 emplace_back(sigmascatphi, sigmascattheta);
529 }
530 }
531 }
533 }
◆ scatteringSigmas()
| std::vector< std::pair< double, double > > & Trk::GXFTrajectory::scatteringSigmas |
( |
| ) |
|
Definition at line 536 of file GXFTrajectory.cxx.
536 {
539 }
541 }
std::vector< std::pair< double, double > > & scatteringAngles()
◆ setBrems()
| void Trk::GXFTrajectory::setBrems |
( |
std::vector< double > & | brems | ) |
|
Definition at line 565 of file GXFTrajectory.cxx.
565 {
566
568 int bremno = 0;
570 if (((*state).materialEffects() != nullptr)
571 && (*state).materialEffects()->sigmaDeltaE() > 0) {
572 (*state).materialEffects()->setdelta_p(
m_brems[bremno]);
573 bremno++;
574 }
575 }
576 }
std::vector< double > & brems()
◆ setChi2()
| void Trk::GXFTrajectory::setChi2 |
( |
double | chi2 | ) |
|
◆ setConverged()
| void Trk::GXFTrajectory::setConverged |
( |
bool | isconverged | ) |
|
◆ setMass()
| void Trk::GXFTrajectory::setMass |
( |
double | mass | ) |
|
◆ setNumberOfBrems()
| void Trk::GXFTrajectory::setNumberOfBrems |
( |
int | nbrem | ) |
|
◆ setNumberOfPerigeeParameters()
| void Trk::GXFTrajectory::setNumberOfPerigeeParameters |
( |
int | nperpar | ) |
|
◆ setNumberOfScatterers()
| void Trk::GXFTrajectory::setNumberOfScatterers |
( |
int | nscat | ) |
|
◆ setOutlier()
| void Trk::GXFTrajectory::setOutlier |
( |
int | index, |
|
|
bool | isoutlier = true ) |
Definition at line 347 of file GXFTrajectory.cxx.
347 {
349 return;
350 }
351
353 return;
354 }
355
356 int nmeas = 0;
358
359 for (
int i = 0;
i < 5;
i++) {
361 nmeas++;
362 }
363 }
364
365 if (isoutlier) {
371 } else {
376 }
377 }
◆ setPrefit()
| void Trk::GXFTrajectory::setPrefit |
( |
int | isprefit | ) |
|
◆ setPrevChi2()
| void Trk::GXFTrajectory::setPrevChi2 |
( |
double | chi2 | ) |
|
◆ setReferenceParameters()
| void Trk::GXFTrajectory::setReferenceParameters |
( |
std::unique_ptr< const TrackParameters > | per | ) |
|
Definition at line 274 of file GXFTrajectory.cxx.
274 {
277 return;
278 }
279
281
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
299 if (distsol.numberOfSolutions() == 1) {
301 } else if (distsol.numberOfSolutions() == 2) {
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 (
319 meff->sigmaDeltaTheta() != 0
320 ) {
322
323 if (meff->deltaE() == 0) {
325 }
326 }
327
328 if (meff != nullptr && meff->sigmaDeltaE() > 0) {
330 }
331 }
332 }
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
◆ setScatteringAngles()
| void Trk::GXFTrajectory::setScatteringAngles |
( |
std::vector< std::pair< double, double > > & | scatteringangles | ) |
|
Definition at line 549 of file GXFTrajectory.cxx.
550 {
552 int scatno = 0;
555 && ((
m_prefit == 0) || (*state).materialEffects()->deltaE() == 0)) {
556 const double scatphi = scatteringangles[scatno].first;
557 const double scattheta = scatteringangles[scatno].second;
558 (*state).materialEffects()->setScatteringAngles(scatphi, scattheta);
559 scatno++;
560 }
561 }
562 }
◆ totalEnergyLoss()
| double Trk::GXFTrajectory::totalEnergyLoss |
( |
| ) |
const |
◆ totalX0()
| double Trk::GXFTrajectory::totalX0 |
( |
| ) |
const |
◆ trackStates() [1/2]
| std::vector< std::unique_ptr< GXFTrackState > > & Trk::GXFTrajectory::trackStates |
( |
| ) |
|
◆ trackStates() [2/2]
| const std::vector< std::unique_ptr< GXFTrackState > > & Trk::GXFTrajectory::trackStates |
( |
| ) |
const |
◆ updateTRTHitCount()
| void Trk::GXFTrajectory::updateTRTHitCount |
( |
int | index, |
|
|
float | oldError ) |
Definition at line 379 of file GXFTrajectory.cxx.
379 {
384 }
385 if (error>1 && oldError<1) {
388 }
389 else if (error<1 && oldError>1) {
392 }
393 }
◆ upstreamMaterialLayers()
| std::vector< std::pair< const Layer *, const Layer * > > & Trk::GXFTrajectory::upstreamMaterialLayers |
( |
| ) |
|
◆ weightedResidualDerivatives()
| Amg::MatrixX & Trk::GXFTrajectory::weightedResidualDerivatives |
( |
| ) |
|
Definition at line 600 of file GXFTrajectory.cxx.
600 {
605 );
606 }
608 }
int numberOfFitParameters() const
◆ m_brems
| std::vector<double> Trk::GXFTrajectory::m_brems |
|
private |
◆ m_caloelossstate
◆ m_chi2
| double Trk::GXFTrajectory::m_chi2 |
|
private |
◆ m_converged
| bool Trk::GXFTrajectory::m_converged |
|
private |
◆ m_errors
◆ m_fieldprop
◆ m_mass
| double Trk::GXFTrajectory::m_mass |
|
private |
◆ m_nbrems
| int Trk::GXFTrajectory::m_nbrems |
|
private |
◆ m_ncaloscatterers
| int Trk::GXFTrajectory::m_ncaloscatterers |
|
private |
◆ m_ndof
| int Trk::GXFTrajectory::m_ndof |
|
private |
◆ m_nhits
| int Trk::GXFTrajectory::m_nhits |
|
private |
◆ m_nmeasoutl
| int Trk::GXFTrajectory::m_nmeasoutl |
|
private |
◆ m_noutl
| int Trk::GXFTrajectory::m_noutl |
|
private |
◆ m_nperpars
| int Trk::GXFTrajectory::m_nperpars |
|
private |
◆ m_npseudo
| int Trk::GXFTrajectory::m_npseudo |
|
private |
◆ m_nscatterers
| int Trk::GXFTrajectory::m_nscatterers |
|
private |
◆ m_nsihits
| int Trk::GXFTrajectory::m_nsihits |
|
private |
◆ m_ntrthits
| int Trk::GXFTrajectory::m_ntrthits |
|
private |
◆ m_ntrtprechits
| int Trk::GXFTrajectory::m_ntrtprechits |
|
private |
◆ m_ntrttubehits
| int Trk::GXFTrajectory::m_ntrttubehits |
|
private |
◆ m_nupstreambrems
| int Trk::GXFTrajectory::m_nupstreambrems |
|
private |
◆ m_nupstreamcaloscatterers
| int Trk::GXFTrajectory::m_nupstreamcaloscatterers |
|
private |
◆ m_nupstreamscatterers
| int Trk::GXFTrajectory::m_nupstreamscatterers |
|
private |
◆ m_nupstreamstates
| int Trk::GXFTrajectory::m_nupstreamstates |
|
private |
◆ m_prefit
| int Trk::GXFTrajectory::m_prefit |
|
private |
◆ m_prevchi2
| double Trk::GXFTrajectory::m_prevchi2 |
|
private |
◆ m_refpar
◆ m_res
◆ m_scatteringangles
| std::vector< std::pair < double, double > > Trk::GXFTrajectory::m_scatteringangles |
|
private |
◆ m_scatteringsigmas
| std::vector< std::pair < double, double > > Trk::GXFTrajectory::m_scatteringsigmas |
|
private |
◆ 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 |
◆ m_toteloss
| double Trk::GXFTrajectory::m_toteloss |
|
private |
◆ m_totx0
| double Trk::GXFTrajectory::m_totx0 |
|
private |
◆ m_upstreammat
| std::vector< std::pair < const Layer *, const Layer *> > Trk::GXFTrajectory::m_upstreammat |
|
private |
◆ m_weightresderiv
The documentation for this class was generated from the following files: