CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes | Friends
OMTFResult Class Reference

#include <OMTFResult.h>

Public Types

typedef std::vector< unsigned int > vector1D
 
typedef std::vector< vector1Dvector2D
 

Public Member Functions

void addResult (unsigned int iRefLayer, unsigned int iLayer, unsigned int val, int iRefPhi, int iRefEta)
 
void clear ()
 
void configure (const OMTFConfiguration *omtfConfig)
 
bool empty () const
 
void finalise ()
 
const OMTFResult::vector1DgetHitsWord () const
 
const OMTFResult::vector1DgetRefEtas () const
 
const OMTFResult::vector1DgetRefPhiRHits () const
 
const OMTFResult::vector1DgetRefPhis () const
 
const OMTFResult::vector2DgetResults () const
 
const OMTFResult::vector1DgetSummaryHits () const
 
const OMTFResult::vector1DgetSummaryVals () const
 
 OMTFResult ()
 
void setRefPhiRHits (unsigned int iRefLayer, int iRefPhiRHit)
 

Private Attributes

vector1D hits1D
 Number of hits for each reference layer. More...
 
vector1D hitsBits
 Words representing nimber of hit layers for each reference layer. More...
 
const OMTFConfigurationmyOmtfConfig
 
vector1D refEta1D
 Reference phi for each reference layer. More...
 
vector1D refPhi1D
 Reference phi for each reference layer. More...
 
vector1D refPhiRHit1D
 Reference phi for each reference layer - the input value. More...
 
vector2D results
 
vector1D results1D
 Sum of pdf weights for each reference layer. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const OMTFResult &aResult)
 

Detailed Description

Definition at line 9 of file OMTFResult.h.

Member Typedef Documentation

◆ vector1D

typedef std::vector<unsigned int> OMTFResult::vector1D

Definition at line 11 of file OMTFResult.h.

◆ vector2D

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

Definition at line 12 of file OMTFResult.h.

Constructor & Destructor Documentation

◆ OMTFResult()

OMTFResult::OMTFResult ( )
inline

Definition at line 14 of file OMTFResult.h.

14 {};

Member Function Documentation

◆ addResult()

void OMTFResult::addResult ( unsigned int  iRefLayer,
unsigned int  iLayer,
unsigned int  val,
int  iRefPhi,
int  iRefEta 
)

Definition at line 22 of file OMTFResult.cc.

References refEta1D, refPhi1D, results, and heppy_batch::val.

22  {
23  refPhi1D[iRefLayer] = iRefPhi;
24  refEta1D[iRefLayer] = iRefEta;
25  results[iLayer][iRefLayer] = val;
26 }
vector2D results
Definition: OMTFResult.h:48
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:51
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:54

◆ clear()

void OMTFResult::clear ( void  )

Definition at line 29 of file OMTFResult.cc.

References hits1D, hitsBits, myOmtfConfig, OMTFConfiguration::nLayers(), OMTFConfiguration::nRefLayers(), refEta1D, refPhi1D, refPhiRHit1D, results, and results1D.

Referenced by configure().

29  {
30  results1D.assign(myOmtfConfig->nRefLayers(), 0);
31  hits1D.assign(myOmtfConfig->nRefLayers(), 0);
33  refPhi1D.assign(myOmtfConfig->nRefLayers(), 1024);
34  refEta1D.assign(myOmtfConfig->nRefLayers(), 1024);
35  hitsBits.assign(myOmtfConfig->nRefLayers(), 0);
36  refPhiRHit1D.assign(myOmtfConfig->nRefLayers(), 1024);
37 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:68
vector2D results
Definition: OMTFResult.h:48
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:57
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:66
unsigned int nLayers() const
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:51
unsigned int nRefLayers() const
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:54
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:63

◆ configure()

void OMTFResult::configure ( const OMTFConfiguration omtfConfig)

Definition at line 10 of file OMTFResult.cc.

References clear(), and myOmtfConfig.

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

10  {
11  myOmtfConfig = omtfConfig;
12 
13  clear();
14 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:68
void clear()
Definition: OMTFResult.cc:29

◆ empty()

bool OMTFResult::empty ( void  ) const

Definition at line 61 of file OMTFResult.cc.

References hits1D, myOmtfConfig, nHits, and OMTFConfiguration::nRefLayers().

61  {
62  unsigned int nHits = 0;
63  for (unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
64  nHits += hits1D[iRefLayer];
65  }
66  return (nHits == 0);
67 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:68
unsigned int nRefLayers() const
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits

◆ finalise()

void OMTFResult::finalise ( )

If connected layer (POS or BEND) has not been fired, ignore this layer also

Do not count bending layers in hit count

Definition at line 40 of file OMTFResult.cc.

References OMTFConfiguration::fwVersion(), OMTFConfiguration::getBendingLayers(), OMTFConfiguration::getLogicToLogic(), hits1D, hitsBits, myOmtfConfig, conifer::pow(), results, results1D, and heppy_batch::val.

40  {
41  for (unsigned int iLogicLayer = 0; iLogicLayer < results.size(); ++iLogicLayer) {
42  unsigned int connectedLayer = myOmtfConfig->getLogicToLogic().at(iLogicLayer);
43  for (unsigned int iRefLayer = 0; iRefLayer < results[iLogicLayer].size(); ++iRefLayer) {
45  unsigned int val = results[connectedLayer][iRefLayer] > 0 ? results[iLogicLayer][iRefLayer] : 0;
46  results1D[iRefLayer] += val;
47  hitsBits[iRefLayer] += (val > 0) * std::pow(2, iLogicLayer);
48 
49  if (myOmtfConfig->fwVersion() <= 4) {
51  if (!myOmtfConfig->getBendingLayers().count(iLogicLayer))
52  hits1D[iRefLayer] += (val > 0);
53  } else {
54  hits1D[iRefLayer] += (val > 0);
55  }
56  }
57  }
58 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:68
constexpr int pow(int x)
Definition: conifer.h:24
vector2D results
Definition: OMTFResult.h:48
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:57
unsigned int fwVersion() const
const std::map< int, int > & getLogicToLogic() const
const std::set< int > & getBendingLayers() const
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:63

◆ getHitsWord()

const OMTFResult::vector1D& OMTFResult::getHitsWord ( ) const
inline

Definition at line 28 of file OMTFResult.h.

References hitsBits.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

28 { return hitsBits; }
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:63

◆ getRefEtas()

const OMTFResult::vector1D& OMTFResult::getRefEtas ( ) const
inline

Definition at line 26 of file OMTFResult.h.

References refEta1D.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

26 { return refEta1D; }
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:54

◆ getRefPhiRHits()

const OMTFResult::vector1D& OMTFResult::getRefPhiRHits ( ) const
inline

Definition at line 30 of file OMTFResult.h.

References refPhiRHit1D.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

30 { return refPhiRHit1D; }
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:66

◆ getRefPhis()

const OMTFResult::vector1D& OMTFResult::getRefPhis ( ) const
inline

Definition at line 24 of file OMTFResult.h.

References refPhi1D.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

24 { return refPhi1D; }
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:51

◆ getResults()

const OMTFResult::vector2D& OMTFResult::getResults ( ) const
inline

Definition at line 18 of file OMTFResult.h.

References results.

Referenced by XMLConfigWriter::writeResultsData().

18 { return results; }
vector2D results
Definition: OMTFResult.h:48

◆ getSummaryHits()

const OMTFResult::vector1D& OMTFResult::getSummaryHits ( ) const
inline

Definition at line 22 of file OMTFResult.h.

References hits1D.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

22 { return hits1D; }
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60

◆ getSummaryVals()

const OMTFResult::vector1D& OMTFResult::getSummaryVals ( ) const
inline

Definition at line 20 of file OMTFResult.h.

References results1D.

Referenced by OMTFSorter< GoldenPatternType >::sortSingleResult().

20 { return results1D; }
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:57

◆ setRefPhiRHits()

void OMTFResult::setRefPhiRHits ( unsigned int  iRefLayer,
int  iRefPhiRHit 
)

Definition at line 18 of file OMTFResult.cc.

References refPhiRHit1D.

18 { refPhiRHit1D[iRefLayer] = iRefPhiRHit; }
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:66

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const OMTFResult aResult 
)
friend

Definition at line 70 of file OMTFResult.cc.

70  {
71  for (unsigned int iLogicLayer = 0; iLogicLayer < aResult.results.size(); ++iLogicLayer) {
72  out << "Logic layer: " << iLogicLayer << " results: ";
73  for (unsigned int iRefLayer = 0; iRefLayer < aResult.results[iLogicLayer].size(); ++iRefLayer) {
74  out << aResult.results[iLogicLayer][iRefLayer] << "\t";
75  }
76  out << std::endl;
77  }
78 
79  out << " Sum over layers: ";
80  for (unsigned int iRefLayer = 0; iRefLayer < aResult.results1D.size(); ++iRefLayer) {
81  out << aResult.results1D[iRefLayer] << "\t";
82  }
83 
84  out << std::endl;
85 
86  out << " Number of hits: ";
87  for (unsigned int iRefLayer = 0; iRefLayer < aResult.hits1D.size(); ++iRefLayer) {
88  out << aResult.hits1D[iRefLayer] << "\t";
89  }
90 
91  return out;
92 }
vector2D results
Definition: OMTFResult.h:48
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:57
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60

Member Data Documentation

◆ hits1D

vector1D OMTFResult::hits1D
private

Number of hits for each reference layer.

Definition at line 60 of file OMTFResult.h.

Referenced by clear(), empty(), finalise(), getSummaryHits(), and operator<<().

◆ hitsBits

vector1D OMTFResult::hitsBits
private

Words representing nimber of hit layers for each reference layer.

Definition at line 63 of file OMTFResult.h.

Referenced by clear(), finalise(), and getHitsWord().

◆ myOmtfConfig

const OMTFConfiguration* OMTFResult::myOmtfConfig
private

Definition at line 68 of file OMTFResult.h.

Referenced by clear(), configure(), empty(), and finalise().

◆ refEta1D

vector1D OMTFResult::refEta1D
private

Reference phi for each reference layer.

Definition at line 54 of file OMTFResult.h.

Referenced by addResult(), clear(), and getRefEtas().

◆ refPhi1D

vector1D OMTFResult::refPhi1D
private

Reference phi for each reference layer.

Definition at line 51 of file OMTFResult.h.

Referenced by addResult(), clear(), and getRefPhis().

◆ refPhiRHit1D

vector1D OMTFResult::refPhiRHit1D
private

Reference phi for each reference layer - the input value.

Definition at line 66 of file OMTFResult.h.

Referenced by clear(), getRefPhiRHits(), and setRefPhiRHits().

◆ results

vector2D OMTFResult::results
private

Pdf weight found for each layer First index: layer number Second index: ref layer number

Definition at line 48 of file OMTFResult.h.

Referenced by addResult(), clear(), finalise(), getResults(), and operator<<().

◆ results1D

vector1D OMTFResult::results1D
private

Sum of pdf weights for each reference layer.

Definition at line 57 of file OMTFResult.h.

Referenced by clear(), finalise(), getSummaryVals(), and operator<<().