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 
4 #include <iostream>
5 #include <fstream>
6 #include <cassert>
7 #include <cmath>
8 #include <vector>
9 
10 namespace trklet {
11 
12  class L1TStub {
13  public:
14  L1TStub();
15  L1TStub(int eventid,
16  std::vector<int> tps,
17  int iphi,
18  int iz,
19  int layer,
20  int ladder,
21  int module,
22  int strip,
23  double x,
24  double y,
25  double z,
26  double sigmax,
27  double sigmaz,
28  double pt,
29  double bend,
30  int isPSmodule,
31  int isFlipped);
32 
33  ~L1TStub() = default;
34 
35  void write(std::ofstream& out);
36  void write(std::ostream& out);
37 
38  double diphi();
39 
40  double iphiouter();
41 
42  double diz();
43 
44  unsigned int layer() const { return layer_; }
45  int disk() const {
46  if (z_ < 0.0) {
47  return -module_;
48  }
49  return module_;
50  }
51  unsigned int ladder() const { return ladder_; }
52  unsigned int module() const { return module_; }
53 
54  double x() const { return x_; }
55  double y() const { return y_; }
56  double z() const { return z_; }
57  double r() const { return std::hypot(x_, y_); }
58  double pt() const { return pt_; }
59  double r2() const { return x_ * x_ + y_ * y_; }
60  double bend() const { return bend_; }
61 
62  double phi() const { return atan2(y_, x_); }
63 
64  unsigned int iphi() const { return iphi_; }
65  unsigned int iz() const { return iz_; }
66 
67  void setiphi(int iphi) { iphi_ = iphi; }
68  void setiz(int iz) { iz_ = iz; }
69 
70  double sigmax() const { return sigmax_; }
71  double sigmaz() const { return sigmaz_; }
72 
73  bool operator==(const L1TStub& other) const;
74 
75  void lorentzcor(double shift);
76 
77  int eventid() const { return eventid_; }
78  std::vector<int> tps() const { return tps_; }
79 
80  void setAllStubIndex(unsigned int index) { allstubindex_ = index; }
81 
82  unsigned int allStubIndex() const { return allstubindex_; }
83 
84  unsigned int strip() const { return strip_; }
85 
86  double alpha(double pitch) const;
87 
88  //Scaled to go between -1 and +1
89  double alphanorm() const;
90 
91  void setXY(double x, double y);
92 
93  unsigned int isPSmodule() const { return isPSmodule_; }
94  unsigned int isFlipped() const { return isFlipped_; }
95 
96  bool isTilted() const;
97 
98  bool tpmatch(int tp) const;
99 
100  private:
101  int eventid_;
102  std::vector<int> tps_;
103  unsigned int iphi_;
104  unsigned int iz_;
105  unsigned int layer_;
106  unsigned int ladder_;
107  unsigned int module_;
108  unsigned int strip_;
109  double x_;
110  double y_;
111  double z_;
112  double sigmax_;
113  double sigmaz_;
114  double pt_;
115  double bend_;
116  unsigned int allstubindex_;
117 
118  unsigned int isPSmodule_;
119  unsigned int isFlipped_;
120  };
121 }; // namespace trklet
122 #endif
trklet::L1TStub::setXY
void setXY(double x, double y)
Definition: L1TStub.cc:103
trklet::L1TStub::tps
std::vector< int > tps() const
Definition: L1TStub.h:78
trklet::L1TStub::eventid_
int eventid_
Definition: L1TStub.h:101
trklet::L1TStub::ladder
unsigned int ladder() const
Definition: L1TStub.h:51
trklet::L1TStub::sigmax
double sigmax() const
Definition: L1TStub.h:70
trklet::L1TStub::layer
unsigned int layer() const
Definition: L1TStub.h:44
trklet::L1TStub::pt
double pt() const
Definition: L1TStub.h:58
trklet::L1TStub::sigmaz_
double sigmaz_
Definition: L1TStub.h:113
trklet::L1TStub::strip_
unsigned int strip_
Definition: L1TStub.h:108
trklet::L1TStub::diphi
double diphi()
trklet::L1TStub::diz
double diz()
trklet::L1TStub::module_
unsigned int module_
Definition: L1TStub.h:107
trklet::L1TStub::isPSmodule_
unsigned int isPSmodule_
Definition: L1TStub.h:118
trklet::L1TStub::bend
double bend() const
Definition: L1TStub.h:60
trklet::L1TStub
Definition: L1TStub.h:12
trklet::L1TStub::z
double z() const
Definition: L1TStub.h:56
trklet::L1TStub::tps_
std::vector< int > tps_
Definition: L1TStub.h:102
trklet::L1TStub::ladder_
unsigned int ladder_
Definition: L1TStub.h:106
trklet::L1TStub::y
double y() const
Definition: L1TStub.h:55
trklet::L1TStub::isTilted
bool isTilted() const
Definition: L1TStub.cc:117
trklet::L1TStub::L1TStub
L1TStub()
Definition: L1TStub.cc:7
trklet::L1TStub::x
double x() const
Definition: L1TStub.h:54
trklet::L1TStub::write
void write(std::ofstream &out)
Definition: L1TStub.cc:47
trklet::L1TStub::sigmax_
double sigmax_
Definition: L1TStub.h:112
trklet::L1TStub::~L1TStub
~L1TStub()=default
trklet::L1TStub::strip
unsigned int strip() const
Definition: L1TStub.h:84
trklet::L1TStub::isPSmodule
unsigned int isPSmodule() const
Definition: L1TStub.h:93
trklet::L1TStub::x_
double x_
Definition: L1TStub.h:109
trackingPlots.other
other
Definition: trackingPlots.py:1465
trklet::L1TStub::module
unsigned int module() const
Definition: L1TStub.h:52
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
trklet::L1TStub::y_
double y_
Definition: L1TStub.h:110
trklet::L1TStub::allStubIndex
unsigned int allStubIndex() const
Definition: L1TStub.h:82
trklet::L1TStub::disk
int disk() const
Definition: L1TStub.h:45
trklet::L1TStub::isFlipped
unsigned int isFlipped() const
Definition: L1TStub.h:94
trklet::L1TStub::alphanorm
double alphanorm() const
Definition: L1TStub.cc:91
trklet::L1TStub::z_
double z_
Definition: L1TStub.h:111
trklet::L1TStub::layer_
unsigned int layer_
Definition: L1TStub.h:105
trklet::L1TStub::iz
unsigned int iz() const
Definition: L1TStub.h:65
trklet::L1TStub::alpha
double alpha(double pitch) const
Definition: L1TStub.cc:79
module
Definition: vlib.h:198
trklet
Definition: AllProjectionsMemory.h:9
trklet::L1TStub::pt_
double pt_
Definition: L1TStub.h:114
trklet::L1TStub::eventid
int eventid() const
Definition: L1TStub.h:77
trklet::L1TStub::lorentzcor
void lorentzcor(double shift)
Definition: L1TStub.cc:72
trklet::L1TStub::iphiouter
double iphiouter()
trklet::L1TStub::operator==
bool operator==(const L1TStub &other) const
Definition: L1TStub.cc:67
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
trklet::L1TStub::allstubindex_
unsigned int allstubindex_
Definition: L1TStub.h:116
trklet::L1TStub::setiphi
void setiphi(int iphi)
Definition: L1TStub.h:67
trklet::L1TStub::isFlipped_
unsigned int isFlipped_
Definition: L1TStub.h:119
trklet::L1TStub::iphi_
unsigned int iphi_
Definition: L1TStub.h:103
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trklet::L1TStub::iphi
unsigned int iphi() const
Definition: L1TStub.h:64
trklet::L1TStub::sigmaz
double sigmaz() const
Definition: L1TStub.h:71
trklet::L1TStub::r
double r() const
Definition: L1TStub.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
trklet::L1TStub::tpmatch
bool tpmatch(int tp) const
Definition: L1TStub.cc:108
trklet::L1TStub::setAllStubIndex
void setAllStubIndex(unsigned int index)
Definition: L1TStub.h:80
trklet::L1TStub::setiz
void setiz(int iz)
Definition: L1TStub.h:68
trklet::L1TStub::bend_
double bend_
Definition: L1TStub.h:115
trklet::L1TStub::r2
double r2() const
Definition: L1TStub.h:59
trklet::L1TStub::phi
double phi() const
Definition: L1TStub.h:62
trklet::L1TStub::iz_
unsigned int iz_
Definition: L1TStub.h:104