#include <RPCEfficiencyShiftHisto.h>
Public Member Functions | |
void | analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) |
Analyze. | |
void | beginJob () |
BeginJob. | |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
RPCEfficiencyShiftHisto (const edm::ParameterSet &iConfig) | |
Constructor. | |
virtual | ~RPCEfficiencyShiftHisto () |
Destructor. | |
Public Attributes | |
MonitorElement * | EffBarrelRoll |
MonitorElement * | EffEndcapMinusRoll |
MonitorElement * | EffEndcapPlusRoll |
MonitorElement * | RollPercentage |
Private Attributes | |
DQMStore * | dbe_ |
int | effCut_ |
std::string | globalFolder_ |
std::string | NameFile |
int | numberOfDisks_ |
bool | SaveFile |
RPCEfficiencyShiftHisto::RPCEfficiencyShiftHisto | ( | const edm::ParameterSet & | iConfig | ) |
Constructor.
Definition at line 25 of file RPCEfficiencyShiftHisto.cc.
References effCut_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, NameFile, numberOfDisks_, and SaveFile.
{ globalFolder_ = ps.getUntrackedParameter<std::string>("GlobalFolder", "RPC/RPCEfficiency/"); effCut_= ps.getUntrackedParameter<int>("EffCut", 90); SaveFile = ps.getUntrackedParameter<bool>("SaveFile", false); NameFile = ps.getUntrackedParameter<std::string>("NameFile","RPCEfficiency.root"); numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3); }
RPCEfficiencyShiftHisto::~RPCEfficiencyShiftHisto | ( | ) | [virtual] |
void RPCEfficiencyShiftHisto::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
void RPCEfficiencyShiftHisto::beginJob | ( | void | ) | [virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 39 of file RPCEfficiencyShiftHisto.cc.
References dbe_, and cmsCodeRules::cppFunctionSkipper::operator.
{ dbe_ = edm::Service<DQMStore>().operator->(); }
void RPCEfficiencyShiftHisto::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 44 of file RPCEfficiencyShiftHisto.cc.
References DQMStore::book1D(), DQMStore::book2D(), dbe_, EffBarrelRoll, EffEndcapMinusRoll, EffEndcapPlusRoll, globalFolder_, RollPercentage, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().
{ if(dbe_ == 0) return; dbe_->setCurrentFolder(globalFolder_); EffBarrelRoll = dbe_->book1D("EffBarrelRoll", "Barrel Efficiency",101,-0.5, 100.5); EffEndcapPlusRoll = dbe_->book1D("EffEndcapPlusRoll", "Endcap + Efficiency",101,-0.5, 100.5); EffEndcapMinusRoll = dbe_->book1D("EffEndcapMinusRoll", "Endcap - Efficiency",101,-0.5, 100.5); RollPercentage = dbe_->book2D("RollPercentage", "RollPercentage",1,0.,1.,3,0.,3.); RollPercentage->setBinLabel(1,"%",1); RollPercentage->setBinLabel(1,"E+",2); RollPercentage->setBinLabel(2,"B",2); RollPercentage->setBinLabel(3,"E-",2); }
void RPCEfficiencyShiftHisto::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 60 of file RPCEfficiencyShiftHisto.cc.
References dbe_, EffBarrelRoll, effCut_, EffEndcapMinusRoll, EffEndcapPlusRoll, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), globalFolder_, NameFile, numberOfDisks_, RollPercentage, asciidump::s, DQMStore::save(), SaveFile, MonitorElement::setBinContent(), ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.
{ std::stringstream meName; MonitorElement * myMe; meName.str(""); meName<<globalFolder_; //Barrel int entriesBarrel = 0; int entriesBarrelBeyondEff = 0; float percBarrel = 0; for(int w = -2 ; w<3; w++){ meName.str(""); if(w <= 0) meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_"<<w; else meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_+"<<w; myMe = dbe_->get(meName.str()); if(myMe){ for(int s = 1; s <= myMe->getNbinsX(); s++){ for(int r = 1;r <= myMe->getNbinsY(); r++){ double effBarrel = myMe->getBinContent(s,r); if(effBarrel >= 0){//5 if (EffBarrelRoll) EffBarrelRoll->Fill(effBarrel); entriesBarrel++; if(effBarrel >= effCut_) entriesBarrelBeyondEff++; } } } } } if(entriesBarrel != 0){ percBarrel = 100*entriesBarrelBeyondEff/entriesBarrel; if(RollPercentage)RollPercentage->setBinContent(1,2,percBarrel);} //EndcapMinus int entriesEndcapMinus = 0; int entriesEndcapMinusBeyondEff = 0; float percEndcapMinus = 0; int entriesEndcapPlus = 0; int entriesEndcapPlusBeyondEff = 0; float percEndcapPlus = 0; for(int d = -numberOfDisks_ ; d < numberOfDisks_; d++){ if(d == 0) continue; meName.str(""); meName<<globalFolder_<<"Efficiency_Roll_vs_Segment_Disk_"<<d; myMe = dbe_->get(meName.str()); if(myMe){ for (int x = 1 ;x <= myMe->getNbinsX();x++){ for(int y = 1;y<=myMe->getNbinsY(); y++){ double effEndcap = myMe->getBinContent(x,y); if(d<0 ){ entriesEndcapMinus++; if(EffEndcapMinusRoll)EffEndcapMinusRoll->Fill(effEndcap); if(effEndcap >= effCut_) entriesEndcapMinusBeyondEff++; }else { entriesEndcapPlus++; if(EffEndcapPlusRoll)EffEndcapPlusRoll->Fill(effEndcap); if(effEndcap >= effCut_) entriesEndcapPlusBeyondEff++; } } } } } if(entriesEndcapMinus != 0){ percEndcapMinus = 100*entriesEndcapMinusBeyondEff/entriesEndcapMinus; if( RollPercentage) RollPercentage->setBinContent(1,3,percEndcapMinus);} if(entriesEndcapPlus != 0){ percEndcapPlus = 100*entriesEndcapPlusBeyondEff/entriesEndcapPlus; if(RollPercentage) RollPercentage->setBinContent(1,1,percEndcapPlus); } if(SaveFile) dbe_->save(NameFile); }
DQMStore* RPCEfficiencyShiftHisto::dbe_ [private] |
Definition at line 65 of file RPCEfficiencyShiftHisto.h.
Referenced by beginJob(), beginRun(), and endRun().
Definition at line 52 of file RPCEfficiencyShiftHisto.h.
Referenced by beginRun(), and endRun().
int RPCEfficiencyShiftHisto::effCut_ [private] |
Definition at line 63 of file RPCEfficiencyShiftHisto.h.
Referenced by endRun(), and RPCEfficiencyShiftHisto().
Definition at line 54 of file RPCEfficiencyShiftHisto.h.
Referenced by beginRun(), and endRun().
Definition at line 53 of file RPCEfficiencyShiftHisto.h.
Referenced by beginRun(), and endRun().
std::string RPCEfficiencyShiftHisto::globalFolder_ [private] |
Definition at line 67 of file RPCEfficiencyShiftHisto.h.
Referenced by beginRun(), endRun(), and RPCEfficiencyShiftHisto().
std::string RPCEfficiencyShiftHisto::NameFile [private] |
Definition at line 61 of file RPCEfficiencyShiftHisto.h.
Referenced by endRun(), and RPCEfficiencyShiftHisto().
int RPCEfficiencyShiftHisto::numberOfDisks_ [private] |
Definition at line 62 of file RPCEfficiencyShiftHisto.h.
Referenced by endRun(), and RPCEfficiencyShiftHisto().
Definition at line 55 of file RPCEfficiencyShiftHisto.h.
Referenced by beginRun(), and endRun().
bool RPCEfficiencyShiftHisto::SaveFile [private] |
Definition at line 59 of file RPCEfficiencyShiftHisto.h.
Referenced by endRun(), and RPCEfficiencyShiftHisto().