CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

RPCDBPopConAnalyzer Class Reference

Inheritance diagram for RPCDBPopConAnalyzer:
popcon::PopConAnalyzer< RPCDBHandler > edm::EDAnalyzer

List of all members.

Public Types

typedef RPCDBHandler SourceHandler

Public Member Functions

 RPCDBPopConAnalyzer (const edm::ParameterSet &pset)

Private Member Functions

virtual void analyze (const edm::Event &ev, const edm::EventSetup &iSetup)
virtual void beginRun (const edm::Run &run, const edm::EventSetup &iSetup)
virtual void endJob ()
void write ()

Private Attributes

DQMStoredbe
std::string efficiencyFolder_
popcon::PopCon m_populator
SourceHandler m_source
std::string recHitTypeFolder_
RPCDQMObjectrpcDQMObject
std::string subsystemFolder_
std::string summaryFolder_

Detailed Description

Definition at line 25 of file RPCDBPopConAnalyzer.cc.


Member Typedef Documentation

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 28 of file RPCDBPopConAnalyzer.cc.


Constructor & Destructor Documentation

RPCDBPopConAnalyzer::RPCDBPopConAnalyzer ( const edm::ParameterSet pset) [inline]

Member Function Documentation

virtual void RPCDBPopConAnalyzer::analyze ( const edm::Event ev,
const edm::EventSetup iSetup 
) [inline, private, virtual]

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 54 of file RPCDBPopConAnalyzer.cc.

References RPCDQMObject::DQMObjectItem::bx, RPCDQMObject::DQMObjectItem::bxrms, RPCDQMObject::DQMObjectItem::clusterSize, dbe, rpcdqm::utils::detId2RollNr(), RPCDQMObject::DQMObjectItem::dpid, RPCDQMObject::DQMObjectItem::efficiency, efficiencyFolder_, RPCBookFolderStructure::folderStructure(), edm::EventSetup::get(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getMean(), MonitorElement::getRMS(), RPCDetId::layer(), RPCGeomServ::name(), NULL, RPCDQMObject::DQMObjectItem::numcluster, RPCDQMObject::DQMObjectItem::numdigi, alignCSCRings::r, recHitTypeFolder_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCChamber::rolls(), rpcDQMObject, RPCDetId::sector(), RPCGeomServ::segment(), RPCDQMObject::DQMObjectItem::status, AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, summaryFolder_, and RPCDQMObject::v_cls.

                                                                       { //}

  //virtual void endRun(const edm::Run& r, const edm::EventSetup& iSetup){

    rpcDQMObject = new RPCDQMObject();
    RPCDQMObject::DQMObjectItem rpcDqmItem;

    edm::ESHandle<RPCGeometry> rpcGeo;
    iSetup.get<MuonGeometryRecord>().get(rpcGeo);
    //Loop on RPC geometry to access ME for each roll

    RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure(); 
    rpcdqm::utils rpcUtils;

    for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
      if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
        RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
        std::vector< const RPCRoll*> roles = (ch->rolls());
        for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){

          //Get RPC DetId
          RPCDetId rpcId = (*r)->id();

          //Check if rpcId is Valid. If not continue;

          //Get roll name
          RPCGeomServ rpcsrv(rpcId);
          std::string nameRoll = rpcsrv.name();

          //Get ME
          std::stringstream mepath;
          mepath.str("");
          //          mepath<<"RPCPVT";
          MonitorElement * MEnumcls = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId)  + "/" + "NumberOfClusters_" + nameRoll);
          MonitorElement * MEcls = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId)  + "/" + "ClusterSize_" + nameRoll);
          MonitorElement * MEocc= dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "Occupancy_" + nameRoll);
          MonitorElement * MEbx = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "BXN_" + nameRoll);

          MonitorElement * MEstatus = NULL;
          MonitorElement * MEeff = NULL;
          rpcDqmItem.status = -999;
          rpcDqmItem.efficiency= -999;

          if( rpcId.region() == 0){ //BARREL

            int nr = rpcUtils.detId2RollNr(rpcId);
            int sector = (int)rpcId.sector();

            //Status
            mepath.str("");
            mepath<<subsystemFolder_<<"/" << recHitTypeFolder_<<"/" <<  summaryFolder_<<"/RPCChamberQuality_Roll_vs_Sector_Wheel"<<rpcId.ring();
            MEstatus = dbe->get(mepath.str());  
            if(MEstatus != 0 ){
              rpcDqmItem.status =  MEstatus->getBinContent(sector, nr);
            }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Status for Barrel "<< nameRoll;
            }

            //Efficiency
            mepath.str("");
            if( rpcId.ring() > 0){
              mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Sector_Wheel_+"<<rpcId.ring();
            }else{
              mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Sector_Wheel_"<<rpcId.ring();
            }

            MEeff = dbe->get(mepath.str());  
            if(MEeff != 0 ){
              rpcDqmItem.efficiency =  MEeff->getBinContent(sector, nr);
            }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Efficiency for Barrel "<< nameRoll;
            }


          }else{
            int segment =  rpcsrv.segment() ;
            int endcapbin =  (rpcId.ring()-1)*3-rpcId.roll()+1;
            int disk = (rpcId.region() * rpcId.layer());

            //Status
            mepath.str("");
            mepath<<subsystemFolder_<<"/" << recHitTypeFolder_<<"/" <<  summaryFolder_<<"/RPCChamberQuality_Ring_vs_Segment_Disk"<<disk;
            MEstatus = dbe->get(mepath.str());
            if(MEstatus != 0 ){
              rpcDqmItem.status =   MEstatus->getBinContent(segment,endcapbin);
            }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Status for Endcap "<< nameRoll;
            }


            //Efficiency
            mepath.str("");
            mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Segment_Disk_"<<disk;
            MEeff = dbe->get(mepath.str());  
            if(MEeff != 0 ){
              rpcDqmItem.efficiency =  MEeff->getBinContent(segment,endcapbin);
            }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Efficiency for Endcap "<< nameRoll;
            }


          }
    
          rpcDqmItem.dpid = (int)rpcId;
          rpcDqmItem.clusterSize = -999;
          rpcDqmItem.numdigi = -999;
            rpcDqmItem.numcluster =-999;
          rpcDqmItem.bx = -999;
          rpcDqmItem.bxrms = -999;
          //rpcDqmItem.status = -999;

          if (MEnumcls != 0) {
            rpcDqmItem.numcluster = (float)MEnumcls->getMean();
          }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Number of Clusters for Roll "<< nameRoll;
          }

          if (MEcls != 0) {
            rpcDqmItem.clusterSize = (float)MEcls->getMean();
          }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find ClusterSize for Roll "<< nameRoll;
          }

          if (MEbx != 0) {
            rpcDqmItem.bx = (float)MEbx->getMean();
            rpcDqmItem.bxrms = (float)MEbx->getRMS();
          }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find BX for Roll "<< nameRoll;
          }
         
          if (MEocc != 0) {
            rpcDqmItem.numdigi = (float)MEocc->getEntries();
          }else{
            edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Occupancy for Roll "<< nameRoll;
          }
         


          (rpcDQMObject->v_cls).push_back(rpcDqmItem);
        }//End loop Rolls
      }
    }//End loop RPC Geometry

  }
virtual void RPCDBPopConAnalyzer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
) [inline, private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file RPCDBPopConAnalyzer.cc.

References dbe, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

                                                                       {
    dbe = edm::Service<DQMStore>().operator->();
    dbe->setCurrentFolder("RPCPVT");
  }//beginRun
virtual void RPCDBPopConAnalyzer::endJob ( void  ) [inline, private, virtual]
void RPCDBPopConAnalyzer::write ( void  ) [inline, private]

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 199 of file RPCDBPopConAnalyzer.cc.

References m_populator, m_source, and popcon::PopCon::write().

Referenced by endJob().


Member Data Documentation

Definition at line 209 of file RPCDBPopConAnalyzer.cc.

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

Definition at line 208 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 202 of file RPCDBPopConAnalyzer.cc.

Referenced by write().

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 203 of file RPCDBPopConAnalyzer.cc.

Referenced by endJob(), and write().

Definition at line 207 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

Definition at line 210 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and endJob().

Definition at line 205 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

std::string RPCDBPopConAnalyzer::summaryFolder_ [private]

Definition at line 206 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().