CMS 3D CMS Logo

L1TStub.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_L1TStub_h
2 #define L1Trigger_TrackFindingTracklet_interface_L1TStub_h
3 
5 
6 #include <iostream>
7 #include <fstream>
8 #include <cassert>
9 #include <cmath>
10 #include <vector>
11 
12 namespace trklet {
13 
14  class L1TStub {
15  public:
16  L1TStub();
17 
19  int region,
20  int layerdisk,
22  int isPSmodule,
23  int isFlipped,
24  bool tiltedBarrel,
25  unsigned int tiltedRingId,
26  unsigned int endcapRingId,
27  unsigned int detId,
28  double x,
29  double y,
30  double z,
31  double bend,
32  double strip,
33  std::vector<int> tps);
34 
35  ~L1TStub() = default;
36 
37  void write(std::ofstream& out);
38 
39  double diphi();
40 
41  double iphiouter();
42 
43  double diz();
44 
45  unsigned int layer() const { return layer_; }
46  int disk() const {
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  }
56 
57  double x() const { return x_; }
58  double y() const { return y_; }
59  double z() const { return z_; }
60  double r() const { return std::hypot(x_, y_); }
61  double pt() const { return pt_; }
62  double r2() const { return x_ * x_ + y_ * y_; }
63  double bend() const { return bend_; }
64 
65  double phi() const { return atan2(y_, x_); }
66 
67  unsigned int iphi() const { return iphi_; }
68  unsigned int iz() const { return iz_; }
69 
70  void setiphi(int iphi) { iphi_ = iphi; }
71  void setiz(int iz) { iz_ = iz; }
72 
73  double sigmax() const { return sigmax_; }
74  double sigmaz() const { return sigmaz_; }
75 
76  bool operator==(const L1TStub& other) const;
77 
78  void lorentzcor(double shift);
79 
80  int eventid() const { return eventid_; }
81  std::vector<int> tps() const { return tps_; }
82 
83  void setAllStubIndex(unsigned int index) { allstubindex_ = index; }
84 
85  unsigned int allStubIndex() const { return allstubindex_; }
86 
87  unsigned int strip() const { return strip_; }
88 
89  double alpha(double pitch) const;
90 
91  //Scaled to go between -1 and +1
92  double alphanorm() const;
93 
94  void setXY(double x, double y);
95 
96  unsigned int isPSmodule() const { return isPSmodule_; }
97  unsigned int isFlipped() const { return isFlipped_; }
98 
99  bool isTilted() const { return tiltedBarrel_; } // Tilted barrel
100 
101  // Tilted module ring no. (Increasing 1 to 12 as |z| increases).
102  unsigned int tiltedRingId() const { return tiltedRingId_; }
103  // Endcap disk module ring number (1-15 as r increases).
104  unsigned int endcapRingId() const { return endcapRingId_; }
105  unsigned int detId() const { return detId_; } // Of lower sensor in module
106 
107  bool tpmatch(int tp) const;
108  bool tpmatch2(int tp) const;
109 
110  const std::string& DTClink() const { return DTClink_; }
111 
112  int layerdisk() const { return layerdisk_; }
113 
114  int region() const { return region_; }
115 
116  const std::string& stubword() const { return stubword_; }
117 
118  private:
121  int region_;
123  int eventid_;
124  std::vector<int> tps_;
125  unsigned int iphi_;
126  unsigned int iz_;
127  unsigned int layer_;
128  unsigned int strip_;
129  double x_;
130  double y_;
131  double z_;
132  double sigmax_;
133  double sigmaz_;
134  double pt_;
135  double bend_;
136  unsigned int allstubindex_;
137  unsigned int isPSmodule_;
138  unsigned int isFlipped_;
140  unsigned int tiltedRingId_;
141  unsigned int endcapRingId_;
142  unsigned int detId_;
143  };
144 }; // namespace trklet
145 #endif
unsigned int tiltedRingId() const
Definition: L1TStub.h:102
double phi() const
Definition: L1TStub.h:65
double sigmax() const
Definition: L1TStub.h:73
unsigned int iz_
Definition: L1TStub.h:126
unsigned int layer() const
Definition: L1TStub.h:45
double pt() const
Definition: L1TStub.h:61
void setXY(double x, double y)
Definition: L1TStub.cc:102
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
void write(std::ofstream &out)
Definition: L1TStub.cc:57
~L1TStub()=default
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
bool tpmatch2(int tp) const
Definition: L1TStub.cc:116
int disk() const
Definition: L1TStub.h:46
unsigned int isFlipped() const
Definition: L1TStub.h:97
unsigned int endcapRingId_
Definition: L1TStub.h:141
unsigned int allStubIndex() const
Definition: L1TStub.h:85
unsigned int iz() const
Definition: L1TStub.h:68
double alpha(double pitch) const
Definition: L1TStub.cc:78
bool isTilted() const
Definition: L1TStub.h:99
double alphanorm() const
Definition: L1TStub.cc:90
bool operator==(const L1TStub &other) const
Definition: L1TStub.cc:67
unsigned int layer_
Definition: L1TStub.h:127
const std::string & stubword() const
Definition: L1TStub.h:116
double pt_
Definition: L1TStub.h:134
int eventid() const
Definition: L1TStub.h:80
unsigned int allstubindex_
Definition: L1TStub.h:136
unsigned int isFlipped_
Definition: L1TStub.h:138
void setiphi(int iphi)
Definition: L1TStub.h:70
void lorentzcor(double shift)
Definition: L1TStub.cc:71
double iphiouter()
double r() const
Definition: L1TStub.h:60
static unsigned int const shift
unsigned int endcapRingId() const
Definition: L1TStub.h:104
void setAllStubIndex(unsigned int index)
Definition: L1TStub.h:83
unsigned int detId_
Definition: L1TStub.h:142
void setiz(int iz)
Definition: L1TStub.h:71
unsigned int iphi_
Definition: L1TStub.h:125
double sigmaz() const
Definition: L1TStub.h:74
unsigned int iphi() const
Definition: L1TStub.h:67
double bend_
Definition: L1TStub.h:135
bool tpmatch(int tp) const
Definition: L1TStub.cc:107
double r2() const
Definition: L1TStub.h:62
int region() const
Definition: L1TStub.h:114
constexpr int N_LAYER
Definition: Settings.h:21
std::vector< int > tps() const
Definition: L1TStub.h:81