CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
const int * cellLayout() const
Definition: MuonPath.h:49
void setPhiCMSSW(float phi_cmssw)
Definition: MuonPath.h:35
float phiB() const
Definition: MuonPath.h:59
float xWirePos(int cell) const
Definition: MuonPath.h:64
void setLateralCombFromPrimitives(void)
Definition: MuonPath.cc:194
void setPhi(float phi)
Definition: MuonPath.h:33
void setXCoorCell(float x, int cell)
Definition: MuonPath.h:37
float phiBcmssw_
Definition: MuonPath.h:121
uint16_t *__restrict__ id
void setTWireTDC(float t, int cell)
Definition: MuonPath.h:41
float horizPos() const
Definition: MuonPath.h:56
float phiB_
Definition: MuonPath.h:119
LATERAL_CASES
Definition: constants.h:45
float tanPhi() const
Definition: MuonPath.h:54
virtual ~MuonPath()
Definition: MuonPath.h:14
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
void setCellHorizontalLayout(int layout[4])
Definition: MuonPath.cc:133
void setNPrimitives(short nprim)
Definition: MuonPath.h:18
uint32_t rawId() const
Definition: MuonPath.h:67
short nprimitivesUp_
Definition: MuonPath.h:84
bool isAnalyzable()
Definition: MuonPath.cc:167
float xCoorCell_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:109
float phicmssw_
Definition: MuonPath.h:120
float zWirePos(int cell) const
Definition: MuonPath.h:65
constexpr std::array< uint8_t, layerIndexSize > layer
int bxNumId_
Definition: MuonPath.h:106
float horizPos_
Definition: MuonPath.h:116
short nprimitivesDown_
Definition: MuonPath.h:85
void setDriftDistance(float dx, int cell)
Definition: MuonPath.h:38
short nprimitivesDown() const
Definition: MuonPath.h:47
int bxNumId() const
Definition: MuonPath.h:53
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 phi_cmssw() const
Definition: MuonPath.h:60
short nprimitivesUp() const
Definition: MuonPath.h:48
float phiB_cmssw() const
Definition: MuonPath.h:61
const cmsdt::LATERAL_CASES * lateralComb() const
Definition: MuonPath.h:55
int baseChannelId_
Definition: MuonPath.h:91
void setBaseChannelId(int bch)
Definition: MuonPath.h:23
int bxTimeValue() const
Definition: MuonPath.h:52
DTPrimitivePtr primitive(int layer) const
Definition: MuonPath.h:45
bool isEqualTo(MuonPath *ptr)
Definition: MuonPath.cc:143
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
uint32_t rawId_
Definition: MuonPath.h:123
void setChiSquare(float chi)
Definition: MuonPath.h:32
float tWireTDC_[cmsdt::NUM_LAYERS_2SL]
Definition: MuonPath.h:113
cmsdt::LATERAL_CASES lateralComb_[cmsdt::NUM_LAYERS]
Definition: MuonPath.h:100
MP_QUALITY
Definition: constants.h:42
short nprimitives_
Definition: MuonPath.h:83
void setLateralComb(cmsdt::LATERAL_CASES latComb[4])
Definition: MuonPath.cc:202
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
float phi() const
Definition: MuonPath.h:58
short nprimitives() const
Definition: MuonPath.h:46
cmsdt::MP_QUALITY quality() const
Definition: MuonPath.h:51
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:185
MuonPath()
Definition: MuonPath.cc:9
int baseChannelId() const
Definition: MuonPath.h:50
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
constexpr int NUM_LAYERS
Definition: constants.h:219
std::vector< MuonPath > MuonPaths
Definition: MuonPath.h:126
bool completeMP()
Definition: MuonPath.cc:181
void setPhiBCMSSW(float phib_cmssw)
Definition: MuonPath.h:36
void setPrimitive(DTPrimitivePtr &ptr, int layer)
Definition: MuonPath.cc:127
float xDriftDistance(int cell) const
Definition: MuonPath.h:63
int cellLayout_[cmsdt::NUM_LAYERS]
Definition: MuonPath.h:90
float xCoorCell(int cell) const
Definition: MuonPath.h:62
float chiSquare_
Definition: MuonPath.h:117
std::shared_ptr< DTPrimitive > DTPrimitivePtr
Definition: DTprimitive.h:54
void setPhiB(float phib)
Definition: MuonPath.h:34
cmsdt::MP_QUALITY quality_
Definition: MuonPath.h:97
float tWireTDC(int cell) const
Definition: MuonPath.h:66