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