CMS 3D CMS Logo

EcalLaserCondTools.h
Go to the documentation of this file.
1 #ifndef EcaLaserCondTools_h
2 #define EcaLaserCondTools_h
3 
4 /*
5  * $Id: EcalLaserCondTools.h,v 1.2 2010/06/14 10:45:16 pgras Exp $
6  */
7 
14 
16 
17 #include <cstdio>
18 #include <ctime>
19 #include <string>
20 #include <vector>
24  //static fields
25 
28  static constexpr int nLmes = 92;
29 
30  //methods
31 public:
36 
39  ~EcalLaserCondTools() override;
40 
45  void analyze(const edm::Event& evt, const edm::EventSetup& es) override;
46 
47 private:
48  static std::string toNth(int n);
49  static std::string timeToString(time_t t);
50  class CorrReader {
51  public:
52  CorrReader() : verb_(0) {}
53  virtual bool readTime(int& t1, int t2[nLmes], int& t3) { return false; }
54  virtual bool readPs(DetId& rawdetid, EcalLaserAPDPNRatios::EcalLaserAPDPNpair& corr) { return false; }
55  virtual ~CorrReader() {}
56  void setVerbosity(int verb) { verb_ = verb; }
57 
58  protected:
59  int verb_;
60  };
61 
63  public:
64  FileReader(const std::vector<std::string>& fnames) : f_(nullptr), fnames_(fnames), ifile_(-1), iline_(0) {}
65  bool readTime(int& t1, int t2[EcalLaserCondTools::nLmes], int& t3) override;
66  bool readPs(DetId& rawdetid, EcalLaserAPDPNRatios::EcalLaserAPDPNpair& corr) override;
67  ~FileReader() override {}
68 
69  private:
70  bool nextFile();
71  void trim();
72  FILE* f_;
73  std::vector<std::string> fnames_;
74  unsigned ifile_;
75  int iline_;
76  };
77 
78 private:
79  void fillDb(CorrReader& r);
80  void dbToAscii(const edm::EventSetup& es);
81  void processIov(CorrReader& r, int t1, int t2[nLmes], int t3);
82 
83  //fields
84 private:
85  FILE* fout_;
86  FILE* eventList_;
88  int verb_;
90  std::vector<std::string> fnames_;
92  int skipIov_;
93  int nIovs_;
94  int fromTime_;
95  int toTime_;
96  double minP_, maxP_;
97  FILE* ferr_;
98 };
99 
100 #endif //EcaLaserCondTools_h not defined
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
EcalLaserCondTools::FileReader
Definition: EcalLaserCondTools.h:62
EcalLaserCondTools::verb_
int verb_
Definition: EcalLaserCondTools.h:88
EcalLaserCondTools::FileReader::nextFile
bool nextFile()
Definition: EcalLaserCondTools.cc:254
EcalLaserCondTools::dbToAscii
void dbToAscii(const edm::EventSetup &es)
Definition: EcalLaserCondTools.cc:422
EcalLaserCondTools::CorrReader::readTime
virtual bool readTime(int &t1, int t2[nLmes], int &t3)
Definition: EcalLaserCondTools.h:53
EDAnalyzer.h
EcalLaserCondTools::CorrReader::setVerbosity
void setVerbosity(int verb)
Definition: EcalLaserCondTools.h:56
EcalLaserCondTools::EcalLaserCondTools
EcalLaserCondTools(const edm::ParameterSet &)
Definition: EcalLaserCondTools.cc:24
EcalLaserCondTools::FileReader::ifile_
unsigned ifile_
Definition: EcalLaserCondTools.h:74
EcalLaserCondTools::~EcalLaserCondTools
~EcalLaserCondTools() override
Definition: EcalLaserCondTools.cc:47
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
EcalLaserCondTools::timeToString
static std::string timeToString(time_t t)
Definition: EcalLaserCondTools.cc:413
EcalLaserCondTools::analyze
void analyze(const edm::Event &evt, const edm::EventSetup &es) override
Definition: EcalLaserCondTools.cc:54
EcalLaserCondTools::db_
edm::Service< cond::service::PoolDBOutputService > db_
Definition: EcalLaserCondTools.h:91
DetId
Definition: DetId.h:17
EcalLaserCondTools::eventListFileName_
std::string eventListFileName_
Definition: EcalLaserCondTools.h:87
EcalLaserCondTools::mode_
std::string mode_
Definition: EcalLaserCondTools.h:89
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
EcalLaserCondTools::toTime_
int toTime_
Definition: EcalLaserCondTools.h:95
PoolDBOutputService.h
EcalLaserCondTools::FileReader::f_
FILE * f_
Definition: EcalLaserCondTools.h:72
EcalLaserCondTools::processIov
void processIov(CorrReader &r, int t1, int t2[nLmes], int t3)
Definition: EcalLaserCondTools.cc:150
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
Service.h
EcalLaserCondTools::CorrReader
Definition: EcalLaserCondTools.h:50
EcalLaserCondTools::FileReader::readPs
bool readPs(DetId &rawdetid, EcalLaserAPDPNRatios::EcalLaserAPDPNpair &corr) override
Definition: EcalLaserCondTools.cc:323
EcalLaserCondTools::CorrReader::verb_
int verb_
Definition: EcalLaserCondTools.h:59
EcalLaserCondTools::FileReader::readTime
bool readTime(int &t1, int t2[EcalLaserCondTools::nLmes], int &t3) override
Definition: EcalLaserCondTools.cc:274
EcalLaserCondTools::CorrReader::CorrReader
CorrReader()
Definition: EcalLaserCondTools.h:52
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
EcalLaserCondTools::FileReader::~FileReader
~FileReader() override
Definition: EcalLaserCondTools.h:67
EcalLaserCondTools::maxP_
double maxP_
Definition: EcalLaserCondTools.h:96
EcalLaserCondTools::fromTime_
int fromTime_
Definition: EcalLaserCondTools.h:94
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalLaserCondTools::toNth
static std::string toNth(int n)
Definition: EcalLaserCondTools.cc:390
EcalLaserCondTools::nIovs_
int nIovs_
Definition: EcalLaserCondTools.h:93
EcalLaserAPDPNRatios::EcalLaserAPDPNpair
Definition: EcalLaserAPDPNRatios.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
EcalLaserCondTools::CorrReader::readPs
virtual bool readPs(DetId &rawdetid, EcalLaserAPDPNRatios::EcalLaserAPDPNpair &corr)
Definition: EcalLaserCondTools.h:54
edm::Service< cond::service::PoolDBOutputService >
EcalLaserCondTools::nLmes
static constexpr int nLmes
Definition: EcalLaserCondTools.h:28
edm::EventSetup
Definition: EventSetup.h:57
EcalLaserAPDPNRatios.h
EcalLaserCondTools::minP_
double minP_
Definition: EcalLaserCondTools.h:96
alignCSCRings.r
r
Definition: alignCSCRings.py:93
EcalLaserCondTools::ferr_
FILE * ferr_
Definition: EcalLaserCondTools.h:97
DetId.h
Frameworkfwd.h
EcalLaserCondTools::skipIov_
int skipIov_
Definition: EcalLaserCondTools.h:92
EcalLaserCondTools::FileReader::fnames_
std::vector< std::string > fnames_
Definition: EcalLaserCondTools.h:73
EcalLaserCondTools
Definition: EcalLaserCondTools.h:23
EcalLaserCondTools::FileReader::trim
void trim()
Definition: EcalLaserCondTools.cc:374
EcalLaserCondTools::fnames_
std::vector< std::string > fnames_
Definition: EcalLaserCondTools.h:90
EcalLaserCondTools::CorrReader::~CorrReader
virtual ~CorrReader()
Definition: EcalLaserCondTools.h:55
ParameterSet.h
EcalLaserCondTools::eventList_
FILE * eventList_
Definition: EcalLaserCondTools.h:86
EcalLaserCondTools::fillDb
void fillDb(CorrReader &r)
Definition: EcalLaserCondTools.cc:75
SiStripCommissioningSource_FromRAW_cfg.fnames
fnames
Definition: SiStripCommissioningSource_FromRAW_cfg.py:143
EcalLaserCondTools::fout_
FILE * fout_
Definition: EcalLaserCondTools.h:85
edm::Event
Definition: Event.h:73
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
EcalLaserCondTools::FileReader::FileReader
FileReader(const std::vector< std::string > &fnames)
Definition: EcalLaserCondTools.h:64
EcalLaserCondTools::FileReader::iline_
int iline_
Definition: EcalLaserCondTools.h:75