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;
12 // Key
14 struct Key {
15 
16 Key(int iEta=99, unsigned int iPt=0, int iCharge= 0):
17  theEtaCode(iEta), thePtCode(iPt), theCharge(iCharge){}
18 
19  inline bool operator< (const Key & o) const {
20  if (thePtCode > o.thePtCode) return true;
21  else if (thePtCode==o.thePtCode && theCharge < o.theCharge) return true;
22  else if (theCharge*thePtCode==o.theCharge*o.thePtCode && theEtaCode<o.theEtaCode) return true;
23  else return false;
24  }
25 
26  bool operator==(const Key& o) const {
28  }
29 
30  friend std::ostream & operator << (std::ostream &out, const Key & o) {
31  out << "Key: (eta="<<o.theEtaCode<<", pt="<<o.thePtCode<<", charge="<<o.theCharge<<")";
32  return out;
33  }
34 
36  unsigned int thePtCode;
37  int theCharge;
38 
39  };
41 // Golden Pattern
43 class OMTFinput;
44 
46 
47  public:
48 
49  typedef std::vector<int> vector1D;
50  typedef std::vector<vector1D> vector2D;
51  typedef std::vector<vector2D> vector3D;
52  typedef std::pair<int,bool> layerResult;
53 
54  //
55  // GoldenPatterns methods
56  //
57  GoldenPattern(const Key & aKey) : theKey(aKey){}
58 
59  Key key() const {return theKey;}
60 
61  void setMeanDistPhi(const vector2D & aMeanDistPhi){ meanDistPhi = aMeanDistPhi; }
62 
63  const vector2D & getMeanDistPhi() const {return meanDistPhi;}
64 
65  const vector3D & getPdf() const {return pdfAllRef;}
66 
67  void setPdf(const vector3D & aPdf){ pdfAllRef = aPdf; }
68 
69  int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const { return meanDistPhi[iLayer][iRefLayer];}
70 
71  int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const {return pdfAllRef[iLayer][iRefLayer][iBin];}
72 
76  unsigned int iLayer,
77  const int refPhi,
78  const OMTFinput::vector1D & layerHits);
79 
80  friend std::ostream & operator << (std::ostream &out, const GoldenPattern & aPattern);
81 
83  void addCount(unsigned int iRefLayer,
84  unsigned int iLayer,
85  const int refPhi,
86  const OMTFinput::vector1D & layerHits);
87 
89  void reset();
90 
93  void normalise();
94 
98  int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer);
99 
101  bool hasCounts();
102 
103  private:
104 
107 
113 
118 
122 
123 };
126 #endif
Key key() const
Definition: GoldenPattern.h:59
GoldenPattern(const Key &aKey)
Definition: GoldenPattern.h:57
friend std::ostream & operator<<(std::ostream &out, const GoldenPattern &aPattern)
Key(int iEta=99, unsigned int iPt=0, int iCharge=0)
Definition: GoldenPattern.h:16
vector2D meanDistPhiCounts
std::vector< int > vector1D
Definition: GoldenPattern.h:49
int theCharge
Definition: GoldenPattern.h:37
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:63
bool operator==(const Key &o) const
Definition: GoldenPattern.h:26
std::vector< int > vector1D
Definition: OMTFinput.h:14
unsigned int thePtCode
Definition: GoldenPattern.h:36
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)
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:50
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:51
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:67
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
vector3D pdfAllRef
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:52
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:71
int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer)
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:61
friend std::ostream & operator<<(std::ostream &out, const Key &o)
Definition: GoldenPattern.h:30
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:69
bool operator<(const Key &o) const
Definition: GoldenPattern.h:19
int theEtaCode
Definition: GoldenPattern.h:35
const vector3D & getPdf() const
Definition: GoldenPattern.h:65