CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public 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
< DbEntryBinSize
DbBinSizeVector
 
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 Attributes

DbVector errors_
 
DbBinSizeVector errorsBinSize_
 
double version_
 

Friends

std::ostream & operator<< (std::ostream &s, const SiPixelCPEGenericErrorParm &genericErrors)
 Function to output the contents of the db object. More...
 

Detailed Description

Definition at line 13 of file SiPixelCPEGenericErrorParm.h.

Member Typedef Documentation

Definition at line 39 of file SiPixelCPEGenericErrorParm.h.

Definition at line 27 of file SiPixelCPEGenericErrorParm.h.

Constructor & Destructor Documentation

SiPixelCPEGenericErrorParm::SiPixelCPEGenericErrorParm ( )
inline
virtual SiPixelCPEGenericErrorParm::~SiPixelCPEGenericErrorParm ( )
inlinevirtual

Definition at line 42 of file SiPixelCPEGenericErrorParm.h.

42 {}

Member Function Documentation

DbVector& SiPixelCPEGenericErrorParm::errors ( )
inline

Accessors for the vectors – non-const version.

Definition at line 51 of file SiPixelCPEGenericErrorParm.h.

References errors_.

Referenced by SiPixelCPEGenericDBErrorParametrization::getError().

const DbVector& SiPixelCPEGenericErrorParm::errors ( ) const
inline

Accessors for the vectors – const version.

Definition at line 56 of file SiPixelCPEGenericErrorParm.h.

References errors_.

DbBinSizeVector& SiPixelCPEGenericErrorParm::errorsBin ( )
inline

Definition at line 52 of file SiPixelCPEGenericErrorParm.h.

References errorsBinSize_.

52 { return errorsBinSize_ ; }
const DbBinSizeVector& SiPixelCPEGenericErrorParm::errorsBinSize ( ) const
inline

Definition at line 57 of file SiPixelCPEGenericErrorParm.h.

References errorsBinSize_.

57 { return errorsBinSize_ ; }
void SiPixelCPEGenericErrorParm::fillCPEGenericErrorParm ( double  version,
std::string  file 
)

Function to fill the db object given a filename.

Definition at line 5 of file SiPixelCPEGenericErrorParm.cc.

References SiPixelCPEGenericErrorParm::DbEntryBinSize::alphaBin_size, SiPixelCPEGenericErrorParm::DbEntry::ave_Qclus, SiPixelCPEGenericErrorParm::DbEntryBinSize::betaBin_size, SiPixelCPEGenericErrorParm::DbEntry::bias, errors_, errorsBinSize_, recoMuon::in, SiPixelCPEGenericErrorParm::DbEntryBinSize::partBin_size, SiPixelCPEGenericErrorParm::DbEntry::pix_height, SiPixelCPEGenericErrorParm::DbEntry::rms, set_version(), SiPixelCPEGenericErrorParm::DbEntry::sigma, and SiPixelCPEGenericErrorParm::DbEntryBinSize::sizeBin_size.

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

Reserve some reasonable sizes for the vectors.

Definition at line 61 of file SiPixelCPEGenericErrorParm.h.

References errors_, and errorsBinSize_.

61  {
62  errors_.reserve(1000);
63  errorsBinSize_.reserve(4);
64  }
void SiPixelCPEGenericErrorParm::set_version ( double  v)
inline

Definition at line 71 of file SiPixelCPEGenericErrorParm.h.

References v, and version_.

Referenced by fillCPEGenericErrorParm().

71 {version_ = v;}
mathSSE::Vec4< T > v
double& SiPixelCPEGenericErrorParm::version ( )
inline

Definition at line 53 of file SiPixelCPEGenericErrorParm.h.

References version_.

const double& SiPixelCPEGenericErrorParm::version ( ) const
inline

Definition at line 58 of file SiPixelCPEGenericErrorParm.h.

References version_.

Friends And Related Function Documentation

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

Function to output the contents of the db object.

Definition at line 51 of file SiPixelCPEGenericErrorParm.cc.

52 {
53  for (unsigned int count=0; count < genericErrors.errors_.size(); ++count) {
54 
55  s.precision(6);
56 
57  s << genericErrors.errors_[count].bias << " "
58  << genericErrors.errors_[count].pix_height << " "
59  << genericErrors.errors_[count].ave_Qclus << " " << std::fixed
60  << genericErrors.errors_[count].sigma << " "
61  << genericErrors.errors_[count].rms << std::endl;
62 
63  s.unsetf ( std::ios_base::fixed );
64  }
65  return s;
66 }

Member Data Documentation

DbVector SiPixelCPEGenericErrorParm::errors_
private

Definition at line 76 of file SiPixelCPEGenericErrorParm.h.

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

DbBinSizeVector SiPixelCPEGenericErrorParm::errorsBinSize_
private
double SiPixelCPEGenericErrorParm::version_
private

Definition at line 78 of file SiPixelCPEGenericErrorParm.h.

Referenced by set_version(), and version().