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 ()
 
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

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

Definition at line 13 of file OMTFResult.h.

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

Definition at line 14 of file OMTFResult.h.

Constructor & Destructor Documentation

OMTFResult::OMTFResult ( )
inline

Definition at line 16 of file OMTFResult.h.

References configure().

16 {};

Member Function Documentation

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

Definition at line 26 of file OMTFResult.cc.

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

Referenced by getRefPhiRHits().

30  {
31 
32  refPhi1D[iRefLayer] = iRefPhi;
33  refEta1D[iRefLayer] = iRefEta;
34  results[iLayer][iRefLayer] = val;
35 
36 }
vector2D results
Definition: OMTFResult.h:54
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:57
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:60
void OMTFResult::clear ( void  )

Definition at line 39 of file OMTFResult.cc.

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

Referenced by configure(), and getRefPhiRHits().

39  {
40 
41  results1D.assign(myOmtfConfig->nRefLayers(),0);
42  hits1D.assign(myOmtfConfig->nRefLayers(),0);
44  refPhi1D.assign(myOmtfConfig->nRefLayers(),1024);
45  refEta1D.assign(myOmtfConfig->nRefLayers(),1024);
46  hitsBits.assign(myOmtfConfig->nRefLayers(),0);
47  refPhiRHit1D.assign(myOmtfConfig->nRefLayers(),1024);
48 }
unsigned int nRefLayers() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:74
unsigned int nLayers() const
vector2D results
Definition: OMTFResult.h:54
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:63
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:72
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:57
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:66
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:60
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:69
void OMTFResult::configure ( const OMTFConfiguration omtfConfig)

Definition at line 10 of file OMTFResult.cc.

References clear(), and myOmtfConfig.

Referenced by OMTFProcessor::addGP(), and OMTFResult().

10  {
11 
12  myOmtfConfig = omtfConfig;
13 
14  clear();
15 
16 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:74
void clear()
Definition: OMTFResult.cc:39
bool OMTFResult::empty ( void  ) const

Definition at line 73 of file OMTFResult.cc.

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

Referenced by getRefPhiRHits().

73  {
74 
75  unsigned int nHits = 0;
76  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
77  nHits+=hits1D[iRefLayer];
78  }
79  return (nHits==0);
80 }
unsigned int nRefLayers() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:74
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:66
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 51 of file OMTFResult.cc.

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

Referenced by getRefPhiRHits().

51  {
52 
53  for(unsigned int iLogicLayer=0;iLogicLayer<results.size();++iLogicLayer){
54  unsigned int connectedLayer = myOmtfConfig->getLogicToLogic().at(iLogicLayer);
55  for(unsigned int iRefLayer=0;iRefLayer<results[iLogicLayer].size();++iRefLayer){
57  unsigned int val = results[connectedLayer][iRefLayer]>0 ? results[iLogicLayer][iRefLayer]: 0;
58  results1D[iRefLayer]+=val;
59  hitsBits[iRefLayer]+=(val>0)*std::pow(2,iLogicLayer);
60 
61  if (myOmtfConfig->fwVersion() <= 4) {
63  if(!myOmtfConfig->getBendingLayers().count(iLogicLayer)) hits1D[iRefLayer]+=(val>0);
64  } else {
65  hits1D[iRefLayer]+=(val>0);
66  }
67 
68  }
69  }
70 }
const std::set< int > & getBendingLayers() const
unsigned int fwVersion() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:74
vector2D results
Definition: OMTFResult.h:54
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:63
const std::map< int, int > & getLogicToLogic() const
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:66
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:69
const OMTFResult::vector1D& OMTFResult::getHitsWord ( ) const
inline

Definition at line 30 of file OMTFResult.h.

References hitsBits.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 28 of file OMTFResult.h.

References refEta1D.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 32 of file OMTFResult.h.

References addResult(), clear(), empty(), finalise(), operator<<, MillePedeFileConverter_cfg::out, refPhiRHit1D, setRefPhiRHits(), and heppy_batch::val.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 26 of file OMTFResult.h.

References refPhi1D.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 20 of file OMTFResult.h.

References results.

Referenced by XMLConfigWriter::writeResultsData().

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

Definition at line 24 of file OMTFResult.h.

References hits1D.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 22 of file OMTFResult.h.

References results1D.

Referenced by OMTFSorter::sortSingleResult().

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

Definition at line 20 of file OMTFResult.cc.

References refPhiRHit1D.

Referenced by getRefPhiRHits().

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

Friends And Related Function Documentation

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

Definition at line 83 of file OMTFResult.cc.

Referenced by getRefPhiRHits().

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

Member Data Documentation

vector1D OMTFResult::hits1D
private

Number of hits for each reference layer.

Definition at line 66 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 69 of file OMTFResult.h.

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

const OMTFConfiguration* OMTFResult::myOmtfConfig
private

Definition at line 74 of file OMTFResult.h.

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

vector1D OMTFResult::refEta1D
private

Reference phi for each reference layer.

Definition at line 60 of file OMTFResult.h.

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

vector1D OMTFResult::refPhi1D
private

Reference phi for each reference layer.

Definition at line 57 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 72 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 54 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 63 of file OMTFResult.h.

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