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
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
bool filterRunType (short const *) override
 
 PresampleTask ()
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &)
 
void setTokens (edm::ConsumesCollector &) override
 
 ~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 &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock 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 setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

bool doPulseMaxCheck_
 
bool FillPedestal = false
 
MESetmePedestalByLS
 
int nSamples_
 
edm::ESGetToken< EcalPedestals, EcalPedestalsRcdPedtoken_
 
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)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- 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 14 of file PresampleTask.h.

Constructor & Destructor Documentation

◆ PresampleTask()

ecaldqm::PresampleTask::PresampleTask ( )

Definition at line 11 of file PresampleTask.cc.

◆ ~PresampleTask()

ecaldqm::PresampleTask::~PresampleTask ( )
inlineoverride

Definition at line 17 of file PresampleTask.h.

17 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 39 of file PresampleTask.h.

39  {
40  switch (_collection) {
41  case kEBDigi:
42  if (_p)
43  runOnDigis(*static_cast<EBDigiCollection const*>(_p));
44  return true;
45  case kEEDigi:
46  if (_p)
47  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
48  return true;
49  break;
50  default:
51  break;
52  }
53 
54  return false;
55  }

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 35 of file PresampleTask.cc.

38  {
39  if (ByLumiResetSwitch) {
40  // Fill separate MEs with only 10 LSs worth of stats
41  // Used to correctly fill Presample Trend plots:
42  // 1 pt:10 LS in Trend plots
43  mePedestalByLS = &MEs_.at("PedestalByLS");
44  if (timestamp_.iLumi % 10 == 0)
46  }
47 
48  MESet& mePedestalProjEtaG1(MEs_.at("PedestalProjEtaG1"));
49  MESet& mePedestalProjEtaG6(MEs_.at("PedestalProjEtaG6"));
50  MESet& mePedestalProjEtaG12(MEs_.at("PedestalProjEtaG12"));
51 
52  if (FillPedestal) {
53  const EcalPedestals* myped = &_es.getData(Pedtoken_);
54 
55  for (int i = 0; i < EBDetId::kSizeForDenseIndexing; i++) {
57  continue;
59  EcalPedestals::const_iterator it = myped->find(ebid.rawId());
60  if (it != myped->end()) {
61  mePedestalProjEtaG1.fill(getEcalDQMSetupObjects(), ebid, (*it).rms_x1);
62  mePedestalProjEtaG6.fill(getEcalDQMSetupObjects(), ebid, (*it).rms_x6);
63  mePedestalProjEtaG12.fill(getEcalDQMSetupObjects(), ebid, (*it).rms_x12);
64  }
65  }
66  for (int i = 0; i < EEDetId::kSizeForDenseIndexing; i++) {
68  continue;
70  EcalPedestals::const_iterator it = myped->find(eeid.rawId());
71  if (it != myped->end()) {
72  mePedestalProjEtaG1.fill(getEcalDQMSetupObjects(), eeid, (*it).rms_x1);
73  mePedestalProjEtaG6.fill(getEcalDQMSetupObjects(), eeid, (*it).rms_x6);
74  mePedestalProjEtaG12.fill(getEcalDQMSetupObjects(), eeid, (*it).rms_x12);
75  }
76  }
77 
78  FillPedestal = false;
79  }
80  }

References ecaldqm::MESetCollection::at(), EcalCondObjectContainer< T >::end(), FillPedestal, EcalCondObjectContainer< T >::find(), edm::EventSetup::getData(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), mps_fire::i, ecaldqm::DQWorker::Timestamp::iLumi, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, mePedestalByLS, ecaldqm::DQWorker::MEs_, Pedtoken_, DetId::rawId(), ecaldqm::MESet::reset(), ecaldqm::DQWorker::timestamp_, EBDetId::unhashIndex(), EEDetId::unhashIndex(), EBDetId::validDenseIndex(), and EEDetId::validDenseIndex().

◆ beginRun()

void ecaldqm::PresampleTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 33 of file PresampleTask.cc.

33 { FillPedestal = true; }

References FillPedestal.

◆ filterRunType()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 21 of file PresampleTask.cc.

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

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 83 of file PresampleTask.cc.

83  {
84  MESet& mePedestal(MEs_.at("Pedestal")); // contains cumulative run stats => not suitable for Trend plots
85 
86  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
87  DetId id(digiItr->id());
88 
89  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
90  EcalDataFrame dataFrame(*digiItr);
91 
92  // Check that the digi pulse maximum occurs on the 6th sample
93  // For cosmics: disable this check to preserve statistics
94  if (doPulseMaxCheck_) {
95  bool gainSwitch(false);
96  int iMax(-1);
97  int maxADC(0);
98  for (int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; ++iSample) {
99  int adc(dataFrame.sample(iSample).adc());
100  if (adc > maxADC) {
101  iMax = iSample;
102  maxADC = adc;
103  }
104  if (iSample < nSamples_ && dataFrame.sample(iSample).gainId() != 1) {
105  gainSwitch = true;
106  break;
107  }
108  } // iSample
109  if (iMax != pulseMaxPosition_ || gainSwitch)
110  continue;
111  } // PulseMaxCheck
112 
113  for (int iSample(0); iSample < nSamples_; ++iSample) {
114  mePedestal.fill(getEcalDQMSetupObjects(), id, double(dataFrame.sample(iSample).adc()));
115  mePedestalByLS->fill(getEcalDQMSetupObjects(), id, double(dataFrame.sample(iSample).adc()));
116  }
117 
118  } // _digis loop
119  } // 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 14 of file PresampleTask.cc.

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

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

◆ setTokens()

void ecaldqm::PresampleTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 19 of file PresampleTask.cc.

19 { Pedtoken_ = _collector.esConsumes(); }

References edm::ConsumesCollector::esConsumes(), and Pedtoken_.

Member Data Documentation

◆ doPulseMaxCheck_

bool ecaldqm::PresampleTask::doPulseMaxCheck_
private

Definition at line 32 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

◆ FillPedestal

bool ecaldqm::PresampleTask::FillPedestal = false
private

Definition at line 36 of file PresampleTask.h.

Referenced by beginEvent(), and beginRun().

◆ mePedestalByLS

MESet* ecaldqm::PresampleTask::mePedestalByLS
private

Definition at line 35 of file PresampleTask.h.

Referenced by beginEvent(), and runOnDigis().

◆ nSamples_

int ecaldqm::PresampleTask::nSamples_
private

Definition at line 34 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

◆ Pedtoken_

edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> ecaldqm::PresampleTask::Pedtoken_
private

Definition at line 31 of file PresampleTask.h.

Referenced by beginEvent(), and setTokens().

◆ pulseMaxPosition_

int ecaldqm::PresampleTask::pulseMaxPosition_
private

Definition at line 33 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:74
EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
ecaldqm::PresampleTask::doPulseMaxCheck_
bool doPulseMaxCheck_
Definition: PresampleTask.h:32
mps_fire.i
i
Definition: mps_fire.py:428
EBDetId
Definition: EBDetId.h:17
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
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:83
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
EcalDataFrame
Definition: EcalDataFrame.h:16
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
ecaldqm::PresampleTask::mePedestalByLS
MESet * mePedestalByLS
Definition: PresampleTask.h:35
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:118
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
EEDetId::validDenseIndex
static bool validDenseIndex(uint32_t din)
Definition: EEDetId.h:213
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:33
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
ecaldqm::PresampleTask::nSamples_
int nSamples_
Definition: PresampleTask.h:34
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
ecaldqm::PresampleTask::Pedtoken_
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > Pedtoken_
Definition: PresampleTask.h:31
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
EEDetId
Definition: EEDetId.h:14
ecaldqm::PresampleTask::FillPedestal
bool FillPedestal
Definition: PresampleTask.h:36
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
EBDetId::validDenseIndex
static bool validDenseIndex(uint32_t din)
Definition: EBDetId.h:105
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::kEBDigi
Definition: Collections.h:25
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EBDetId::kSizeForDenseIndexing
Definition: EBDetId.h:155
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:128
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19