CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Attributes | Friends
GoldenPattern Class Reference

#include <GoldenPattern.h>

Inheritance diagram for GoldenPattern:
GoldenPatternBase GoldenPatternWithThresh GoldenPatternWithStat

Public Types

typedef std::pair< int, bool > layerResult
 
typedef boost::multi_array
< short, 3 > 
meanDistPhiArrayType
 
typedef boost::multi_array
< PdfValueType, 3 > 
pdfArrayType
 
typedef std::vector< int > vector1D
 
typedef std::vector< vector1Dvector2D
 
typedef std::vector< vector2Dvector3D
 
- Public Types inherited from GoldenPatternBase
typedef boost::multi_array
< GoldenPatternResult, 2 > 
resultsArrayType
 
typedef std::vector< int > vector1D
 

Public Member Functions

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. More...
 
int getDistPhiBitShift (unsigned int iLayer, unsigned int iRefLayer) const override
 
virtual const
meanDistPhiArrayType
getMeanDistPhi () const
 
const vector2DgetMeanDistPhi () const
 
virtual const pdfArrayTypegetPdf () const
 
const vector3DgetPdf () const
 
 GoldenPattern (const Key &aKey, unsigned int nLayers, unsigned int nRefLayers, unsigned int nPdfAddrBits)
 
 GoldenPattern (const Key &aKey, const OMTFConfiguration *omtfConfig)
 
 GoldenPattern (const Key &aKey, const OMTFConfiguration *omtfConfig)
 
bool hasCounts ()
 Check if the GP has any counts in any of referecne layers;. More...
 
Key key () const
 
int meanDistPhiValue (unsigned int iLayer, unsigned int iRefLayer, int refLayerPhiB=0) const override
 
int meanDistPhiValue (unsigned int iLayer, unsigned int iRefLayer) const
 
void normalise (unsigned int nPdfAddrBits)
 
PdfValueType pdfValue (unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin, int refLayerPhiB=0) const override
 
int pdfValue (unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
 
GoldenPattern::layerResult process1Layer1RefLayer (unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
 
int propagateRefPhi (int phiRef, int etaRef, unsigned int iRefLayer) override
 
int propagateRefPhi (int phiRef, int etaRef, unsigned int iRefLayer)
 
virtual void reset ()
 Reset contents of all data vectors, keeping the vectors size. More...
 
void reset ()
 Reset contents of all data vectors, keeping the vectors size. More...
 
void setDistPhiBitShift (int value, unsigned int iLayer, unsigned int iRefLayer) override
 
virtual void setMeanDistPhi (const meanDistPhiArrayType &aMeanDistPhi)
 
void setMeanDistPhi (const vector2D &aMeanDistPhi)
 
void setMeanDistPhiValue (int value, unsigned int iLayer, unsigned int iRefLayer, unsigned int paramIndex=0) override
 
virtual void setPdf (pdfArrayType &aPdf)
 
void setPdf (const vector3D &aPdf)
 
void setPdfValue (PdfValueType value, unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin, int refLayerPhiB=0) override
 
 ~GoldenPattern () override
 
- Public Member Functions inherited from GoldenPatternBase
virtual void finalise (unsigned int procIndx)
 last step of the event processing, before sorting and ghost busting More...
 
const OMTFConfigurationgetConfig () const
 
resultsArrayTypegetResults ()
 
 GoldenPatternBase (const Key &aKey)
 
 GoldenPatternBase (const Key &aKey, const OMTFConfiguration *omtfConfig)
 
virtual Keykey ()
 
virtual StubResult process1Layer1RefLayer (unsigned int iRefLayer, unsigned int iLayer, MuonStubPtrs1D layerStubs, const MuonStubPtr refStub)
 
virtual void setConfig (const OMTFConfiguration *omtfConfig)
 
virtual ~GoldenPatternBase ()
 

Protected Attributes

boost::multi_array< short, 2 > distPhiBitShift
 
meanDistPhiArrayType meanDistPhi
 
pdfArrayType pdfAllRef
 
- Protected Attributes inherited from GoldenPatternBase
const OMTFConfigurationmyOmtfConfig
 
resultsArrayType results
 
Key theKey
 Pattern kinematic identification (iEta,iPt,iCharge) More...
 

Private Attributes

vector2D meanDistPhi
 
vector2D meanDistPhiCounts
 
const OMTFConfigurationmyOmtfConfig
 
vector3D pdfAllRef
 
Key theKey
 Pattern kinematical identification (iEta,iPt,iCharge) More...
 

Friends

std::ostream & operator<< (std::ostream &out, const GoldenPattern &aPattern)
 
std::ostream & operator<< (std::ostream &out, const GoldenPattern &aPattern)
 

Detailed Description

Definition at line 44 of file GoldenPattern.h.

Member Typedef Documentation

typedef std::pair<int, bool> GoldenPattern::layerResult

Definition at line 49 of file GoldenPattern.h.

typedef boost::multi_array<short, 3> GoldenPattern::meanDistPhiArrayType

Definition at line 18 of file GoldenPattern.h.

typedef boost::multi_array<PdfValueType, 3> GoldenPattern::pdfArrayType

Definition at line 17 of file GoldenPattern.h.

typedef std::vector<int> GoldenPattern::vector1D

Definition at line 46 of file GoldenPattern.h.

typedef std::vector<vector1D> GoldenPattern::vector2D

Definition at line 47 of file GoldenPattern.h.

typedef std::vector<vector2D> GoldenPattern::vector3D

Definition at line 48 of file GoldenPattern.h.

Constructor & Destructor Documentation

GoldenPattern::GoldenPattern ( const Key aKey,
const OMTFConfiguration omtfConfig 
)
inline

Definition at line 54 of file GoldenPattern.h.

54 : theKey(aKey), myOmtfConfig(omtfConfig) {}
const OMTFConfiguration * myOmtfConfig
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
GoldenPattern::GoldenPattern ( const Key aKey,
unsigned int  nLayers,
unsigned int  nRefLayers,
unsigned int  nPdfAddrBits 
)
inline

Definition at line 22 of file GoldenPattern.h.

References reset().

23  : GoldenPatternBase(aKey),
24  pdfAllRef(boost::extents[nLayers][nRefLayers][1 << nPdfAddrBits]),
25  meanDistPhi(boost::extents[nLayers][nRefLayers][2]),
26  distPhiBitShift(boost::extents[nLayers][nRefLayers]) {
27  reset();
28  }
boost::multi_array< short, 2 > distPhiBitShift
vector2D meanDistPhi
constexpr int nLayers
Definition: Config.h:73
vector3D pdfAllRef
GoldenPatternBase(const Key &aKey)
void reset()
Reset contents of all data vectors, keeping the vectors size.
GoldenPattern::GoldenPattern ( const Key aKey,
const OMTFConfiguration omtfConfig 
)
inline

Definition at line 30 of file GoldenPattern.h.

References reset().

31  : GoldenPatternBase(aKey, omtfConfig),
32  pdfAllRef(boost::extents[omtfConfig->nLayers()][omtfConfig->nRefLayers()][omtfConfig->nPdfBins()]),
33  meanDistPhi(boost::extents[omtfConfig->nLayers()][omtfConfig->nRefLayers()][2]),
34  distPhiBitShift(boost::extents[omtfConfig->nLayers()][omtfConfig->nRefLayers()]) {
35  reset();
36  }
unsigned int nRefLayers() const
unsigned int nLayers() const
boost::multi_array< short, 2 > distPhiBitShift
vector2D meanDistPhi
unsigned int nPdfBins() const
vector3D pdfAllRef
GoldenPatternBase(const Key &aKey)
void reset()
Reset contents of all data vectors, keeping the vectors size.
GoldenPattern::~GoldenPattern ( )
inlineoverride

Definition at line 38 of file GoldenPattern.h.

38 {};

Member Function Documentation

void GoldenPattern::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.

For making the patterns take events with a single hit in each layer

Shift phiDist so it is in +-Pi range

Shift phidist, so 0 is at the middle of the range

Check if phiDist is within pdf range in -64 +63 U2 code Find more elegant way to check this.

Definition at line 50 of file GoldenPattern.cc.

References funct::abs(), OMTFConfiguration::getRefToLogicNumber(), meanDistPhiCounts, myOmtfConfig, OMTFConfiguration::nPdfAddrBits(), OMTFConfiguration::nPhiBins(), and pdfAllRef.

53  {
54  int nHitsInLayer = 0;
55  int phiDist = exp2(myOmtfConfig->nPdfAddrBits());
56  for (auto itHit : layerHits) {
57  if (itHit >= (int)myOmtfConfig->nPhiBins())
58  continue;
59  if (abs(itHit - phiRefHit) < phiDist)
60  phiDist = itHit - phiRefHit;
61  ++nHitsInLayer;
62  }
64  if (nHitsInLayer > 1 || nHitsInLayer == 0)
65  return;
66 
68  if (phiDist >= (int)myOmtfConfig->nPhiBins() / 2)
69  phiDist -= (int)myOmtfConfig->nPhiBins();
70  if (phiDist <= -(int)myOmtfConfig->nPhiBins() / 2)
71  phiDist += (int)myOmtfConfig->nPhiBins();
72 
74  int phiDistShift = phiDist + exp2(myOmtfConfig->nPdfAddrBits() - 1);
75 
79  if (phiDistShift < 0 || phiDistShift > exp2(myOmtfConfig->nPdfAddrBits()) - 1) {
80  return;
81  }
82 
83  if ((int)iLayer == myOmtfConfig->getRefToLogicNumber()[iRefLayer])
84  ++meanDistPhiCounts[iLayer][iRefLayer];
85  ++pdfAllRef[iLayer][iRefLayer][phiDistShift];
86 }
vector2D meanDistPhiCounts
unsigned int nPhiBins() const
const OMTFConfiguration * myOmtfConfig
unsigned int nPdfAddrBits() const
vector3D pdfAllRef
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::vector< int > & getRefToLogicNumber() const
int GoldenPattern::getDistPhiBitShift ( unsigned int  iLayer,
unsigned int  iRefLayer 
) const
inlineoverridevirtual

Implements GoldenPatternBase.

Definition at line 72 of file GoldenPattern.h.

References distPhiBitShift.

Referenced by XMLConfigWriter::writeGPData().

72  {
73  return distPhiBitShift[iLayer][iRefLayer];
74  }
boost::multi_array< short, 2 > distPhiBitShift
virtual const meanDistPhiArrayType& GoldenPattern::getMeanDistPhi ( ) const
inlinevirtual

Definition at line 42 of file GoldenPattern.h.

References meanDistPhi.

42 { return meanDistPhi; }
vector2D meanDistPhi
const vector2D& GoldenPattern::getMeanDistPhi ( ) const
inline

Definition at line 60 of file GoldenPattern.h.

References meanDistPhi.

Referenced by OMTFProcessor< GoldenPatternType >::averagePatterns(), and XMLConfigWriter::writeGPData().

60 { return meanDistPhi; }
vector2D meanDistPhi
virtual const pdfArrayType& GoldenPattern::getPdf ( ) const
inlinevirtual

Definition at line 44 of file GoldenPattern.h.

References pdfAllRef.

44 { return pdfAllRef; }
vector3D pdfAllRef
const vector3D& GoldenPattern::getPdf ( ) const
inline

Definition at line 62 of file GoldenPattern.h.

References pdfAllRef.

Referenced by OMTFProcessor< GoldenPatternType >::shiftGP().

62 { return pdfAllRef; }
vector3D pdfAllRef
bool GoldenPattern::hasCounts ( )

Check if the GP has any counts in any of referecne layers;.

Definition at line 226 of file GoldenPattern.cc.

References meanDistPhi, and meanDistPhiCounts.

226  {
227  for (unsigned int iRefLayer = 0; iRefLayer < meanDistPhi[0].size(); ++iRefLayer) {
228  for (unsigned int iLayer = 0; iLayer < meanDistPhi.size(); ++iLayer) {
229  if (!meanDistPhiCounts.empty() && meanDistPhiCounts[iLayer][iRefLayer])
230  return true;
231  }
232  }
233  return false;
234 }
vector2D meanDistPhiCounts
vector2D meanDistPhi
Key GoldenPattern::key ( ) const
inline

Definition at line 56 of file GoldenPattern.h.

References theKey.

Referenced by OMTFProcessor< GoldenPatternType >::addGP(), PatternOptimizerBase::observeEventEnd(), XMLConfigWriter::writeGPData(), and OMTFPatternMaker::writeMergedGPs().

56 { return theKey; }
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
int GoldenPattern::meanDistPhiValue ( unsigned int  iLayer,
unsigned int  iRefLayer,
int  refLayerPhiB = 0 
) const
overridevirtual

Implements GoldenPatternBase.

Definition at line 9 of file GoldenPattern.cc.

References meanDistPhi, myOmtfConfig, and OMTFConfiguration::nPdfAddrBits().

9  {
10  //return meanDistPhi[iLayer][iRefLayer][0];
11  return (((meanDistPhi[iLayer][iRefLayer][1] * refLayerPhiB) >> myOmtfConfig->nPdfAddrBits()) +
12  meanDistPhi[iLayer][iRefLayer][0]);
13  //assumes that the meanDistPhi[1] is float alpha from the fit to the phiB-phi distribution multiplied by 2^myOmtfConfig->nPdfAddrBits()
14 }
const OMTFConfiguration * myOmtfConfig
vector2D meanDistPhi
unsigned int nPdfAddrBits() const
int GoldenPattern::meanDistPhiValue ( unsigned int  iLayer,
unsigned int  iRefLayer 
) const
inline

Definition at line 66 of file GoldenPattern.h.

References meanDistPhi.

Referenced by PatternGenerator::updateStat(), and XMLConfigWriter::writeGPData().

66 { return meanDistPhi[iLayer][iRefLayer]; }
vector2D meanDistPhi
void GoldenPattern::normalise ( unsigned int  nPdfAddrBits)

Normalise event counts in mean dist phi, and pdf vectors to get the real values of meand dist phi and probability. The pdf width is passed to this method, since the width stored in configuration is extended during the pattern making phase.

Mean dist phi

Probabilities. Normalise and change from float to integer values

If there are only a few counts in given measurement layer, set pdf value to 0

Digitisation Values remapped 0->std::pow(2,nPdfValBits) minPlog->0

Make sure digitised value is saved using nBitsVal bits

Shift pdf index by meanDistPhi

Definition at line 152 of file GoldenPattern.cc.

References OMTFConfiguration::getRefToLogicNumber(), log, meanDistPhi, meanDistPhiCounts, OMTFConfiguration::minPdfVal(), myOmtfConfig, OMTFConfiguration::nPdfAddrBits(), OMTFConfiguration::nPdfValBits(), pdfAllRef, and funct::pow().

152  {
153  for (unsigned int iRefLayer = 0; iRefLayer < pdfAllRef[0].size(); ++iRefLayer) {
154  for (unsigned int iLayer = 0; iLayer < pdfAllRef.size(); ++iLayer) {
155  for (unsigned int iPdf = 0; iPdf < pdfAllRef[iLayer][iRefLayer].size(); ++iPdf) {
156  float pVal = log((float)pdfAllRef[iLayer][iRefLayer][iPdf] /
157  meanDistPhiCounts[myOmtfConfig->getRefToLogicNumber()[iRefLayer]][iRefLayer]);
158  if (pVal < log(myOmtfConfig->minPdfVal()))
159  continue;
160  meanDistPhi[iLayer][iRefLayer] +=
161  (iPdf - exp2(myOmtfConfig->nPdfAddrBits() - 1)) * pdfAllRef[iLayer][iRefLayer][iPdf];
162  if ((int)iLayer != myOmtfConfig->getRefToLogicNumber()[iRefLayer])
163  meanDistPhiCounts[iLayer][iRefLayer] += pdfAllRef[iLayer][iRefLayer][iPdf];
164  }
165  }
166  }
167 
169  for (unsigned int iRefLayer = 0; iRefLayer < meanDistPhi[0].size(); ++iRefLayer) {
170  for (unsigned int iLayer = 0; iLayer < meanDistPhi.size(); ++iLayer) {
171  if (!meanDistPhiCounts.empty() && meanDistPhiCounts[iLayer][iRefLayer]) {
172  if (meanDistPhiCounts[iLayer][iRefLayer] < 1000)
173  meanDistPhi[iLayer][iRefLayer] = 0;
174  else
175  meanDistPhi[iLayer][iRefLayer] =
176  rint((float)meanDistPhi[iLayer][iRefLayer] / meanDistPhiCounts[iLayer][iRefLayer]);
177  }
178  }
179  }
180  const float minPlog = log(myOmtfConfig->minPdfVal());
181  const unsigned int nPdfValBits = myOmtfConfig->nPdfValBits();
183  float pVal;
184  int digitisedVal, truncatedValue;
185  for (unsigned int iRefLayer = 0; iRefLayer < pdfAllRef[0].size(); ++iRefLayer) {
186  for (unsigned int iLayer = 0; iLayer < pdfAllRef.size(); ++iLayer) {
187  for (unsigned int iPdf = 0; iPdf < pdfAllRef[iLayer][iRefLayer].size(); ++iPdf) {
188  if (!meanDistPhiCounts[myOmtfConfig->getRefToLogicNumber()[iRefLayer]][iRefLayer] ||
189  !pdfAllRef[iLayer][iRefLayer][iPdf])
190  continue;
191  pVal = log((float)pdfAllRef[iLayer][iRefLayer][iPdf] /
192  meanDistPhiCounts[myOmtfConfig->getRefToLogicNumber()[iRefLayer]][iRefLayer]);
194  if ((pVal < minPlog || meanDistPhiCounts[iLayer][iRefLayer] < 1000)) {
195  pdfAllRef[iLayer][iRefLayer][iPdf] = 0;
196  continue;
197  }
201  digitisedVal = rint((std::pow(2, nPdfValBits) - 1) - (pVal / minPlog) * (std::pow(2, nPdfValBits) - 1));
203  truncatedValue = 0 | (digitisedVal & ((int)pow(2, nPdfValBits) - 1));
204  pdfAllRef[iLayer][iRefLayer][iPdf] = truncatedValue;
205  }
206  }
207  }
208 
209  vector3D pdfAllRefTmp = pdfAllRef;
210  for (unsigned int iRefLayer = 0; iRefLayer < pdfAllRef[0].size(); ++iRefLayer) {
211  for (unsigned int iLayer = 0; iLayer < pdfAllRef.size(); ++iLayer) {
212  for (unsigned int iPdf = 0; iPdf < pdfAllRef[iLayer][iRefLayer].size(); ++iPdf) {
213  pdfAllRef[iLayer][iRefLayer][iPdf] = 0;
215  int index =
216  iPdf - exp2(myOmtfConfig->nPdfAddrBits() - 1) - meanDistPhi[iLayer][iRefLayer] + exp2(nPdfAddrBits - 1);
217  if (index < 0 || index > exp2(nPdfAddrBits) - 1)
218  continue;
219  pdfAllRef[iLayer][iRefLayer][index] = pdfAllRefTmp[iLayer][iRefLayer][iPdf];
220  }
221  }
222  }
223 }
static std::vector< std::string > checklist log
vector2D meanDistPhiCounts
const OMTFConfiguration * myOmtfConfig
vector2D meanDistPhi
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:48
unsigned int nPdfAddrBits() const
vector3D pdfAllRef
float minPdfVal() const
const std::vector< int > & getRefToLogicNumber() const
unsigned int nPdfValBits() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
PdfValueType GoldenPattern::pdfValue ( unsigned int  iLayer,
unsigned int  iRefLayer,
unsigned int  iBin,
int  refLayerPhiB = 0 
) const
inlineoverridevirtual

Implements GoldenPatternBase.

Definition at line 50 of file GoldenPattern.h.

References pdfAllRef.

53  {
54  return pdfAllRef[iLayer][iRefLayer][iBin];
55  }
vector3D pdfAllRef
int GoldenPattern::pdfValue ( unsigned int  iLayer,
unsigned int  iRefLayer,
unsigned int  iBin 
) const
inline

Definition at line 68 of file GoldenPattern.h.

References pdfAllRef.

Referenced by OMTFProcessor< GoldenPatternType >::shiftGP(), and XMLConfigWriter::writeGPData().

68  {
69  return pdfAllRef[iLayer][iRefLayer][iBin];
70  }
vector3D pdfAllRef
GoldenPattern::layerResult GoldenPattern::process1Layer1RefLayer ( unsigned int  iRefLayer,
unsigned int  iLayer,
const int  refPhi,
const OMTFinput::vector1D layerHits 
)

Process single measurement layer with a single ref layer Method should be thread safe

Select hit closest to the mean of probability distribution in given layer

Check if phiDist is within pdf range -63 +63

Shift phidist, so 0 is at the middle of the range

Definition at line 13 of file GoldenPattern.cc.

References funct::abs(), meanDistPhi, myOmtfConfig, OMTFConfiguration::nPdfAddrBits(), OMTFConfiguration::nPhiBins(), and pdfAllRef.

16  {
18 
19  int phiMean = meanDistPhi[iLayer][iRefLayer];
20  int phiDist = exp2(myOmtfConfig->nPdfAddrBits());
23  for (auto itHit : layerHits) {
24  if (itHit >= (int)myOmtfConfig->nPhiBins())
25  continue;
26  if (abs(itHit - phiMean - phiRefHit) < abs(phiDist))
27  phiDist = itHit - phiMean - phiRefHit;
28  }
29 
31  if (abs(phiDist) > (exp2(myOmtfConfig->nPdfAddrBits() - 1) - 1))
32  return aResult;
33 
35  phiDist += exp2(myOmtfConfig->nPdfAddrBits() - 1);
36 
37  int pdfVal = pdfAllRef[iLayer][iRefLayer][phiDist];
38 
39  return GoldenPattern::layerResult(pdfVal, pdfVal > 0);
40 }
unsigned int nPhiBins() const
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:49
const OMTFConfiguration * myOmtfConfig
vector2D meanDistPhi
unsigned int nPdfAddrBits() const
vector3D pdfAllRef
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int GoldenPattern::propagateRefPhi ( int  phiRef,
int  etaRef,
unsigned int  iRefLayer 
)
overridevirtual

Propagate phi from given reference layer to MB2 or ME2 expressed in integer MicroGMT scale: 1.1/2.61*240 = 101

Implements GoldenPatternBase.

int GoldenPattern::propagateRefPhi ( int  phiRef,
int  etaRef,
unsigned int  iRefLayer 
)
virtual

Propagate phi from given reference layer to MB2 or ME2 ME2 is used if eta of reference hit is larger than 1.1 expressed in ingerer MicroGMT scale: 1.1/2.61*240 = 101

Implements GoldenPatternBase.

Definition at line 43 of file GoldenPattern.cc.

References meanDistPhi.

43  {
44  unsigned int iLayer = 2; //MB2
45  //if(etaRef>101) iLayer = 7;//RE2
46  return phiRef + meanDistPhi[iLayer][iRefLayer];
47 }
vector2D meanDistPhi
virtual void GoldenPattern::reset ( )
virtual

Reset contents of all data vectors, keeping the vectors size.

void GoldenPattern::reset ( void  )

Reset contents of all data vectors, keeping the vectors size.

Definition at line 136 of file GoldenPattern.cc.

References meanDistPhi, meanDistPhiCounts, myOmtfConfig, OMTFConfiguration::nLayers(), OMTFConfiguration::nPdfAddrBits(), OMTFConfiguration::nRefLayers(), and pdfAllRef.

Referenced by OMTFPatternMaker::endJob(), GoldenPattern(), and OMTFPatternMaker::writeMergedGPs().

136  {
138  GoldenPattern::vector2D meanDistPhi2D(myOmtfConfig->nLayers());
139  meanDistPhi2D.assign(myOmtfConfig->nLayers(), meanDistPhi1D);
140  meanDistPhi = meanDistPhi2D;
141  meanDistPhiCounts = meanDistPhi2D;
142 
146 
147  pdf2D.assign(myOmtfConfig->nRefLayers(), pdf1D);
148  pdfAllRef.assign(myOmtfConfig->nLayers(), pdf2D);
149 }
unsigned int nRefLayers() const
vector2D meanDistPhiCounts
std::vector< int > vector1D
Definition: GoldenPattern.h:46
unsigned int nLayers() const
const OMTFConfiguration * myOmtfConfig
vector2D meanDistPhi
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:47
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:48
unsigned int nPdfAddrBits() const
vector3D pdfAllRef
void GoldenPattern::setDistPhiBitShift ( int  value,
unsigned int  iLayer,
unsigned int  iRefLayer 
)
inlineoverridevirtual

Implements GoldenPatternBase.

Definition at line 76 of file GoldenPattern.h.

References distPhiBitShift, and relativeConstraints::value.

76  {
77  distPhiBitShift[iLayer][iRefLayer] = value;
78  }
boost::multi_array< short, 2 > distPhiBitShift
virtual void GoldenPattern::setMeanDistPhi ( const meanDistPhiArrayType aMeanDistPhi)
inlinevirtual

Definition at line 40 of file GoldenPattern.h.

References meanDistPhi.

40 { meanDistPhi = aMeanDistPhi; }
vector2D meanDistPhi
void GoldenPattern::setMeanDistPhi ( const vector2D aMeanDistPhi)
inline

Definition at line 58 of file GoldenPattern.h.

References meanDistPhi.

Referenced by OMTFProcessor< GoldenPatternType >::averagePatterns(), and OMTFProcessor< GoldenPatternType >::configure().

58 { meanDistPhi = aMeanDistPhi; }
vector2D meanDistPhi
void GoldenPattern::setMeanDistPhiValue ( int  value,
unsigned int  iLayer,
unsigned int  iRefLayer,
unsigned int  paramIndex = 0 
)
inlineoverridevirtual

Implements GoldenPatternBase.

Definition at line 57 of file GoldenPattern.h.

References meanDistPhi, and relativeConstraints::value.

60  {
61  meanDistPhi[iLayer][iRefLayer][paramIndex] = value;
62  }
vector2D meanDistPhi
virtual void GoldenPattern::setPdf ( pdfArrayType aPdf)
inlinevirtual

Definition at line 46 of file GoldenPattern.h.

References pdfAllRef.

46 { pdfAllRef = aPdf; }
vector3D pdfAllRef
void GoldenPattern::setPdf ( const vector3D aPdf)
inline

Definition at line 64 of file GoldenPattern.h.

References pdfAllRef.

Referenced by OMTFProcessor< GoldenPatternType >::configure(), and OMTFProcessor< GoldenPatternType >::shiftGP().

64 { pdfAllRef = aPdf; }
vector3D pdfAllRef
void GoldenPattern::setPdfValue ( PdfValueType  value,
unsigned int  iLayer,
unsigned int  iRefLayer,
unsigned int  iBin,
int  refLayerPhiB = 0 
)
inlineoverridevirtual

Implements GoldenPatternBase.

Definition at line 64 of file GoldenPattern.h.

References pdfAllRef, and relativeConstraints::value.

68  {
69  pdfAllRef[iLayer][iRefLayer][iBin] = value;
70  }
vector3D pdfAllRef

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const GoldenPattern aPattern 
)
friend

Definition at line 89 of file GoldenPattern.cc.

89  {
90  out << "GoldenPattern " << aPattern.theKey << std::endl;
91  out << "Number of reference layers: " << aPattern.meanDistPhi[0].size()
92  << ", number of measurement layers: " << aPattern.pdfAllRef.size() << std::endl;
93 
94  if (aPattern.meanDistPhi.empty())
95  return out;
96  if (aPattern.pdfAllRef.empty())
97  return out;
98 
99  out << "Mean dist phi per layer:" << std::endl;
100  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.meanDistPhi[0].size(); ++iRefLayer) {
101  out << "Ref layer: " << iRefLayer << " (";
102  for (unsigned int iLayer = 0; iLayer < aPattern.meanDistPhi.size(); ++iLayer) {
103  out << std::setw(3) << aPattern.meanDistPhi[iLayer][iRefLayer] << "\t";
104  }
105  out << ")" << std::endl;
106  }
107 
108  if (!aPattern.meanDistPhiCounts.empty()) {
109  out << "Counts number per layer:" << std::endl;
110  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.meanDistPhi[0].size(); ++iRefLayer) {
111  out << "Ref layer: " << iRefLayer << " (";
112  for (unsigned int iLayer = 0; iLayer < aPattern.meanDistPhi.size(); ++iLayer) {
113  out << aPattern.meanDistPhiCounts[iLayer][iRefLayer] << "\t";
114  }
115  out << ")" << std::endl;
116  }
117  }
118 
119  unsigned int nPdfAddrBits = 7;
120  out << "PDF per layer:" << std::endl;
121  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.pdfAllRef[0].size(); ++iRefLayer) {
122  out << "Ref layer: " << iRefLayer;
123  for (unsigned int iLayer = 0; iLayer < aPattern.pdfAllRef.size(); ++iLayer) {
124  out << ", measurement layer: " << iLayer << std::endl;
125  for (unsigned int iPdf = 0; iPdf < exp2(nPdfAddrBits); ++iPdf) {
126  out << std::setw(2) << aPattern.pdfAllRef[iLayer][iRefLayer][iPdf] << " ";
127  }
128  out << std::endl;
129  }
130  }
131 
132  return out;
133 }
vector2D meanDistPhiCounts
vector2D meanDistPhi
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
vector3D pdfAllRef
std::ostream& operator<< ( std::ostream &  out,
const GoldenPattern aPattern 
)
friend

Definition at line 89 of file GoldenPattern.cc.

89  {
90  out << "GoldenPattern " << aPattern.theKey << std::endl;
91  out << "Number of reference layers: " << aPattern.meanDistPhi[0].size()
92  << ", number of measurement layers: " << aPattern.pdfAllRef.size() << std::endl;
93 
94  if (aPattern.meanDistPhi.empty())
95  return out;
96  if (aPattern.pdfAllRef.empty())
97  return out;
98 
99  out << "Mean dist phi per layer:" << std::endl;
100  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.meanDistPhi[0].size(); ++iRefLayer) {
101  out << "Ref layer: " << iRefLayer << " (";
102  for (unsigned int iLayer = 0; iLayer < aPattern.meanDistPhi.size(); ++iLayer) {
103  out << std::setw(3) << aPattern.meanDistPhi[iLayer][iRefLayer] << "\t";
104  }
105  out << ")" << std::endl;
106  }
107 
108  if (!aPattern.meanDistPhiCounts.empty()) {
109  out << "Counts number per layer:" << std::endl;
110  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.meanDistPhi[0].size(); ++iRefLayer) {
111  out << "Ref layer: " << iRefLayer << " (";
112  for (unsigned int iLayer = 0; iLayer < aPattern.meanDistPhi.size(); ++iLayer) {
113  out << aPattern.meanDistPhiCounts[iLayer][iRefLayer] << "\t";
114  }
115  out << ")" << std::endl;
116  }
117  }
118 
119  unsigned int nPdfAddrBits = 7;
120  out << "PDF per layer:" << std::endl;
121  for (unsigned int iRefLayer = 0; iRefLayer < aPattern.pdfAllRef[0].size(); ++iRefLayer) {
122  out << "Ref layer: " << iRefLayer;
123  for (unsigned int iLayer = 0; iLayer < aPattern.pdfAllRef.size(); ++iLayer) {
124  out << ", measurement layer: " << iLayer << std::endl;
125  for (unsigned int iPdf = 0; iPdf < exp2(nPdfAddrBits); ++iPdf) {
126  out << std::setw(2) << aPattern.pdfAllRef[iLayer][iRefLayer][iPdf] << " ";
127  }
128  out << std::endl;
129  }
130  }
131 
132  return out;
133 }
vector2D meanDistPhiCounts
vector2D meanDistPhi
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
vector3D pdfAllRef

Member Data Documentation

boost::multi_array<short, 2> GoldenPattern::distPhiBitShift
protected

distPhi resolution can be reduced to reduce the number of bit on the LUT input distPhi = distPhi<<distPhiBitShift[layer]refLayer First index: measurement layer number Second index: refLayer number

Definition at line 106 of file GoldenPattern.h.

Referenced by getDistPhiBitShift(), and setDistPhiBitShift().

meanDistPhiArrayType GoldenPattern::meanDistPhi
protected

Mean positions in each layer First index: measurement layer number Second index: refLayer number Third index: index = 0 - a0, index = 1 - a1 for the linear fit meanDistPhi = a0 + a1 * phi_b

Definition at line 100 of file GoldenPattern.h.

vector2D GoldenPattern::meanDistPhi
private

Mean positions in each layer First index: measurement layer number Second index: refLayer number

Definition at line 114 of file GoldenPattern.h.

Referenced by getMeanDistPhi(), hasCounts(), meanDistPhiValue(), normalise(), operator<<(), process1Layer1RefLayer(), propagateRefPhi(), reset(), setMeanDistPhi(), and setMeanDistPhiValue().

vector2D GoldenPattern::meanDistPhiCounts
private

Vector holding number of counts. Used for making the patterns

Definition at line 118 of file GoldenPattern.h.

Referenced by addCount(), hasCounts(), normalise(), operator<<(), and reset().

const OMTFConfiguration* GoldenPattern::myOmtfConfig
private

Definition at line 120 of file GoldenPattern.h.

Referenced by addCount(), meanDistPhiValue(), normalise(), process1Layer1RefLayer(), and reset().

pdfArrayType GoldenPattern::pdfAllRef
protected

Distributions for all reference layers First index: measurement layer number Second index: refLayer number Third index: pdf bin number within layer

Definition at line 94 of file GoldenPattern.h.

vector3D GoldenPattern::pdfAllRef
private

Distributions for all reference layers First index: measurement layer number Second index: refLayer number Third index: pdf bin number within layer

Definition at line 109 of file GoldenPattern.h.

Referenced by addCount(), getPdf(), GoldenPatternWithStat::iniStatisitics(), normalise(), operator<<(), pdfValue(), process1Layer1RefLayer(), reset(), setPdf(), and setPdfValue().

Key GoldenPattern::theKey
private

Pattern kinematical identification (iEta,iPt,iCharge)

Definition at line 103 of file GoldenPattern.h.

Referenced by key(), operator<<(), GoldenPatternWithStat::setKeyNumber(), and GoldenPatternWithStat::setKeyPt().