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
 
double diphi ()
 
int disk () const
 
double diz ()
 
const std::string & DTClink () 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, double x, double y, double z, double bend, double strip, std::vector< int > tps)
 
unsigned int ladder () const
 
unsigned int layer () const
 
int layerdisk () const
 
void lorentzcor (double shift)
 
unsigned int module () const
 
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
 
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_
 
std::string DTClink_
 
int eventid_
 
unsigned int iphi_
 
unsigned int isFlipped_
 
unsigned int isPSmodule_
 
unsigned int iz_
 
unsigned int ladder_
 
unsigned int layer_
 
int layerdisk_
 
unsigned int module_
 
double pt_
 
int region_
 
double sigmax_
 
double sigmaz_
 
unsigned int strip_
 
std::string stubword_
 
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,
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_, sistrip::module_, trklet::N_LAYER, HLT_2022v14_cff::region, digitizers_cfi::strip, and x.

19  {
20  DTClink_ = DTClink;
22  region_ = region;
24  eventid_ = -1;
25  tps_ = tps;
26  iphi_ = -1;
27  iz_ = -1;
28  layer_ = layerdisk;
29  if (layerdisk >= N_LAYER) {
30  layer_ = 1000 + layerdisk - N_LAYER + 1;
31  if (z < 0.0)
32  layer_ += 1000;
33  }
34 
35  ladder_ = -1;
36  module_ = -1;
37  strip_ = strip;
38  x_ = x;
39  y_ = y;
40  z_ = z;
41  sigmax_ = -1.0;
42  sigmaz_ = -1.0;
43  pt_ = -1.0;
44  bend_ = bend;
47 
48  allstubindex_ = 999;
49 }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int module_
Definition: L1TStub.h:121
double bend() const
Definition: L1TStub.h:61
std::vector< int > tps_
Definition: L1TStub.h:116
double sigmaz_
Definition: L1TStub.h:127
unsigned int strip_
Definition: L1TStub.h:122
unsigned int ladder_
Definition: L1TStub.h:120
const std::string & DTClink() const
Definition: L1TStub.h:102
unsigned int isPSmodule_
Definition: L1TStub.h:132
double z() const
Definition: L1TStub.h:57
double x() const
Definition: L1TStub.h:55
double y() const
Definition: L1TStub.h:56
std::string DTClink_
Definition: L1TStub.h:112
unsigned int isPSmodule() const
Definition: L1TStub.h:94
double sigmax_
Definition: L1TStub.h:126
std::string stubword_
Definition: L1TStub.h:114
unsigned int strip() const
Definition: L1TStub.h:85
int layerdisk() const
Definition: L1TStub.h:104
unsigned int isFlipped() const
Definition: L1TStub.h:95
unsigned int layer_
Definition: L1TStub.h:119
const std::string & stubword() const
Definition: L1TStub.h:108
double pt_
Definition: L1TStub.h:128
unsigned int allstubindex_
Definition: L1TStub.h:130
unsigned int isFlipped_
Definition: L1TStub.h:133
unsigned int iphi_
Definition: L1TStub.h:117
double bend_
Definition: L1TStub.h:129
int region() const
Definition: L1TStub.h:106
constexpr int N_LAYER
Definition: Settings.h:21
std::vector< int > tps() const
Definition: L1TStub.h:79

◆ ~L1TStub()

trklet::L1TStub::~L1TStub ( )
default

Member Function Documentation

◆ allStubIndex()

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

Definition at line 83 of file L1TStub.h.

References allstubindex_.

83 { return allstubindex_; }
unsigned int allstubindex_
Definition: L1TStub.h:130

◆ alpha()

double L1TStub::alpha ( double  pitch) const

Definition at line 73 of file L1TStub.cc.

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

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

73  {
74  if (isPSmodule())
75  return 0.0;
76  int flip = 1;
77  if (isFlipped())
78  flip = -1;
79  if (z_ > 0.0) {
80  return ((int)strip_ - 509.5) * pitch * flip / r2();
81  }
82  return -((int)strip_ - 509.5) * pitch * flip / r2();
83 }
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule() const
Definition: L1TStub.h:94
unsigned int isFlipped() const
Definition: L1TStub.h:95
double r2() const
Definition: L1TStub.h:60

◆ alphanorm()

double L1TStub::alphanorm ( ) const

Definition at line 85 of file L1TStub.cc.

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

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

85  {
86  if (isPSmodule())
87  return 0.0;
88  int flip = 1;
89  if (isFlipped())
90  flip = -1;
91  if (z_ > 0.0) {
92  return ((int)strip_ - 509.5) * flip / 510.0;
93  }
94  return -((int)strip_ - 509.5) * flip / 510.0;
95 }
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule() const
Definition: L1TStub.h:94
unsigned int isFlipped() const
Definition: L1TStub.h:95

◆ bend()

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

Definition at line 61 of file L1TStub.h.

References bend_.

61 { return bend_; }
double bend_
Definition: L1TStub.h:129

◆ diphi()

double trklet::L1TStub::diphi ( )

◆ disk()

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

Definition at line 42 of file L1TStub.h.

References layerdisk_, trklet::N_LAYER, and z_.

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

42  {
43  if (layerdisk_ < N_LAYER) {
44  return 0;
45  }
46  int disk = layerdisk_ - N_LAYER + 1;
47  if (z_ < 0.0) {
48  return -disk;
49  }
50  return disk;
51  }
int disk() const
Definition: L1TStub.h:42
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 102 of file L1TStub.h.

References DTClink_.

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

102 { return DTClink_; }
std::string DTClink_
Definition: L1TStub.h:112

◆ eventid()

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

Definition at line 78 of file L1TStub.h.

References eventid_.

78 { return eventid_; }

◆ iphi()

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

Definition at line 65 of file L1TStub.h.

References iphi_.

Referenced by setiphi().

65 { return iphi_; }
unsigned int iphi_
Definition: L1TStub.h:117

◆ iphiouter()

double trklet::L1TStub::iphiouter ( )

◆ isFlipped()

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

Definition at line 95 of file L1TStub.h.

References isFlipped_.

95 { return isFlipped_; }
unsigned int isFlipped_
Definition: L1TStub.h:133

◆ isPSmodule()

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

◆ isTilted()

bool L1TStub::isTilted ( ) const

Definition at line 126 of file L1TStub.cc.

References cms::cuda::assert(), sistrip::layer_, sistrip::module_, trklet::N_MOD_PLANK, trklet::N_PSLAYER, and trklet::N_TILTED_RINGS.

126  {
127  //here layer_ runs 0-5 for barrel, >1000 for disk
128  //disk modules and outer barrel modules are not tilted by construction
129  if (layer_ >= N_PSLAYER)
130  return false;
131 
132  assert(layer_ < N_PSLAYER); // safety for acccessing # modules/plank
134  return true;
135  return false;
136 }
unsigned int module_
Definition: L1TStub.h:121
assert(be >=bs)
constexpr std::array< unsigned int, N_PSLAYER > N_MOD_PLANK
Definition: Settings.h:894
constexpr unsigned int N_TILTED_RINGS
Definition: Settings.h:893
constexpr unsigned int N_PSLAYER
Definition: Settings.h:23
unsigned int layer_
Definition: L1TStub.h:119

◆ iz()

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

Definition at line 66 of file L1TStub.h.

References iz_.

Referenced by setiz().

66 { return iz_; }
unsigned int iz_
Definition: L1TStub.h:118

◆ ladder()

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

Definition at line 52 of file L1TStub.h.

References ladder_.

52 { return ladder_; }
unsigned int ladder_
Definition: L1TStub.h:120

◆ layer()

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

Definition at line 41 of file L1TStub.h.

References layer_.

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

41 { return layer_; }
unsigned int layer_
Definition: L1TStub.h:119

◆ layerdisk()

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

◆ lorentzcor()

void L1TStub::lorentzcor ( double  shift)

Definition at line 66 of file L1TStub.cc.

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

66  {
67  double r = this->r();
68  double phi = this->phi() - shift / r;
69  this->x_ = r * cos(phi);
70  this->y_ = r * sin(phi);
71 }
double phi() const
Definition: L1TStub.h:63
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:58
static unsigned int const shift

◆ module()

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

Definition at line 53 of file L1TStub.h.

References module_.

53 { return module_; }
unsigned int module_
Definition: L1TStub.h:121

◆ operator==()

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

Definition at line 61 of file L1TStub.cc.

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

61  {
62  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.ladder() == ladder_ &&
63  other.module() == module_);
64 }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int module_
Definition: L1TStub.h:121
unsigned int ladder_
Definition: L1TStub.h:120
unsigned int layer_
Definition: L1TStub.h:119
unsigned int iphi_
Definition: L1TStub.h:117

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

References x_, and y_.

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

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

◆ region()

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

Definition at line 106 of file L1TStub.h.

References region_.

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

106 { return region_; }

◆ setAllStubIndex()

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

Definition at line 81 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 68 of file L1TStub.h.

References iphi(), and iphi_.

68 { iphi_ = iphi; }
unsigned int iphi_
Definition: L1TStub.h:117
unsigned int iphi() const
Definition: L1TStub.h:65

◆ setiz()

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

Definition at line 69 of file L1TStub.h.

References iz(), and iz_.

69 { iz_ = iz; }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int iz() const
Definition: L1TStub.h:66

◆ setXY()

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

Definition at line 97 of file L1TStub.cc.

References x.

97  {
98  x_ = x;
99  y_ = y;
100 }
double x() const
Definition: L1TStub.h:55
double y() const
Definition: L1TStub.h:56

◆ sigmax()

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

Definition at line 71 of file L1TStub.h.

References sigmax_.

71 { return sigmax_; }
double sigmax_
Definition: L1TStub.h:126

◆ sigmaz()

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

◆ strip()

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

Definition at line 85 of file L1TStub.h.

References strip_.

85 { return strip_; }
unsigned int strip_
Definition: L1TStub.h:122

◆ stubword()

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

Definition at line 108 of file L1TStub.h.

References stubword_.

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

108 { return stubword_; }
std::string stubword_
Definition: L1TStub.h:114

◆ tpmatch()

bool L1TStub::tpmatch ( int  tp) const

Definition at line 102 of file L1TStub.cc.

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

102  {
103  for (int itp : tps_) {
104  if (tp == std::abs(itp))
105  return true;
106  }
107 
108  return false;
109 }
std::vector< int > tps_
Definition: L1TStub.h:116
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ tpmatch2()

bool L1TStub::tpmatch2 ( int  tp) const

Definition at line 111 of file L1TStub.cc.

References cmsswSequenceInfo::tp.

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

111  {
112  bool match1 = false;
113  bool match2 = false;
114  for (int itp : tps_) {
115  if (tp == itp) {
116  match1 = true;
117  }
118  if (tp == -itp) {
119  match2 = true;
120  }
121  }
122 
123  return match1 && match2;
124 }
std::vector< int > tps_
Definition: L1TStub.h:116

◆ tps()

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

Definition at line 79 of file L1TStub.h.

References tps_.

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

79 { return tps_; }
std::vector< int > tps_
Definition: L1TStub.h:116

◆ write()

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

Definition at line 51 of file L1TStub.cc.

References MillePedeFileConverter_cfg::out.

51  {
52  out << "Stub: " << DTClink_ << "\t" << region_ << "\t" << layerdisk_ << "\t" << stubword_ << "\t" << isPSmodule_
53  << "\t" << isFlipped_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << strip_ << "\t"
54  << "\t" << tps_.size() << " \t";
55  for (int itp : tps_) {
56  out << itp << " \t";
57  }
58  out << endl;
59 }
std::vector< int > tps_
Definition: L1TStub.h:116
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule_
Definition: L1TStub.h:132
std::string DTClink_
Definition: L1TStub.h:112
std::string stubword_
Definition: L1TStub.h:114
unsigned int isFlipped_
Definition: L1TStub.h:133
double bend_
Definition: L1TStub.h:129

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

Referenced by allStubIndex(), and setAllStubIndex().

◆ bend_

double trklet::L1TStub::bend_
private

Definition at line 129 of file L1TStub.h.

Referenced by bend().

◆ DTClink_

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

Definition at line 112 of file L1TStub.h.

Referenced by DTClink().

◆ eventid_

int trklet::L1TStub::eventid_
private

Definition at line 115 of file L1TStub.h.

Referenced by eventid().

◆ iphi_

unsigned int trklet::L1TStub::iphi_
private

Definition at line 117 of file L1TStub.h.

Referenced by iphi(), and setiphi().

◆ isFlipped_

unsigned int trklet::L1TStub::isFlipped_
private

Definition at line 133 of file L1TStub.h.

Referenced by isFlipped().

◆ isPSmodule_

unsigned int trklet::L1TStub::isPSmodule_
private

Definition at line 132 of file L1TStub.h.

Referenced by isPSmodule().

◆ iz_

unsigned int trklet::L1TStub::iz_
private

Definition at line 118 of file L1TStub.h.

Referenced by iz(), and setiz().

◆ ladder_

unsigned int trklet::L1TStub::ladder_
private

Definition at line 120 of file L1TStub.h.

Referenced by ladder().

◆ layer_

unsigned int trklet::L1TStub::layer_
private

Definition at line 119 of file L1TStub.h.

Referenced by layer().

◆ layerdisk_

int trklet::L1TStub::layerdisk_
private

Definition at line 111 of file L1TStub.h.

Referenced by disk(), and layerdisk().

◆ module_

unsigned int trklet::L1TStub::module_
private

Definition at line 121 of file L1TStub.h.

Referenced by module().

◆ pt_

double trklet::L1TStub::pt_
private

Definition at line 128 of file L1TStub.h.

Referenced by pt().

◆ region_

int trklet::L1TStub::region_
private

Definition at line 113 of file L1TStub.h.

Referenced by region().

◆ sigmax_

double trklet::L1TStub::sigmax_
private

Definition at line 126 of file L1TStub.h.

Referenced by sigmax().

◆ sigmaz_

double trklet::L1TStub::sigmaz_
private

Definition at line 127 of file L1TStub.h.

Referenced by sigmaz().

◆ strip_

unsigned int trklet::L1TStub::strip_
private

Definition at line 122 of file L1TStub.h.

Referenced by strip().

◆ stubword_

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

Definition at line 114 of file L1TStub.h.

Referenced by stubword().

◆ tps_

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

Definition at line 116 of file L1TStub.h.

Referenced by tps().

◆ x_

double trklet::L1TStub::x_
private

Definition at line 123 of file L1TStub.h.

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

◆ y_

double trklet::L1TStub::y_
private

Definition at line 124 of file L1TStub.h.

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

◆ z_

double trklet::L1TStub::z_
private

Definition at line 125 of file L1TStub.h.

Referenced by disk(), and z().