ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimTrack Class Reference

#include <FPGATrackSimTrack.h>

Collaboration diagram for FPGATrackSimTrack:

Public Member Functions

 FPGATrackSimTrack ()=default
virtual ~FPGATrackSimTrack ()
TrackCorrType getTrackCorrType () const
TrackStage getTrackStage () const
bool getDoDeltaGPhis () const
int getBankID () const
int getPatternID () const
int getFirstSectorID () const
int getSecondSectorID () const
int getTrackID () const
float getParameter (int) const
float getHoughX () const
float getHoughY () const
float getQOverPt () const
float getPt () const
float getD0 () const
float getPhi () const
float getZ0 () const
float getEta () const
float getTheta () const
float getChi2 () const
float getChi2Phi () const
float getChi2Eta () const
float getOrigChi2 () const
float getChi2ndof () const
float getOrigChi2ndof () const
int getSubRegion () const
int getRegion () const
unsigned getHoughXBin () const
unsigned getHoughYBin () const
int getNMissing () const
unsigned int getTypeMask () const
unsigned int getHitMap () const
int getNCoords () const
signed long getEventIndex () const
HepMcParticleLink::barcode_type getBarcode () const
HepMcParticleLink::barcode_type getUniqueID () const
unsigned long barcode () const
float getBarcodeFrac () const
const std::vector< FPGATrackSimHit > & getFPGATrackSimHits () const
const std::vector< std::shared_ptr< const FPGATrackSimHit > > & getFPGATrackSimHitPtrs () const
void persistifyHits ()
std::vector< float > getCoords (unsigned ilayer) const
std::vector< float > computeIdealCoords (unsigned ilayer) const
float getEtaCoord (int ilayer) const
float getPhiCoord (int ilayer) const
double getIdealRadius (int ilayer) const
bool isValidCand () const
void setTrackCorrType (TrackCorrType v)
void setTrackStage (TrackStage v)
void setDoDeltaGPhis (bool v)
void setBankID (int v)
void setPatternID (int v)
void setFirstSectorID (int v)
void setSecondSectorID (int v)
void setTrackID (int v)
void setParameter (int, float)
void setHoughX (float v)
void setHoughY (float v)
void setQOverPt (float v)
void setD0 (float v)
void setPhi (float v, bool ForceRange=true)
void setZ0 (float v)
void setEta (float v)
void setChi2 (float v)
void setChi2Phi (float v)
void setChi2Eta (float v)
void setOrigChi2 (float v)
void setNMissing (int v)
void setTypeMask (unsigned int v)
void setHitMap (unsigned int v)
void setEventIndex (const signed long &v)
void setBarcode (const HepMcParticleLink::barcode_type &v)
void setUniqueID (const HepMcParticleLink::barcode_type &v)
void setBarcodeFrac (const float &v)
void setSubRegion (unsigned v)
void setRegion (unsigned v)
void setHoughXBin (unsigned v)
void setHoughYBin (unsigned v)
void setValidCand (bool v)
void setIdealRadii (const std::vector< double > &v)
void setBinIdx (std::vector< unsigned > x)
const std::vector< unsigned > & getBinIdx () const
void calculateTruth ()
void setNLayers (int)
 set the number of layers in the track.
void setFPGATrackSimHit (unsigned i, std::shared_ptr< const FPGATrackSimHit > hit)
void setPars (FPGATrackSimTrackPars const &pars)
FPGATrackSimTrackPars getPars () const
unsigned int passedOR () const
void setPassedOR (unsigned int)

Private Attributes

TrackCorrType m_trackCorrType = TrackCorrType::None
TrackStage m_trackStage = TrackStage::FIRST
bool m_doDeltaGPhis = false
int m_bankID = -1
int m_patternID = 0
int m_firstSectorID = -1
int m_secondSectorID = -1
int m_trackID = -1
int m_IdealGeoCorr = 0
float m_houghX = 0.0F
float m_houghY = 0.0F
float m_qoverpt = 0.0F
float m_d0 = 0.0F
float m_phi = 0.0F
float m_z0 = 0.0F
float m_eta = 0.0F
float m_chi2 = 0.0F
float m_chi2_phi = 0.0F
float m_chi2_eta = 0.0F
float m_origchi2 = 0.0F
unsigned int m_nmissing = 0
unsigned int m_typemask = 0
unsigned int m_hitmap = 0
int m_subregion = 0
int m_region = 0
unsigned m_xBin = 0
unsigned m_yBin = 0
std::vector< FPGATrackSimHitm_hits
std::vector< std::shared_ptr< const FPGATrackSimHit > > m_hit_ptrs
std::vector< unsigned > m_binIdx
 transient
signed long m_eventindex = -1
HepMcParticleLink::barcode_type m_barcode = std::numeric_limits<HepMcParticleLink::barcode_type>::max()
HepMcParticleLink::barcode_type m_uniqueID = std::numeric_limits<HepMcParticleLink::barcode_type>::max()
float m_barcode_frac = 0.0F
bool m_isValidCand = true
std::vector< double > m_idealRadii
unsigned int m_ORcode = 1

Friends

std::ostream & operator<< (std::ostream &out, const FPGATrackSimTrack &track)

Detailed Description

Definition at line 18 of file FPGATrackSimTrack.h.

Constructor & Destructor Documentation

◆ FPGATrackSimTrack()

FPGATrackSimTrack::FPGATrackSimTrack ( )
default

◆ ~FPGATrackSimTrack()

FPGATrackSimTrack::~FPGATrackSimTrack ( )
virtual

Definition at line 18 of file FPGATrackSimTrack.cxx.

18{}

Member Function Documentation

◆ barcode()

unsigned long FPGATrackSimTrack::barcode ( ) const
inline

Definition at line 62 of file FPGATrackSimTrack.h.

62{ return getBarcode(); }
HepMcParticleLink::barcode_type getBarcode() const

◆ calculateTruth()

void FPGATrackSimTrack::calculateTruth ( )

Definition at line 252 of file FPGATrackSimTrack.cxx.

253{
254 vector<FPGATrackSimMultiTruth> mtv;
255 mtv.reserve(m_hit_ptrs.size());
256
257 // don't loop over coordinates, since we only calculate truth *per hit* and not per coordinate, though hitmap is saved for coordinates, so be careful
258 if (!m_hit_ptrs.empty()) {
259 for (const auto& thishit : m_hit_ptrs)
260 {
261 if (!thishit) throw std::runtime_error("Null hit pointer in FPGATrackSimTrack::calculateTruth()");
262 if (thishit->isReal())
263 {
264 FPGATrackSimMultiTruth this_mt(thishit->getTruth());
265 this_mt.assign_equal_normalization();
266 if (thishit->isPixel())
267 for ( auto& x : this_mt)
268 x.second *= 2;
269 mtv.push_back(this_mt);
270 }
271 }
272 }
273 else {
274 for (const auto& thishit : m_hits)
275 {
276 if (thishit.isReal())
277 {
278 FPGATrackSimMultiTruth this_mt(thishit.getTruth());
279 this_mt.assign_equal_normalization();
280 if (thishit.isPixel())
281 for ( auto& x : this_mt)
282 x.second *= 2;
283 mtv.push_back(this_mt);
284 }
285 }
286 }
287
288 // compute the best geant match, the barcode with the largest number of hits contributing to the track.
289 // frac is then the fraction of the total number of hits on the track attributed to the barcode.
290 FPGATrackSimMultiTruth mt(std::accumulate(mtv.begin(), mtv.end(), FPGATrackSimMultiTruth(), FPGATrackSimMultiTruth::AddAccumulator()));
293 const bool ok = mt.best(tbarcode, tfrac);
294 if (ok)
295 {
296 setEventIndex(tbarcode.first);
297 setBarcode(tbarcode.second);
298 setBarcodeFrac(tfrac);
299 }
300 else
301 {
302 setEventIndex(-1);
303 setBarcode(-1);
305 }
306}
#define x
std::pair< unsigned long, unsigned long > Barcode
void setEventIndex(const signed long &v)
void setBarcode(const HepMcParticleLink::barcode_type &v)
std::vector< std::shared_ptr< const FPGATrackSimHit > > m_hit_ptrs
void setBarcodeFrac(const float &v)
std::vector< FPGATrackSimHit > m_hits

◆ computeIdealCoords()

std::vector< float > FPGATrackSimTrack::computeIdealCoords ( unsigned ilayer) const

Definition at line 43 of file FPGATrackSimTrack.cxx.

44{
45
46 double target_r = m_idealRadii[ilayer];
47 if (ilayer >= m_hit_ptrs.size() || !m_hit_ptrs[ilayer])
48 throw std::range_error("FPGATrackSimTrack::computeIdealCoords() invalid hit access at index " + std::to_string(ilayer));
49 const auto& hit = *m_hit_ptrs[ilayer];
50 if (hit.getHitType() == HitType::spacepoint) {
51 unsigned other_layer = (hit.getSide() == 0) ? ilayer + 1 : ilayer - 1;
52 target_r = (target_r + m_idealRadii[other_layer]) / 2.;
53 }
54
55 double hough_x = getHoughX();
56 double hough_y = getHoughY();
57
58 // Use the centralized computeIdealCoords function from FPGATrackSimFunctions
59 std::vector<float> coords = ::computeIdealCoords(hit, hough_x, hough_y, target_r, m_doDeltaGPhis, m_trackCorrType);
60
61 return coords;
62}
TrackCorrType m_trackCorrType
float getHoughX() const
float getHoughY() const
std::vector< double > m_idealRadii
std::vector< float > computeIdealCoords(unsigned ilayer) const

◆ getBankID()

int FPGATrackSimTrack::getBankID ( ) const
inline

Definition at line 28 of file FPGATrackSimTrack.h.

28{ return m_bankID; }

◆ getBarcode()

HepMcParticleLink::barcode_type FPGATrackSimTrack::getBarcode ( ) const
inline

Definition at line 60 of file FPGATrackSimTrack.h.

60{ return m_barcode; }
HepMcParticleLink::barcode_type m_barcode

◆ getBarcodeFrac()

float FPGATrackSimTrack::getBarcodeFrac ( ) const
inline

Definition at line 63 of file FPGATrackSimTrack.h.

63{ return m_barcode_frac; }

◆ getBinIdx()

const std::vector< unsigned > & FPGATrackSimTrack::getBinIdx ( ) const
inline

Definition at line 139 of file FPGATrackSimTrack.h.

139{ return m_binIdx; }
std::vector< unsigned > m_binIdx
transient

◆ getChi2()

float FPGATrackSimTrack::getChi2 ( ) const
inline

Definition at line 43 of file FPGATrackSimTrack.h.

43{ return m_chi2; }

◆ getChi2Eta()

float FPGATrackSimTrack::getChi2Eta ( ) const
inline

Definition at line 45 of file FPGATrackSimTrack.h.

45{ return m_chi2_eta; }

◆ getChi2ndof()

float FPGATrackSimTrack::getChi2ndof ( ) const
inline

Definition at line 47 of file FPGATrackSimTrack.h.

47{ return m_chi2 / (getNCoords() - m_nmissing - 5); }

◆ getChi2Phi()

float FPGATrackSimTrack::getChi2Phi ( ) const
inline

Definition at line 44 of file FPGATrackSimTrack.h.

44{ return m_chi2_phi; }

◆ getCoords()

std::vector< float > FPGATrackSimTrack::getCoords ( unsigned ilayer) const

Definition at line 20 of file FPGATrackSimTrack.cxx.

21{
22 std::vector<float> coords;
23 if (ilayer >= m_hit_ptrs.size())
24 throw std::range_error("FPGATrackSimTrack::getCoords() out of bounds");
25 if (!m_hit_ptrs[ilayer])
26 throw std::range_error("FPGATrackSimTrack::getCoords() null pointer at index " + std::to_string(ilayer));
27
28 const auto& hit = *m_hit_ptrs[ilayer];
29
31 {
32 coords.push_back(hit.getEtaIndex());
33 coords.push_back(hit.getPhiIndex());
34 }
35 else
36 {
37 coords = computeIdealCoords(ilayer);
38 }
39
40 return coords;
41}

◆ getD0()

float FPGATrackSimTrack::getD0 ( ) const
inline

Definition at line 38 of file FPGATrackSimTrack.h.

38{ return m_d0; }

◆ getDoDeltaGPhis()

bool FPGATrackSimTrack::getDoDeltaGPhis ( ) const
inline

Definition at line 27 of file FPGATrackSimTrack.h.

27{ return m_doDeltaGPhis; }

◆ getEta()

float FPGATrackSimTrack::getEta ( ) const
inline

Definition at line 41 of file FPGATrackSimTrack.h.

41{ return m_eta; }

◆ getEtaCoord()

float FPGATrackSimTrack::getEtaCoord ( int ilayer) const

Definition at line 64 of file FPGATrackSimTrack.cxx.

64 {
65 auto coords = getCoords(ilayer);
66 if (coords.size() > 0) {
67 return coords.at(0);
68 }
69 else {
70 throw std::range_error("FPGATrackSimTrack::getCoord(layer,coord) out of bounds");
71 }
72}
std::vector< float > getCoords(unsigned ilayer) const

◆ getEventIndex()

signed long FPGATrackSimTrack::getEventIndex ( ) const
inline

Definition at line 59 of file FPGATrackSimTrack.h.

59{ return m_eventindex; }

◆ getFirstSectorID()

int FPGATrackSimTrack::getFirstSectorID ( ) const
inline

Definition at line 30 of file FPGATrackSimTrack.h.

◆ getFPGATrackSimHitPtrs()

const std::vector< std::shared_ptr< const FPGATrackSimHit > > & FPGATrackSimTrack::getFPGATrackSimHitPtrs ( ) const
inline

Definition at line 71 of file FPGATrackSimTrack.h.

71 {
72 return m_hit_ptrs;
73 }

◆ getFPGATrackSimHits()

const std::vector< FPGATrackSimHit > & FPGATrackSimTrack::getFPGATrackSimHits ( ) const
inline

Definition at line 68 of file FPGATrackSimTrack.h.

68{ return m_hits; }

◆ getHitMap()

unsigned int FPGATrackSimTrack::getHitMap ( ) const
inline

Definition at line 56 of file FPGATrackSimTrack.h.

56{ return m_hitmap; } // coordinate mask!!

◆ getHoughX()

float FPGATrackSimTrack::getHoughX ( ) const
inline

Definition at line 34 of file FPGATrackSimTrack.h.

34{ return m_houghX; }

◆ getHoughXBin()

unsigned FPGATrackSimTrack::getHoughXBin ( ) const
inline

Definition at line 51 of file FPGATrackSimTrack.h.

51{ return m_xBin; }

◆ getHoughY()

float FPGATrackSimTrack::getHoughY ( ) const
inline

Definition at line 35 of file FPGATrackSimTrack.h.

35{ return m_houghY; }

◆ getHoughYBin()

unsigned FPGATrackSimTrack::getHoughYBin ( ) const
inline

Definition at line 52 of file FPGATrackSimTrack.h.

52{ return m_yBin; }

◆ getIdealRadius()

double FPGATrackSimTrack::getIdealRadius ( int ilayer) const
inline

Definition at line 97 of file FPGATrackSimTrack.h.

97{ return m_idealRadii.at(ilayer); };

◆ getNCoords()

int FPGATrackSimTrack::getNCoords ( ) const

Definition at line 103 of file FPGATrackSimTrack.cxx.

103 {
104 int nCoords = 0;
105 if (!m_hit_ptrs.empty()) {
106 for (const auto& hit : m_hit_ptrs) {
107 if (hit) nCoords += hit->getDim();
108 }
109 }
110 else {
111 for (const auto& hit : m_hits) {
112 nCoords += hit.getDim();
113 }
114 }
115 return nCoords;
116}

◆ getNMissing()

int FPGATrackSimTrack::getNMissing ( ) const
inline

Definition at line 54 of file FPGATrackSimTrack.h.

54{ return m_nmissing; } // missing coordinates

◆ getOrigChi2()

float FPGATrackSimTrack::getOrigChi2 ( ) const
inline

Definition at line 46 of file FPGATrackSimTrack.h.

46{ return m_origchi2; }

◆ getOrigChi2ndof()

float FPGATrackSimTrack::getOrigChi2ndof ( ) const
inline

Definition at line 48 of file FPGATrackSimTrack.h.

48{ return m_origchi2 / (getNCoords() - m_nmissing - 5); }

◆ getParameter()

float FPGATrackSimTrack::getParameter ( int ipar) const

Definition at line 163 of file FPGATrackSimTrack.cxx.

164{
165 switch (ipar) {
166 case 0:
167 return m_qoverpt;
168 break;
169 case 1:
170 return m_d0;
171 break;
172 case 2:
173 return m_phi;
174 break;
175 case 3:
176 return m_z0;
177 break;
178 case 4:
179 return m_eta;
180 break;
181 }
182
183 return 0.;
184}

◆ getPars()

FPGATrackSimTrackPars FPGATrackSimTrack::getPars ( ) const
inline

Definition at line 153 of file FPGATrackSimTrack.h.

153 {
154 FPGATrackSimTrackPars pars;
155 pars.qOverPt = getQOverPt();
156 pars.eta = getEta();
157 pars.phi = getPhi();
158 pars.d0 = getD0();
159 pars.z0 = getZ0();
160
161 return pars;
162 }
float getQOverPt() const

◆ getPatternID()

int FPGATrackSimTrack::getPatternID ( ) const
inline

Definition at line 29 of file FPGATrackSimTrack.h.

29{ return m_patternID; }

◆ getPhi()

float FPGATrackSimTrack::getPhi ( ) const
inline

Definition at line 39 of file FPGATrackSimTrack.h.

39{ return m_phi; }

◆ getPhiCoord()

float FPGATrackSimTrack::getPhiCoord ( int ilayer) const

Definition at line 74 of file FPGATrackSimTrack.cxx.

74 {
75 auto coords = getCoords(ilayer);
76 // If this is a spacepoint, and if this is the "outer" hit on a strip module
77 // (side = 1) then we actually return the z/eta coord.
78 // Since spacepoints are duplicated, this avoids using the same phi coord
79 // twice and alsp avoids having to teach the code that strip spacepoints are
80 // "2D" hits despite being in the strips, which everything assumes is 1D.
81 // This makes it easy to mix and match spacepoints with strip hits that aren't
82 // spacepoints (since the number of strip layers is held fixed).
83 unsigned target_coord = 1;
84 if (!m_hit_ptrs.empty()) {
85 const auto& hit_ptr = m_hit_ptrs.at(ilayer);
86 if (hit_ptr && hit_ptr->getHitType() == HitType::spacepoint && (hit_ptr->getPhysLayer() % 2) == 1) {
87 target_coord = 0;
88 }
89 } else if (!m_hits.empty()) {
90 if (m_hits.at(ilayer).getHitType() == HitType::spacepoint && (m_hits.at(ilayer).getPhysLayer() % 2) == 1) {
91 target_coord = 0;
92 }
93 }
94
95 if (coords.size() > target_coord) {
96 return coords.at(target_coord);
97 }
98 else {
99 throw std::range_error("FPGATrackSimTrack::getCoord(layer,coord) out of bounds");
100 }
101}

◆ getPt()

float FPGATrackSimTrack::getPt ( ) const
inline

Definition at line 37 of file FPGATrackSimTrack.h.

37{ return m_qoverpt != 0 ? std::abs(1 / m_qoverpt) : 99999999.; }

◆ getQOverPt()

float FPGATrackSimTrack::getQOverPt ( ) const
inline

Definition at line 36 of file FPGATrackSimTrack.h.

36{ return m_qoverpt; }

◆ getRegion()

int FPGATrackSimTrack::getRegion ( ) const
inline

Definition at line 50 of file FPGATrackSimTrack.h.

50{ return m_region; }

◆ getSecondSectorID()

int FPGATrackSimTrack::getSecondSectorID ( ) const
inline

Definition at line 31 of file FPGATrackSimTrack.h.

◆ getSubRegion()

int FPGATrackSimTrack::getSubRegion ( ) const
inline

Definition at line 49 of file FPGATrackSimTrack.h.

49{ return m_subregion; }

◆ getTheta()

float FPGATrackSimTrack::getTheta ( ) const
inline

Definition at line 42 of file FPGATrackSimTrack.h.

42{ return 2*std::atan(std::exp(-m_eta)); }

◆ getTrackCorrType()

TrackCorrType FPGATrackSimTrack::getTrackCorrType ( ) const
inline

Definition at line 25 of file FPGATrackSimTrack.h.

25{ return m_trackCorrType; }

◆ getTrackID()

int FPGATrackSimTrack::getTrackID ( ) const
inline

Definition at line 32 of file FPGATrackSimTrack.h.

32{ return m_trackID; }

◆ getTrackStage()

TrackStage FPGATrackSimTrack::getTrackStage ( ) const
inline

Definition at line 26 of file FPGATrackSimTrack.h.

26{ return m_trackStage; }

◆ getTypeMask()

unsigned int FPGATrackSimTrack::getTypeMask ( ) const
inline

Definition at line 55 of file FPGATrackSimTrack.h.

55{ return m_typemask; }

◆ getUniqueID()

HepMcParticleLink::barcode_type FPGATrackSimTrack::getUniqueID ( ) const
inline

Definition at line 61 of file FPGATrackSimTrack.h.

61{ return m_uniqueID; }
HepMcParticleLink::barcode_type m_uniqueID

◆ getZ0()

float FPGATrackSimTrack::getZ0 ( ) const
inline

Definition at line 40 of file FPGATrackSimTrack.h.

40{ return m_z0; }

◆ isValidCand()

bool FPGATrackSimTrack::isValidCand ( ) const
inline

Definition at line 99 of file FPGATrackSimTrack.h.

99{ return m_isValidCand; }

◆ passedOR()

unsigned int FPGATrackSimTrack::passedOR ( ) const
inline

Definition at line 165 of file FPGATrackSimTrack.h.

165{ return m_ORcode; }

◆ persistifyHits()

void FPGATrackSimTrack::persistifyHits ( )
inline

Definition at line 76 of file FPGATrackSimTrack.h.

76 {
77 if (m_hit_ptrs.empty()) return;
78 m_hits.clear();
79 m_hits.reserve(m_hit_ptrs.size());
80 for (const auto& hit : m_hit_ptrs) {
81 if (hit) m_hits.push_back(*hit);
82 }
83 }

◆ setBankID()

void FPGATrackSimTrack::setBankID ( int v)
inline

Definition at line 104 of file FPGATrackSimTrack.h.

◆ setBarcode()

void FPGATrackSimTrack::setBarcode ( const HepMcParticleLink::barcode_type & v)
inline

Definition at line 125 of file FPGATrackSimTrack.h.

125{ m_barcode = v; }

◆ setBarcodeFrac()

void FPGATrackSimTrack::setBarcodeFrac ( const float & v)
inline

Definition at line 127 of file FPGATrackSimTrack.h.

127{ m_barcode_frac = v; }

◆ setBinIdx()

void FPGATrackSimTrack::setBinIdx ( std::vector< unsigned > x)
inline

Definition at line 138 of file FPGATrackSimTrack.h.

138{ m_binIdx = std::move(x); }

◆ setChi2()

void FPGATrackSimTrack::setChi2 ( float v)
inline

Definition at line 117 of file FPGATrackSimTrack.h.

117{ m_chi2 = v; }

◆ setChi2Eta()

void FPGATrackSimTrack::setChi2Eta ( float v)
inline

Definition at line 119 of file FPGATrackSimTrack.h.

119{ m_chi2_eta = v; }

◆ setChi2Phi()

void FPGATrackSimTrack::setChi2Phi ( float v)
inline

Definition at line 118 of file FPGATrackSimTrack.h.

118{ m_chi2_phi = v; }

◆ setD0()

void FPGATrackSimTrack::setD0 ( float v)
inline

Definition at line 113 of file FPGATrackSimTrack.h.

113{ m_d0 = v; }

◆ setDoDeltaGPhis()

void FPGATrackSimTrack::setDoDeltaGPhis ( bool v)
inline

Definition at line 103 of file FPGATrackSimTrack.h.

103{ m_doDeltaGPhis = v; }

◆ setEta()

void FPGATrackSimTrack::setEta ( float v)
inline

Definition at line 116 of file FPGATrackSimTrack.h.

116{ m_eta = v; }

◆ setEventIndex()

void FPGATrackSimTrack::setEventIndex ( const signed long & v)
inline

Definition at line 124 of file FPGATrackSimTrack.h.

124{ m_eventindex = v; }

◆ setFirstSectorID()

void FPGATrackSimTrack::setFirstSectorID ( int v)
inline

Definition at line 106 of file FPGATrackSimTrack.h.

106{ m_firstSectorID = v; }

◆ setFPGATrackSimHit()

void FPGATrackSimTrack::setFPGATrackSimHit ( unsigned i,
std::shared_ptr< const FPGATrackSimHit > hit )

Definition at line 123 of file FPGATrackSimTrack.cxx.

124{
125 if (m_hit_ptrs.size() <= i) m_hit_ptrs.resize(i+1);
126 m_hit_ptrs[i] = std::move(hit);
127}

◆ setHitMap()

void FPGATrackSimTrack::setHitMap ( unsigned int v)
inline

Definition at line 123 of file FPGATrackSimTrack.h.

123{ m_hitmap = v; }

◆ setHoughX()

void FPGATrackSimTrack::setHoughX ( float v)
inline

Definition at line 110 of file FPGATrackSimTrack.h.

110{ m_houghX = v; }

◆ setHoughXBin()

void FPGATrackSimTrack::setHoughXBin ( unsigned v)
inline

Definition at line 131 of file FPGATrackSimTrack.h.

131{ m_xBin = v; }

◆ setHoughY()

void FPGATrackSimTrack::setHoughY ( float v)
inline

Definition at line 111 of file FPGATrackSimTrack.h.

111{ m_houghY = v; }

◆ setHoughYBin()

void FPGATrackSimTrack::setHoughYBin ( unsigned v)
inline

Definition at line 132 of file FPGATrackSimTrack.h.

132{ m_yBin = v;}

◆ setIdealRadii()

void FPGATrackSimTrack::setIdealRadii ( const std::vector< double > & v)
inline

Definition at line 135 of file FPGATrackSimTrack.h.

135{ m_idealRadii = v; }

◆ setNLayers()

void FPGATrackSimTrack::setNLayers ( int dim)

set the number of layers in the track.

=0 is used to clear the track

Definition at line 130 of file FPGATrackSimTrack.cxx.

131{
132 // Pre-fill with dummy hits to ensure dense vector model.
133 // This guarantees that all layers 0 to dim-1 have entries (no sparse nulls).
134 // setFPGATrackSimHit() will replace these dummies with real hits as needed.
135 m_hit_ptrs.clear();
136 m_hit_ptrs.reserve(dim);
137 for (int i = 0; i < dim; i++) {
138 FPGATrackSimHit dummy;
139 dummy.setLayer(i);
140 dummy.setSection(0);
141 m_hit_ptrs.push_back(std::make_shared<FPGATrackSimHit>(dummy));
142 }
143}

◆ setNMissing()

void FPGATrackSimTrack::setNMissing ( int v)
inline

Definition at line 121 of file FPGATrackSimTrack.h.

121{ m_nmissing = v; }

◆ setOrigChi2()

void FPGATrackSimTrack::setOrigChi2 ( float v)
inline

Definition at line 120 of file FPGATrackSimTrack.h.

120{ m_origchi2 = v; }

◆ setParameter()

void FPGATrackSimTrack::setParameter ( int ipar,
float val )

Definition at line 187 of file FPGATrackSimTrack.cxx.

188{
189 switch (ipar) {
190 case 0:
191 m_qoverpt = val;
192 break;
193 case 1:
194 m_d0 = val;
195 break;
196 case 2:
197 m_phi = val;
198 break;
199 case 3:
200 m_z0 = val;
201 break;
202 case 4:
203 m_eta = val;
204 break;
205 }
206}

◆ setPars()

void FPGATrackSimTrack::setPars ( FPGATrackSimTrackPars const & pars)
inline

Definition at line 144 of file FPGATrackSimTrack.h.

145 {
146 setQOverPt(pars.qOverPt);
147 setPhi(pars.phi, false);
148 setEta(pars.eta);
149 setD0(pars.d0);
150 setZ0(pars.z0);
151 }
void setQOverPt(float v)
void setPhi(float v, bool ForceRange=true)

◆ setPassedOR()

void FPGATrackSimTrack::setPassedOR ( unsigned int code)

Definition at line 308 of file FPGATrackSimTrack.cxx.

309{
310 m_ORcode = code;
311}

◆ setPatternID()

void FPGATrackSimTrack::setPatternID ( int v)
inline

Definition at line 105 of file FPGATrackSimTrack.h.

105{ m_patternID = v; }

◆ setPhi()

void FPGATrackSimTrack::setPhi ( float v,
bool ForceRange = true )

Definition at line 147 of file FPGATrackSimTrack.cxx.

147 {
148 if (ForceRange) {
149 // when phi is ridiculously large, there is no point in adjusting it
150 if (std::abs(phi) > 100) {
151 if (m_chi2 < 100) { // this is a BAD track, so fail it if chi2 hasn't done so already
152 m_chi2 += 100; // we want to fail this event anyway
153 }
154 }
155 else {
156 while (phi >= M_PI) phi -= (2. * M_PI);
157 while (phi < -M_PI) phi += (2. * M_PI);
158 }
159 }
160 m_phi = phi;
161}
#define M_PI
Scalar phi() const
phi method

◆ setQOverPt()

void FPGATrackSimTrack::setQOverPt ( float v)
inline

Definition at line 112 of file FPGATrackSimTrack.h.

112{ m_qoverpt = v; }

◆ setRegion()

void FPGATrackSimTrack::setRegion ( unsigned v)
inline

Definition at line 130 of file FPGATrackSimTrack.h.

130{ m_region = v; }

◆ setSecondSectorID()

void FPGATrackSimTrack::setSecondSectorID ( int v)
inline

Definition at line 107 of file FPGATrackSimTrack.h.

107{ m_secondSectorID = v; }

◆ setSubRegion()

void FPGATrackSimTrack::setSubRegion ( unsigned v)
inline

Definition at line 129 of file FPGATrackSimTrack.h.

129{ m_subregion = v; }

◆ setTrackCorrType()

void FPGATrackSimTrack::setTrackCorrType ( TrackCorrType v)
inline

Definition at line 101 of file FPGATrackSimTrack.h.

101{ m_trackCorrType = v; }

◆ setTrackID()

void FPGATrackSimTrack::setTrackID ( int v)
inline

Definition at line 108 of file FPGATrackSimTrack.h.

108{ m_trackID = v; }

◆ setTrackStage()

void FPGATrackSimTrack::setTrackStage ( TrackStage v)
inline

Definition at line 102 of file FPGATrackSimTrack.h.

102{ m_trackStage = v; }

◆ setTypeMask()

void FPGATrackSimTrack::setTypeMask ( unsigned int v)
inline

Definition at line 122 of file FPGATrackSimTrack.h.

122{ m_typemask = v; }

◆ setUniqueID()

void FPGATrackSimTrack::setUniqueID ( const HepMcParticleLink::barcode_type & v)
inline

Definition at line 126 of file FPGATrackSimTrack.h.

126{ m_uniqueID = v; }

◆ setValidCand()

void FPGATrackSimTrack::setValidCand ( bool v)
inline

Definition at line 134 of file FPGATrackSimTrack.h.

134{ m_isValidCand = v; }

◆ setZ0()

void FPGATrackSimTrack::setZ0 ( float v)
inline

Definition at line 115 of file FPGATrackSimTrack.h.

115{ m_z0 = v; }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const FPGATrackSimTrack & track )
friend

Definition at line 209 of file FPGATrackSimTrack.cxx.

210{
211
212 out << "TRACK: ID=" << std::left << setw(8) << track.m_trackID;
213 out << " SECTOR1=" << std::left << setw(8) << track.m_firstSectorID;
214 out << " BANK=" << std::left << setw(8) << track.m_bankID;
215 out << " BARCODE=" << std::left << setw(6) << track.m_barcode;
216 out << " BARCODE_F=" << std::left << setw(9) << track.m_barcode_frac;
217 out << " EVENT=" << std::left << setw(6) << track.m_eventindex;
218 out << " HITMAP=" << std::left << setw(8) << track.getHitMap();
219 out << " TYPE=" << std::left << setw(3) << track.m_typemask;
220 out << " NMISS=" << std::left << setw(3) << track.getNMissing();
221 out << "\n";
222 streamsize oldprec = out.precision();
223 out.precision(4);
224 out << " PHI=" << std::left << setw(10) << track.m_phi;
225 out.setf(ios_base::scientific);
226 out.precision(2);
227 out << " Q/PT=" << std::left << setw(10) << track.m_qoverpt;
228 out.unsetf(ios_base::scientific);
229 out.precision(4);
230 out << " d0=" << std::left << setw(10) << track.m_d0;
231 out << " ETA=" << std::left << setw(10) << track.m_eta;
232 out << " z0=" << std::left << setw(10) << track.m_z0;
233 out << " Chi2=" << std::left << setw(12) << track.m_chi2;
234 out << " OChi2=" << std::left << setw(12) << track.m_origchi2;
235
236 out << endl;
237 out.precision(oldprec);
238
239 out << endl;
240
241 // print the hits
242 int iter = 0;
243 for (const auto& hit : track.m_hits) {
244 out << "Hit " << iter << ": " << hit << "\n";
245 iter++;
246 }
247
248 return out;
249}

Member Data Documentation

◆ m_bankID

int FPGATrackSimTrack::m_bankID = -1
private

Definition at line 176 of file FPGATrackSimTrack.h.

◆ m_barcode

HepMcParticleLink::barcode_type FPGATrackSimTrack::m_barcode = std::numeric_limits<HepMcParticleLink::barcode_type>::max()
private

Definition at line 218 of file FPGATrackSimTrack.h.

◆ m_barcode_frac

float FPGATrackSimTrack::m_barcode_frac = 0.0F
private

Definition at line 221 of file FPGATrackSimTrack.h.

◆ m_binIdx

std::vector<unsigned> FPGATrackSimTrack::m_binIdx
private

transient

Definition at line 215 of file FPGATrackSimTrack.h.

◆ m_chi2

float FPGATrackSimTrack::m_chi2 = 0.0F
private

Definition at line 191 of file FPGATrackSimTrack.h.

◆ m_chi2_eta

float FPGATrackSimTrack::m_chi2_eta = 0.0F
private

Definition at line 193 of file FPGATrackSimTrack.h.

◆ m_chi2_phi

float FPGATrackSimTrack::m_chi2_phi = 0.0F
private

Definition at line 192 of file FPGATrackSimTrack.h.

◆ m_d0

float FPGATrackSimTrack::m_d0 = 0.0F
private

Definition at line 187 of file FPGATrackSimTrack.h.

◆ m_doDeltaGPhis

bool FPGATrackSimTrack::m_doDeltaGPhis = false
private

Definition at line 174 of file FPGATrackSimTrack.h.

◆ m_eta

float FPGATrackSimTrack::m_eta = 0.0F
private

Definition at line 190 of file FPGATrackSimTrack.h.

◆ m_eventindex

signed long FPGATrackSimTrack::m_eventindex = -1
private

Definition at line 217 of file FPGATrackSimTrack.h.

◆ m_firstSectorID

int FPGATrackSimTrack::m_firstSectorID = -1
private

Definition at line 178 of file FPGATrackSimTrack.h.

◆ m_hit_ptrs

std::vector<std::shared_ptr<const FPGATrackSimHit> > FPGATrackSimTrack::m_hit_ptrs
private

Definition at line 212 of file FPGATrackSimTrack.h.

◆ m_hitmap

unsigned int FPGATrackSimTrack::m_hitmap = 0
private

Definition at line 199 of file FPGATrackSimTrack.h.

◆ m_hits

std::vector<FPGATrackSimHit> FPGATrackSimTrack::m_hits
private

Definition at line 209 of file FPGATrackSimTrack.h.

◆ m_houghX

float FPGATrackSimTrack::m_houghX = 0.0F
private

Definition at line 184 of file FPGATrackSimTrack.h.

◆ m_houghY

float FPGATrackSimTrack::m_houghY = 0.0F
private

Definition at line 185 of file FPGATrackSimTrack.h.

◆ m_IdealGeoCorr

int FPGATrackSimTrack::m_IdealGeoCorr = 0
private

Definition at line 182 of file FPGATrackSimTrack.h.

◆ m_idealRadii

std::vector<double> FPGATrackSimTrack::m_idealRadii
private

Definition at line 232 of file FPGATrackSimTrack.h.

◆ m_isValidCand

bool FPGATrackSimTrack::m_isValidCand = true
private

Definition at line 227 of file FPGATrackSimTrack.h.

◆ m_nmissing

unsigned int FPGATrackSimTrack::m_nmissing = 0
private

Definition at line 197 of file FPGATrackSimTrack.h.

◆ m_ORcode

unsigned int FPGATrackSimTrack::m_ORcode = 1
private

Definition at line 236 of file FPGATrackSimTrack.h.

◆ m_origchi2

float FPGATrackSimTrack::m_origchi2 = 0.0F
private

Definition at line 194 of file FPGATrackSimTrack.h.

◆ m_patternID

int FPGATrackSimTrack::m_patternID = 0
private

Definition at line 177 of file FPGATrackSimTrack.h.

◆ m_phi

float FPGATrackSimTrack::m_phi = 0.0F
private

Definition at line 188 of file FPGATrackSimTrack.h.

◆ m_qoverpt

float FPGATrackSimTrack::m_qoverpt = 0.0F
private

Definition at line 186 of file FPGATrackSimTrack.h.

◆ m_region

int FPGATrackSimTrack::m_region = 0
private

Definition at line 204 of file FPGATrackSimTrack.h.

◆ m_secondSectorID

int FPGATrackSimTrack::m_secondSectorID = -1
private

Definition at line 179 of file FPGATrackSimTrack.h.

◆ m_subregion

int FPGATrackSimTrack::m_subregion = 0
private

Definition at line 202 of file FPGATrackSimTrack.h.

◆ m_trackCorrType

TrackCorrType FPGATrackSimTrack::m_trackCorrType = TrackCorrType::None
private

Definition at line 172 of file FPGATrackSimTrack.h.

◆ m_trackID

int FPGATrackSimTrack::m_trackID = -1
private

Definition at line 180 of file FPGATrackSimTrack.h.

◆ m_trackStage

TrackStage FPGATrackSimTrack::m_trackStage = TrackStage::FIRST
private

Definition at line 173 of file FPGATrackSimTrack.h.

◆ m_typemask

unsigned int FPGATrackSimTrack::m_typemask = 0
private

Definition at line 198 of file FPGATrackSimTrack.h.

◆ m_uniqueID

HepMcParticleLink::barcode_type FPGATrackSimTrack::m_uniqueID = std::numeric_limits<HepMcParticleLink::barcode_type>::max()
private

Definition at line 219 of file FPGATrackSimTrack.h.

◆ m_xBin

unsigned FPGATrackSimTrack::m_xBin = 0
private

Definition at line 206 of file FPGATrackSimTrack.h.

◆ m_yBin

unsigned FPGATrackSimTrack::m_yBin = 0
private

Definition at line 207 of file FPGATrackSimTrack.h.

◆ m_z0

float FPGATrackSimTrack::m_z0 = 0.0F
private

Definition at line 189 of file FPGATrackSimTrack.h.


The documentation for this class was generated from the following files: