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 &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
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 ( )

◆ ~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.

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

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  }
void runOnDigis(DigiCollection const &)

◆ 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.

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, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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().

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  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
const_iterator find(uint32_t rawId) const
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Timestamp timestamp_
Definition: DQWorker.h:134
std::vector< Item >::const_iterator const_iterator
MESetCollection MEs_
Definition: DQWorker.h:131
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
static bool validDenseIndex(uint32_t din)
Definition: EEDetId.h:213
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > Pedtoken_
Definition: PresampleTask.h:31
const_iterator end() const
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
static bool validDenseIndex(uint32_t din)
Definition: EBDetId.h:105

◆ 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.

References FillPedestal.

33 { FillPedestal = true; }

◆ filterRunType()

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

◆ runOnDigis()

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

Definition at line 83 of file PresampleTask.cc.

References gpuClustering::adc, ecaldqm::MESetCollection::at(), doPulseMaxCheck_, ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), l1ctLayer2EG_cff::id, EcalDataFrame::MAXSAMPLES, mePedestalByLS, ecaldqm::DQWorker::MEs_, nSamples_, and pulseMaxPosition_.

Referenced by analyze().

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
MESet & at(const std::string &key)
Definition: MESet.h:399
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:131
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 14 of file PresampleTask.cc.

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

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

◆ setTokens()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 19 of file PresampleTask.cc.

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

19 { Pedtoken_ = _collector.esConsumes(); }
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > Pedtoken_
Definition: PresampleTask.h:31

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