CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTDAQInfo Class Reference

#include <DTDAQInfo.h>

Inheritance diagram for DTDAQInfo:
edm::EDAnalyzer

List of all members.

Public Member Functions

 DTDAQInfo (const edm::ParameterSet &pset)
 Constructor.
virtual ~DTDAQInfo ()
 Destructor.

Private Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
virtual void beginJob ()
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
virtual void beginRun (const edm::Run &run, const edm::EventSetup &setup)
virtual void endJob ()
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)

Private Attributes

std::map< int, MonitorElement * > daqFractions
MonitorElementdaqMap
edm::ESHandle< DTReadOutMappingmapping
DQMStoretheDbe
MonitorElementtotalDAQFraction

Detailed Description

No description available.

Date:
2010/01/05 10:15:46
Revision:
1.4
Author:
G. Cerminara - INFN Torino

Definition at line 22 of file DTDAQInfo.h.


Constructor & Destructor Documentation

DTDAQInfo::DTDAQInfo ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file DTDAQInfo.cc.

{}
DTDAQInfo::~DTDAQInfo ( ) [virtual]

Destructor.

Definition at line 43 of file DTDAQInfo.cc.

{}

Member Function Documentation

void DTDAQInfo::analyze ( const edm::Event event,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 146 of file DTDAQInfo.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file DTDAQInfo.cc.

References cppFunctionSkipper::operator, and hcal_dqm_sourceclient-file_cfg::streams.

                        {
  // get the DQMStore
  theDbe = Service<DQMStore>().operator->();
  
  // book the ME
  // global fraction
  theDbe->setCurrentFolder("DT/EventInfo");
  totalDAQFraction = theDbe->bookFloat("DAQSummary");  
  totalDAQFraction->Fill(-1);

  // map
  daqMap = theDbe->book2D("DAQSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
  daqMap->setAxisTitle("sector",1);
  daqMap->setAxisTitle("wheel",2);


  // Wheel "fractions" -> will be 0 or 1
  theDbe->setCurrentFolder("DT/EventInfo/DAQContents");
  for(int wheel = -2; wheel != 3; ++wheel) {
    stringstream streams;
    streams << "DT_Wheel" << wheel;
    daqFractions[wheel] = theDbe->bookFloat(streams.str());
    daqFractions[wheel]->Fill(-1);
  }

  //

}
void DTDAQInfo::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file DTDAQInfo.cc.

References edm::EventSetup::find(), edm::typelookup::findType(), edm::EventSetup::get(), LogTrace, FEDNumbering::MAXDTFEDID, and FEDNumbering::MINDTFEDID.

                                                                                          {
  // create a record key for RunInfoRcd
  eventsetup::EventSetupRecordKey recordKey(eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd"));


  if(setup.find(recordKey) != 0) { 
    // reset to 0
    totalDAQFraction->Fill(0.);
    daqFractions[-2]->Fill(0.);
    daqFractions[-1]->Fill(0.);
    daqFractions[-0]->Fill(0.);
    daqFractions[1]->Fill(0.);
    daqFractions[2]->Fill(0.);

    daqMap->Reset();

    //get fed summary information
    ESHandle<RunInfo> sumFED;
    setup.get<RunInfoRcd>().get(sumFED);    
    vector<int> fedInIDs = sumFED->m_fed_in;   


    // the range of DT feds
    static int FEDIDmin = FEDNumbering::MINDTFEDID;
    static int FEDIDMax = FEDNumbering::MAXDTFEDID;

    // loop on all active feds
    for(vector<int>::const_iterator fed = fedInIDs.begin();
        fed != fedInIDs.end();
        ++fed) {
      // check if the fed is in the DT range
      if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;

      // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
      int wheel = -99;
      int sector = -99;
      int dummy = -99;
      for(int ros = 1; ros != 13; ++ros) {
        if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
          LogTrace("DQM|DTMonitorClient|DTDAQInfo")
            << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
          daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
          totalDAQFraction->Fill(totalDAQFraction->getFloatValue() + 1./60.);
          daqMap->Fill(sector,wheel);
        }
      }
    }   
  } else {      
    LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
    totalDAQFraction->Fill(-1);               
    for(int wheel = -2; wheel != 3; ++wheel) {
      daqFractions[wheel]->Fill(-1);
    }
    return; 
  }
}
void DTDAQInfo::beginRun ( const edm::Run run,
const edm::EventSetup setup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file DTDAQInfo.cc.

References edm::EventSetup::get().

                                                                {
  // retrieve the mapping
  setup.get<DTReadOutMappingRcd>().get(mapping);
}
void DTDAQInfo::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file DTDAQInfo.cc.

{}
void DTDAQInfo::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file DTDAQInfo.cc.

{}

Member Data Documentation

std::map<int, MonitorElement*> DTDAQInfo::daqFractions [private]

Definition at line 46 of file DTDAQInfo.h.

Definition at line 45 of file DTDAQInfo.h.

Definition at line 47 of file DTDAQInfo.h.

Definition at line 42 of file DTDAQInfo.h.

Definition at line 44 of file DTDAQInfo.h.