156 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw){
160 for (
int wh=-2; wh<=2; ++wh){
161 for (
int sect=1; sect<=12; ++sect){
167 TH2F * DDUvsTM = getHisto<TH2F>(igetter.
get(
getMEName(
"QualDDUvsQualTM",
"LocalTriggerPhiIn", chId)));
170 int matchSummary = 1;
172 if (DDUvsTM->GetEntries()>1) {
174 double entries = DDUvsTM->GetEntries();
175 double corrEntries = 0;
176 for (
int ibin=2; ibin<=8; ++ibin) {
177 corrEntries += DDUvsTM->GetBinContent(ibin,ibin);
179 double corrRatio = corrEntries/entries;
181 if (corrRatio <
parameters.getUntrackedParameter<
double>(
"matchingFracError",.65)){
184 else if (corrRatio <
parameters.getUntrackedParameter<
double>(
"matchingFracWarning",.85)){
195 whME[wh].find(
fullName(
"MatchingPhi"))->second->setBinContent(sect,
stat,corrRatio);
199 whME[wh].find(
fullName(
"MatchingSummary"))->second->setBinContent(sect,
stat,matchSummary);
205 TH2F * BXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"BXvsQual_In",
"LocalTriggerPhiIn", chId)));
206 TH1F * BestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"BestQual_In",
"LocalTriggerPhiIn", chId)));
207 TH2F * Flag1stvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"Flag1stvsQual_In",
"LocalTriggerPhiIn", chId)));
208 if (BXvsQual && Flag1stvsQual && BestQual) {
210 int secondSummary = 1;
213 double BXMean = 51. ;
214 double corrFrac = 0.;
215 double secondFrac = 0.;
216 double besttrigs = 0.;
217 if (BestQual->GetEntries()>1) {
218 TH1D* BXHH = BXvsQual->ProjectionY(
"",6,7,
"");
219 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
220 int BXOK_bin = BXHH->GetEntries()>=1 ? BXHH->GetMaximumBin() : 51;
221 BXMean = BXHH->GetEntries()>=1 ? BXHH->GetMean() : 51;
222 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
223 double trigsFlag2nd = Flag1st->GetBinContent(2);
224 double trigs = Flag1st->GetEntries();
225 besttrigs = BestQual->GetEntries();
226 double besttrigsCorr = BestQual->Integral(5,7,
"");
230 corrFrac = besttrigsCorr/besttrigs;
231 secondFrac = trigsFlag2nd/trigs;
232 if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracError",.5)){
235 else if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracWarning",.6)){
241 if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracError",.2)){
244 else if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracWarning",.1)){
256 TH1D* BXDistr = BXvsQual->ProjectionY();
257 TH1D* QualDistr = BXvsQual->ProjectionX();
258 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
260 int nbinsBX = BXDistr->GetNbinsX();
261 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
262 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
263 int iMin = firstBinCenter>-4 ? firstBinCenter : -4;
264 int iMax = lastBinCenter<20 ? lastBinCenter : 20;
265 for (
int ibin=iMin+5;ibin<=iMax+5; ++ibin) {
266 innerME->find(
fullName(
"BXDistribPhiIn"))->second->setBinContent(ibin,
stat,BXDistr->GetBinContent(ibin-5-firstBinCenter+1));
268 for (
int ibin=1;ibin<=7;++ibin) {
269 innerME->find(
fullName(
"QualDistribPhiIn"))->second->setBinContent(ibin,
stat,QualDistr->GetBinContent(ibin));
276 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
286 innerME = &(
whME[wh]);
287 innerME->find(
fullName(
"CorrectBXPhiIn"))->second->setBinContent(sect,
stat,BX_OK+0.00001);
288 innerME->find(
fullName(
"ResidualBXPhiIn"))->second->setBinContent(sect,
stat,round(25.*(BXMean-BX_OK))+0.00001);
289 innerME->find(
fullName(
"CorrFractionPhiIn"))->second->setBinContent(sect,
stat,corrFrac);
290 innerME->find(
fullName(
"TriggerInclusivePhiIn"))->second->setBinContent(sect,
stat,besttrigs);
291 innerME->find(
fullName(
"2ndFractionPhiIn"))->second->setBinContent(sect,
stat,secondFrac);
294 whME[wh].find(
fullName(
"CorrFractionSummaryIn"))->second->setBinContent(sect,
stat,corrSummary);
295 whME[wh].find(
fullName(
"2ndFractionSummaryIn"))->second->setBinContent(sect,
stat,secondSummary);
302 TH2F * BXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"BXvsQual_Out",
"LocalTriggerPhiOut", chId)));
303 TH1F * BestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"BestQual_Out",
"LocalTriggerPhiOut", chId)));
304 TH2F * Flag1stvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"Flag1stvsQual_Out",
"LocalTriggerPhiOut", chId)));
305 if (BXvsQual && Flag1stvsQual && BestQual) {
307 int secondSummary = 1;
310 double BXMean = 51. ;
311 double corrFrac = 0.;
312 double secondFrac = 0.;
313 double besttrigs = 0.;
315 if (BestQual->GetEntries()>1) {
316 TH1D* BXHH = BXvsQual->ProjectionY(
"",6,7,
"");
317 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
318 int BXOK_bin = BXHH->GetEntries()>=1 ? BXHH->GetMaximumBin() : 51;
319 BXMean = BXHH->GetEntries()>=1 ? BXHH->GetMean() : 51;
320 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
321 double trigsFlag2nd = Flag1st->GetBinContent(2);
322 double trigs = Flag1st->GetEntries();
323 besttrigs = BestQual->GetEntries();
324 double besttrigsCorr = BestQual->Integral(5,7,
"");
328 corrFrac = besttrigsCorr/besttrigs;
329 secondFrac = trigsFlag2nd/trigs;
330 if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracError",.5)){
333 else if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracWarning",.6)){
339 if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracError",.2)){
342 else if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracWarning",.1)){
354 TH1D* BXDistr = BXvsQual->ProjectionY();
355 TH1D* QualDistr = BXvsQual->ProjectionX();
356 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
358 int nbinsBX = BXDistr->GetNbinsX();
359 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
360 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
361 int iMin = firstBinCenter>-4 ? firstBinCenter : -4;
362 int iMax = lastBinCenter<20 ? lastBinCenter : 20;
363 for (
int ibin=iMin+5;ibin<=iMax+5; ++ibin) {
364 innerME->find(
fullName(
"BXDistribPhiOut"))->second->setBinContent(ibin,
stat,BXDistr->GetBinContent(ibin-5-firstBinCenter+1));
366 for (
int ibin=1;ibin<=7;++ibin) {
367 innerME->find(
fullName(
"QualDistribPhiOut"))->second->setBinContent(ibin,
stat,QualDistr->GetBinContent(ibin));
374 std::map<std::string,MonitorElement*> *innerME = &(
secME[sector_id]);
384 innerME = &(
whME[wh]);
385 innerME->find(
fullName(
"CorrectBXPhiOut"))->second->setBinContent(sect,
stat,BX_OK+0.00001);
386 innerME->find(
fullName(
"ResidualBXPhiOut"))->second->setBinContent(sect,
stat,round(25.*(BXMean-BX_OK))+0.00001);
387 innerME->find(
fullName(
"CorrFractionPhiOut"))->second->setBinContent(sect,
stat,corrFrac);
388 innerME->find(
fullName(
"TriggerInclusivePhiOut"))->second->setBinContent(sect,
stat,besttrigs);
389 innerME->find(
fullName(
"2ndFractionPhiOut"))->second->setBinContent(sect,
stat,secondFrac);
392 whME[wh].find(
fullName(
"CorrFractionSummaryOut"))->second->setBinContent(sect,
stat,corrSummary);
393 whME[wh].find(
fullName(
"2ndFractionSummaryOut"))->second->setBinContent(sect,
stat,secondSummary);
400 TH2F * ThetaBXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"ThetaBXvsQual",
"LocalTriggerTheta", chId)));
401 TH1F * ThetaBestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"ThetaBestQual",
"LocalTriggerTheta", chId)));
404 if (ThetaBXvsQual && ThetaBestQual && stat<4 && ThetaBestQual->GetEntries()>1) {
405 TH1D* BXH = ThetaBXvsQual->ProjectionY(
"",4,4,
"");
406 int BXOK_bin = BXH->GetEffectiveEntries()>=1 ? BXH->GetMaximumBin(): 10;
407 double BX_OK = ThetaBXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
408 double trigs = ThetaBestQual->GetEntries();
409 double trigsH = ThetaBestQual->GetBinContent(4);
416 std::map<std::string,MonitorElement*> *innerME = &(
whME.find(wh)->second);
417 innerME->find(
fullName(
"CorrectBXTheta"))->second->setBinContent(sect,
stat,BX_OK+0.00001);
418 innerME->find(
fullName(
"HFractionTheta"))->second->setBinContent(sect,
stat,trigsH/trigs);
424 TH2F * ThetaPosvsBX = getHisto<TH2F>(igetter.
get(
getMEName(
"PositionvsBX",
"LocalTriggerTheta", chId)));
427 if (ThetaPosvsBX && stat<4 && ThetaPosvsBX->GetEntries()>1) {
428 TH1D*
BX = ThetaPosvsBX->ProjectionX();
429 int BXOK_bin = BX->GetEffectiveEntries()>=1 ? BX->GetMaximumBin(): 10;
430 BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
436 std::map<std::string,MonitorElement*> *innerME = &(
whME.find(wh)->second);
437 innerME->find(
fullName(
"CorrectBXTheta"))->second->setBinContent(sect,
stat,BX_OK+0.00001);
441 TH2F * ThetaBXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"ThetaBXvsQual",
"LocalTriggerTheta", chId)));
442 TH1F * ThetaBestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"ThetaBestQual",
"LocalTriggerTheta", chId)));
443 if (ThetaBXvsQual && ThetaBestQual && stat<4 && ThetaBestQual->GetEntries()>1) {
444 double trigs = ThetaBestQual->GetEntries();
445 double trigsH = ThetaBestQual->GetBinContent(2);
449 std::map<std::string,MonitorElement*> *innerME = &(
whME.find(wh)->second);
450 innerME->find(
fullName(
"HFractionTheta"))->second->setBinContent(sect,
stat,trigsH/trigs);
465 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw){
467 for (
int wh=-2; wh<=2; ++wh){
468 std::map<std::string,MonitorElement*> *innerME = &(
whME[wh]);
470 TH2F* matchWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"MatchingSummary"))->second);
471 for (
int sect=1; sect<=12; ++sect){
475 switch (static_cast<int>(matchWhSummary->GetBinContent(sect,
stat))) {
482 if (matchNoData == 4) matchErr = 5;
488 TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryIn"))->second);
489 TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryIn"))->second);
490 for (
int sect=1; sect<=12; ++sect){
494 int secondNoData = 0;
496 switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect,
stat))) {
502 switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect,
stat))) {
509 if (corrNoData == 4) corrErr = 5;
510 if (secondNoData == 4) secondErr = 5;
515 TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryOut"))->second);
516 TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryOut"))->second);
517 for (
int sect=1; sect<=12; ++sect){
521 int secondNoData = 0;
523 switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect,
stat))) {
529 switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect,
stat))) {
536 if (corrNoData == 4) corrErr = 5;
537 if (secondNoData == 4) secondErr = 5;
std::map< int, std::map< std::string, MonitorElement * > > secME
std::vector< std::string > trigSources
std::map< int, std::map< std::string, MonitorElement * > > whME
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void fillGlobalSummary(DQMStore::IGetter &)
MonitorElement * get(std::string const &path)
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
std::map< std::string, MonitorElement * > cmsME
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
const int wheelArrayShift
std::vector< std::string > hwSources
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
std::string fullName(std::string htype)
Create fullname from histo partial name.