CMS 3D CMS Logo

GoldenPattern.h
Go to the documentation of this file.
1 #ifndef OMTF_GoldenPattern_H
2 #define OMTF_GoldenPattern_H
3 
4 #include <vector>
5 #include <ostream>
6 
8 
9 class OMTFConfigMaker;
10 class OMTFProcessor;
11 class OMTFConfiguration;
13 // Key
15 struct Key {
16 
17 Key(int iEta=99, unsigned int iPt=0, int iCharge= 0, unsigned int iNumber=999):
18  theEtaCode(iEta), thePtCode(iPt), theCharge(iCharge), theNumber(iNumber) {}
19 
20  inline bool operator< (const Key & o) const {return (theNumber < o.theNumber);}
21 
22  bool operator==(const Key& o) const {
24  }
25 
26  friend std::ostream & operator << (std::ostream &out, const Key & o) {
27  out << "Key_"<<o.theNumber<<": (eta="<<o.theEtaCode<<", pt="<<o.thePtCode<<", charge="<<o.theCharge<<")";
28  return out;
29  }
30 
31  unsigned int number() const {return theNumber;}
32 
34  unsigned int thePtCode;
35  int theCharge;
36  unsigned int theNumber;
37 
38  };
40 // Golden Pattern
42 class OMTFinput;
43 
45 
46  public:
47 
48  typedef std::vector<int> vector1D;
49  typedef std::vector<vector1D> vector2D;
50  typedef std::vector<vector2D> vector3D;
51  typedef std::pair<int,bool> layerResult;
52 
53  //
54  // GoldenPatterns methods
55  //
56  GoldenPattern(const Key & aKey, const OMTFConfiguration * omtfConfig) : theKey(aKey), myOmtfConfig(omtfConfig){}
57 
58  Key key() const {return theKey;}
59 
60  void setMeanDistPhi(const vector2D & aMeanDistPhi){ meanDistPhi = aMeanDistPhi; }
61 
62  const vector2D & getMeanDistPhi() const {return meanDistPhi;}
63 
64  const vector3D & getPdf() const {return pdfAllRef;}
65 
66  void setPdf(const vector3D & aPdf){ pdfAllRef = aPdf; }
67 
68  int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const { return meanDistPhi[iLayer][iRefLayer];}
69 
70  int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const {return pdfAllRef[iLayer][iRefLayer][iBin];}
71 
74  GoldenPattern::layerResult process1Layer1RefLayer(unsigned int iRefLayer,
75  unsigned int iLayer,
76  const int refPhi,
77  const OMTFinput::vector1D & layerHits);
78 
79  friend std::ostream & operator << (std::ostream &out, const GoldenPattern & aPattern);
80 
82  void addCount(unsigned int iRefLayer,
83  unsigned int iLayer,
84  const int refPhi,
85  const OMTFinput::vector1D & layerHits);
86 
88  void reset();
89 
94  void normalise(unsigned int nPdfAddrBits);
95 
99  int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer);
100 
102  bool hasCounts();
103 
104  private:
105 
108 
113  vector3D pdfAllRef;
114 
118  vector2D meanDistPhi;
119 
123 
125 
126 };
129 #endif
Key key() const
Definition: GoldenPattern.h:58
unsigned int number() const
Definition: GoldenPattern.h:31
unsigned int theNumber
Definition: GoldenPattern.h:36
Key(int iEta=99, unsigned int iPt=0, int iCharge=0, unsigned int iNumber=999)
Definition: GoldenPattern.h:17
vector2D meanDistPhiCounts
std::vector< int > vector1D
Definition: GoldenPattern.h:48
int theCharge
Definition: GoldenPattern.h:35
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:62
bool operator==(const Key &o) const
Definition: GoldenPattern.h:22
std::vector< int > vector1D
Definition: OMTFinput.h:15
const OMTFConfiguration * myOmtfConfig
unsigned int thePtCode
Definition: GoldenPattern.h:34
vector2D meanDistPhi
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:49
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:50
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:66
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
vector3D pdfAllRef
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:51
GoldenPattern(const Key &aKey, const OMTFConfiguration *omtfConfig)
Definition: GoldenPattern.h:56
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:70
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:60
friend std::ostream & operator<<(std::ostream &out, const Key &o)
Definition: GoldenPattern.h:26
int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const
Definition: GoldenPattern.h:68
void reset(double vett[256])
Definition: TPedValues.cc:11
bool operator<(const Key &o) const
Definition: GoldenPattern.h:20
int theEtaCode
Definition: GoldenPattern.h:33
const vector3D & getPdf() const
Definition: GoldenPattern.h:64