Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:12:50

0001 #ifndef L1T_OmtfP1_GOLDENPATTERNRESULTS_H
0002 #define L1T_OmtfP1_GOLDENPATTERNRESULTS_H
0003 
0004 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
0005 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
0006 #include "L1Trigger/L1TMuonOverlapPhase1/interface/StubResult.h"
0007 
0008 #include <ostream>
0009 
0010 //result for one refHit of one GoldenPattern
0011 class GoldenPatternResult {
0012 public:
0013 private:
0014   bool valid = false;
0015 
0016   //number of the layer from which the reference hit originated
0017   int refLayer = 0;
0018 
0019   ///phi at the 2nd muon station (propagated refHitPhi)
0020   int phi = 0;
0021 
0022   ///eta at the 2nd muon station
0023   int eta = 0;
0024 
0025   ///Sum of pdfValues
0026   //omtfPdfValueType
0027   double pdfSum = 0;
0028 
0029   ///Number of fired layers - excluding bending layers
0030   unsigned int firedLayerCnt = 0;
0031 
0032   ///bits representing fired logicLayers (including bending layers),
0033   unsigned int firedLayerBits = 0;
0034 
0035   ///phi of the reference hits
0036   int refHitPhi = 0;
0037 
0038   int finalizeFunction = 0;
0039 
0040   double gpProbability1 = 0;
0041 
0042   double gpProbability2 = 0;
0043 
0044   StubResults stubResults;
0045 
0046 public:
0047   void init(const OMTFConfiguration* omtfConfig);
0048 
0049   void reset();
0050 
0051   bool isValid() const { return valid; }
0052 
0053   void setValid(bool valid) { this->valid = valid; }
0054 
0055   void set(int refLayer, int phi, int eta, int refHitPhi);
0056 
0057   void setStubResult(float pdfVal, bool valid, int pdfBin, int layer, MuonStubPtr stub);
0058 
0059   void setStubResult(int layer, StubResult& stubResult);
0060 
0061   int getRefLayer() const { return this->refLayer; }
0062 
0063   void setRefLayer(int refLayer) { this->refLayer = refLayer; }
0064 
0065   int getEta() const { return eta; }
0066 
0067   void setEta(int eta) { this->eta = eta; }
0068 
0069   unsigned int getFiredLayerBits() const { return firedLayerBits; }
0070 
0071   void setFiredLayerBits(unsigned int firedLayerBits) { this->firedLayerBits = firedLayerBits; }
0072 
0073   unsigned int getFiredLayerCnt() const { return firedLayerCnt; }
0074 
0075   void setFiredLayerCnt(unsigned int firedLayerCnt) { this->firedLayerCnt = firedLayerCnt; }
0076 
0077   /*
0078    * sum of the pdfValues in layers
0079    * if finalise2() it is product of the pdfValues
0080    */
0081   PdfValueType getPdfSum() const { return pdfSum; }
0082 
0083   const StubResults& getStubResults() const { return stubResults; }
0084 
0085   int getPhi() const { return phi; }
0086 
0087   void setPhi(int phi) { this->phi = phi; }
0088 
0089   int getRefHitPhi() const { return refHitPhi; }
0090 
0091   void setRefHitPhi(int refHitPhi) { this->refHitPhi = refHitPhi; }
0092 
0093   bool isLayerFired(unsigned int iLayer) const { return firedLayerBits & (1 << iLayer); }
0094 
0095   GoldenPatternResult(){};
0096 
0097   //dont use this in the pattern construction, since the myOmtfConfig is null then
0098   GoldenPatternResult(const OMTFConfiguration* omtfConfig);
0099 
0100   std::function<void()> finalise;
0101 
0102   //version for the "normal" patterns, i.e. without pdfSum threshold
0103   void finalise0();
0104 
0105   //version for the patterns with pdfSum threshold
0106   void finalise1();
0107 
0108   //multiplication of PDF values instead of sum
0109   void finalise2();
0110 
0111   //for patterns generation
0112   void finalise3();
0113 
0114   void finalise5();
0115 
0116   void finalise6();
0117 
0118   void finalise7();
0119 
0120   void finalise8();
0121 
0122   void finalise9();
0123   //bool empty() const;
0124 
0125   friend std::ostream& operator<<(std::ostream& out, const GoldenPatternResult& aResult);
0126 
0127   double getGpProbability1() const { return gpProbability1; }
0128 
0129   void setGpProbability1(double probability1 = 0) { this->gpProbability1 = probability1; }
0130 
0131   double getGpProbability2() const { return gpProbability2; }
0132 
0133   void setGpProbability2(double probability2 = 0) { this->gpProbability2 = probability2; }
0134 
0135 private:
0136   const OMTFConfiguration* omtfConfig = nullptr;
0137 };
0138 
0139 #endif  //L1T_OmtfP1_GOLDENPATTERNRESULTS_H