Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#include "DQM/SiPixelMonitorClient/interface/SiPixelDcsInfo.h"
//#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
#include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
#include "CondFormats/RunInfo/interface/RunInfo.h"
#include "CondFormats/RunInfo/interface/RunSummary.h"

using namespace std;
using namespace edm;
SiPixelDcsInfo::SiPixelDcsInfo(const edm::ParameterSet &ps) { firstRun = true; }

SiPixelDcsInfo::~SiPixelDcsInfo() {}

void SiPixelDcsInfo::dqmEndLuminosityBlock(DQMStore::IBooker &iBooker,
                                           DQMStore::IGetter &iGetter,
                                           const edm::LuminosityBlock &lumiBlock,
                                           const edm::EventSetup &iSetup) {
  if (firstRun) {
    iBooker.setCurrentFolder("Pixel/EventInfo");
    Fraction_ = iBooker.bookFloat("DCSSummary");
    iBooker.setCurrentFolder("Pixel/EventInfo/DCSContents");
    FractionBarrel_ = iBooker.bookFloat("PixelBarrelFraction");
    FractionEndcap_ = iBooker.bookFloat("PixelEndcapFraction");
  }

  if (iSetup.tryToGet<RunInfoRcd>()) {
    // all Pixel:
    Fraction_->Fill(1.);
    // Barrel:
    FractionBarrel_->Fill(1.);
    // Endcap:
    FractionEndcap_->Fill(1.);
    return;
  }
}

void SiPixelDcsInfo::dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) {
  // Nothing actually happened in the old endJob/endRun, so this is left empty.
}