test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
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 
114 
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
friend std::ostream & operator<<(std::ostream &out, const GoldenPattern &aPattern)
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
bool hasCounts()
Check if the GP has any counts in any of referecne layers;.
GoldenPattern::layerResult process1Layer1RefLayer(unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
void normalise(unsigned int nPdfAddrBits)
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
void reset()
Reset contents of all data vectors, keeping the vectors size.
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:70
int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer)
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:60
friend std::ostream & operator<<(std::ostream &out, const Key &o)
Definition: GoldenPattern.h:26
void addCount(unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
Add a single count to the relevant pdf bin in three dimensions.
int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const
Definition: GoldenPattern.h:68
bool operator<(const Key &o) const
Definition: GoldenPattern.h:20
int theEtaCode
Definition: GoldenPattern.h:33
const vector3D & getPdf() const
Definition: GoldenPattern.h:64