CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
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...
 
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 7 of file OMTFResult.h.

Member Typedef Documentation

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

Definition at line 11 of file OMTFResult.h.

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

Definition at line 12 of file OMTFResult.h.

Constructor & Destructor Documentation

OMTFResult::OMTFResult ( )

Definition at line 10 of file OMTFResult.cc.

References clear().

10  {
11 
12  clear();
13 
14 }
void clear()
Definition: OMTFResult.cc:37

Member Function Documentation

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

Definition at line 24 of file OMTFResult.cc.

References refEta1D, refPhi1D, and results.

28  {
29 
30  refPhi1D[iRefLayer] = iRefPhi;
31  refEta1D[iRefLayer] = iRefEta;
32  results[iLayer][iRefLayer] = val;
33 
34 }
vector2D results
Definition: OMTFResult.h:50
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:53
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:56
void OMTFResult::clear ( void  )

Definition at line 37 of file OMTFResult.cc.

References hits1D, hitsBits, OMTFConfiguration::instance(), refEta1D, refPhi1D, refPhiRHit1D, results, and results1D.

Referenced by OMTFResult().

37  {
38 
39  results1D.assign(OMTFConfiguration::instance()->nRefLayers,0);
40  hits1D.assign(OMTFConfiguration::instance()->nRefLayers,0);
42  refPhi1D.assign(OMTFConfiguration::instance()->nRefLayers,1024);
43  refEta1D.assign(OMTFConfiguration::instance()->nRefLayers,1024);
44  hitsBits.assign(OMTFConfiguration::instance()->nRefLayers,0);
45  refPhiRHit1D.assign(OMTFConfiguration::instance()->nRefLayers,1024);
46 }
vector2D results
Definition: OMTFResult.h:50
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:59
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:68
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:53
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:62
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:56
static const OMTFConfiguration * instance()
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:65
bool OMTFResult::empty ( void  ) const

Definition at line 69 of file OMTFResult.cc.

References hits1D, OMTFConfiguration::instance(), and OMTFConfiguration::nRefLayers.

69  {
70 
71  unsigned int nHits = 0;
72 
73  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
74  nHits+=hits1D[iRefLayer];
75  }
76  return (nHits==0);
77 }
unsigned int nRefLayers
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:62
static const OMTFConfiguration * instance()
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 49 of file OMTFResult.cc.

References OMTFConfiguration::bendingLayers, hits1D, hitsBits, OMTFConfiguration::instance(), OMTFConfiguration::logicToLogic, funct::pow(), results, and results1D.

49  {
50 
51  for(unsigned int iLogicLayer=0;iLogicLayer<results.size();++iLogicLayer){
52 
53  //unsigned int connectedLayer = OMTFConfiguration::instance()->logicToLogic[iLogicLayer];
54  auto iter = OMTFConfiguration::instance()->logicToLogic.find(iLogicLayer);
55  unsigned int connectedLayer = iter->second;
56 
57  for(unsigned int iRefLayer=0;iRefLayer<results[iLogicLayer].size();++iRefLayer){
59  unsigned int val = results[connectedLayer][iRefLayer]>0 ? results[iLogicLayer][iRefLayer]: 0;
60  results1D[iRefLayer]+=val;
61  hitsBits[iRefLayer]+=(val>0)*std::pow(2,iLogicLayer);
63  if(!OMTFConfiguration::instance()->bendingLayers.count(iLogicLayer)) hits1D[iRefLayer]+=(val>0);
64  }
65  }
66 }
std::map< int, int > logicToLogic
vector2D results
Definition: OMTFResult.h:50
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:59
std::set< int > bendingLayers
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:62
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
static const OMTFConfiguration * instance()
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:65
const OMTFResult::vector1D& OMTFResult::getHitsWord ( ) const
inline

Definition at line 26 of file OMTFResult.h.

References hitsBits.

Referenced by OMTFSorter::sortSingleResult().

26 { return hitsBits;}
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:65
const OMTFResult::vector1D& OMTFResult::getRefEtas ( ) const
inline

Definition at line 24 of file OMTFResult.h.

References refEta1D.

Referenced by OMTFSorter::sortSingleResult().

24 {return refEta1D;}
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:56
const OMTFResult::vector1D& OMTFResult::getRefPhiRHits ( ) const
inline

Definition at line 28 of file OMTFResult.h.

References refPhiRHit1D.

Referenced by OMTFSorter::sortSingleResult().

28 {return refPhiRHit1D;}
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:68
const OMTFResult::vector1D& OMTFResult::getRefPhis ( ) const
inline

Definition at line 22 of file OMTFResult.h.

References refPhi1D.

Referenced by OMTFSorter::sortSingleResult().

22 {return refPhi1D;}
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:53
const OMTFResult::vector2D& OMTFResult::getResults ( ) const
inline

Definition at line 16 of file OMTFResult.h.

References results.

Referenced by XMLConfigWriter::writeResultsData().

16 {return results;}
vector2D results
Definition: OMTFResult.h:50
const OMTFResult::vector1D& OMTFResult::getSummaryHits ( ) const
inline

Definition at line 20 of file OMTFResult.h.

References hits1D.

Referenced by OMTFSorter::sortSingleResult().

20 {return hits1D;}
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:62
const OMTFResult::vector1D& OMTFResult::getSummaryVals ( ) const
inline

Definition at line 18 of file OMTFResult.h.

References results1D.

Referenced by OMTFSorter::sortSingleResult().

18 {return results1D;}
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:59
void OMTFResult::setRefPhiRHits ( unsigned int  iRefLayer,
int  iRefPhiRHit 
)

Definition at line 18 of file OMTFResult.cc.

References refPhiRHit1D.

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

Friends And Related Function Documentation

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

Definition at line 80 of file OMTFResult.cc.

80  {
81 
82  for(unsigned int iLogicLayer=0;iLogicLayer<aResult.results.size();++iLogicLayer){
83  out<<"Logic layer: "<<iLogicLayer<<" results: ";
84  for(unsigned int iRefLayer=0;iRefLayer<aResult.results[iLogicLayer].size();++iRefLayer){
85  out<<aResult.results[iLogicLayer][iRefLayer]<<"\t";
86  }
87  out<<std::endl;
88  }
89 
90  out<<" Sum over layers: ";
91  for(unsigned int iRefLayer=0;iRefLayer<aResult.results1D.size();++iRefLayer){
92  out<<aResult.results1D[iRefLayer]<<"\t";
93  }
94 
95  out<<std::endl;
96 
97  out<<" Number of hits: ";
98  for(unsigned int iRefLayer=0;iRefLayer<aResult.hits1D.size();++iRefLayer){
99  out<<aResult.hits1D[iRefLayer]<<"\t";
100  }
101 
102  return out;
103 }
vector2D results
Definition: OMTFResult.h:50
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:59
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:62

Member Data Documentation

vector1D OMTFResult::hits1D
private

Number of hits for each reference layer.

Definition at line 62 of file OMTFResult.h.

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

vector1D OMTFResult::hitsBits
private

Words representing nimber of hit layers for each reference layer.

Definition at line 65 of file OMTFResult.h.

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

vector1D OMTFResult::refEta1D
private

Reference phi for each reference layer.

Definition at line 56 of file OMTFResult.h.

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

vector1D OMTFResult::refPhi1D
private

Reference phi for each reference layer.

Definition at line 53 of file OMTFResult.h.

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

vector1D OMTFResult::refPhiRHit1D
private

Reference phi for each reference layer - the input value.

Definition at line 68 of file OMTFResult.h.

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

vector2D OMTFResult::results
private

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

Definition at line 50 of file OMTFResult.h.

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

vector1D OMTFResult::results1D
private

Sum of pdf weights for each reference layer.

Definition at line 59 of file OMTFResult.h.

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