Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-04 06:14:13

0001 #include "CondFormats/SiPixelObjects/interface/SiPixelCPEGenericErrorParm.h"
0002 #include <fstream>
0003 
0004 void SiPixelCPEGenericErrorParm::fillCPEGenericErrorParm(double version, std::string file) {
0005   //--- Open the file
0006   std::ifstream in(file.c_str(), std::ios::in);
0007 
0008   //--- Currently do not need to store part of detector, but is in input file
0009   int part;
0010   set_version(version);
0011 
0012   DbEntry Entry;
0013   in >> part >> Entry.bias >> Entry.pix_height >> Entry.ave_Qclus >> Entry.sigma >> Entry.rms;
0014 
0015   while (!in.eof()) {
0016     errors_.push_back(Entry);
0017 
0018     in >> part >> Entry.bias >> Entry.pix_height >> Entry.ave_Qclus >> Entry.sigma >> Entry.rms;
0019   }
0020   //--- Finished parsing the file, we're done.
0021   in.close();
0022 
0023   //--- Specify the current binning sizes to use
0024   DbEntryBinSize ErrorsBinSize;
0025   //--- Part = 1 By
0026   ErrorsBinSize.partBin_size = 0;
0027   ErrorsBinSize.sizeBin_size = 40;
0028   ErrorsBinSize.alphaBin_size = 10;
0029   ErrorsBinSize.betaBin_size = 1;
0030   errorsBinSize_.push_back(ErrorsBinSize);
0031   //--- Part = 2 Bx
0032   ErrorsBinSize.partBin_size = 240;
0033   ErrorsBinSize.alphaBin_size = 1;
0034   ErrorsBinSize.betaBin_size = 10;
0035   errorsBinSize_.push_back(ErrorsBinSize);
0036   //--- Part = 3 Fy
0037   ErrorsBinSize.partBin_size = 360;
0038   ErrorsBinSize.alphaBin_size = 10;
0039   ErrorsBinSize.betaBin_size = 1;
0040   errorsBinSize_.push_back(ErrorsBinSize);
0041   //--- Part = 4 Fx
0042   ErrorsBinSize.partBin_size = 380;
0043   ErrorsBinSize.alphaBin_size = 1;
0044   ErrorsBinSize.betaBin_size = 10;
0045   errorsBinSize_.push_back(ErrorsBinSize);
0046 }
0047 
0048 std::ostream& operator<<(std::ostream& s, const SiPixelCPEGenericErrorParm& genericErrors) {
0049   for (unsigned int count = 0; count < genericErrors.errors_.size(); ++count) {
0050     s.precision(6);
0051 
0052     s << genericErrors.errors_[count].bias << " " << genericErrors.errors_[count].pix_height << " "
0053       << genericErrors.errors_[count].ave_Qclus << " " << std::fixed << genericErrors.errors_[count].sigma << " "
0054       << genericErrors.errors_[count].rms << std::endl;
0055 
0056     s.unsetf(std::ios_base::fixed);
0057   }
0058   return s;
0059 }