CMS 3D CMS Logo

SiPixelCPEGenericErrorParm.cc
Go to the documentation of this file.
2 #include <fstream>
3 
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 }
47 
48 std::ostream& operator<<(std::ostream& s, const SiPixelCPEGenericErrorParm& genericErrors) {
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 }
Definition: Entry.h:18
void fillCPEGenericErrorParm(double version, std::string file)
Function to fill the db object given a filename.
ALIdouble sigma() const
Definition: Entry.h:55
A struct to hold the binning information for (part, size, alpha, beta)
std::ostream & operator<<(std::ostream &s, const SiPixelCPEGenericErrorParm &genericErrors)
part
Definition: HCALResponse.h:20
A struct to hold information for a given (alpha,beta,size)