CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::L1TStub Class Reference

#include <L1TStub.h>

Public Member Functions

unsigned int allStubIndex () const
 
double alpha (double pitch) const
 
double alphanorm () const
 
double bend () const
 
unsigned int detId () const
 
double diphi ()
 
int disk () const
 
double diz ()
 
const std::string & DTClink () const
 
unsigned int endcapRingId () const
 
int eventid () const
 
unsigned int iphi () const
 
double iphiouter ()
 
unsigned int isFlipped () const
 
unsigned int isPSmodule () const
 
bool isTilted () const
 
unsigned int iz () const
 
 L1TStub ()
 
 L1TStub (std::string DTClink, int region, int layerdisk, std::string stubword, int isPSmodule, int isFlipped, bool tiltedBarrel, unsigned int tiltedRingId, unsigned int endcapRingId, unsigned int detId, double x, double y, double z, double bend, double strip, std::vector< int > tps)
 
unsigned int layer () const
 
int layerdisk () const
 
void lorentzcor (double shift)
 
bool operator== (const L1TStub &other) const
 
double phi () const
 
double pt () const
 
double r () const
 
double r2 () const
 
int region () const
 
void setAllStubIndex (unsigned int index)
 
void setCoords (double x, double y, double z)
 
void setiphi (int iphi)
 
void setiz (int iz)
 
void setUniqueIndex (unsigned int index)
 
void setXY (double x, double y)
 
double sigmax () const
 
double sigmaz () const
 
unsigned int strip () const
 
const std::string & stubword () const
 
unsigned int tiltedRingId () const
 
bool tpmatch (int tp) const
 
bool tpmatch2 (int tp) const
 
std::vector< int > tps () const
 
unsigned int uniqueIndex () const
 
void write (std::ofstream &out)
 
double x () const
 
double y () const
 
double z () const
 
 ~L1TStub ()=default
 

Private Attributes

unsigned int allstubindex_
 
double bend_
 
unsigned int detId_
 
std::string DTClink_
 
unsigned int endcapRingId_
 
int eventid_
 
unsigned int iphi_
 
unsigned int isFlipped_
 
unsigned int isPSmodule_
 
unsigned int iz_
 
unsigned int layer_
 
int layerdisk_
 
double pt_
 
int region_
 
double sigmax_
 
double sigmaz_
 
unsigned int strip_
 
std::string stubword_
 
bool tiltedBarrel_
 
unsigned int tiltedRingId_
 
std::vector< int > tps_
 
unsigned int uniqueindex_
 
double x_
 
double y_
 
double z_
 

Detailed Description

Definition at line 14 of file L1TStub.h.

Constructor & Destructor Documentation

◆ L1TStub() [1/2]

L1TStub::L1TStub ( )

Definition at line 6 of file L1TStub.cc.

6 {}

◆ L1TStub() [2/2]

L1TStub::L1TStub ( std::string  DTClink,
int  region,
int  layerdisk,
std::string  stubword,
int  isPSmodule,
int  isFlipped,
bool  tiltedBarrel,
unsigned int  tiltedRingId,
unsigned int  endcapRingId,
unsigned int  detId,
double  x,
double  y,
double  z,
double  bend,
double  strip,
std::vector< int >  tps 
)

Definition at line 8 of file L1TStub.cc.

References hcalRecHitTable_cff::detId, sistrip::layer_, trklet::N_LAYER, nano_mu_digi_cff::region, nano_mu_digi_cff::strip, and x.

23  {
24  DTClink_ = DTClink;
26  region_ = region;
28  eventid_ = -1;
29  tps_ = tps;
30  iphi_ = -1;
31  iz_ = -1;
32  layer_ = layerdisk;
33  if (layerdisk >= N_LAYER) {
34  layer_ = 1000 + layerdisk - N_LAYER + 1;
35  if (z < 0.0)
36  layer_ += 1000;
37  }
38 
39  strip_ = strip;
40  x_ = x;
41  y_ = y;
42  z_ = z;
43  sigmax_ = -1.0;
44  sigmaz_ = -1.0;
45  pt_ = -1.0;
46  bend_ = bend;
49  tiltedBarrel_ = tiltedBarrel;
52  detId_ = detId;
53 
54  allstubindex_ = 999;
55  uniqueindex_ = 99999;
56 }
unsigned int tiltedRingId() const
Definition: L1TStub.h:109
unsigned int iz_
Definition: L1TStub.h:133
double bend() const
Definition: L1TStub.h:63
std::vector< int > tps_
Definition: L1TStub.h:131
unsigned int tiltedRingId_
Definition: L1TStub.h:148
double sigmaz_
Definition: L1TStub.h:140
unsigned int strip_
Definition: L1TStub.h:135
const std::string & DTClink() const
Definition: L1TStub.h:117
unsigned int isPSmodule_
Definition: L1TStub.h:145
double z() const
Definition: L1TStub.h:59
double x() const
Definition: L1TStub.h:57
double y() const
Definition: L1TStub.h:58
std::string DTClink_
Definition: L1TStub.h:127
unsigned int isPSmodule() const
Definition: L1TStub.h:103
double sigmax_
Definition: L1TStub.h:139
bool tiltedBarrel_
Definition: L1TStub.h:147
std::string stubword_
Definition: L1TStub.h:129
unsigned int strip() const
Definition: L1TStub.h:94
unsigned int detId() const
Definition: L1TStub.h:112
int layerdisk() const
Definition: L1TStub.h:119
unsigned int isFlipped() const
Definition: L1TStub.h:104
unsigned int uniqueindex_
Definition: L1TStub.h:144
unsigned int endcapRingId_
Definition: L1TStub.h:149
unsigned int layer_
Definition: L1TStub.h:134
const std::string & stubword() const
Definition: L1TStub.h:123
double pt_
Definition: L1TStub.h:141
unsigned int allstubindex_
Definition: L1TStub.h:143
unsigned int isFlipped_
Definition: L1TStub.h:146
unsigned int endcapRingId() const
Definition: L1TStub.h:111
unsigned int detId_
Definition: L1TStub.h:150
unsigned int iphi_
Definition: L1TStub.h:132
double bend_
Definition: L1TStub.h:142
int region() const
Definition: L1TStub.h:121
constexpr int N_LAYER
Definition: Settings.h:25
std::vector< int > tps() const
Definition: L1TStub.h:81

◆ ~L1TStub()

trklet::L1TStub::~L1TStub ( )
default

Member Function Documentation

◆ allStubIndex()

unsigned int trklet::L1TStub::allStubIndex ( ) const
inline

Definition at line 91 of file L1TStub.h.

References allstubindex_.

Referenced by trklet::PurgeDuplicate::getInventedSeedingStub().

91 { return allstubindex_; }
unsigned int allstubindex_
Definition: L1TStub.h:143

◆ alpha()

double L1TStub::alpha ( double  pitch) const

Definition at line 79 of file L1TStub.cc.

References HLT_2023v12_cff::flip, createfilelist::int, and diffTwoXMLs::r2.

Referenced by trklet::FitTrack::trackFitChisq().

79  {
80  if (isPSmodule())
81  return 0.0;
82  int flip = 1;
83  if (isFlipped())
84  flip = -1;
85  if (z_ > 0.0) {
86  return ((int)strip_ - 509.5) * pitch * flip / r2();
87  }
88  return -((int)strip_ - 509.5) * pitch * flip / r2();
89 }
unsigned int strip_
Definition: L1TStub.h:135
unsigned int isPSmodule() const
Definition: L1TStub.h:103
unsigned int isFlipped() const
Definition: L1TStub.h:104
double r2() const
Definition: L1TStub.h:62

◆ alphanorm()

double L1TStub::alphanorm ( ) const

Definition at line 91 of file L1TStub.cc.

References HLT_2023v12_cff::flip, and createfilelist::int.

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

91  {
92  if (isPSmodule())
93  return 0.0;
94  int flip = 1;
95  if (isFlipped())
96  flip = -1;
97  if (z_ > 0.0) {
98  return ((int)strip_ - 509.5) * flip / 510.0;
99  }
100  return -((int)strip_ - 509.5) * flip / 510.0;
101 }
unsigned int strip_
Definition: L1TStub.h:135
unsigned int isPSmodule() const
Definition: L1TStub.h:103
unsigned int isFlipped() const
Definition: L1TStub.h:104

◆ bend()

double trklet::L1TStub::bend ( ) const
inline

Definition at line 63 of file L1TStub.h.

References bend_.

Referenced by trklet::PurgeDuplicate::l1tinfo().

63 { return bend_; }
double bend_
Definition: L1TStub.h:142

◆ detId()

unsigned int trklet::L1TStub::detId ( ) const
inline

Definition at line 112 of file L1TStub.h.

References detId_.

112 { return detId_; } // Of lower sensor in module
unsigned int detId_
Definition: L1TStub.h:150

◆ diphi()

double trklet::L1TStub::diphi ( )

◆ disk()

int trklet::L1TStub::disk ( ) const
inline

Definition at line 46 of file L1TStub.h.

References layerdisk_, trklet::N_LAYER, and z_.

Referenced by trklet::Tracklet::disk(), trklet::FitTrack::execute(), and trklet::Tracklet::getStubIDs().

46  {
47  if (layerdisk_ < N_LAYER) {
48  return 0;
49  }
50  int disk = layerdisk_ - N_LAYER + 1;
51  if (z_ < 0.0) {
52  return -disk;
53  }
54  return disk;
55  }
int disk() const
Definition: L1TStub.h:46
constexpr int N_LAYER
Definition: Settings.h:25

◆ diz()

double trklet::L1TStub::diz ( )

◆ DTClink()

const std::string& trklet::L1TStub::DTClink ( ) const
inline

Definition at line 117 of file L1TStub.h.

References DTClink_.

Referenced by trklet::TrackletEventProcessor::event().

117 { return DTClink_; }
std::string DTClink_
Definition: L1TStub.h:127

◆ endcapRingId()

unsigned int trklet::L1TStub::endcapRingId ( ) const
inline

Definition at line 111 of file L1TStub.h.

References endcapRingId_.

111 { return endcapRingId_; }
unsigned int endcapRingId_
Definition: L1TStub.h:149

◆ eventid()

int trklet::L1TStub::eventid ( ) const
inline

Definition at line 80 of file L1TStub.h.

References eventid_.

80 { return eventid_; }

◆ iphi()

unsigned int trklet::L1TStub::iphi ( ) const
inline

Definition at line 67 of file L1TStub.h.

References iphi_.

Referenced by trklet::PurgeDuplicate::l1tinfo(), and setiphi().

67 { return iphi_; }
unsigned int iphi_
Definition: L1TStub.h:132

◆ iphiouter()

double trklet::L1TStub::iphiouter ( )

◆ isFlipped()

unsigned int trklet::L1TStub::isFlipped ( ) const
inline

Definition at line 104 of file L1TStub.h.

References isFlipped_.

104 { return isFlipped_; }
unsigned int isFlipped_
Definition: L1TStub.h:146

◆ isPSmodule()

unsigned int trklet::L1TStub::isPSmodule ( ) const
inline

◆ isTilted()

bool trklet::L1TStub::isTilted ( ) const
inline

Definition at line 106 of file L1TStub.h.

References tiltedBarrel_.

106 { return tiltedBarrel_; } // Tilted barrel
bool tiltedBarrel_
Definition: L1TStub.h:147

◆ iz()

unsigned int trklet::L1TStub::iz ( ) const
inline

Definition at line 68 of file L1TStub.h.

References iz_.

Referenced by setiz().

68 { return iz_; }
unsigned int iz_
Definition: L1TStub.h:133

◆ layer()

unsigned int trklet::L1TStub::layer ( ) const
inline

Definition at line 45 of file L1TStub.h.

References layer_.

Referenced by geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), and trklet::Tracklet::Tracklet().

45 { return layer_; }
unsigned int layer_
Definition: L1TStub.h:134

◆ layerdisk()

int trklet::L1TStub::layerdisk ( ) const
inline

◆ lorentzcor()

void L1TStub::lorentzcor ( double  shift)

Definition at line 72 of file L1TStub.cc.

References funct::cos(), edm::shift, and funct::sin().

72  {
73  double r = this->r();
74  double phi = this->phi() - shift / r;
75  this->x_ = r * cos(phi);
76  this->y_ = r * sin(phi);
77 }
double phi() const
Definition: L1TStub.h:65
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double r() const
Definition: L1TStub.h:60
static unsigned int const shift

◆ operator==()

bool L1TStub::operator== ( const L1TStub other) const

Definition at line 68 of file L1TStub.cc.

References sistrip::layer_, and trackingPlots::other.

68  {
69  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.detId() == detId_);
70 }
unsigned int iz_
Definition: L1TStub.h:133
unsigned int layer_
Definition: L1TStub.h:134
unsigned int detId_
Definition: L1TStub.h:150
unsigned int iphi_
Definition: L1TStub.h:132

◆ phi()

double trklet::L1TStub::phi ( void  ) const
inline

◆ pt()

double trklet::L1TStub::pt ( ) const
inline

◆ r()

double trklet::L1TStub::r ( ) const
inline

◆ r2()

double trklet::L1TStub::r2 ( ) const
inline

Definition at line 62 of file L1TStub.h.

References x_, and y_.

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

62 { return x_ * x_ + y_ * y_; }

◆ region()

int trklet::L1TStub::region ( ) const
inline

Definition at line 121 of file L1TStub.h.

References region_.

Referenced by trklet::TrackletEventProcessor::event().

121 { return region_; }

◆ setAllStubIndex()

void trklet::L1TStub::setAllStubIndex ( unsigned int  index)
inline

◆ setCoords()

void trklet::L1TStub::setCoords ( double  x,
double  y,
double  z 
)
inline

Definition at line 85 of file L1TStub.h.

References x(), x_, y(), y_, z(), and z_.

Referenced by trklet::PurgeDuplicate::getInventedSeedingStub().

85  {
86  x_ = x;
87  y_ = y;
88  z_ = z;
89  }
double z() const
Definition: L1TStub.h:59
double x() const
Definition: L1TStub.h:57
double y() const
Definition: L1TStub.h:58

◆ setiphi()

void trklet::L1TStub::setiphi ( int  iphi)
inline

Definition at line 70 of file L1TStub.h.

References iphi(), and iphi_.

70 { iphi_ = iphi; }
unsigned int iphi_
Definition: L1TStub.h:132
unsigned int iphi() const
Definition: L1TStub.h:67

◆ setiz()

void trklet::L1TStub::setiz ( int  iz)
inline

Definition at line 71 of file L1TStub.h.

References iz(), and iz_.

71 { iz_ = iz; }
unsigned int iz_
Definition: L1TStub.h:133
unsigned int iz() const
Definition: L1TStub.h:68

◆ setUniqueIndex()

void trklet::L1TStub::setUniqueIndex ( unsigned int  index)
inline

◆ setXY()

void L1TStub::setXY ( double  x,
double  y 
)

Definition at line 103 of file L1TStub.cc.

References x.

103  {
104  x_ = x;
105  y_ = y;
106 }
double x() const
Definition: L1TStub.h:57
double y() const
Definition: L1TStub.h:58

◆ sigmax()

double trklet::L1TStub::sigmax ( ) const
inline

Definition at line 73 of file L1TStub.h.

References sigmax_.

73 { return sigmax_; }
double sigmax_
Definition: L1TStub.h:139

◆ sigmaz()

double trklet::L1TStub::sigmaz ( ) const
inline

◆ strip()

unsigned int trklet::L1TStub::strip ( void  ) const
inline

Definition at line 94 of file L1TStub.h.

References strip_.

94 { return strip_; }
unsigned int strip_
Definition: L1TStub.h:135

◆ stubword()

const std::string& trklet::L1TStub::stubword ( ) const
inline

Definition at line 123 of file L1TStub.h.

References stubword_.

Referenced by trklet::TrackletProcessorDisplaced::execute(), and trklet::Stub::Stub().

123 { return stubword_; }
std::string stubword_
Definition: L1TStub.h:129

◆ tiltedRingId()

unsigned int trklet::L1TStub::tiltedRingId ( ) const
inline

Definition at line 109 of file L1TStub.h.

References tiltedRingId_.

109 { return tiltedRingId_; }
unsigned int tiltedRingId_
Definition: L1TStub.h:148

◆ tpmatch()

bool L1TStub::tpmatch ( int  tp) const

Definition at line 108 of file L1TStub.cc.

References funct::abs(), and cmsswSequenceInfo::tp.

108  {
109  for (int itp : tps_) {
110  if (tp == std::abs(itp))
111  return true;
112  }
113 
114  return false;
115 }
std::vector< int > tps_
Definition: L1TStub.h:131
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ tpmatch2()

bool L1TStub::tpmatch2 ( int  tp) const

Definition at line 117 of file L1TStub.cc.

References cmsswSequenceInfo::tp.

Referenced by trklet::Stub::Stub().

117  {
118  bool match1 = false;
119  bool match2 = false;
120  for (int itp : tps_) {
121  if (tp == itp) {
122  match1 = true;
123  }
124  if (tp == -itp) {
125  match2 = true;
126  }
127  }
128 
129  return match1 && match2;
130 }
std::vector< int > tps_
Definition: L1TStub.h:131

◆ tps()

std::vector<int> trklet::L1TStub::tps ( ) const
inline

Definition at line 81 of file L1TStub.h.

References tps_.

Referenced by trklet::Tracklet::stubtruthmatch(), and trklet::Tracklet::tpseed().

81 { return tps_; }
std::vector< int > tps_
Definition: L1TStub.h:131

◆ uniqueIndex()

unsigned int trklet::L1TStub::uniqueIndex ( ) const
inline

Definition at line 92 of file L1TStub.h.

References uniqueindex_.

Referenced by trklet::PurgeDuplicate::getInventedSeedingStub(), and L1FPGATrackProducer::produce().

92 { return uniqueindex_; }
unsigned int uniqueindex_
Definition: L1TStub.h:144

◆ write()

void L1TStub::write ( std::ofstream &  out)

Definition at line 58 of file L1TStub.cc.

References MillePedeFileConverter_cfg::out.

58  {
59  out << "Stub: " << DTClink_ << "\t" << region_ << "\t" << layerdisk_ << "\t" << stubword_ << "\t" << isPSmodule_
60  << "\t" << isFlipped_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << strip_ << "\t"
61  << "\t" << tps_.size() << " \t";
62  for (int itp : tps_) {
63  out << itp << " \t";
64  }
65  out << endl;
66 }
std::vector< int > tps_
Definition: L1TStub.h:131
unsigned int strip_
Definition: L1TStub.h:135
unsigned int isPSmodule_
Definition: L1TStub.h:145
std::string DTClink_
Definition: L1TStub.h:127
std::string stubword_
Definition: L1TStub.h:129
unsigned int isFlipped_
Definition: L1TStub.h:146
double bend_
Definition: L1TStub.h:142

◆ x()

double trklet::L1TStub::x ( ) const
inline

◆ y()

double trklet::L1TStub::y ( ) const
inline

◆ z()

double trklet::L1TStub::z ( ) const
inline

Member Data Documentation

◆ allstubindex_

unsigned int trklet::L1TStub::allstubindex_
private

Definition at line 143 of file L1TStub.h.

Referenced by allStubIndex(), and setAllStubIndex().

◆ bend_

double trklet::L1TStub::bend_
private

Definition at line 142 of file L1TStub.h.

Referenced by bend().

◆ detId_

unsigned int trklet::L1TStub::detId_
private

Definition at line 150 of file L1TStub.h.

Referenced by detId().

◆ DTClink_

std::string trklet::L1TStub::DTClink_
private

Definition at line 127 of file L1TStub.h.

Referenced by DTClink().

◆ endcapRingId_

unsigned int trklet::L1TStub::endcapRingId_
private

Definition at line 149 of file L1TStub.h.

Referenced by endcapRingId().

◆ eventid_

int trklet::L1TStub::eventid_
private

Definition at line 130 of file L1TStub.h.

Referenced by eventid().

◆ iphi_

unsigned int trklet::L1TStub::iphi_
private

Definition at line 132 of file L1TStub.h.

Referenced by iphi(), and setiphi().

◆ isFlipped_

unsigned int trklet::L1TStub::isFlipped_
private

Definition at line 146 of file L1TStub.h.

Referenced by isFlipped().

◆ isPSmodule_

unsigned int trklet::L1TStub::isPSmodule_
private

Definition at line 145 of file L1TStub.h.

Referenced by isPSmodule().

◆ iz_

unsigned int trklet::L1TStub::iz_
private

Definition at line 133 of file L1TStub.h.

Referenced by iz(), and setiz().

◆ layer_

unsigned int trklet::L1TStub::layer_
private

Definition at line 134 of file L1TStub.h.

Referenced by layer().

◆ layerdisk_

int trklet::L1TStub::layerdisk_
private

Definition at line 126 of file L1TStub.h.

Referenced by disk(), and layerdisk().

◆ pt_

double trklet::L1TStub::pt_
private

Definition at line 141 of file L1TStub.h.

Referenced by pt().

◆ region_

int trklet::L1TStub::region_
private

Definition at line 128 of file L1TStub.h.

Referenced by region().

◆ sigmax_

double trklet::L1TStub::sigmax_
private

Definition at line 139 of file L1TStub.h.

Referenced by sigmax().

◆ sigmaz_

double trklet::L1TStub::sigmaz_
private

Definition at line 140 of file L1TStub.h.

Referenced by sigmaz().

◆ strip_

unsigned int trklet::L1TStub::strip_
private

Definition at line 135 of file L1TStub.h.

Referenced by strip().

◆ stubword_

std::string trklet::L1TStub::stubword_
private

Definition at line 129 of file L1TStub.h.

Referenced by stubword().

◆ tiltedBarrel_

bool trklet::L1TStub::tiltedBarrel_
private

Definition at line 147 of file L1TStub.h.

Referenced by isTilted().

◆ tiltedRingId_

unsigned int trklet::L1TStub::tiltedRingId_
private

Definition at line 148 of file L1TStub.h.

Referenced by tiltedRingId().

◆ tps_

std::vector<int> trklet::L1TStub::tps_
private

Definition at line 131 of file L1TStub.h.

Referenced by tps().

◆ uniqueindex_

unsigned int trklet::L1TStub::uniqueindex_
private

Definition at line 144 of file L1TStub.h.

Referenced by setUniqueIndex(), and uniqueIndex().

◆ x_

double trklet::L1TStub::x_
private

Definition at line 136 of file L1TStub.h.

Referenced by phi(), r(), r2(), setCoords(), and x().

◆ y_

double trklet::L1TStub::y_
private

Definition at line 137 of file L1TStub.h.

Referenced by phi(), r(), r2(), setCoords(), and y().

◆ z_

double trklet::L1TStub::z_
private

Definition at line 138 of file L1TStub.h.

Referenced by disk(), setCoords(), and z().