CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCDataCertification.cc
Go to the documentation of this file.
2 
7 
10 //CondFormats
13 
14 
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
19  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
20  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
21  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
22 
23  init_= false;
24  defaultValue_=1.;
25 }
26 
28 
30 
32  edm::LuminosityBlock const & LB, edm::EventSetup const& setup){
33 
34  if(!init_){
35 
36  this->checkFED(setup);
37 
38  if(!offlineDQM_){ this->myBooker(ibooker); }
39  }
40 }
41 
43 
44  if(offlineDQM_){ this->myBooker(ibooker); }
45 
46 }
47 
48 
51 
52  double defaultValue = 1.;
53 
54  if(0 != setup.find( recordKey ) ) {
55  defaultValue = -1;
56  //get fed summary information
58  setup.get<RunInfoRcd>().get(sumFED);
59  std::vector<int> FedsInIds= sumFED->m_fed_in;
60  unsigned int f = 0;
61  bool flag = false;
62  while(!flag && f < FedsInIds.size()) {
63  int fedID=FedsInIds[f];
64  //make sure fed id is in allowed range
65  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
66  defaultValue = 1;
67  flag = true;
68  }
69  f++;
70  }
71  }
72 
73  defaultValue_ = defaultValue;
74 
75  init_= true;
76 
77 }
78 
79 
81 
82  ibooker.setCurrentFolder("RPC/EventInfo");
83  // global fraction
84  totalCertFraction = ibooker.bookFloat("CertificationSummary");
86 
87  CertMap_ = ibooker.book2D( "CertificationSummaryMap","RPC Certification Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
88 
89  //customize the 2d histo
90  std::stringstream BinLabel;
91  for (int i= 1 ; i<13; i++){
92  BinLabel.str("");
93  BinLabel<<"Sec"<<i;
94  CertMap_->setBinLabel(i,BinLabel.str(),2);
95  }
96 
97  for(int i = -2 ; i <=2; i++){
98  BinLabel.str("");
99  BinLabel<<"Wheel"<<i;
100  CertMap_->setBinLabel(i+8,BinLabel.str(),1);
101  }
102 
103 
104  for(int i = 1; i<=numberOfDisks_; i++){
105  BinLabel.str("");
106  BinLabel<<"Disk"<<i;
107  CertMap_->setBinLabel((i+11),BinLabel.str(),1);
108  BinLabel.str("");
109  BinLabel<<"Disk"<<-i;
110  CertMap_->setBinLabel((-i+5),BinLabel.str(),1);
111  }
112  //fill the histo with "1" --- just for the moment
113  for(int i=1; i<=15; i++){
114  for (int j=1; j<=12; j++ ){
115  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
116  CertMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
117  else
119  }
120  }
121 
122 
123  if(numberOfDisks_ < 4){
124  for (int j=1; j<=12; j++ ){
125  CertMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
126  CertMap_->setBinContent(15,j,-1);
127  }
128  }
129  // book the ME
130  ibooker.setCurrentFolder("RPC/EventInfo/CertificationContents");
131 
132  int limit = numberOfDisks_;
133  if(numberOfDisks_ < 2) limit = 2;
134 
135 
136  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
137  if (i>-3 && i<3){//wheels
138  std::stringstream streams;
139  streams << "RPC_Wheel" << i;
140  certWheelFractions[i+2] = ibooker.bookFloat(streams.str());
142  }
143 
144  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
145 
146  int offset = numberOfDisks_;
147  if (i>0) offset --; //used to skip case equale to zero
148  std::stringstream streams;
149  streams << "RPC_Disk" << i;
150  certDiskFractions[i+2] = ibooker.bookFloat(streams.str());
152  }
153 }
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void myBooker(DQMStore::IBooker &)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * certWheelFractions[5]
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
void Fill(long long x)
MonitorElement * CertMap_
MonitorElement * totalCertFraction
std::pair< int, int > FEDRange_
RPCDataCertification(const edm::ParameterSet &pset)
Constructor.
int j
Definition: DBlmapReader.cc:9
double f[11][100]
MonitorElement * certDiskFractions[10]
virtual ~RPCDataCertification()
Destructor.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
const T & get() const
Definition: EventSetup.h:56
void checkFED(edm::EventSetup const &)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
tuple streams
Definition: HLT_ES_cff.py:11
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override