CMS 3D CMS Logo

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  double pdfSum = 0;
27 
30  //i.e. not counting the pdfValue of the phiB of the refLayer
31  double pdfSumUnconstr = 0;
32 
34  unsigned int firedLayerCnt = 0;
35 
37  unsigned int firedLayerBits = 0;
38 
40  int refHitPhi = 0;
41 
43 
44  double gpProbability1 = 0;
45 
46  double gpProbability2 = 0;
47 
49 
50 public:
51  void init(const OMTFConfiguration* omtfConfig);
52 
53  void reset();
54 
55  bool isValid() const { return valid; }
56 
57  void setValid(bool valid) { this->valid = valid; }
58 
59  void set(int refLayer, int phi, int eta, int refHitPhi);
60 
61  void setStubResult(float pdfVal, bool valid, int pdfBin, int layer, MuonStubPtr stub);
62 
63  void setStubResult(int layer, StubResult& stubResult);
64 
65  int getRefLayer() const { return this->refLayer; }
66 
67  void setRefLayer(int refLayer) { this->refLayer = refLayer; }
68 
69  int getEta() const { return eta; }
70 
71  void setEta(int eta) { this->eta = eta; }
72 
73  unsigned int getFiredLayerBits() const { return firedLayerBits; }
74 
75  void setFiredLayerBits(unsigned int firedLayerBits) { this->firedLayerBits = firedLayerBits; }
76 
77  unsigned int getFiredLayerCnt() const { return firedLayerCnt; }
78 
79  void setFiredLayerCnt(unsigned int firedLayerCnt) { this->firedLayerCnt = firedLayerCnt; }
80 
81  /*
82  * sum of the pdfValues in layers
83  * if finalise2() it is product of the pdfValues
84  */
85  PdfValueType getPdfSum() const { return pdfSum; }
86 
88 
89  const StubResults& getStubResults() const { return stubResults; }
90 
91  int getPhi() const { return phi; }
92 
93  void setPhi(int phi) { this->phi = phi; }
94 
95  int getRefHitPhi() const { return refHitPhi; }
96 
97  void setRefHitPhi(int refHitPhi) { this->refHitPhi = refHitPhi; }
98 
99  bool isLayerFired(unsigned int iLayer) const { return firedLayerBits & (1 << iLayer); }
100 
102 
103  //dont use this in the pattern construction, since the myOmtfConfig is null then
105 
106  std::function<void()> finalise;
107 
108  //version for the "normal" patterns, i.e. without pdfSum threshold
109  void finalise0();
110 
111  //version for the patterns with pdfSum threshold
112  void finalise1();
113 
114  //multiplication of PDF values instead of sum
115  void finalise2();
116 
117  //for patterns generation
118  void finalise3();
119 
120  void finalise5();
121 
122  void finalise6();
123 
124  void finalise7();
125 
126  void finalise8();
127 
128  void finalise9();
129 
130  void finalise10();
131 
132  void finalise11();
133  //bool empty() const;
134 
135  friend std::ostream& operator<<(std::ostream& out, const GoldenPatternResult& aResult);
136 
137  double getGpProbability1() const { return gpProbability1; }
138 
139  void setGpProbability1(double probability1 = 0) { this->gpProbability1 = probability1; }
140 
141  double getGpProbability2() const { return gpProbability2; }
142 
143  void setGpProbability2(double probability2 = 0) { this->gpProbability2 = probability2; }
144 
145 private:
146  const OMTFConfiguration* omtfConfig = nullptr;
147 };
148 
149 #endif //L1T_OmtfP1_GOLDENPATTERNRESULTS_H
unsigned int firedLayerBits
bits representing fired logicLayers (including bending layers),
PdfValueType getPdfSumUnconstr() const
double getGpProbability1() const
friend std::ostream & operator<<(std::ostream &out, const GoldenPatternResult &aResult)
const OMTFConfiguration * omtfConfig
std::function< void()> finalise
void setRefLayer(int refLayer)
double getGpProbability2() const
unsigned int getFiredLayerBits() const
void setFiredLayerBits(unsigned int firedLayerBits)
void init(const OMTFConfiguration *omtfConfig)
void setStubResult(float pdfVal, bool valid, int pdfBin, int layer, MuonStubPtr stub)
const StubResults & getStubResults() const
std::shared_ptr< MuonStub > MuonStubPtr
Definition: MuonStub.h:67
bool isLayerFired(unsigned int iLayer) const
unsigned int getFiredLayerCnt() const
float PdfValueType
int eta
eta at the 2nd muon station
std::vector< StubResult > StubResults
Definition: StubResult.h:56
void setRefHitPhi(int refHitPhi)
void setGpProbability1(double probability1=0)
PdfValueType getPdfSum() const
double pdfSum
Sum of pdfValues.
void setGpProbability2(double probability2=0)
unsigned int firedLayerCnt
Number of fired layers.
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