CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  double x,
25  double y,
26  double z,
27  double bend,
28  double strip,
29  std::vector<int> tps);
30 
31  ~L1TStub() = default;
32 
33  void write(std::ofstream& out);
34 
35  double diphi();
36 
37  double iphiouter();
38 
39  double diz();
40 
41  unsigned int layer() const { return layer_; }
42  int disk() const {
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  }
52  unsigned int ladder() const { return ladder_; }
53  unsigned int module() const { return module_; }
54 
55  double x() const { return x_; }
56  double y() const { return y_; }
57  double z() const { return z_; }
58  double r() const { return std::hypot(x_, y_); }
59  double pt() const { return pt_; }
60  double r2() const { return x_ * x_ + y_ * y_; }
61  double bend() const { return bend_; }
62 
63  double phi() const { return atan2(y_, x_); }
64 
65  unsigned int iphi() const { return iphi_; }
66  unsigned int iz() const { return iz_; }
67 
68  void setiphi(int iphi) { iphi_ = iphi; }
69  void setiz(int iz) { iz_ = iz; }
70 
71  double sigmax() const { return sigmax_; }
72  double sigmaz() const { return sigmaz_; }
73 
74  bool operator==(const L1TStub& other) const;
75 
76  void lorentzcor(double shift);
77 
78  int eventid() const { return eventid_; }
79  std::vector<int> tps() const { return tps_; }
80 
81  void setAllStubIndex(unsigned int index) { allstubindex_ = index; }
82 
83  unsigned int allStubIndex() const { return allstubindex_; }
84 
85  unsigned int strip() const { return strip_; }
86 
87  double alpha(double pitch) const;
88 
89  //Scaled to go between -1 and +1
90  double alphanorm() const;
91 
92  void setXY(double x, double y);
93 
94  unsigned int isPSmodule() const { return isPSmodule_; }
95  unsigned int isFlipped() const { return isFlipped_; }
96 
97  bool isTilted() const;
98 
99  bool tpmatch(int tp) const;
100  bool tpmatch2(int tp) const;
101 
102  const std::string& DTClink() const { return DTClink_; }
103 
104  int layerdisk() const { return layerdisk_; }
105 
106  int region() const { return region_; }
107 
108  const std::string& stubword() const { return stubword_; }
109 
110  private:
113  int region_;
115  int eventid_;
116  std::vector<int> tps_;
117  unsigned int iphi_;
118  unsigned int iz_;
119  unsigned int layer_;
120  unsigned int ladder_;
121  unsigned int module_;
122  unsigned int strip_;
123  double x_;
124  double y_;
125  double z_;
126  double sigmax_;
127  double sigmaz_;
128  double pt_;
129  double bend_;
130  unsigned int allstubindex_;
131 
132  unsigned int isPSmodule_;
133  unsigned int isFlipped_;
134  };
135 }; // namespace trklet
136 #endif
double r() const
Definition: L1TStub.h:58
unsigned int iz_
Definition: L1TStub.h:118
unsigned int iz() const
Definition: L1TStub.h:66
void setXY(double x, double y)
Definition: L1TStub.cc:97
unsigned int isFlipped() const
Definition: L1TStub.h:95
bool tpmatch2(int tp) const
Definition: L1TStub.cc:111
unsigned int module_
Definition: L1TStub.h:121
unsigned int strip() const
Definition: L1TStub.h:85
double r2() const
Definition: L1TStub.h:60
int region() const
Definition: L1TStub.h:106
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
int eventid() const
Definition: L1TStub.h:78
double phi() const
Definition: L1TStub.h:63
unsigned int isPSmodule_
Definition: L1TStub.h:132
void write(std::ofstream &out)
Definition: L1TStub.cc:51
bool operator==(const L1TStub &other) const
Definition: L1TStub.cc:61
~L1TStub()=default
const std::string & DTClink() const
Definition: L1TStub.h:102
double pt() const
Definition: L1TStub.h:59
std::string DTClink_
Definition: L1TStub.h:112
int disk() const
Definition: L1TStub.h:42
double bend() const
Definition: L1TStub.h:61
double sigmax_
Definition: L1TStub.h:126
std::string stubword_
Definition: L1TStub.h:114
bool isTilted() const
Definition: L1TStub.cc:126
double z() const
Definition: L1TStub.h:57
double sigmaz() const
Definition: L1TStub.h:72
double alpha(double pitch) const
Definition: L1TStub.cc:73
int layerdisk() const
Definition: L1TStub.h:104
unsigned int iphi() const
Definition: L1TStub.h:65
unsigned int isPSmodule() const
Definition: L1TStub.h:94
const std::string & stubword() const
Definition: L1TStub.h:108
unsigned int module() const
Definition: L1TStub.h:53
unsigned int ladder() const
Definition: L1TStub.h:52
double x() const
Definition: L1TStub.h:55
unsigned int layer_
Definition: L1TStub.h:119
bool tpmatch(int tp) const
Definition: L1TStub.cc:102
double pt_
Definition: L1TStub.h:128
unsigned int allStubIndex() const
Definition: L1TStub.h:83
unsigned int allstubindex_
Definition: L1TStub.h:130
unsigned int isFlipped_
Definition: L1TStub.h:133
void setiphi(int iphi)
Definition: L1TStub.h:68
void lorentzcor(double shift)
Definition: L1TStub.cc:66
double iphiouter()
double sigmax() const
Definition: L1TStub.h:71
static unsigned int const shift
unsigned int layer() const
Definition: L1TStub.h:41
double alphanorm() const
Definition: L1TStub.cc:85
std::vector< int > tps() const
Definition: L1TStub.h:79
void setAllStubIndex(unsigned int index)
Definition: L1TStub.h:81
double y() const
Definition: L1TStub.h:56
void setiz(int iz)
Definition: L1TStub.h:69
unsigned int iphi_
Definition: L1TStub.h:117
double bend_
Definition: L1TStub.h:129
constexpr int N_LAYER
Definition: Settings.h:21