CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

RPCMultiplicityTest Class Reference

#include <RPCMultiplicityTest.h>

Inheritance diagram for RPCMultiplicityTest:
RPCClient

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Analyze.
void beginJob (DQMStore *, std::string)
 BeginJob.
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 Begin Lumi block.
void beginRun (const edm::Run &, const edm::EventSetup &)
void clientOperation (edm::EventSetup const &c)
void endJob ()
 Endjob.
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 End Lumi Block.
void endRun (const edm::Run &, const edm::EventSetup &)
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &)
 RPCMultiplicityTest (const edm::ParameterSet &ps)
 Constructor.
virtual ~RPCMultiplicityTest ()
 Destructor.

Protected Member Functions

void fillGlobalME (RPCDetId &detId, MonitorElement *myMe)

Private Attributes

DQMStoredbe_
std::string globalFolder_
MonitorElementMULTDDisk [10]
MonitorElementMULTDisk [10]
MonitorElementMULTDWheel [5]
MonitorElementMULTWheel [5]
std::vector< RPCDetIdmyDetIds_
std::vector< MonitorElement * > myNumDigiMe_
int numberOfDisks_
int numberOfRings_
int prescaleFactor_
bool testMode_

Detailed Description

Definition at line 11 of file RPCMultiplicityTest.h.


Constructor & Destructor Documentation

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]

Destructor.

Definition at line 25 of file RPCMultiplicityTest.cc.

References dbe_.

                                         {
  dbe_ = 0;
}

Member Function Documentation

void RPCMultiplicityTest::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
) [virtual]

Analyze.

Implements RPCClient.

Definition at line 72 of file RPCMultiplicityTest.cc.

{}
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]

Begin Lumi block.

Implements RPCClient.

Definition at line 70 of file RPCMultiplicityTest.cc.

{}
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]

Endjob.

Implements RPCClient.

Definition at line 157 of file RPCMultiplicityTest.cc.

{}
void RPCMultiplicityTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
) [virtual]

End Lumi Block.

Implements RPCClient.

Definition at line 74 of file RPCMultiplicityTest.cc.

{}
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]);
    }
  }
}

Member Data Documentation

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().

Definition at line 62 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

Definition at line 61 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

Definition at line 60 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

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().

Definition at line 56 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

Definition at line 53 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().

Definition at line 54 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().

Definition at line 51 of file RPCMultiplicityTest.h.

Referenced by RPCMultiplicityTest().

Definition at line 58 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().