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

#include <FPGATrackSimTrack.h>

Collaboration diagram for FPGATrackSimTrack:

Public Member Functions

 FPGATrackSimTrack ()=default
 FPGATrackSimTrack (const FPGATrackSimTrack &)=default
FPGATrackSimTrackoperator= (const FPGATrackSimTrack &)=default
 FPGATrackSimTrack (FPGATrackSimTrack &&)=default
FPGATrackSimTrackoperator= (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 getNHits () const
layer_bitmask_t getHitMask () 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 23 of file FPGATrackSimTrack.h.

Constructor & Destructor Documentation

◆ FPGATrackSimTrack() [1/3]

FPGATrackSimTrack::FPGATrackSimTrack ( )
default

◆ FPGATrackSimTrack() [2/3]

FPGATrackSimTrack::FPGATrackSimTrack ( const FPGATrackSimTrack & )
default

◆ FPGATrackSimTrack() [3/3]

FPGATrackSimTrack::FPGATrackSimTrack ( FPGATrackSimTrack && )
default

◆ ~FPGATrackSimTrack()

FPGATrackSimTrack::~FPGATrackSimTrack ( )
virtual

Definition at line 17 of file FPGATrackSimTrack.cxx.

17{}

Member Function Documentation

◆ barcode()

unsigned long FPGATrackSimTrack::barcode ( ) const
inline

Definition at line 76 of file FPGATrackSimTrack.h.

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

◆ calculateTruth()

void FPGATrackSimTrack::calculateTruth ( )

Definition at line 251 of file FPGATrackSimTrack.cxx.

252{
253 vector<FPGATrackSimMultiTruth> mtv;
254 mtv.reserve(m_hit_ptrs.size());
255
256 // 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
257 if (!m_hit_ptrs.empty()) {
258 for (const auto& thishit : m_hit_ptrs)
259 {
260 if (!thishit) throw std::runtime_error("Null hit pointer in FPGATrackSimTrack::calculateTruth()");
261 if (thishit->isReal())
262 {
263 FPGATrackSimMultiTruth this_mt(thishit->getTruth());
264 this_mt.assign_equal_normalization();
265 if (thishit->isPixel())
266 for ( auto& x : this_mt)
267 x.second *= 2;
268 mtv.push_back(this_mt);
269 }
270 }
271 }
272 else {
273 for (const auto& thishit : m_hits)
274 {
275 if (thishit.isReal())
276 {
277 FPGATrackSimMultiTruth this_mt(thishit.getTruth());
278 this_mt.assign_equal_normalization();
279 if (thishit.isPixel())
280 for ( auto& x : this_mt)
281 x.second *= 2;
282 mtv.push_back(this_mt);
283 }
284 }
285 }
286
287 // compute the best geant match, the barcode with the largest number of hits contributing to the track.
288 // frac is then the fraction of the total number of hits on the track attributed to the barcode.
289 FPGATrackSimMultiTruth mt(std::accumulate(mtv.begin(), mtv.end(), FPGATrackSimMultiTruth(), FPGATrackSimMultiTruth::AddAccumulator()));
292 const bool ok = mt.best(tbarcode, tfrac);
293 if (ok)
294 {
295 setEventIndex(tbarcode.first);
296 setBarcode(tbarcode.second);
297 setBarcodeFrac(tfrac);
298 }
299 else
300 {
301 setEventIndex(-1);
302 setBarcode(-1);
304 }
305}
#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 42 of file FPGATrackSimTrack.cxx.

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

38{ return m_bankID; }

◆ getBarcode()

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

Definition at line 74 of file FPGATrackSimTrack.h.

74{ return m_barcode; }
HepMcParticleLink::barcode_type m_barcode

◆ getBarcodeFrac()

float FPGATrackSimTrack::getBarcodeFrac ( ) const
inline

Definition at line 77 of file FPGATrackSimTrack.h.

77{ return m_barcode_frac; }

◆ getBinIdx()

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

Definition at line 153 of file FPGATrackSimTrack.h.

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

◆ getChi2()

float FPGATrackSimTrack::getChi2 ( ) const
inline

Definition at line 53 of file FPGATrackSimTrack.h.

53{ return m_chi2; }

◆ getChi2Eta()

float FPGATrackSimTrack::getChi2Eta ( ) const
inline

Definition at line 55 of file FPGATrackSimTrack.h.

55{ return m_chi2_eta; }

◆ getChi2ndof()

float FPGATrackSimTrack::getChi2ndof ( ) const
inline

Definition at line 57 of file FPGATrackSimTrack.h.

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

◆ getChi2Phi()

float FPGATrackSimTrack::getChi2Phi ( ) const
inline

Definition at line 54 of file FPGATrackSimTrack.h.

54{ return m_chi2_phi; }

◆ getCoords()

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

Definition at line 19 of file FPGATrackSimTrack.cxx.

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

◆ getD0()

float FPGATrackSimTrack::getD0 ( ) const
inline

Definition at line 48 of file FPGATrackSimTrack.h.

48{ return m_d0; }

◆ getDoDeltaGPhis()

bool FPGATrackSimTrack::getDoDeltaGPhis ( ) const
inline

Definition at line 37 of file FPGATrackSimTrack.h.

37{ return m_doDeltaGPhis; }

◆ getEta()

float FPGATrackSimTrack::getEta ( ) const
inline

Definition at line 51 of file FPGATrackSimTrack.h.

51{ return m_eta; }

◆ getEtaCoord()

float FPGATrackSimTrack::getEtaCoord ( int ilayer) const

Definition at line 63 of file FPGATrackSimTrack.cxx.

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

◆ getEventIndex()

signed long FPGATrackSimTrack::getEventIndex ( ) const
inline

Definition at line 73 of file FPGATrackSimTrack.h.

73{ return m_eventindex; }

◆ getFirstSectorID()

int FPGATrackSimTrack::getFirstSectorID ( ) const
inline

Definition at line 40 of file FPGATrackSimTrack.h.

◆ getFPGATrackSimHitPtrs()

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

Definition at line 85 of file FPGATrackSimTrack.h.

85 {
86 return m_hit_ptrs;
87 }

◆ getFPGATrackSimHits()

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

Definition at line 82 of file FPGATrackSimTrack.h.

82{ return m_hits; }

◆ getHitMap()

unsigned int FPGATrackSimTrack::getHitMap ( ) const
inline

Definition at line 70 of file FPGATrackSimTrack.h.

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

◆ getHitMask()

layer_bitmask_t FPGATrackSimTrack::getHitMask ( ) const

Definition at line 313 of file FPGATrackSimTrack.cxx.

313 {
314 unsigned retv =0;
315 for (unsigned lyr = 0; lyr < m_hit_ptrs.size(); lyr++)
316 {
317 if (m_hit_ptrs[lyr] && m_hit_ptrs[lyr]->isReal()) retv|=(1<< lyr);
318 }
319 return retv;
320}

◆ getHoughX()

float FPGATrackSimTrack::getHoughX ( ) const
inline

Definition at line 44 of file FPGATrackSimTrack.h.

44{ return m_houghX; }

◆ getHoughXBin()

unsigned FPGATrackSimTrack::getHoughXBin ( ) const
inline

Definition at line 61 of file FPGATrackSimTrack.h.

61{ return m_xBin; }

◆ getHoughY()

float FPGATrackSimTrack::getHoughY ( ) const
inline

Definition at line 45 of file FPGATrackSimTrack.h.

45{ return m_houghY; }

◆ getHoughYBin()

unsigned FPGATrackSimTrack::getHoughYBin ( ) const
inline

Definition at line 62 of file FPGATrackSimTrack.h.

62{ return m_yBin; }

◆ getIdealRadius()

double FPGATrackSimTrack::getIdealRadius ( int ilayer) const
inline

Definition at line 111 of file FPGATrackSimTrack.h.

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

◆ getNCoords()

int FPGATrackSimTrack::getNCoords ( ) const

Definition at line 102 of file FPGATrackSimTrack.cxx.

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

◆ getNHits()

int FPGATrackSimTrack::getNHits ( ) const
inline

Definition at line 65 of file FPGATrackSimTrack.h.

65{ return std::count_if(m_hit_ptrs.begin(), m_hit_ptrs.end(), [](const std::shared_ptr<const FPGATrackSimHit>& hit) { return hit && hit->isReal();});}

◆ getNMissing()

int FPGATrackSimTrack::getNMissing ( ) const
inline

Definition at line 68 of file FPGATrackSimTrack.h.

68{ return m_nmissing; } // missing coordinates

◆ getOrigChi2()

float FPGATrackSimTrack::getOrigChi2 ( ) const
inline

Definition at line 56 of file FPGATrackSimTrack.h.

56{ return m_origchi2; }

◆ getOrigChi2ndof()

float FPGATrackSimTrack::getOrigChi2ndof ( ) const
inline

Definition at line 58 of file FPGATrackSimTrack.h.

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

◆ getParameter()

float FPGATrackSimTrack::getParameter ( int ipar) const

Definition at line 162 of file FPGATrackSimTrack.cxx.

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

◆ getPars()

FPGATrackSimTrackPars FPGATrackSimTrack::getPars ( ) const
inline

Definition at line 167 of file FPGATrackSimTrack.h.

167 {
168 FPGATrackSimTrackPars pars;
169 pars.qOverPt = getQOverPt();
170 pars.eta = getEta();
171 pars.phi = getPhi();
172 pars.d0 = getD0();
173 pars.z0 = getZ0();
174
175 return pars;
176 }
float getQOverPt() const

◆ getPatternID()

int FPGATrackSimTrack::getPatternID ( ) const
inline

Definition at line 39 of file FPGATrackSimTrack.h.

39{ return m_patternID; }

◆ getPhi()

float FPGATrackSimTrack::getPhi ( ) const
inline

Definition at line 49 of file FPGATrackSimTrack.h.

49{ return m_phi; }

◆ getPhiCoord()

float FPGATrackSimTrack::getPhiCoord ( int ilayer) const

Definition at line 73 of file FPGATrackSimTrack.cxx.

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

◆ getPt()

float FPGATrackSimTrack::getPt ( ) const
inline

Definition at line 47 of file FPGATrackSimTrack.h.

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

◆ getQOverPt()

float FPGATrackSimTrack::getQOverPt ( ) const
inline

Definition at line 46 of file FPGATrackSimTrack.h.

46{ return m_qoverpt; }

◆ getRegion()

int FPGATrackSimTrack::getRegion ( ) const
inline

Definition at line 60 of file FPGATrackSimTrack.h.

60{ return m_region; }

◆ getSecondSectorID()

int FPGATrackSimTrack::getSecondSectorID ( ) const
inline

Definition at line 41 of file FPGATrackSimTrack.h.

◆ getSubRegion()

int FPGATrackSimTrack::getSubRegion ( ) const
inline

Definition at line 59 of file FPGATrackSimTrack.h.

59{ return m_subregion; }

◆ getTheta()

float FPGATrackSimTrack::getTheta ( ) const
inline

Definition at line 52 of file FPGATrackSimTrack.h.

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

◆ getTrackCorrType()

TrackCorrType FPGATrackSimTrack::getTrackCorrType ( ) const
inline

Definition at line 35 of file FPGATrackSimTrack.h.

35{ return m_trackCorrType; }

◆ getTrackID()

int FPGATrackSimTrack::getTrackID ( ) const
inline

Definition at line 42 of file FPGATrackSimTrack.h.

42{ return m_trackID; }

◆ getTrackStage()

TrackStage FPGATrackSimTrack::getTrackStage ( ) const
inline

Definition at line 36 of file FPGATrackSimTrack.h.

36{ return m_trackStage; }

◆ getTypeMask()

unsigned int FPGATrackSimTrack::getTypeMask ( ) const
inline

Definition at line 69 of file FPGATrackSimTrack.h.

69{ return m_typemask; }

◆ getUniqueID()

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

Definition at line 75 of file FPGATrackSimTrack.h.

75{ return m_uniqueID; }
HepMcParticleLink::barcode_type m_uniqueID

◆ getZ0()

float FPGATrackSimTrack::getZ0 ( ) const
inline

Definition at line 50 of file FPGATrackSimTrack.h.

50{ return m_z0; }

◆ isValidCand()

bool FPGATrackSimTrack::isValidCand ( ) const
inline

Definition at line 113 of file FPGATrackSimTrack.h.

113{ return m_isValidCand; }

◆ operator=() [1/2]

FPGATrackSimTrack & FPGATrackSimTrack::operator= ( const FPGATrackSimTrack & )
default

◆ operator=() [2/2]

FPGATrackSimTrack & FPGATrackSimTrack::operator= ( FPGATrackSimTrack && )
default

◆ passedOR()

unsigned int FPGATrackSimTrack::passedOR ( ) const
inline

Definition at line 179 of file FPGATrackSimTrack.h.

179{ return m_ORcode; }

◆ persistifyHits()

void FPGATrackSimTrack::persistifyHits ( )
inline

Definition at line 90 of file FPGATrackSimTrack.h.

90 {
91 if (m_hit_ptrs.empty()) return;
92 m_hits.clear();
93 m_hits.reserve(m_hit_ptrs.size());
94 for (const auto& hit : m_hit_ptrs) {
95 if (hit) m_hits.push_back(*hit);
96 }
97 }

◆ setBankID()

void FPGATrackSimTrack::setBankID ( int v)
inline

Definition at line 118 of file FPGATrackSimTrack.h.

◆ setBarcode()

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

Definition at line 139 of file FPGATrackSimTrack.h.

139{ m_barcode = v; }

◆ setBarcodeFrac()

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

Definition at line 141 of file FPGATrackSimTrack.h.

141{ m_barcode_frac = v; }

◆ setBinIdx()

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

Definition at line 152 of file FPGATrackSimTrack.h.

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

◆ setChi2()

void FPGATrackSimTrack::setChi2 ( float v)
inline

Definition at line 131 of file FPGATrackSimTrack.h.

131{ m_chi2 = v; }

◆ setChi2Eta()

void FPGATrackSimTrack::setChi2Eta ( float v)
inline

Definition at line 133 of file FPGATrackSimTrack.h.

133{ m_chi2_eta = v; }

◆ setChi2Phi()

void FPGATrackSimTrack::setChi2Phi ( float v)
inline

Definition at line 132 of file FPGATrackSimTrack.h.

132{ m_chi2_phi = v; }

◆ setD0()

void FPGATrackSimTrack::setD0 ( float v)
inline

Definition at line 127 of file FPGATrackSimTrack.h.

127{ m_d0 = v; }

◆ setDoDeltaGPhis()

void FPGATrackSimTrack::setDoDeltaGPhis ( bool v)
inline

Definition at line 117 of file FPGATrackSimTrack.h.

117{ m_doDeltaGPhis = v; }

◆ setEta()

void FPGATrackSimTrack::setEta ( float v)
inline

Definition at line 130 of file FPGATrackSimTrack.h.

130{ m_eta = v; }

◆ setEventIndex()

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

Definition at line 138 of file FPGATrackSimTrack.h.

138{ m_eventindex = v; }

◆ setFirstSectorID()

void FPGATrackSimTrack::setFirstSectorID ( int v)
inline

Definition at line 120 of file FPGATrackSimTrack.h.

120{ m_firstSectorID = v; }

◆ setFPGATrackSimHit()

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

Definition at line 122 of file FPGATrackSimTrack.cxx.

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

◆ setHitMap()

void FPGATrackSimTrack::setHitMap ( unsigned int v)
inline

Definition at line 137 of file FPGATrackSimTrack.h.

137{ m_hitmap = v; }

◆ setHoughX()

void FPGATrackSimTrack::setHoughX ( float v)
inline

Definition at line 124 of file FPGATrackSimTrack.h.

124{ m_houghX = v; }

◆ setHoughXBin()

void FPGATrackSimTrack::setHoughXBin ( unsigned v)
inline

Definition at line 145 of file FPGATrackSimTrack.h.

145{ m_xBin = v; }

◆ setHoughY()

void FPGATrackSimTrack::setHoughY ( float v)
inline

Definition at line 125 of file FPGATrackSimTrack.h.

125{ m_houghY = v; }

◆ setHoughYBin()

void FPGATrackSimTrack::setHoughYBin ( unsigned v)
inline

Definition at line 146 of file FPGATrackSimTrack.h.

146{ m_yBin = v;}

◆ setIdealRadii()

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

Definition at line 149 of file FPGATrackSimTrack.h.

149{ 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 129 of file FPGATrackSimTrack.cxx.

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

◆ setNMissing()

void FPGATrackSimTrack::setNMissing ( int v)
inline

Definition at line 135 of file FPGATrackSimTrack.h.

135{ m_nmissing = v; }

◆ setOrigChi2()

void FPGATrackSimTrack::setOrigChi2 ( float v)
inline

Definition at line 134 of file FPGATrackSimTrack.h.

134{ m_origchi2 = v; }

◆ setParameter()

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

Definition at line 186 of file FPGATrackSimTrack.cxx.

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

◆ setPars()

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

Definition at line 158 of file FPGATrackSimTrack.h.

159 {
160 setQOverPt(pars.qOverPt);
161 setPhi(pars.phi, false);
162 setEta(pars.eta);
163 setD0(pars.d0);
164 setZ0(pars.z0);
165 }
void setQOverPt(float v)
void setPhi(float v, bool ForceRange=true)

◆ setPassedOR()

void FPGATrackSimTrack::setPassedOR ( unsigned int code)

Definition at line 307 of file FPGATrackSimTrack.cxx.

308{
309 m_ORcode = code;
310}

◆ setPatternID()

void FPGATrackSimTrack::setPatternID ( int v)
inline

Definition at line 119 of file FPGATrackSimTrack.h.

119{ m_patternID = v; }

◆ setPhi()

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

Definition at line 146 of file FPGATrackSimTrack.cxx.

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

◆ setQOverPt()

void FPGATrackSimTrack::setQOverPt ( float v)
inline

Definition at line 126 of file FPGATrackSimTrack.h.

126{ m_qoverpt = v; }

◆ setRegion()

void FPGATrackSimTrack::setRegion ( unsigned v)
inline

Definition at line 144 of file FPGATrackSimTrack.h.

144{ m_region = v; }

◆ setSecondSectorID()

void FPGATrackSimTrack::setSecondSectorID ( int v)
inline

Definition at line 121 of file FPGATrackSimTrack.h.

121{ m_secondSectorID = v; }

◆ setSubRegion()

void FPGATrackSimTrack::setSubRegion ( unsigned v)
inline

Definition at line 143 of file FPGATrackSimTrack.h.

143{ m_subregion = v; }

◆ setTrackCorrType()

void FPGATrackSimTrack::setTrackCorrType ( TrackCorrType v)
inline

Definition at line 115 of file FPGATrackSimTrack.h.

115{ m_trackCorrType = v; }

◆ setTrackID()

void FPGATrackSimTrack::setTrackID ( int v)
inline

Definition at line 122 of file FPGATrackSimTrack.h.

122{ m_trackID = v; }

◆ setTrackStage()

void FPGATrackSimTrack::setTrackStage ( TrackStage v)
inline

Definition at line 116 of file FPGATrackSimTrack.h.

116{ m_trackStage = v; }

◆ setTypeMask()

void FPGATrackSimTrack::setTypeMask ( unsigned int v)
inline

Definition at line 136 of file FPGATrackSimTrack.h.

136{ m_typemask = v; }

◆ setUniqueID()

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

Definition at line 140 of file FPGATrackSimTrack.h.

140{ m_uniqueID = v; }

◆ setValidCand()

void FPGATrackSimTrack::setValidCand ( bool v)
inline

Definition at line 148 of file FPGATrackSimTrack.h.

148{ m_isValidCand = v; }

◆ setZ0()

void FPGATrackSimTrack::setZ0 ( float v)
inline

Definition at line 129 of file FPGATrackSimTrack.h.

129{ m_z0 = v; }

◆ operator<<

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

Definition at line 208 of file FPGATrackSimTrack.cxx.

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

Member Data Documentation

◆ m_bankID

int FPGATrackSimTrack::m_bankID = -1
private

Definition at line 190 of file FPGATrackSimTrack.h.

◆ m_barcode

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

Definition at line 232 of file FPGATrackSimTrack.h.

◆ m_barcode_frac

float FPGATrackSimTrack::m_barcode_frac = 0.0F
private

Definition at line 235 of file FPGATrackSimTrack.h.

◆ m_binIdx

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

transient

Definition at line 229 of file FPGATrackSimTrack.h.

◆ m_chi2

float FPGATrackSimTrack::m_chi2 = 0.0F
private

Definition at line 205 of file FPGATrackSimTrack.h.

◆ m_chi2_eta

float FPGATrackSimTrack::m_chi2_eta = 0.0F
private

Definition at line 207 of file FPGATrackSimTrack.h.

◆ m_chi2_phi

float FPGATrackSimTrack::m_chi2_phi = 0.0F
private

Definition at line 206 of file FPGATrackSimTrack.h.

◆ m_d0

float FPGATrackSimTrack::m_d0 = 0.0F
private

Definition at line 201 of file FPGATrackSimTrack.h.

◆ m_doDeltaGPhis

bool FPGATrackSimTrack::m_doDeltaGPhis = false
private

Definition at line 188 of file FPGATrackSimTrack.h.

◆ m_eta

float FPGATrackSimTrack::m_eta = 0.0F
private

Definition at line 204 of file FPGATrackSimTrack.h.

◆ m_eventindex

signed long FPGATrackSimTrack::m_eventindex = -1
private

Definition at line 231 of file FPGATrackSimTrack.h.

◆ m_firstSectorID

int FPGATrackSimTrack::m_firstSectorID = -1
private

Definition at line 192 of file FPGATrackSimTrack.h.

◆ m_hit_ptrs

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

Definition at line 226 of file FPGATrackSimTrack.h.

◆ m_hitmap

unsigned int FPGATrackSimTrack::m_hitmap = 0
private

Definition at line 213 of file FPGATrackSimTrack.h.

◆ m_hits

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

Definition at line 223 of file FPGATrackSimTrack.h.

◆ m_houghX

float FPGATrackSimTrack::m_houghX = 0.0F
private

Definition at line 198 of file FPGATrackSimTrack.h.

◆ m_houghY

float FPGATrackSimTrack::m_houghY = 0.0F
private

Definition at line 199 of file FPGATrackSimTrack.h.

◆ m_IdealGeoCorr

int FPGATrackSimTrack::m_IdealGeoCorr = 0
private

Definition at line 196 of file FPGATrackSimTrack.h.

◆ m_idealRadii

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

Definition at line 246 of file FPGATrackSimTrack.h.

◆ m_isValidCand

bool FPGATrackSimTrack::m_isValidCand = true
private

Definition at line 241 of file FPGATrackSimTrack.h.

◆ m_nmissing

unsigned int FPGATrackSimTrack::m_nmissing = 0
private

Definition at line 211 of file FPGATrackSimTrack.h.

◆ m_ORcode

unsigned int FPGATrackSimTrack::m_ORcode = 1
private

Definition at line 250 of file FPGATrackSimTrack.h.

◆ m_origchi2

float FPGATrackSimTrack::m_origchi2 = 0.0F
private

Definition at line 208 of file FPGATrackSimTrack.h.

◆ m_patternID

int FPGATrackSimTrack::m_patternID = 0
private

Definition at line 191 of file FPGATrackSimTrack.h.

◆ m_phi

float FPGATrackSimTrack::m_phi = 0.0F
private

Definition at line 202 of file FPGATrackSimTrack.h.

◆ m_qoverpt

float FPGATrackSimTrack::m_qoverpt = 0.0F
private

Definition at line 200 of file FPGATrackSimTrack.h.

◆ m_region

int FPGATrackSimTrack::m_region = 0
private

Definition at line 218 of file FPGATrackSimTrack.h.

◆ m_secondSectorID

int FPGATrackSimTrack::m_secondSectorID = -1
private

Definition at line 193 of file FPGATrackSimTrack.h.

◆ m_subregion

int FPGATrackSimTrack::m_subregion = 0
private

Definition at line 216 of file FPGATrackSimTrack.h.

◆ m_trackCorrType

TrackCorrType FPGATrackSimTrack::m_trackCorrType = TrackCorrType::None
private

Definition at line 186 of file FPGATrackSimTrack.h.

◆ m_trackID

int FPGATrackSimTrack::m_trackID = -1
private

Definition at line 194 of file FPGATrackSimTrack.h.

◆ m_trackStage

TrackStage FPGATrackSimTrack::m_trackStage = TrackStage::FIRST
private

Definition at line 187 of file FPGATrackSimTrack.h.

◆ m_typemask

unsigned int FPGATrackSimTrack::m_typemask = 0
private

Definition at line 212 of file FPGATrackSimTrack.h.

◆ m_uniqueID

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

Definition at line 233 of file FPGATrackSimTrack.h.

◆ m_xBin

unsigned FPGATrackSimTrack::m_xBin = 0
private

Definition at line 220 of file FPGATrackSimTrack.h.

◆ m_yBin

unsigned FPGATrackSimTrack::m_yBin = 0
private

Definition at line 221 of file FPGATrackSimTrack.h.

◆ m_z0

float FPGATrackSimTrack::m_z0 = 0.0F
private

Definition at line 203 of file FPGATrackSimTrack.h.


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