CMS 3D CMS Logo

RPCEventSummary Class Reference

* DQM Event Summary module for RPCs More...

#include <DQM/RPCMonitorClient/interface/RPCEventSummary.h>

Inheritance diagram for RPCEventSummary:

edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 Analyze.
void beginJob (const edm::EventSetup &iSetup)
 BeginJob.
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Begin Lumi block.
void beginRun (const edm::Run &r, const edm::EventSetup &c)
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 End Lumi Block.
 RPCEventSummary (const edm::ParameterSet &ps)
 Constructor.
virtual ~RPCEventSummary ()
 Destructor.

Protected Member Functions

void fillReportSummary (const std::map< int, std::map< int, std::pair< float, float > > > &sumMap, int region)
std::string getMEName (RPCDetId &detId)
 Get the ME name.

Private Attributes

float allGood_
float allRolls_
DQMStoredbe_
bool enableReportSummary_
std::string eventInfoPath_
std::map< RPCDetId, std::string > meCollection
int minHitsInRoll_
edm::ESHandle< RPCGeometrymuonGeom
int nLumiSegs_
std::string prefixDir_
int prescaleFactor_
std::vector< std::string > segmentNames
bool tier0_
bool verbose_


Detailed Description

* DQM Event Summary module for RPCs

Date
2008/11/12 12:26:53
Revision
1.7
Author:
Anna Cimmino

Definition at line 32 of file RPCEventSummary.h.


Constructor & Destructor Documentation

RPCEventSummary::RPCEventSummary ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 23 of file RPCEventSummary.cc.

References enableReportSummary_, eventInfoPath_, edm::ParameterSet::getUntrackedParameter(), minHitsInRoll_, prefixDir_, prescaleFactor_, tier0_, and verbose_.

00023                                                        {
00024   LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Constructor";
00025 
00026   enableReportSummary_ = ps.getUntrackedParameter<bool>("EnableSummaryReport",true);
00027   prescaleFactor_ =  ps.getUntrackedParameter<int>("PrescaleFactor", 10);
00028   eventInfoPath_ = ps.getUntrackedParameter<string>("EventInfoPath", "RPC/EventInfo");
00029   prefixDir_ = ps.getUntrackedParameter<string>("RPCPrefixDir", "RPC/RecHits");
00030   verbose_=ps.getUntrackedParameter<bool>("VerboseLevel", 0);
00031   minHitsInRoll_=ps.getUntrackedParameter<unsigned int>("MinimunHitsPerRoll", 2000);
00032  tier0_=ps.getUntrackedParameter<bool>("Tier0", false);
00033 
00034 }

RPCEventSummary::~RPCEventSummary (  )  [virtual]

Destructor.

Definition at line 36 of file RPCEventSummary.cc.

References dbe_.

00036                                  {
00037   LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Destructor ";
00038   dbe_=0;
00039 }


Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 134 of file RPCEventSummary.cc.

References edm::Event::luminosityBlock(), and nLumiSegs_.

00134                                                                       {
00135   nLumiSegs_=iEvent.luminosityBlock();
00136 }

void RPCEventSummary::beginJob ( const edm::EventSetup iSetup  )  [virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file RPCEventSummary.cc.

References dbe_, DQMStore::setVerbose(), and verbose_.

00041                                                       {
00042  LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Begin job ";
00043  dbe_ = Service<DQMStore>().operator->();
00044  dbe_->setVerbose(verbose_);
00045 }

void RPCEventSummary::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
) [virtual]

Begin Lumi block.

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file RPCEventSummary.cc.

00132 {} 

void RPCEventSummary::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file RPCEventSummary.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dbe_, eventInfoPath_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), i, j, me, nLumiSegs_, DQMStore::removeElement(), segmentNames, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

00047                                                                {
00048  LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Begin run";
00049 
00050  nLumiSegs_=0;
00051 
00052  MonitorElement* me;
00053  dbe_->setCurrentFolder(eventInfoPath_);
00054 
00055  //a global summary float [0,1] providing a global summary of the status 
00056  //and showing the goodness of the data taken by the the sub-system 
00057  string histoName="reportSummary";
00058  if ( me = dbe_->get(eventInfoPath_ +"/"+ histoName) ) {
00059     dbe_->removeElement(me->getName());
00060   }
00061 
00062   me = dbe_->bookFloat(histoName);
00063   me->Fill(1);
00064 
00065   //TH2F ME providing a map of values[0-1] to show if problems are localized or distributed
00066   if ( me = dbe_->get(eventInfoPath_ + "/reportSummaryMap") ) {
00067      dbe_->removeElement(me->getName());
00068   }
00069   me = dbe_->book2D("reportSummaryMap", "RPC Report Summary Map", 15, -7.5, 7.5, 12, 0.5 ,12.5);
00070   
00071   //customize the 2d histo
00072   stringstream BinLabel;
00073   for (int i= 1 ; i<=15; i++){
00074     BinLabel.str("");
00075     if(i<13){
00076       BinLabel<<"Sec"<<i;
00077        me->setBinLabel(i,BinLabel.str(),2);
00078     } 
00079 
00080     BinLabel.str("");
00081     if(i<5)
00082       BinLabel<<"Disk"<<i-5;
00083     else if(i>11)
00084       BinLabel<<"Disk"<<i-11;
00085     else if(i==11 || i==5)
00086       BinLabel.str("");
00087     else
00088       BinLabel<<"Wheel"<<i-8;
00089  
00090      me->setBinLabel(i,BinLabel.str(),1);
00091   }
00092 
00093   //fill the histo with "1" --- just for the moment
00094   for(int i=1; i<=15; i++){
00095      for (int j=1; j<=12; j++ ){
00096        if(i==5 || i==11 || (j>6 && (i<6 || i>10)))    
00097          me->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
00098        else     
00099          me->setBinContent(i,j,1);
00100      }
00101    }
00102 
00103  //the reportSummaryContents folder containins a collection of ME floats [0-1] (order of 5-10)
00104  // which describe the behavior of the respective subsystem sub-components.
00105   dbe_->setCurrentFolder(eventInfoPath_+ "/reportSummaryContents");
00106   
00107   stringstream segName;
00108   for(int i=-4; i<=4; i++){
00109     if(i>-3 && i<3) {
00110       segName.str("");
00111       segName<<"RPC_Wheel"<<i;
00112       segmentNames.push_back(segName.str());
00113     }
00114     if(i==0) continue;
00115     segName.str("");
00116     segName<<"RPC_Disk"<<i;
00117     segmentNames.push_back(segName.str());
00118   }
00119   
00120   //  segmentNames.push_back("RPC_DataIntegrity");
00121   // segmentNames.push_back("RPC_Timing");
00122 
00123   for(unsigned int i=0; i<segmentNames.size(); i++){
00124     if ( me = dbe_->get(eventInfoPath_ + "/reportSummaryContents/" +segmentNames[i]) ) {
00125       dbe_->removeElement(me->getName());
00126     }
00127     me = dbe_->bookFloat(segmentNames[i]);
00128     me->Fill(1);
00129   }
00130 }

void RPCEventSummary::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
) [virtual]

End Lumi Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file RPCEventSummary.cc.

References allGood_, allRolls_, dbe_, detId, enableReportSummary_, eventInfoPath_, MonitorElement::Fill(), fillReportSummary(), RPCBookFolderStructure::folderStructure(), edm::EventSetup::get(), DQMStore::get(), QReport::getBadChannels(), MonitorElement::getEntries(), MonitorElement::getQReport(), edm::LuminosityBlock::id(), it, edm::LuminosityBlockID::luminosityBlock(), minHitsInRoll_, RPCGeomServ::name(), nLumiSegs_, NULL, prefixDir_, prescaleFactor_, r, RPCDetId::region(), getDQMSummary::reportSummary, RPCDetId::ring(), RPCChamber::rolls(), RPCDetId::sector(), RPCDetId::station(), and tier0_.

00138                                                                                                  {  
00139   LogVerbatim ("rpceventsummary") <<"[RPCEventSummary]: End of LS transition, performing DQM client operation";
00140 
00141   if (tier0_) return;
00142 
00143   // counts number of lumiSegs 
00144    nLumiSegs_ = lumiSeg.id().luminosityBlock();
00145    //nLumiSegs_++;
00146 
00147   //check some statements and prescale Factor
00148   if(enableReportSummary_  &&  (nLumiSegs_%prescaleFactor_ == 0)) {
00149  
00150   ESHandle<RPCGeometry> rpcGeo;
00151   iSetup.get<MuonGeometryRecord>().get(rpcGeo);
00152  
00153   map<int, map< int ,  pair<float,float> > >  barrelMap, endcapPlusMap, endcapMinusMap;
00154     
00155   //Loop on chambers
00156   for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
00157     if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
00158        RPCChamber* ch = dynamic_cast< RPCChamber* >( *it ); 
00159        std::vector< const RPCRoll*> roles = (ch->rolls());
00160        int ty=1;
00161        //Loop on rolls in given chamber
00162        for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
00163          RPCDetId detId = (*r)->id();
00164          //Get Occupancy ME for roll
00165          RPCGeomServ RPCname(detId);
00166          RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure();
00167          MonitorElement * myMe = dbe_->get(prefixDir_+"/"+ folderStr->folderStructure(detId)+"/Occupancy_"+RPCname.name()); 
00168          if (!myMe)continue;
00169          
00170          //check for enough statistics
00171          if (myMe->getEntries() < minHitsInRoll_) continue;
00172 
00173          const QReport * theOccupancyQReport = myMe->getQReport("DeadChannel_0");  
00174          if(!theOccupancyQReport) continue;
00175          vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels();
00176          float goodFraction =((*r)->nstrips() - badChannels.size())/(*r)->nstrips();              
00177          if (detId.region()==0) {
00178            barrelMap[detId.ring()][detId.sector()].first += goodFraction;
00179            barrelMap[detId.ring()][detId.sector()].second++ ;
00180          }else if(detId.region()==-1){
00181            endcapMinusMap[-1 * detId.station()][detId.sector()].first +=  goodFraction;
00182            endcapMinusMap[-1 * detId.station()][detId.sector()].second++ ;
00183          }else {
00184            endcapPlusMap[detId.station()][detId.sector()].first += goodFraction;
00185            endcapPlusMap[detId.station()][detId.sector()].second++;
00186          }
00187          ty++;      
00188        }//End loop on rolls in given chambers
00189     }
00190   }//End loop on chamber
00191   
00192   //clear counters
00193   allRolls_=0;
00194   allGood_=0;
00195   
00196   this->fillReportSummary(barrelMap, 0);
00197   
00198   this->fillReportSummary(endcapPlusMap, 1);
00199   
00200   this->fillReportSummary(endcapMinusMap, -1);
00201 
00202   //Fill report summary
00203   MonitorElement *   reportSummary = dbe_->get(eventInfoPath_ +"/reportSummary");
00204   if(reportSummary == NULL) return;
00205 
00206   if (allRolls_!=0)   reportSummary->Fill(allGood_/allRolls_);
00207   else reportSummary->Fill(-1);
00208   }
00209 }

void RPCEventSummary::fillReportSummary ( const std::map< int, std::map< int, std::pair< float, float > > > &  sumMap,
int  region 
) [protected]

Referenced by endLuminosityBlock().

std::string RPCEventSummary::getMEName ( RPCDetId detId  )  [protected]

Get the ME name.


Member Data Documentation

float RPCEventSummary::allGood_ [private]

Definition at line 79 of file RPCEventSummary.h.

Referenced by endLuminosityBlock().

float RPCEventSummary::allRolls_ [private]

Definition at line 78 of file RPCEventSummary.h.

Referenced by endLuminosityBlock().

DQMStore* RPCEventSummary::dbe_ [private]

Definition at line 74 of file RPCEventSummary.h.

Referenced by beginJob(), beginRun(), endLuminosityBlock(), and ~RPCEventSummary().

bool RPCEventSummary::enableReportSummary_ [private]

Definition at line 71 of file RPCEventSummary.h.

Referenced by endLuminosityBlock(), and RPCEventSummary().

std::string RPCEventSummary::eventInfoPath_ [private]

Definition at line 68 of file RPCEventSummary.h.

Referenced by beginRun(), endLuminosityBlock(), and RPCEventSummary().

std::map<RPCDetId,std::string> RPCEventSummary::meCollection [private]

Definition at line 87 of file RPCEventSummary.h.

int RPCEventSummary::minHitsInRoll_ [private]

Definition at line 75 of file RPCEventSummary.h.

Referenced by endLuminosityBlock(), and RPCEventSummary().

edm::ESHandle<RPCGeometry> RPCEventSummary::muonGeom [private]

Definition at line 81 of file RPCEventSummary.h.

int RPCEventSummary::nLumiSegs_ [private]

Definition at line 76 of file RPCEventSummary.h.

Referenced by analyze(), beginRun(), and endLuminosityBlock().

std::string RPCEventSummary::prefixDir_ [private]

Definition at line 68 of file RPCEventSummary.h.

Referenced by endLuminosityBlock(), and RPCEventSummary().

int RPCEventSummary::prescaleFactor_ [private]

Definition at line 72 of file RPCEventSummary.h.

Referenced by endLuminosityBlock(), and RPCEventSummary().

std::vector<std::string> RPCEventSummary::segmentNames [private]

Definition at line 85 of file RPCEventSummary.h.

Referenced by beginRun().

bool RPCEventSummary::tier0_ [private]

Definition at line 70 of file RPCEventSummary.h.

Referenced by endLuminosityBlock(), and RPCEventSummary().

bool RPCEventSummary::verbose_ [private]

Definition at line 73 of file RPCEventSummary.h.

Referenced by beginJob(), and RPCEventSummary().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:59 2009 for CMSSW by  doxygen 1.5.4