CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes

ecaldqm::PNPresampleTask Class Reference

#include <PNPresampleTask.h>

Inheritance diagram for ecaldqm::PNPresampleTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

List of all members.

Public Types

enum  MESets { kPedestal, nMESets }

Public Member Functions

void analyze (const void *, Collections)
void beginRun (const edm::Run &, const edm::EventSetup &)
void endEvent (const edm::Event &, const edm::EventSetup &)
bool filterRunType (const std::vector< short > &)
 PNPresampleTask (const edm::ParameterSet &, const edm::ParameterSet &)
void runOnPnDigis (const EcalPnDiodeDigiCollection &)
 ~PNPresampleTask ()

Static Public Member Functions

static void setMEData (std::vector< MEData > &)

Protected Attributes

bool enable_ [BinService::nDCC]

Detailed Description

Definition at line 10 of file PNPresampleTask.h.


Member Enumeration Documentation

Enumerator:
kPedestal 
nMESets 

Reimplemented from ecaldqm::DQWorker.

Definition at line 24 of file PNPresampleTask.h.


Constructor & Destructor Documentation

afs cern ch work a aaltunda public www CMSSW_6_2_5 src DQM EcalBarrelMonitorTasks src PNPresampleTask cc ecaldqm::PNPresampleTask::PNPresampleTask ( const edm::ParameterSet _params,
const edm::ParameterSet _paths 
)

Definition at line 8 of file PNPresampleTask.cc.

References ecaldqm::kPnDiodeDigi.

  {
    collectionMask_ =
      (0x1 << kPnDiodeDigi);
  }

ecaldqm::PNPresampleTask::~PNPresampleTask ( )

Definition at line 15 of file PNPresampleTask.cc.

  {
  }


Member Function Documentation

void ecaldqm::PNPresampleTask::analyze ( const void *  _p,
Collections  _collection 
) [inline, virtual]

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 35 of file PNPresampleTask.h.

References ecaldqm::kPnDiodeDigi, and runOnPnDigis().

                                                                             {
    switch(_collection){
    case kPnDiodeDigi:
      runOnPnDigis(*static_cast<const EcalPnDiodeDigiCollection*>(_p));
      break;
    default:
      break;
    }
  }
void ecaldqm::PNPresampleTask::beginRun ( const edm::Run ,
const edm::EventSetup  
) [virtual]

Reimplemented from ecaldqm::DQWorker.

Definition at line 20 of file PNPresampleTask.cc.

References enable_.

  {
    for(int idcc(0); idcc < 54; idcc++)
      enable_[idcc] = false;
  }

void ecaldqm::PNPresampleTask::endEvent ( const edm::Event ,
const edm::EventSetup  
) [virtual]

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 27 of file PNPresampleTask.cc.

References enable_.

  {
    for(int idcc(0); idcc < 54; idcc++)
      enable_[idcc] = false;
  }

bool ecaldqm::PNPresampleTask::filterRunType ( const std::vector< short > &  _runType) [virtual]

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 34 of file PNPresampleTask.cc.

References enable_, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::TESTPULSE_GAP, and EcalDCCHeaderBlock::TESTPULSE_MGPA.

  {
    bool enable(false);

    for(int iDCC(0); iDCC < 54; iDCC++){
      if(_runType[iDCC] == EcalDCCHeaderBlock::LASER_STD ||
         _runType[iDCC] == EcalDCCHeaderBlock::LASER_GAP ||
         _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
         _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_GAP){
        enable = true;
        enable_[iDCC] = true;
      }
    }

    return enable;
  }

void ecaldqm::PNPresampleTask::runOnPnDigis ( const EcalPnDiodeDigiCollection _digis)

Definition at line 52 of file PNPresampleTask.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), kPedestal, timingPdfMaker::mean, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

  {
    for(EcalPnDiodeDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
      const EcalPnDiodeDetId& id(digiItr->id());

      float mean(0.);
      bool gainSwitch(false);

      for(int iSample(0); iSample < 4; iSample++){
        if(digiItr->sample(iSample).gainId() != 1){
          gainSwitch = true;
          break;
        }
        mean += digiItr->sample(iSample).adc();
      }
      if(gainSwitch) continue;

      mean /= 4.;

      MEs_[kPedestal]->fill(id, mean);
    }
  }

void ecaldqm::PNPresampleTask::setMEData ( std::vector< MEData > &  _data) [static]

Member Data Documentation

bool ecaldqm::PNPresampleTask::enable_[BinService::nDCC] [protected]

Definition at line 32 of file PNPresampleTask.h.

Referenced by beginRun(), endEvent(), and filterRunType().