CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::PresampleTask Class Reference

#include <PresampleTask.h>

Inheritance diagram for ecaldqm::PresampleTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
bool filterRunType (short const *) override
 
 PresampleTask ()
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &)
 
 ~PresampleTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const std::string & getName () const
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void setParams (edm::ParameterSet const &) override
 

Private Attributes

bool doPulseMaxCheck_
 
MESetmePedestalByLS
 
int nSamples_
 
int pulseMaxPosition_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 10 of file PresampleTask.h.

Constructor & Destructor Documentation

◆ PresampleTask()

ecaldqm::PresampleTask::PresampleTask ( )

Definition at line 10 of file PresampleTask.cc.

◆ ~PresampleTask()

ecaldqm::PresampleTask::~PresampleTask ( )
inlineoverride

Definition at line 13 of file PresampleTask.h.

13 {}

Member Function Documentation

◆ analyze()

bool ecaldqm::PresampleTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 32 of file PresampleTask.h.

32  {
33  switch (_collection) {
34  case kEBDigi:
35  if (_p)
36  runOnDigis(*static_cast<EBDigiCollection const*>(_p));
37  return true;
38  case kEEDigi:
39  if (_p)
40  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
41  return true;
42  break;
43  default:
44  break;
45  }
46 
47  return false;
48  }

References ecaldqm::kEBDigi, ecaldqm::kEEDigi, and runOnDigis().

◆ beginLuminosityBlock()

void ecaldqm::PresampleTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 31 of file PresampleTask.cc.

31  {
32  // Fill separate MEs with only 10 LSs worth of stats
33  // Used to correctly fill Presample Trend plots:
34  // 1 pt:10 LS in Trend plots
35  mePedestalByLS = &MEs_.at("PedestalByLS");
36  if (timestamp_.iLumi % 10 == 0)
38  }

References ecaldqm::DQWorker::Timestamp::iLumi, mePedestalByLS, ecaldqm::DQWorker::MEs_, ecaldqm::MESet::reset(), and ecaldqm::DQWorker::timestamp_.

◆ filterRunType()

bool ecaldqm::PresampleTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 19 of file PresampleTask.cc.

19  {
20  for (int iFED(0); iFED < nDCC; iFED++) {
21  if (_runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
22  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
23  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
24  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
25  return true;
26  }
27 
28  return false;
29  }

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, ecaldqm::nDCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.

◆ runOnDigis()

template<typename DigiCollection >
void ecaldqm::PresampleTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 41 of file PresampleTask.cc.

41  {
42  MESet& mePedestal(MEs_.at("Pedestal")); // contains cumulative run stats => not suitable for Trend plots
43 
44  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
45  DetId id(digiItr->id());
46 
47  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
48  EcalDataFrame dataFrame(*digiItr);
49 
50  // Check that the digi pulse maximum occurs on the 6th sample
51  // For cosmics: disable this check to preserve statistics
52  if (doPulseMaxCheck_) {
53  bool gainSwitch(false);
54  int iMax(-1);
55  int maxADC(0);
56  for (int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; ++iSample) {
57  int adc(dataFrame.sample(iSample).adc());
58  if (adc > maxADC) {
59  iMax = iSample;
60  maxADC = adc;
61  }
62  if (iSample < nSamples_ && dataFrame.sample(iSample).gainId() != 1) {
63  gainSwitch = true;
64  break;
65  }
66  } // iSample
67  if (iMax != pulseMaxPosition_ || gainSwitch)
68  continue;
69  } // PulseMaxCheck
70 
71  for (int iSample(0); iSample < nSamples_; ++iSample) {
72  mePedestal.fill(id, double(dataFrame.sample(iSample).adc()));
73  mePedestalByLS->fill(id, double(dataFrame.sample(iSample).adc()));
74  }
75 
76  } // _digis loop
77  } // runOnDigis

References ecalMGPA::adc(), doPulseMaxCheck_, ecaldqm::MESet::fill(), triggerObjects_cff::id, EcalDataFrame::MAXSAMPLES, mePedestalByLS, ecaldqm::DQWorker::MEs_, nSamples_, and pulseMaxPosition_.

Referenced by analyze().

◆ setParams()

void ecaldqm::PresampleTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 13 of file PresampleTask.cc.

13  {
14  doPulseMaxCheck_ = _params.getUntrackedParameter<bool>("doPulseMaxCheck");
15  pulseMaxPosition_ = _params.getUntrackedParameter<int>("pulseMaxPosition");
16  nSamples_ = _params.getUntrackedParameter<int>("nSamples");
17  }

References l1extraParticles_cfi::_params, doPulseMaxCheck_, nSamples_, and pulseMaxPosition_.

Member Data Documentation

◆ doPulseMaxCheck_

bool ecaldqm::PresampleTask::doPulseMaxCheck_
private

Definition at line 26 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

◆ mePedestalByLS

MESet* ecaldqm::PresampleTask::mePedestalByLS
private

Definition at line 29 of file PresampleTask.h.

Referenced by beginLuminosityBlock(), and runOnDigis().

◆ nSamples_

int ecaldqm::PresampleTask::nSamples_
private

Definition at line 28 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

◆ pulseMaxPosition_

int ecaldqm::PresampleTask::pulseMaxPosition_
private

Definition at line 27 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
ecaldqm::PresampleTask::doPulseMaxCheck_
bool doPulseMaxCheck_
Definition: PresampleTask.h:26
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::PresampleTask::runOnDigis
void runOnDigis(DigiCollection const &)
Definition: PresampleTask.cc:41
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
EcalDataFrame
Definition: EcalDataFrame.h:16
ecaldqm::PresampleTask::mePedestalByLS
MESet * mePedestalByLS
Definition: PresampleTask.h:29
ecaldqm::MESet::fill
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
ecaldqm::PresampleTask::pulseMaxPosition_
int pulseMaxPosition_
Definition: PresampleTask.h:27
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::PresampleTask::nSamples_
int nSamples_
Definition: PresampleTask.h:28
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESet::reset
virtual void reset(double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::kEBDigi
Definition: Collections.h:25
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:81
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92