CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GoldenPatternResult.h
Go to the documentation of this file.
1 #ifndef L1T_OmtfP1_GOLDENPATTERNRESULTS_H
2 #define L1T_OmtfP1_GOLDENPATTERNRESULTS_H
3 
7 
8 #include <ostream>
9 
10 //result for one refHit of one GoldenPattern
12 public:
13 private:
14  bool valid = false;
15 
16  //number of the layer from which the reference hit originated
17  int refLayer = 0;
18 
20  int phi = 0;
21 
23  int eta = 0;
24 
26  //omtfPdfValueType
27  double pdfSum = 0;
28 
30  unsigned int firedLayerCnt = 0;
31 
33  unsigned int firedLayerBits = 0;
34 
36  int refHitPhi = 0;
37 
39 
40  double gpProbability1 = 0;
41 
42  double gpProbability2 = 0;
43 
45 
46 public:
47  void init(const OMTFConfiguration* omtfConfig);
48 
49  void reset();
50 
51  bool isValid() const { return valid; }
52 
53  void setValid(bool valid) { this->valid = valid; }
54 
55  void set(int refLayer, int phi, int eta, int refHitPhi);
56 
57  void setStubResult(float pdfVal, bool valid, int pdfBin, int layer, MuonStubPtr stub);
58 
59  void setStubResult(int layer, StubResult& stubResult);
60 
61  int getRefLayer() const { return this->refLayer; }
62 
63  void setRefLayer(int refLayer) { this->refLayer = refLayer; }
64 
65  int getEta() const { return eta; }
66 
67  void setEta(int eta) { this->eta = eta; }
68 
69  unsigned int getFiredLayerBits() const { return firedLayerBits; }
70 
71  void setFiredLayerBits(unsigned int firedLayerBits) { this->firedLayerBits = firedLayerBits; }
72 
73  unsigned int getFiredLayerCnt() const { return firedLayerCnt; }
74 
75  void setFiredLayerCnt(unsigned int firedLayerCnt) { this->firedLayerCnt = firedLayerCnt; }
76 
77  /*
78  * sum of the pdfValues in layers
79  * if finalise2() it is product of the pdfValues
80  */
81  PdfValueType getPdfSum() const { return pdfSum; }
82 
83  const StubResults& getStubResults() const { return stubResults; }
84 
85  int getPhi() const { return phi; }
86 
87  void setPhi(int phi) { this->phi = phi; }
88 
89  int getRefHitPhi() const { return refHitPhi; }
90 
91  void setRefHitPhi(int refHitPhi) { this->refHitPhi = refHitPhi; }
92 
93  bool isLayerFired(unsigned int iLayer) const { return firedLayerBits & (1 << iLayer); }
94 
96 
97  //dont use this in the pattern construction, since the myOmtfConfig is null then
99 
100  std::function<void()> finalise;
101 
102  //version for the "normal" patterns, i.e. without pdfSum threshold
103  void finalise0();
104 
105  //version for the patterns with pdfSum threshold
106  void finalise1();
107 
108  //multiplication of PDF values instead of sum
109  void finalise2();
110 
111  //for patterns generation
112  void finalise3();
113 
114  void finalise5();
115 
116  void finalise6();
117 
118  void finalise7();
119 
120  void finalise8();
121 
122  void finalise9();
123  //bool empty() const;
124 
125  friend std::ostream& operator<<(std::ostream& out, const GoldenPatternResult& aResult);
126 
127  double getGpProbability1() const { return gpProbability1; }
128 
129  void setGpProbability1(double probability1 = 0) { this->gpProbability1 = probability1; }
130 
131  double getGpProbability2() const { return gpProbability2; }
132 
133  void setGpProbability2(double probability2 = 0) { this->gpProbability2 = probability2; }
134 
135 private:
136  const OMTFConfiguration* omtfConfig = nullptr;
137 };
138 
139 #endif //L1T_OmtfP1_GOLDENPATTERNRESULTS_H
double getGpProbability2() const
unsigned int firedLayerBits
bits representing fired logicLayers (including bending layers),
const StubResults & getStubResults() const
unsigned int getFiredLayerCnt() const
friend std::ostream & operator<<(std::ostream &out, const GoldenPatternResult &aResult)
void set(int refLayer, int phi, int eta, int refHitPhi)
const OMTFConfiguration * omtfConfig
std::function< void()> finalise
constexpr std::array< uint8_t, layerIndexSize > layer
void setRefLayer(int refLayer)
PdfValueType getPdfSum() const
void setFiredLayerBits(unsigned int firedLayerBits)
void init(const OMTFConfiguration *omtfConfig)
void setStubResult(float pdfVal, bool valid, int pdfBin, int layer, MuonStubPtr stub)
std::shared_ptr< const MuonStub > MuonStubPtr
Definition: MuonStub.h:64
float PdfValueType
int eta
eta at the 2nd muon station
std::vector< StubResult > StubResults
Definition: StubResult.h:54
bool isLayerFired(unsigned int iLayer) const
unsigned int getFiredLayerBits() const
void setRefHitPhi(int refHitPhi)
void setGpProbability1(double probability1=0)
double pdfSum
Sum of pdfValues.
void setGpProbability2(double probability2=0)
unsigned int firedLayerCnt
Number of fired layers - excluding bending layers.
double getGpProbability1() const
void setValid(bool valid)
void setFiredLayerCnt(unsigned int firedLayerCnt)
int phi
phi at the 2nd muon station (propagated refHitPhi)
int refHitPhi
phi of the reference hits