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
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) 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 &)
 
 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
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 EcalDQMSetupObjects getEcalDQMSetupObjects ()
 
const EcalElectronicsMappingGetElectronicsMap ()
 
const CaloGeometryGetGeometry ()
 
const std::string & getName () const
 
const CaloTopologyGetTopology ()
 
const EcalTrigTowerConstituentsMapGetTrigTowerMap ()
 
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 setSetupObjects (edm::EventSetup const &)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

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().

◆ beginEvent()

void ecaldqm::PresampleTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ByLumiResetSwitch,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 31 of file PresampleTask.cc.

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

References ecaldqm::MESetCollection::at(), ecaldqm::DQWorker::GetElectronicsMap(), 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 46 of file PresampleTask.cc.

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

References gpuClustering::adc, ecaldqm::MESetCollection::at(), doPulseMaxCheck_, ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), 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 beginEvent(), 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
EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
ecaldqm::PresampleTask::doPulseMaxCheck_
bool doPulseMaxCheck_
Definition: PresampleTask.h:26
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
ecaldqm::kEEDigi
Definition: Collections.h:26
ecaldqm::MESet::fill
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
ecaldqm::PresampleTask::runOnDigis
void runOnDigis(DigiCollection const &)
Definition: PresampleTask.cc:46
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
EcalDataFrame
Definition: EcalDataFrame.h:16
ecaldqm::PresampleTask::mePedestalByLS
MESet * mePedestalByLS
Definition: PresampleTask.h:29
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
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:104
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:40
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::kEBDigi
Definition: Collections.h:25
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:107
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91