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.

22  {
23  refPhi1D[iRefLayer] = iRefPhi;
24  refEta1D[iRefLayer] = iRefEta;
25  results[iLayer][iRefLayer] = val;
26 }

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

◆ clear()

void OMTFResult::clear ( void  )

Definition at line 29 of file OMTFResult.cc.

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 }

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

Referenced by configure().

◆ configure()

void OMTFResult::configure ( const OMTFConfiguration omtfConfig)

Definition at line 10 of file OMTFResult.cc.

10  {
11  myOmtfConfig = omtfConfig;
12 
13  clear();
14 }

References clear(), and myOmtfConfig.

Referenced by OMTFProcessor::addGP().

◆ empty()

bool OMTFResult::empty ( void  ) const

Definition at line 61 of file OMTFResult.cc.

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 }

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

◆ 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.

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 }

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

◆ getHitsWord()

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

Definition at line 28 of file OMTFResult.h.

28 { return hitsBits; }

References hitsBits.

Referenced by OMTFSorter::sortSingleResult().

◆ getRefEtas()

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

Definition at line 26 of file OMTFResult.h.

26 { return refEta1D; }

References refEta1D.

Referenced by OMTFSorter::sortSingleResult().

◆ getRefPhiRHits()

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

Definition at line 30 of file OMTFResult.h.

30 { return refPhiRHit1D; }

References refPhiRHit1D.

Referenced by OMTFSorter::sortSingleResult().

◆ getRefPhis()

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

Definition at line 24 of file OMTFResult.h.

24 { return refPhi1D; }

References refPhi1D.

Referenced by OMTFSorter::sortSingleResult().

◆ getResults()

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

Definition at line 18 of file OMTFResult.h.

18 { return results; }

References results.

Referenced by XMLConfigWriter::writeResultsData().

◆ getSummaryHits()

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

Definition at line 22 of file OMTFResult.h.

22 { return hits1D; }

References hits1D.

Referenced by OMTFSorter::sortSingleResult().

◆ getSummaryVals()

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

Definition at line 20 of file OMTFResult.h.

20 { return results1D; }

References results1D.

Referenced by OMTFSorter::sortSingleResult().

◆ setRefPhiRHits()

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

Definition at line 18 of file OMTFResult.cc.

18 { refPhiRHit1D[iRefLayer] = iRefPhiRHit; }

References refPhiRHit1D.

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 }

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

OMTFResult::refPhi1D
vector1D refPhi1D
Reference phi for each reference layer.
Definition: OMTFResult.h:51
OMTFResult::hits1D
vector1D hits1D
Number of hits for each reference layer.
Definition: OMTFResult.h:60
OMTFConfiguration::fwVersion
unsigned int fwVersion() const
Definition: OMTFConfiguration.h:81
OMTFResult::refEta1D
vector1D refEta1D
Reference phi for each reference layer.
Definition: OMTFResult.h:54
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
OMTFResult::clear
void clear()
Definition: OMTFResult.cc:29
OMTFResult::hitsBits
vector1D hitsBits
Words representing nimber of hit layers for each reference layer.
Definition: OMTFResult.h:63
OMTFConfiguration::getLogicToLogic
const std::map< int, int > & getLogicToLogic() const
Definition: OMTFConfiguration.h:103
OMTFConfiguration::nLayers
unsigned int nLayers() const
Definition: OMTFConfiguration.h:87
OMTFResult::myOmtfConfig
const OMTFConfiguration * myOmtfConfig
Definition: OMTFResult.h:68
OMTFResult::results1D
vector1D results1D
Sum of pdf weights for each reference layer.
Definition: OMTFResult.h:57
OMTFResult::results
vector2D results
Definition: OMTFResult.h:48
heppy_batch.val
val
Definition: heppy_batch.py:351
OMTFConfiguration::nRefLayers
unsigned int nRefLayers() const
Definition: OMTFConfiguration.h:89
OMTFConfiguration::getBendingLayers
const std::set< int > & getBendingLayers() const
Definition: OMTFConfiguration.h:104
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
OMTFResult::refPhiRHit1D
vector1D refPhiRHit1D
Reference phi for each reference layer - the input value.
Definition: OMTFResult.h:66