CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

RPCDaqInfo Class Reference

#include <RPCDaqInfo.h>

Inheritance diagram for RPCDaqInfo:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
virtual void endJob ()
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)

Private Attributes

MonitorElementdaqDiskFractions [10]
MonitorElementDaqFraction_
MonitorElementDaqMap_
MonitorElementdaqWheelFractions [5]
DQMStoredbe_
std::pair< int, int > FEDRange_
int numberOfDisks_
int NumberOfFeds_

Detailed Description

Definition at line 25 of file RPCDaqInfo.h.


Constructor & Destructor Documentation

RPCDaqInfo::RPCDaqInfo ( const edm::ParameterSet ps) [explicit]

Definition at line 7 of file RPCDaqInfo.cc.

References FEDRange_, edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, and NumberOfFeds_.

                                                {
 
  FEDRange_.first  = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
  
  NumberOfFeds_ =FEDRange_.second -  FEDRange_.first +1;

  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
}
RPCDaqInfo::~RPCDaqInfo ( )

Definition at line 17 of file RPCDaqInfo.cc.

{}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 121 of file RPCDaqInfo.cc.

{}
void RPCDaqInfo::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file RPCDaqInfo.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), daqDiskFractions, DaqFraction_, DaqMap_, daqWheelFractions, dbe_, MonitorElement::Fill(), i, MessageLogger_cff::limit, numberOfDisks_, evf::evtn::offset(), cppFunctionSkipper::operator, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and hcal_dqm_sourceclient-file_cfg::streams.

                         {

  dbe_ = 0;
  dbe_ = edm::Service<DQMStore>().operator->();
  
  //fraction of alive FEDs
  dbe_->setCurrentFolder("RPC/EventInfo/DAQContents");
 
  int limit = numberOfDisks_;
  if(numberOfDisks_ < 2) limit = 2;
  
  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
    if (i>-3 && i<3){//wheels
      std::stringstream streams;
      streams << "RPC_Wheel" << i;
      daqWheelFractions[i+2] = dbe_->bookFloat(streams.str());
      daqWheelFractions[i+2]->Fill(-1);
    }
    
    if (i == 0  || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
    
    int offset = numberOfDisks_;
    if (i>0) offset --; //used to skip case equale to zero
    
    std::stringstream streams;
    streams << "RPC_Disk" << i;
    daqDiskFractions[i+2] = dbe_->bookFloat(streams.str());
    daqDiskFractions[i+2]->Fill(-1);
  }


  //daq summary for RPCs
  dbe_->setCurrentFolder("RPC/EventInfo");
    
  DaqFraction_ = dbe_->bookFloat("DAQSummary");

  DaqMap_ = dbe_->book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);

 //customize the 2d histo
  std::stringstream BinLabel;
  for (int i= 1 ; i<=15; i++){
    BinLabel.str("");
    if(i<13){
      BinLabel<<"Sec"<<i;
      DaqMap_->setBinLabel(i,BinLabel.str(),2);
    } 

    BinLabel.str("");
    if(i<5)
      BinLabel<<"Disk"<<i-5;
    else if(i>11)
      BinLabel<<"Disk"<<i-11;
    else if(i==11 || i==5)
      BinLabel.str("");
    else
      BinLabel<<"Wheel"<<i-8;
 
     DaqMap_->setBinLabel(i,BinLabel.str(),1);
  }
}
void RPCDaqInfo::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 19 of file RPCDaqInfo.cc.

References DaqFraction_, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), and NumberOfFeds_.

                                                                                                      {
  
  edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd"));


  if(0 != iSetup.find( recordKey ) ) {

    //get fed summary information
    edm::ESHandle<RunInfo> sumFED;
    iSetup.get<RunInfoRcd>().get(sumFED);    
    std::vector<int> FedsInIds= sumFED->m_fed_in;   

    int FedCount=0;

    //loop on all active feds
    for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
      int fedID=FedsInIds[fedItr];
      //make sure fed id is in allowed range  

      if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
    }   

    //Fill active fed fraction ME
    if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
    else  DaqFraction_->Fill(-1);
 
  }else{      
    DaqFraction_->Fill(-1);               
    return; 
  }
}
void RPCDaqInfo::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file RPCDaqInfo.cc.

{}
void RPCDaqInfo::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file RPCDaqInfo.cc.

{}

Member Data Documentation

Definition at line 43 of file RPCDaqInfo.h.

Referenced by beginJob().

Definition at line 40 of file RPCDaqInfo.h.

Referenced by beginJob(), and beginLuminosityBlock().

Definition at line 41 of file RPCDaqInfo.h.

Referenced by beginJob().

Definition at line 42 of file RPCDaqInfo.h.

Referenced by beginJob().

Definition at line 38 of file RPCDaqInfo.h.

Referenced by beginJob().

std::pair<int,int> RPCDaqInfo::FEDRange_ [private]

Definition at line 45 of file RPCDaqInfo.h.

Referenced by beginLuminosityBlock(), and RPCDaqInfo().

Definition at line 47 of file RPCDaqInfo.h.

Referenced by beginJob(), and RPCDaqInfo().

Definition at line 47 of file RPCDaqInfo.h.

Referenced by beginLuminosityBlock(), and RPCDaqInfo().