CMS 3D CMS Logo

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

#include <SiPixelCPEGenericErrorParm.h>

Classes

struct  DbEntry
 A struct to hold information for a given (alpha,beta,size) More...
 
struct  DbEntryBinSize
 A struct to hold the binning information for (part, size, alpha, beta) More...
 

Public Types

typedef std::vector< DbEntryBinSizeDbBinSizeVector
 
typedef std::vector< DbEntryDbVector
 

Public Member Functions

DbVectorerrors ()
 Accessors for the vectors – non-const version. More...
 
const DbVectorerrors () const
 Accessors for the vectors – const version. More...
 
DbBinSizeVectorerrorsBin ()
 
const DbBinSizeVectorerrorsBinSize () const
 
void fillCPEGenericErrorParm (double version, std::string file)
 Function to fill the db object given a filename. More...
 
void reserve ()
 Reserve some reasonable sizes for the vectors. More...
 
void set_version (double v)
 
 SiPixelCPEGenericErrorParm ()
 
double & version ()
 
const double & version () const
 
virtual ~SiPixelCPEGenericErrorParm ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

DbVector errors_
 
DbBinSizeVector errorsBinSize_
 
double version_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
std::ostream & operator<< (std::ostream &s, const SiPixelCPEGenericErrorParm &genericErrors)
 Function to output the contents of the db object. More...
 

Detailed Description

Definition at line 15 of file SiPixelCPEGenericErrorParm.h.

Member Typedef Documentation

◆ DbBinSizeVector

Definition at line 43 of file SiPixelCPEGenericErrorParm.h.

◆ DbVector

Definition at line 29 of file SiPixelCPEGenericErrorParm.h.

Constructor & Destructor Documentation

◆ SiPixelCPEGenericErrorParm()

SiPixelCPEGenericErrorParm::SiPixelCPEGenericErrorParm ( )
inline

◆ ~SiPixelCPEGenericErrorParm()

virtual SiPixelCPEGenericErrorParm::~SiPixelCPEGenericErrorParm ( )
inlinevirtual

Definition at line 46 of file SiPixelCPEGenericErrorParm.h.

46 {}

Member Function Documentation

◆ errors() [1/2]

DbVector& SiPixelCPEGenericErrorParm::errors ( )
inline

Accessors for the vectors – non-const version.

Definition at line 55 of file SiPixelCPEGenericErrorParm.h.

References errors_.

◆ errors() [2/2]

const DbVector& SiPixelCPEGenericErrorParm::errors ( ) const
inline

Accessors for the vectors – const version.

Definition at line 60 of file SiPixelCPEGenericErrorParm.h.

References errors_.

◆ errorsBin()

DbBinSizeVector& SiPixelCPEGenericErrorParm::errorsBin ( )
inline

Definition at line 56 of file SiPixelCPEGenericErrorParm.h.

References errorsBinSize_.

56 { return errorsBinSize_; }

◆ errorsBinSize()

const DbBinSizeVector& SiPixelCPEGenericErrorParm::errorsBinSize ( ) const
inline

Definition at line 61 of file SiPixelCPEGenericErrorParm.h.

References errorsBinSize_.

61 { return errorsBinSize_; }

◆ fillCPEGenericErrorParm()

void SiPixelCPEGenericErrorParm::fillCPEGenericErrorParm ( double  version,
std::string  file 
)

Function to fill the db object given a filename.

Definition at line 4 of file SiPixelCPEGenericErrorParm.cc.

References SiPixelCPEGenericErrorParm::DbEntryBinSize::alphaBin_size, SiPixelCPEGenericErrorParm::DbEntryBinSize::betaBin_size, errors_, errorsBinSize_, geometryDiff::file, recoMuon::in, SiPixelCPEGenericErrorParm::DbEntryBinSize::partBin_size, set_version(), Entry::sigma(), SiPixelCPEGenericErrorParm::DbEntryBinSize::sizeBin_size, and version().

4  {
5  //--- Open the file
6  std::ifstream in(file.c_str(), std::ios::in);
7 
8  //--- Currently do not need to store part of detector, but is in input file
9  int part;
11 
12  DbEntry Entry;
13  in >> part >> Entry.bias >> Entry.pix_height >> Entry.ave_Qclus >> Entry.sigma >> Entry.rms;
14 
15  while (!in.eof()) {
16  errors_.push_back(Entry);
17 
18  in >> part >> Entry.bias >> Entry.pix_height >> Entry.ave_Qclus >> Entry.sigma >> Entry.rms;
19  }
20  //--- Finished parsing the file, we're done.
21  in.close();
22 
23  //--- Specify the current binning sizes to use
24  DbEntryBinSize ErrorsBinSize;
25  //--- Part = 1 By
26  ErrorsBinSize.partBin_size = 0;
27  ErrorsBinSize.sizeBin_size = 40;
28  ErrorsBinSize.alphaBin_size = 10;
29  ErrorsBinSize.betaBin_size = 1;
30  errorsBinSize_.push_back(ErrorsBinSize);
31  //--- Part = 2 Bx
32  ErrorsBinSize.partBin_size = 240;
33  ErrorsBinSize.alphaBin_size = 1;
34  ErrorsBinSize.betaBin_size = 10;
35  errorsBinSize_.push_back(ErrorsBinSize);
36  //--- Part = 3 Fy
37  ErrorsBinSize.partBin_size = 360;
38  ErrorsBinSize.alphaBin_size = 10;
39  ErrorsBinSize.betaBin_size = 1;
40  errorsBinSize_.push_back(ErrorsBinSize);
41  //--- Part = 4 Fx
42  ErrorsBinSize.partBin_size = 380;
43  ErrorsBinSize.alphaBin_size = 1;
44  ErrorsBinSize.betaBin_size = 10;
45  errorsBinSize_.push_back(ErrorsBinSize);
46 }
Definition: Entry.h:18
ALIdouble sigma() const
Definition: Entry.h:55
part
Definition: HCALResponse.h:20

◆ reserve()

void SiPixelCPEGenericErrorParm::reserve ( )
inline

Reserve some reasonable sizes for the vectors.

Definition at line 65 of file SiPixelCPEGenericErrorParm.h.

References errors_, and errorsBinSize_.

65  {
66  errors_.reserve(1000);
67  errorsBinSize_.reserve(4);
68  }

◆ serialize()

template<class Archive >
void SiPixelCPEGenericErrorParm::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ set_version()

void SiPixelCPEGenericErrorParm::set_version ( double  v)
inline

◆ version() [1/2]

double& SiPixelCPEGenericErrorParm::version ( )
inline

◆ version() [2/2]

const double& SiPixelCPEGenericErrorParm::version ( ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 84 of file SiPixelCPEGenericErrorParm.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 84 of file SiPixelCPEGenericErrorParm.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const SiPixelCPEGenericErrorParm genericErrors 
)
friend

Function to output the contents of the db object.

Definition at line 48 of file SiPixelCPEGenericErrorParm.cc.

48  {
49  for (unsigned int count = 0; count < genericErrors.errors_.size(); ++count) {
50  s.precision(6);
51 
52  s << genericErrors.errors_[count].bias << " " << genericErrors.errors_[count].pix_height << " "
53  << genericErrors.errors_[count].ave_Qclus << " " << std::fixed << genericErrors.errors_[count].sigma << " "
54  << genericErrors.errors_[count].rms << std::endl;
55 
56  s.unsetf(std::ios_base::fixed);
57  }
58  return s;
59 }

Member Data Documentation

◆ errors_

DbVector SiPixelCPEGenericErrorParm::errors_
private

Definition at line 80 of file SiPixelCPEGenericErrorParm.h.

Referenced by errors(), fillCPEGenericErrorParm(), operator<<(), and reserve().

◆ errorsBinSize_

DbBinSizeVector SiPixelCPEGenericErrorParm::errorsBinSize_
private

◆ version_

double SiPixelCPEGenericErrorParm::version_
private

Definition at line 82 of file SiPixelCPEGenericErrorParm.h.

Referenced by set_version(), and version().