CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCBadChambersConditions.h
Go to the documentation of this file.
1 #ifndef _CSCBADCHAMBERSCONDITIONS_H
2 #define _CSCBADCHAMBERSCONDITIONS_H
3 
4 #include <memory>
5 #include <cmath>
15 
19 
21  public:
24 
25 
26  inline static CSCBadChambers * prefillBadChambers();
27 
28  typedef const CSCBadChambers * ReturnType;
29 
31 
32  private:
33  // ----------member data ---------------------------
36 
37 };
38 
39 #include<fstream>
40 #include<vector>
41 #include<iostream>
42 
43 // to workaround plugin library
45 {
46  // const int MAX_SIZE = 468;
47  //cndbbadchambers = new CSCBadChambers();
48 
49  int new_chambers;
50  std::vector<int> new_badchambers;
51 
52  int new_nrlines;
53  new_nrlines=0;
54 
55  std::ifstream newdata;
56 
57  newdata.open("badchambers.dat",std::ios::in);
58  if(!newdata) {
59  std::cerr <<"Error: badchambers.dat -> no such file!"<< std::endl;
60  exit(1);
61  }
62 
63  while(!newdata.eof() ) {
64  newdata >> new_chambers;
65  new_badchambers.push_back(new_chambers);
66  ++new_nrlines;
67  }
68  newdata.close();
69 
70  CSCBadChambers * cndbbadchambers = new CSCBadChambers(new_nrlines, new_badchambers);
71 
72  //std::cout <<"numberOfBadChambers "<<new_nrlines<<std::endl;
73 
74  return cndbbadchambers;
75 }
76 
77 #endif
static CSCBadChambers * prefillBadChambers()
ReturnType produceBadChambers(const CSCBadChambersRcd &)
CSCBadChambersConditions(const edm::ParameterSet &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
const CSCBadChambers * ReturnType