#include <RPCMultiplicityTest.h>
Definition at line 11 of file RPCMultiplicityTest.h.
RPCMultiplicityTest::RPCMultiplicityTest | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 16 of file RPCMultiplicityTest.cc.
References edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, numberOfRings_, prescaleFactor_, and testMode_.
{ edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: Constructor"; prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1); numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3); numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2); testMode_ = ps.getUntrackedParameter<bool>("testMode", false); }
RPCMultiplicityTest::~RPCMultiplicityTest | ( | ) | [virtual] |
void RPCMultiplicityTest::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | c | ||
) | [virtual] |
void RPCMultiplicityTest::beginJob | ( | DQMStore * | dbe, |
std::string | workingFolder | ||
) | [virtual] |
BeginJob.
Implements RPCClient.
Definition at line 30 of file RPCMultiplicityTest.cc.
References dbe_, and globalFolder_.
{ edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: Begin job"; globalFolder_ = workingFolder; dbe_=dbe; }
void RPCMultiplicityTest::beginLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, |
edm::EventSetup const & | context | ||
) | [virtual] |
void RPCMultiplicityTest::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements RPCClient.
Definition at line 86 of file RPCMultiplicityTest.cc.
References DQMStore::book1D(), DQMStore::book2D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, NULL, numberOfDisks_, numberOfRings_, evf::evtn::offset(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), and testMode_.
{ MonitorElement* me=NULL; dbe_->setCurrentFolder(globalFolder_); std::stringstream histoName; rpcdqm::utils rpcUtils; for (int i = -2; i<=2;i++ ){//loop on wheels and disks histoName.str(""); histoName<<"NumberOfDigi_Mean_Roll_vs_Sector_Wheel"<<i; me = 0; me = dbe_->get(globalFolder_ +"/"+ histoName.str()); if ( 0!=me) { dbe_->removeElement(me->getName()); } MULTWheel[i+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5); rpcUtils.labelXAxisSector( MULTWheel[i+2]); rpcUtils.labelYAxisRoll( MULTWheel[i+2], 0, i); if(testMode_){ histoName.str(""); histoName<<"NumberOfDigi_Mean_Distribution_Wheel"<<i; me = 0; me = dbe_->get(globalFolder_ +"/"+ histoName.str()); if ( 0!=me) { dbe_->removeElement(me->getName()); } MULTDWheel[i+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5); } }//end wheels for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){ if (d == 0 )continue; int offset = numberOfDisks_; if (d>0) offset --; //used to skip case equale to zero histoName.str(""); histoName<<"NumberOfDigi_Mean_Ring_vs_Segment_Disk"<<d; me = 0; me = dbe_->get(globalFolder_ +"/"+ histoName.str()); if ( 0!=me) { dbe_->removeElement(me->getName()); } MULTDisk[d+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(),36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5); rpcUtils.labelXAxisSegment(MULTDisk[d+offset]); rpcUtils.labelYAxisRing(MULTDisk[d+offset], numberOfRings_); if(testMode_){ histoName.str(""); histoName<<"NumberOfDigi_Mean_Distribution_Disk"<<d; me = 0; me = dbe_->get(globalFolder_ +"/"+ histoName.str()); if ( 0!=me) { dbe_->removeElement(me->getName()); } MULTDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5); } }//end loop on wheels and disks }
void RPCMultiplicityTest::clientOperation | ( | edm::EventSetup const & | c | ) | [virtual] |
Implements RPCClient.
Definition at line 76 of file RPCMultiplicityTest.cc.
References fillGlobalME(), i, myDetIds_, and myNumDigiMe_.
{ edm::LogVerbatim ("multiplicity") <<"[RPCMultiplicityTest]: Client Operation"; //Loop on MEs for (unsigned int i = 0 ; i<myNumDigiMe_.size();i++){ this->fillGlobalME(myDetIds_[i],myNumDigiMe_[i]); }//End loop on MEs }
void RPCMultiplicityTest::endJob | ( | void | ) | [virtual] |
void RPCMultiplicityTest::endLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, |
edm::EventSetup const & | iSetup | ||
) | [virtual] |
void RPCMultiplicityTest::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements RPCClient.
Definition at line 38 of file RPCMultiplicityTest.cc.
{ edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: End run"; }
void RPCMultiplicityTest::fillGlobalME | ( | RPCDetId & | detId, |
MonitorElement * | myMe | ||
) | [protected] |
Definition at line 159 of file RPCMultiplicityTest.cc.
References rpcdqm::utils::detId2RollNr(), MonitorElement::Fill(), MonitorElement::getMean(), plotscripts::mean(), MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), MonitorElement::setBinContent(), RPCDetId::station(), and testMode_.
Referenced by clientOperation().
{ MonitorElement * MULT =NULL; MonitorElement * MULTD = NULL; if (detId.region()==0) { MULT = MULTWheel[detId.ring()+2]; if(testMode_) MULTD = MULTDWheel[detId.ring()+2]; }else{ if(-detId.station() + numberOfDisks_ >= 0 ){ if(detId.region()<0){ MULT = MULTDisk[-detId.station() + numberOfDisks_]; if(testMode_) MULTD = MULTDDisk[-detId.station()+ numberOfDisks_]; }else{ MULT = MULTDisk[detId.station()+ numberOfDisks_ -1]; if(testMode_) MULTD = MULTDDisk[detId.station()+ numberOfDisks_-1]; } } } int xBin,yBin; if(detId.region()==0){//Barrel xBin= detId.sector(); rpcdqm::utils rollNumber; yBin = rollNumber.detId2RollNr(detId); }else{//Endcap //get segment number RPCGeomServ RPCServ(detId); xBin = RPCServ.segment(); (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1); } float mean = myMe->getMean(); if(MULT) MULT->setBinContent(xBin,yBin, mean ); if(testMode_ && MULTD) MULTD->Fill(mean); }
void RPCMultiplicityTest::getMonitorElements | ( | std::vector< MonitorElement * > & | meVector, |
std::vector< RPCDetId > & | detIdVector | ||
) | [virtual] |
Implements RPCClient.
Definition at line 44 of file RPCMultiplicityTest.cc.
References i, rpcdqm::MULTIPLICITY, myDetIds_, and myNumDigiMe_.
{ //Get NumberOfDigi ME for each roll for (unsigned int i = 0 ; i<meVector.size(); i++){ bool flag= false; DQMNet::TagList tagList; tagList = meVector[i]->getTags(); DQMNet::TagList::iterator tagItr = tagList.begin(); while (tagItr != tagList.end() && !flag ) { if((*tagItr) == rpcdqm::MULTIPLICITY) flag= true; tagItr++; } if(flag){ myNumDigiMe_.push_back(meVector[i]); myDetIds_.push_back(detIdVector[i]); } } }
DQMStore* RPCMultiplicityTest::dbe_ [private] |
Definition at line 64 of file RPCMultiplicityTest.h.
Referenced by beginJob(), beginRun(), and ~RPCMultiplicityTest().
std::string RPCMultiplicityTest::globalFolder_ [private] |
Definition at line 52 of file RPCMultiplicityTest.h.
Referenced by beginJob(), and beginRun().
MonitorElement* RPCMultiplicityTest::MULTDDisk[10] [private] |
Definition at line 62 of file RPCMultiplicityTest.h.
Referenced by beginRun(), and fillGlobalME().
MonitorElement* RPCMultiplicityTest::MULTDisk[10] [private] |
Definition at line 61 of file RPCMultiplicityTest.h.
Referenced by beginRun(), and fillGlobalME().
MonitorElement* RPCMultiplicityTest::MULTDWheel[5] [private] |
Definition at line 60 of file RPCMultiplicityTest.h.
Referenced by beginRun(), and fillGlobalME().
MonitorElement* RPCMultiplicityTest::MULTWheel[5] [private] |
Definition at line 59 of file RPCMultiplicityTest.h.
Referenced by beginRun(), and fillGlobalME().
std::vector<RPCDetId> RPCMultiplicityTest::myDetIds_ [private] |
Definition at line 57 of file RPCMultiplicityTest.h.
Referenced by clientOperation(), and getMonitorElements().
std::vector<MonitorElement *> RPCMultiplicityTest::myNumDigiMe_ [private] |
Definition at line 56 of file RPCMultiplicityTest.h.
Referenced by clientOperation(), and getMonitorElements().
int RPCMultiplicityTest::numberOfDisks_ [private] |
Definition at line 53 of file RPCMultiplicityTest.h.
Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().
int RPCMultiplicityTest::numberOfRings_ [private] |
Definition at line 54 of file RPCMultiplicityTest.h.
Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().
int RPCMultiplicityTest::prescaleFactor_ [private] |
Definition at line 51 of file RPCMultiplicityTest.h.
Referenced by RPCMultiplicityTest().
bool RPCMultiplicityTest::testMode_ [private] |
Definition at line 58 of file RPCMultiplicityTest.h.
Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().