CMS 3D CMS Logo

MuonPath.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_MuonPath_h
2 #define L1Trigger_DTTriggerPhase2_MuonPath_h
3 #include <iostream>
4 #include <memory>
5 
7 
8 class MuonPath {
9 public:
10  MuonPath();
11  MuonPath(DTPrimitivePtrs &ptrPrimitive, int prup = 0, int prdw = 0);
12  MuonPath(DTPrimitives &ptrPrimitive, int prup = 0, int prdw = 0);
13  MuonPath(std::shared_ptr<MuonPath> &ptr);
14  virtual ~MuonPath() {}
15 
16  // setter methods
17  void setPrimitive(DTPrimitivePtr &ptr, int layer);
18  void setNPrimitives(short nprim) { nprimitives_ = nprim; }
19  void setNPrimitivesUp(short nprim) { nprimitivesUp_ = nprim; }
20  void setNPrimitivesDown(short nprim) { nprimitivesDown_ = nprim; }
21  void setCellHorizontalLayout(int layout[4]);
22  void setCellHorizontalLayout(const int *layout);
23  void setBaseChannelId(int bch) { baseChannelId_ = bch; }
24  void setQuality(cmsdt::MP_QUALITY qty) { quality_ = qty; }
25  void setBxTimeValue(int time);
26  void setLateralComb(cmsdt::LATERAL_CASES latComb[4]);
27  void setLateralComb(const cmsdt::LATERAL_CASES *latComb);
29 
30  void setHorizPos(float pos) { horizPos_ = pos; }
31  void setTanPhi(float tanPhi) { tanPhi_ = tanPhi; }
32  void setChiSquare(float chi) { chiSquare_ = chi; }
33  void setPhi(float phi) { phi_ = phi; }
34  void setPhiB(float phib) { phiB_ = phib; }
36  void setPhiBCMSSW(float phib_cmssw) { phiBcmssw_ = phib_cmssw; }
37  void setXCoorCell(float x, int cell) { xCoorCell_[cell] = x; }
38  void setDriftDistance(float dx, int cell) { xDriftDistance_[cell] = dx; }
39  void setXWirePos(float x, int cell) { xWirePos_[cell] = x; }
40  void setZWirePos(float z, int cell) { zWirePos_[cell] = z; }
41  void setTWireTDC(float t, int cell) { tWireTDC_[cell] = t; }
42  void setRawId(uint32_t id) { rawId_ = id; }
43 
44  // getter methods
45  DTPrimitivePtr primitive(int layer) const { return prim_[layer]; }
46  short nprimitives() const { return nprimitives_; }
47  short nprimitivesDown() const { return nprimitivesDown_; }
48  short nprimitivesUp() const { return nprimitivesUp_; }
49  const int *cellLayout() const { return cellLayout_; }
50  int baseChannelId() const { return baseChannelId_; }
51  cmsdt::MP_QUALITY quality() const { return quality_; }
52  int bxTimeValue() const { return bxTimeValue_; }
53  int bxNumId() const { return bxNumId_; }
54  float tanPhi() const { return tanPhi_; }
55  const cmsdt::LATERAL_CASES *lateralComb() const { return (lateralComb_); }
56  float horizPos() const { return horizPos_; }
57  float chiSquare() const { return chiSquare_; }
58  float phi() const { return phi_; }
59  float phiB() const { return phiB_; }
60  float phi_cmssw() const { return phicmssw_; }
61  float phiB_cmssw() const { return phiBcmssw_; }
62  float xCoorCell(int cell) const { return xCoorCell_[cell]; }
63  float xDriftDistance(int cell) const { return xDriftDistance_[cell]; }
64  float xWirePos(int cell) const { return xWirePos_[cell]; }
65  float zWirePos(int cell) const { return zWirePos_[cell]; }
66  float tWireTDC(int cell) const { return tWireTDC_[cell]; }
67  uint32_t rawId() const { return rawId_; }
68 
69  // Other methods
70  bool isEqualTo(MuonPath *ptr);
71  bool isAnalyzable();
72  bool completeMP();
73 
74 private:
75  //------------------------------------------------------------------
76  //--- MuonPath's data
77  //------------------------------------------------------------------
78  /*
79  Primitives that make up the path. The 0th position holds the channel ID of
80  the lower layer. The order is critical.
81  */
82  DTPrimitivePtrs prim_; //ENSURE that there are no more than 4-8 prims
83  short nprimitives_;
86 
87  /* Horizontal position of each cell (one per layer), in half-cell units,
88  with respect of the lower layer (layer 0).
89  */
92 
93  //------------------------------------------------------------------
94  //--- Fit results:
95  //------------------------------------------------------------------
96  /* path quality */
98 
99  /* Lateral combination */
101 
102  /* BX time value with respect to BX0 of the orbit */
104 
105  /* BX number in the orbit */
106  int bxNumId_;
107 
108  /* Cell parameters */
109  float xCoorCell_[cmsdt::NUM_LAYERS_2SL]; // Horizontal position of the hit in each cell
110  float xDriftDistance_[cmsdt::NUM_LAYERS_2SL]; // Drift distance on the cell (absolute value)
114 
115  float tanPhi_;
116  float horizPos_;
117  float chiSquare_;
118  float phi_;
119  float phiB_;
120  float phicmssw_;
121  float phiBcmssw_;
122 
123  uint32_t rawId_;
124 };
125 
126 typedef std::vector<MuonPath> MuonPaths;
127 typedef std::shared_ptr<MuonPath> MuonPathPtr;
128 typedef std::vector<MuonPathPtr> MuonPathPtrs;
129 
130 #endif
std::vector< DTPrimitivePtr > DTPrimitivePtrs
Definition: DTprimitive.h:55
void setXWirePos(float x, int cell)
Definition: MuonPath.h:39
void setPhiCMSSW(float phi_cmssw)
Definition: MuonPath.h:35
float zWirePos(int cell) const
Definition: MuonPath.h:65
void setLateralCombFromPrimitives(void)
Definition: MuonPath.cc:190
void setPhi(float phi)
Definition: MuonPath.h:33
void setXCoorCell(float x, int cell)
Definition: MuonPath.h:37
float tWireTDC(int cell) const
Definition: MuonPath.h:66
float phiBcmssw_
Definition: MuonPath.h:121
void setTWireTDC(float t, int cell)
Definition: MuonPath.h:41
float phiB_
Definition: MuonPath.h:119
LATERAL_CASES
Definition: constants.h:45
const int * cellLayout() const
Definition: MuonPath.h:49
virtual ~MuonPath()
Definition: MuonPath.h:14
float tanPhi() const
Definition: MuonPath.h:54
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
void setCellHorizontalLayout(int layout[4])
Definition: MuonPath.cc:129
void setNPrimitives(short nprim)
Definition: MuonPath.h:18
float phiB_cmssw() const
Definition: MuonPath.h:61
short nprimitivesUp_
Definition: MuonPath.h:84
int bxNumId() const
Definition: MuonPath.h:53
bool isAnalyzable()
Definition: MuonPath.cc:163
float horizPos() const
Definition: MuonPath.h:56
float xCoorCell_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:109
float phicmssw_
Definition: MuonPath.h:120
float xCoorCell(int cell) const
Definition: MuonPath.h:62
int bxNumId_
Definition: MuonPath.h:106
float horizPos_
Definition: MuonPath.h:116
short nprimitivesDown_
Definition: MuonPath.h:85
int bxTimeValue() const
Definition: MuonPath.h:52
void setDriftDistance(float dx, int cell)
Definition: MuonPath.h:38
float zWirePos_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:112
void setNPrimitivesDown(short nprim)
Definition: MuonPath.h:20
void setHorizPos(float pos)
Definition: MuonPath.h:30
DTPrimitivePtrs prim_
Definition: MuonPath.h:82
float tanPhi_
Definition: MuonPath.h:115
float xWirePos(int cell) const
Definition: MuonPath.h:64
float phi_cmssw() const
Definition: MuonPath.h:60
int baseChannelId_
Definition: MuonPath.h:91
void setBaseChannelId(int bch)
Definition: MuonPath.h:23
bool isEqualTo(MuonPath *ptr)
Definition: MuonPath.cc:139
void setRawId(uint32_t id)
Definition: MuonPath.h:42
float xWirePos_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:111
float xDriftDistance_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:110
short nprimitivesDown() const
Definition: MuonPath.h:47
short nprimitivesUp() const
Definition: MuonPath.h:48
uint32_t rawId_
Definition: MuonPath.h:123
void setChiSquare(float chi)
Definition: MuonPath.h:32
float xDriftDistance(int cell) const
Definition: MuonPath.h:63
float tWireTDC_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:113
DTPrimitivePtr primitive(int layer) const
Definition: MuonPath.h:45
cmsdt::LATERAL_CASES lateralComb_[cmsdt::NUM_LAYERS]
Definition: MuonPath.h:100
int baseChannelId() const
Definition: MuonPath.h:50
MP_QUALITY
Definition: constants.h:42
short nprimitives_
Definition: MuonPath.h:83
void setLateralComb(cmsdt::LATERAL_CASES latComb[4])
Definition: MuonPath.cc:198
void setZWirePos(float z, int cell)
Definition: MuonPath.h:40
void setNPrimitivesUp(short nprim)
Definition: MuonPath.h:19
constexpr int NUM_LAYERS_2SL
Definition: constants.h:254
short nprimitives() const
Definition: MuonPath.h:46
float phiB() const
Definition: MuonPath.h:59
float chiSquare() const
Definition: MuonPath.h:57
float phi_
Definition: MuonPath.h:118
void setQuality(cmsdt::MP_QUALITY qty)
Definition: MuonPath.h:24
void setBxTimeValue(int time)
Definition: MuonPath.cc:181
uint32_t rawId() const
Definition: MuonPath.h:67
float phi() const
Definition: MuonPath.h:58
MuonPath()
Definition: MuonPath.cc:9
std::vector< DTPrimitive > DTPrimitives
Definition: DTprimitive.h:53
void setTanPhi(float tanPhi)
Definition: MuonPath.h:31
std::shared_ptr< MuonPath > MuonPathPtr
Definition: MuonPath.h:127
int bxTimeValue_
Definition: MuonPath.h:103
cmsdt::MP_QUALITY quality() const
Definition: MuonPath.h:51
constexpr int NUM_LAYERS
Definition: constants.h:219
std::vector< MuonPath > MuonPaths
Definition: MuonPath.h:126
bool completeMP()
Definition: MuonPath.cc:177
void setPhiBCMSSW(float phib_cmssw)
Definition: MuonPath.h:36
void setPrimitive(DTPrimitivePtr &ptr, int layer)
Definition: MuonPath.cc:127
int cellLayout_[cmsdt::NUM_LAYERS]
Definition: MuonPath.h:90
float chiSquare_
Definition: MuonPath.h:117
std::shared_ptr< DTPrimitive > DTPrimitivePtr
Definition: DTprimitive.h:54
const cmsdt::LATERAL_CASES * lateralComb() const
Definition: MuonPath.h:55
void setPhiB(float phib)
Definition: MuonPath.h:34
cmsdt::MP_QUALITY quality_
Definition: MuonPath.h:97