CMS 3D CMS Logo

RPCMon_SS_Dbx_Global Class Reference

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

Inheritance diagram for RPCMon_SS_Dbx_Global:

edm::EDAnalyzer

List of all members.

Public Member Functions

 RPCMon_SS_Dbx_Global (const edm::ParameterSet &)
 ~RPCMon_SS_Dbx_Global ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void endJob ()

Private Attributes

DQMStoredbe_
std::string globalFolder_
std::string rootFileName_
bool saveRootFile_
int verbose_


Detailed Description

Definition at line 17 of file RPCMon_SS_Dbx_Global.h.


Constructor & Destructor Documentation

RPCMon_SS_Dbx_Global::RPCMon_SS_Dbx_Global ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 21 of file RPCMon_SS_Dbx_Global.cc.

References edm::ParameterSet::getUntrackedParameter(), globalFolder_, rootFileName_, saveRootFile_, and verbose_.

00021                                                                       {
00022 
00023 
00024   LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Constructor";
00025 
00026 
00027   globalFolder_ = iConfig.getUntrackedParameter<string>("GlobalHistogramsFolder","RPC/RecHits/SummaryHistograms");
00028 
00029   saveRootFile_ =  iConfig.getUntrackedParameter<bool>("SaveRootFile", false);
00030   rootFileName_ = iConfig.getUntrackedParameter<string>("RootFileName","out.root");
00031   verbose_ =  iConfig.getUntrackedParameter<int>("VerboseLevel", 0);
00032 }

RPCMon_SS_Dbx_Global::~RPCMon_SS_Dbx_Global (  ) 

Definition at line 34 of file RPCMon_SS_Dbx_Global.cc.

References dbe_.

00034                                            {
00035   LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Destructor ";
00036   dbe_=0;
00037 }


Member Function Documentation

void RPCMon_SS_Dbx_Global::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 59 of file RPCMon_SS_Dbx_Global.cc.

References funct::abs(), DQMStore::book2D(), RPCGeomServ::chambernr(), GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), MonitorElement::Fill(), edm::EventSetup::get(), DQMStore::get(), edm::Event::getByType(), globalFolder_, me, name, RPCGeomServ::name(), RPCRoll::nstrips(), range, seg, RPCGeomServ::segment(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and ecalRecalibSequence_cff::tag.

00059                                                                                  {
00060 
00061  edm::Handle<RPCDigiCollection> rpcDigis;
00062  iEvent.getByType(rpcDigis);
00063  
00064  edm::ESHandle<RPCGeometry> pDD;
00065  iSetup.get<MuonGeometryRecord>().get( pDD );
00066  
00067  
00068  RPCDigiCollection::DigiRangeIterator detUnitIt;
00069  
00070   dbe_->setCurrentFolder(globalFolder_);
00071 
00072  // Loop over DetUnit's
00073  for (detUnitIt=rpcDigis->begin();detUnitIt!=rpcDigis->end();++detUnitIt){      
00074    const RPCDetId& id = (*detUnitIt).first;
00075    const RPCRoll* roll = dynamic_cast<const RPCRoll* >( pDD->roll(id));
00076    const RPCDigiCollection::Range& range = (*detUnitIt).second;
00077    //     std::cout <<" detector "<< id.region()<< std::endl;
00078    ostringstream tag;
00079    ostringstream name;  
00080    MonitorElement* me;
00081 
00082    //get roll name
00083    RPCGeomServ RPCname(id);
00084    string nameRoll = RPCname.name();
00085    //get roll number      
00086    RPCGeomServ RPCnumber(id);
00087    int nr = RPCnumber.chambernr();
00088    //get segment (valid only if endcap)
00089    RPCGeomServ RPCsegment(id);
00090    int seg = RPCsegment.segment();
00091    
00092    // Loop over the digis of this DetUnit 
00093    for (RPCDigiCollection::const_iterator digiIt = range.first;digiIt!=range.second;++digiIt) {
00094      if (digiIt->strip() < 1 || digiIt->strip() > roll->nstrips() )
00095        LogVerbatim ("rpcmonitorerror") <<" XXXX  Problem with detector "<< id << ", strip # " << digiIt->strip();
00096      else {  
00097        for (RPCDigiCollection::const_iterator digiIt2 = digiIt; digiIt2!=range.second; ++digiIt2) {
00098          int dstrip = digiIt->strip() - digiIt2->strip();
00099          int dbx = digiIt->bx() - digiIt2->bx();
00100          if ( dstrip == 0 && abs(dbx) != 0 ) {
00101            //      std::cout <<" detector 3333 "<< id.region()<<" " << id.ring()<<std::endl;
00102            me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff");
00103            if(!me) continue;
00104            me->Fill(dbx);
00105 
00106            if (id.region()!=0){//Endcap
00107              name.str("");
00108              tag.str("");
00109              tag << "AfterPulse_DiffBx_Disk#" << id.region()*id.station();
00110              name << "Endcap, After Pulse, Diff bx, Disk # " << id.region()*id.station();
00111              me = dbe_->get(globalFolder_ + "/"+tag.str());
00112              if (!me){
00113                me = dbe_->book2D (tag.str(),name.str(),36,1.0,36.0,9,1.0,9.0);
00114            
00115                for (int chamber=1; chamber<=36 ; chamber++){
00116                  name.str("");
00117                  name<<"Ch#"<< setw(2) << setfill('0') <<chamber;
00118                  me->setBinLabel(chamber, name.str(), 1); 
00119                }
00120                for (int ring=1; ring<=3 ; ring++){
00121                  for(int roll =1; roll<=3; roll++){
00122                    string myRoll;
00123                    if(roll==1) myRoll="A";
00124                    else if(roll==2) myRoll="B";
00125                    else if(roll==3) myRoll="C";
00126                    else if(roll==3) myRoll="D";
00127                    name.str("");
00128                    name<<"Ring"<<ring<<"_"<<myRoll;
00129                    me->setBinLabel((ring-1)*3+roll, name.str(), 2); 
00130                  }
00131                }
00132              }
00133              me->Fill(seg, (id.ring()-1)*3+id.roll()); 
00134            } else { // Barrel ( region == 0 ).
00135         
00136              name.str("");
00137              tag.str("");
00138              tag << "AfterPulse_Wheel#" << std::setw(2) << std::setfill('+') << id.ring();
00139              name << "Barrel, After Pulse, Diff. bx, Wheel # " << std::setw(2) << std::setfill('+') << id.ring();
00140              me = dbe_->get(globalFolder_ + "/"+tag.str());
00141              if (!me){
00142                std::cout <<tag.str()<<std::endl;
00143                me = dbe_->book2D (tag.str(),name.str(),12,0.5,13.5,21,1.0,21.0);
00144                for (int sector=1; sector<=12 ; sector++){
00145                  name.str("");
00146                  name<<"Sec"<< setw(2) << setfill('0') <<sector;
00147                  me->setBinLabel(sector, name.str(), 1); 
00148                }
00149              } 
00150              me->Fill(id.sector(),nr);
00151            }
00152            if (id.region()==0){ //fill barrel labels
00153              string Yaxis=RPCname.name();
00154              Yaxis.erase (1,1);
00155              Yaxis.erase(0,3);
00156              Yaxis.replace(Yaxis.find("S"),4,"");
00157              Yaxis.erase(Yaxis.find("_")+2,8);
00158              me->setBinLabel(nr, Yaxis, 2);
00159            }
00160          }
00161        }
00162      }      
00163    }
00164  }                   // for  digis in layer
00165 }              

void RPCMon_SS_Dbx_Global::beginJob ( const edm::EventSetup iSetup  )  [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file RPCMon_SS_Dbx_Global.cc.

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

00039                                                            {
00040  LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin job ";
00041  dbe_ = Service<DQMStore>().operator->();
00042  dbe_->setVerbose(verbose_);
00043 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file RPCMon_SS_Dbx_Global.cc.

References DQMStore::book1D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, me, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

00047                                                                     {
00048   LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin run";
00049 
00050   dbe_->setCurrentFolder(globalFolder_);
00051 
00052   MonitorElement* me;
00053 
00054   if ( me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff")) 
00055     dbe_->removeElement(me->getName());
00056   me = dbe_->book1D("AfterPulseBxDiff","After Pulse Bx Difference",13,-6.5,6.5);
00057 }

void RPCMon_SS_Dbx_Global::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file RPCMon_SS_Dbx_Global.cc.

00045 {}


Member Data Documentation

DQMStore* RPCMon_SS_Dbx_Global::dbe_ [private]

Definition at line 33 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), beginJob(), beginRun(), and ~RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::globalFolder_ [private]

Definition at line 29 of file RPCMon_SS_Dbx_Global.h.

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

std::string RPCMon_SS_Dbx_Global::rootFileName_ [private]

Definition at line 32 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

bool RPCMon_SS_Dbx_Global::saveRootFile_ [private]

Definition at line 30 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

int RPCMon_SS_Dbx_Global::verbose_ [private]

Definition at line 31 of file RPCMon_SS_Dbx_Global.h.

Referenced by beginJob(), and RPCMon_SS_Dbx_Global().


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