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 setiphi (int iphi)
 
void setiz (int iz)
 
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
 
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_
 
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 sistrip::layer_, trklet::N_LAYER, HLT_2022v15_cff::region, digitizers_cfi::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 }
unsigned int tiltedRingId() const
Definition: L1TStub.h:102
unsigned int iz_
Definition: L1TStub.h:126
double bend() const
Definition: L1TStub.h:63
std::vector< int > tps_
Definition: L1TStub.h:124
unsigned int tiltedRingId_
Definition: L1TStub.h:140
double sigmaz_
Definition: L1TStub.h:133
unsigned int strip_
Definition: L1TStub.h:128
const std::string & DTClink() const
Definition: L1TStub.h:110
unsigned int isPSmodule_
Definition: L1TStub.h:137
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:120
unsigned int isPSmodule() const
Definition: L1TStub.h:96
double sigmax_
Definition: L1TStub.h:132
bool tiltedBarrel_
Definition: L1TStub.h:139
std::string stubword_
Definition: L1TStub.h:122
unsigned int strip() const
Definition: L1TStub.h:87
unsigned int detId() const
Definition: L1TStub.h:105
int layerdisk() const
Definition: L1TStub.h:112
unsigned int isFlipped() const
Definition: L1TStub.h:97
unsigned int endcapRingId_
Definition: L1TStub.h:141
unsigned int layer_
Definition: L1TStub.h:127
const std::string & stubword() const
Definition: L1TStub.h:116
double pt_
Definition: L1TStub.h:134
unsigned int allstubindex_
Definition: L1TStub.h:136
unsigned int isFlipped_
Definition: L1TStub.h:138
unsigned int endcapRingId() const
Definition: L1TStub.h:104
unsigned int detId_
Definition: L1TStub.h:142
unsigned int iphi_
Definition: L1TStub.h:125
double bend_
Definition: L1TStub.h:135
int region() const
Definition: L1TStub.h:114
constexpr int N_LAYER
Definition: Settings.h:21
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 85 of file L1TStub.h.

References allstubindex_.

85 { return allstubindex_; }
unsigned int allstubindex_
Definition: L1TStub.h:136

◆ alpha()

double L1TStub::alpha ( double  pitch) const

Definition at line 78 of file L1TStub.cc.

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

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

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

◆ alphanorm()

double L1TStub::alphanorm ( ) const

Definition at line 90 of file L1TStub.cc.

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

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

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

◆ bend()

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

Definition at line 63 of file L1TStub.h.

References bend_.

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

◆ detId()

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

Definition at line 105 of file L1TStub.h.

References detId_.

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

◆ 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:21

◆ diz()

double trklet::L1TStub::diz ( )

◆ DTClink()

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

Definition at line 110 of file L1TStub.h.

References DTClink_.

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

110 { return DTClink_; }
std::string DTClink_
Definition: L1TStub.h:120

◆ endcapRingId()

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

Definition at line 104 of file L1TStub.h.

References endcapRingId_.

104 { return endcapRingId_; }
unsigned int endcapRingId_
Definition: L1TStub.h:141

◆ 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 setiphi().

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

◆ iphiouter()

double trklet::L1TStub::iphiouter ( )

◆ isFlipped()

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

Definition at line 97 of file L1TStub.h.

References isFlipped_.

97 { return isFlipped_; }
unsigned int isFlipped_
Definition: L1TStub.h:138

◆ isPSmodule()

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

◆ isTilted()

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

Definition at line 99 of file L1TStub.h.

References tiltedBarrel_.

99 { return tiltedBarrel_; } // Tilted barrel
bool tiltedBarrel_
Definition: L1TStub.h:139

◆ 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:126

◆ 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:127

◆ layerdisk()

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

◆ lorentzcor()

void L1TStub::lorentzcor ( double  shift)

Definition at line 71 of file L1TStub.cc.

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

71  {
72  double r = this->r();
73  double phi = this->phi() - shift / r;
74  this->x_ = r * cos(phi);
75  this->y_ = r * sin(phi);
76 }
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 67 of file L1TStub.cc.

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

67  {
68  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.detId() == detId_);
69 }
unsigned int iz_
Definition: L1TStub.h:126
unsigned int layer_
Definition: L1TStub.h:127
unsigned int detId_
Definition: L1TStub.h:142
unsigned int iphi_
Definition: L1TStub.h:125

◆ 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 114 of file L1TStub.h.

References region_.

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

114 { return region_; }

◆ setAllStubIndex()

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

Definition at line 83 of file L1TStub.h.

References allstubindex_.

Referenced by trklet::VMRouterCM::execute(), and trklet::VMRouter::execute().

◆ 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:125
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:126
unsigned int iz() const
Definition: L1TStub.h:68

◆ setXY()

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

Definition at line 102 of file L1TStub.cc.

References x.

102  {
103  x_ = x;
104  y_ = y;
105 }
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:132

◆ sigmaz()

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

◆ strip()

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

Definition at line 87 of file L1TStub.h.

References strip_.

87 { return strip_; }
unsigned int strip_
Definition: L1TStub.h:128

◆ stubword()

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

Definition at line 116 of file L1TStub.h.

References stubword_.

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

116 { return stubword_; }
std::string stubword_
Definition: L1TStub.h:122

◆ tiltedRingId()

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

Definition at line 102 of file L1TStub.h.

References tiltedRingId_.

102 { return tiltedRingId_; }
unsigned int tiltedRingId_
Definition: L1TStub.h:140

◆ tpmatch()

bool L1TStub::tpmatch ( int  tp) const

Definition at line 107 of file L1TStub.cc.

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

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

◆ tpmatch2()

bool L1TStub::tpmatch2 ( int  tp) const

Definition at line 116 of file L1TStub.cc.

References cmsswSequenceInfo::tp.

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

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

◆ 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:124

◆ write()

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

Definition at line 57 of file L1TStub.cc.

References MillePedeFileConverter_cfg::out.

57  {
58  out << "Stub: " << DTClink_ << "\t" << region_ << "\t" << layerdisk_ << "\t" << stubword_ << "\t" << isPSmodule_
59  << "\t" << isFlipped_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << strip_ << "\t"
60  << "\t" << tps_.size() << " \t";
61  for (int itp : tps_) {
62  out << itp << " \t";
63  }
64  out << endl;
65 }
std::vector< int > tps_
Definition: L1TStub.h:124
unsigned int strip_
Definition: L1TStub.h:128
unsigned int isPSmodule_
Definition: L1TStub.h:137
std::string DTClink_
Definition: L1TStub.h:120
std::string stubword_
Definition: L1TStub.h:122
unsigned int isFlipped_
Definition: L1TStub.h:138
double bend_
Definition: L1TStub.h:135

◆ 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 136 of file L1TStub.h.

Referenced by allStubIndex(), and setAllStubIndex().

◆ bend_

double trklet::L1TStub::bend_
private

Definition at line 135 of file L1TStub.h.

Referenced by bend().

◆ detId_

unsigned int trklet::L1TStub::detId_
private

Definition at line 142 of file L1TStub.h.

Referenced by detId().

◆ DTClink_

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

Definition at line 120 of file L1TStub.h.

Referenced by DTClink().

◆ endcapRingId_

unsigned int trklet::L1TStub::endcapRingId_
private

Definition at line 141 of file L1TStub.h.

Referenced by endcapRingId().

◆ eventid_

int trklet::L1TStub::eventid_
private

Definition at line 123 of file L1TStub.h.

Referenced by eventid().

◆ iphi_

unsigned int trklet::L1TStub::iphi_
private

Definition at line 125 of file L1TStub.h.

Referenced by iphi(), and setiphi().

◆ isFlipped_

unsigned int trklet::L1TStub::isFlipped_
private

Definition at line 138 of file L1TStub.h.

Referenced by isFlipped().

◆ isPSmodule_

unsigned int trklet::L1TStub::isPSmodule_
private

Definition at line 137 of file L1TStub.h.

Referenced by isPSmodule().

◆ iz_

unsigned int trklet::L1TStub::iz_
private

Definition at line 126 of file L1TStub.h.

Referenced by iz(), and setiz().

◆ layer_

unsigned int trklet::L1TStub::layer_
private

Definition at line 127 of file L1TStub.h.

Referenced by layer().

◆ layerdisk_

int trklet::L1TStub::layerdisk_
private

Definition at line 119 of file L1TStub.h.

Referenced by disk(), and layerdisk().

◆ pt_

double trklet::L1TStub::pt_
private

Definition at line 134 of file L1TStub.h.

Referenced by pt().

◆ region_

int trklet::L1TStub::region_
private

Definition at line 121 of file L1TStub.h.

Referenced by region().

◆ sigmax_

double trklet::L1TStub::sigmax_
private

Definition at line 132 of file L1TStub.h.

Referenced by sigmax().

◆ sigmaz_

double trklet::L1TStub::sigmaz_
private

Definition at line 133 of file L1TStub.h.

Referenced by sigmaz().

◆ strip_

unsigned int trklet::L1TStub::strip_
private

Definition at line 128 of file L1TStub.h.

Referenced by strip().

◆ stubword_

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

Definition at line 122 of file L1TStub.h.

Referenced by stubword().

◆ tiltedBarrel_

bool trklet::L1TStub::tiltedBarrel_
private

Definition at line 139 of file L1TStub.h.

Referenced by isTilted().

◆ tiltedRingId_

unsigned int trklet::L1TStub::tiltedRingId_
private

Definition at line 140 of file L1TStub.h.

Referenced by tiltedRingId().

◆ tps_

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

Definition at line 124 of file L1TStub.h.

Referenced by tps().

◆ x_

double trklet::L1TStub::x_
private

Definition at line 129 of file L1TStub.h.

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

◆ y_

double trklet::L1TStub::y_
private

Definition at line 130 of file L1TStub.h.

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

◆ z_

double trklet::L1TStub::z_
private

Definition at line 131 of file L1TStub.h.

Referenced by disk(), and z().