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