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  Key(int iEta = 99, unsigned int iPt = 0, int iCharge = 0, unsigned int iNumber = 999)
17  : theEtaCode(iEta), thePtCode(iPt), theCharge(iCharge), theNumber(iNumber) {}
18 
19  inline bool operator<(const Key &o) const { return (theNumber < o.theNumber); }
20 
21  bool operator==(const Key &o) const {
22  return theEtaCode == o.theEtaCode && thePtCode == o.thePtCode && theCharge == o.theCharge &&
23  theNumber == o.theNumber;
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  << ")";
29  return out;
30  }
31 
32  unsigned int number() const { return theNumber; }
33 
35  unsigned int thePtCode;
36  int theCharge;
37  unsigned int theNumber;
38 };
40 // Golden Pattern
42 class OMTFinput;
43 
45 public:
46  typedef std::vector<int> vector1D;
47  typedef std::vector<vector1D> vector2D;
48  typedef std::vector<vector2D> vector3D;
49  typedef std::pair<int, bool> layerResult;
50 
51  //
52  // GoldenPatterns methods
53  //
54  GoldenPattern(const Key &aKey, const OMTFConfiguration *omtfConfig) : theKey(aKey), myOmtfConfig(omtfConfig) {}
55 
56  Key key() const { return theKey; }
57 
58  void setMeanDistPhi(const vector2D &aMeanDistPhi) { meanDistPhi = aMeanDistPhi; }
59 
60  const vector2D &getMeanDistPhi() const { return meanDistPhi; }
61 
62  const vector3D &getPdf() const { return pdfAllRef; }
63 
64  void setPdf(const vector3D &aPdf) { pdfAllRef = aPdf; }
65 
66  int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const { return meanDistPhi[iLayer][iRefLayer]; }
67 
68  int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const {
69  return pdfAllRef[iLayer][iRefLayer][iBin];
70  }
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, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits);
83 
85  void reset();
86 
91  void normalise(unsigned int nPdfAddrBits);
92 
96  int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer);
97 
99  bool hasCounts();
100 
101 private:
104 
110 
115 
119 
121 };
124 #endif
GoldenPattern::operator<<
friend std::ostream & operator<<(std::ostream &out, const GoldenPattern &aPattern)
Definition: GoldenPattern.cc:89
GoldenPattern::setMeanDistPhi
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:58
GoldenPattern::setPdf
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:64
OMTFConfigMaker
Definition: OMTFConfigMaker.h:17
Key::thePtCode
unsigned int thePtCode
Definition: GoldenPattern.h:35
GoldenPattern::meanDistPhi
vector2D meanDistPhi
Definition: GoldenPattern.h:114
GoldenPattern::addCount
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.
Definition: GoldenPattern.cc:50
GoldenPattern::propagateRefPhi
int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer)
Definition: GoldenPattern.cc:43
OMTFConfiguration
Definition: OMTFConfiguration.h:44
GoldenPattern::vector1D
std::vector< int > vector1D
Definition: GoldenPattern.h:46
GoldenPattern::getMeanDistPhi
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:60
GoldenPattern::hasCounts
bool hasCounts()
Check if the GP has any counts in any of referecne layers;.
Definition: GoldenPattern.cc:226
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
Key::Key
Key(int iEta=99, unsigned int iPt=0, int iCharge=0, unsigned int iNumber=999)
Definition: GoldenPattern.h:16
Key
Definition: GoldenPattern.h:15
Key::operator<
bool operator<(const Key &o) const
Definition: GoldenPattern.h:19
Key::theCharge
int theCharge
Definition: GoldenPattern.h:36
GoldenPattern::vector3D
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:48
OMTFProcessor
Definition: OMTFProcessor.h:19
GoldenPattern::pdfAllRef
vector3D pdfAllRef
Definition: GoldenPattern.h:109
GoldenPattern::process1Layer1RefLayer
GoldenPattern::layerResult process1Layer1RefLayer(unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
Definition: GoldenPattern.cc:13
GoldenPattern::pdfValue
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:68
GoldenPattern::theKey
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
Definition: GoldenPattern.h:103
GoldenPattern::GoldenPattern
GoldenPattern(const Key &aKey, const OMTFConfiguration *omtfConfig)
Definition: GoldenPattern.h:54
GoldenPattern::key
Key key() const
Definition: GoldenPattern.h:56
Key::operator<<
friend std::ostream & operator<<(std::ostream &out, const Key &o)
Definition: GoldenPattern.h:26
OMTFinput::vector1D
std::vector< int > vector1D
Definition: OMTFinput.h:13
GoldenPattern::myOmtfConfig
const OMTFConfiguration * myOmtfConfig
Definition: GoldenPattern.h:120
Key::theNumber
unsigned int theNumber
Definition: GoldenPattern.h:37
GoldenPattern::meanDistPhiCounts
vector2D meanDistPhiCounts
Definition: GoldenPattern.h:118
Key::theEtaCode
int theEtaCode
Definition: GoldenPattern.h:34
GoldenPattern
Definition: GoldenPattern.h:44
GoldenPattern::meanDistPhiValue
int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const
Definition: GoldenPattern.h:66
GoldenPattern::reset
void reset()
Reset contents of all data vectors, keeping the vectors size.
Definition: GoldenPattern.cc:136
GoldenPattern::layerResult
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:49
GoldenPattern::getPdf
const vector3D & getPdf() const
Definition: GoldenPattern.h:62
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
Key::operator==
bool operator==(const Key &o) const
Definition: GoldenPattern.h:21
GoldenPattern::normalise
void normalise(unsigned int nPdfAddrBits)
Definition: GoldenPattern.cc:152
OMTFinput.h
OMTFinput
Definition: OMTFinput.h:11
Key::number
unsigned int number() const
Definition: GoldenPattern.h:32
GoldenPattern::vector2D
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:47