CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
ECALpedestalPCLworker Class Reference

#include <ECALpedestalPCLworker.h>

Inheritance diagram for ECALpedestalPCLworker:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 ECALpedestalPCLworker (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Static Private Member Functions

static bool adc_compare (uint16_t a, uint16_t b)
 

Private Attributes

bool checkSignal_
 
edm::EDGetTokenT< EBDigiCollectiondigiTokenEB_
 
edm::EDGetTokenT< EEDigiCollectiondigiTokenEE_
 
std::string dqmDir_
 
bool dynamicBooking_
 
int fixedBookingCenterBin_
 
std::vector< MonitorElement * > meEB_
 
std::vector< MonitorElement * > meEE_
 
int nBins_
 
uint32_t pedestalSamples_
 
bool requireStableBeam_
 
uint32_t sThresholdEB_
 
uint32_t sThresholdEE_
 
edm::EDGetTokenT< TCDSRecordtcdsToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: Fill DQM histograms with pedestals. Intended to be used on laser data from the TestEnablesEcalHcal dataset

Definition at line 33 of file ECALpedestalPCLworker.h.

Constructor & Destructor Documentation

◆ ECALpedestalPCLworker()

ECALpedestalPCLworker::ECALpedestalPCLworker ( const edm::ParameterSet iConfig)
explicit

Definition at line 12 of file ECALpedestalPCLworker.cc.

14 {
15  edm::InputTag digiTagEB = iConfig.getParameter<edm::InputTag>("BarrelDigis");
16  edm::InputTag digiTagEE = iConfig.getParameter<edm::InputTag>("EndcapDigis");
17 
18  digiTokenEB_ = consumes<EBDigiCollection>(digiTagEB);
19  digiTokenEE_ = consumes<EEDigiCollection>(digiTagEE);
20 
21  pedestalSamples_ = iConfig.getParameter<uint32_t>("pedestalSamples");
22  checkSignal_ = iConfig.getParameter<bool>("checkSignal");
23  sThresholdEB_ = iConfig.getParameter<uint32_t>("sThresholdEB");
24  sThresholdEE_ = iConfig.getParameter<uint32_t>("sThresholdEE");
25 
26  dynamicBooking_ = iConfig.getParameter<bool>("dynamicBooking");
27  fixedBookingCenterBin_ = iConfig.getParameter<int>("fixedBookingCenterBin");
28  nBins_ = iConfig.getParameter<int>("nBins");
29  dqmDir_ = iConfig.getParameter<std::string>("dqmDir");
30 
31  edm::InputTag tcdsRecord = iConfig.getParameter<edm::InputTag>("tcdsRecord");
32  tcdsToken_ = consumes<TCDSRecord>(tcdsRecord);
33  requireStableBeam_ = iConfig.getParameter<bool>("requireStableBeam");
34 }

References checkSignal_, digiTokenEB_, digiTokenEE_, dqmDir_, dynamicBooking_, fixedBookingCenterBin_, edm::ParameterSet::getParameter(), nBins_, pedestalSamples_, requireStableBeam_, sThresholdEB_, sThresholdEE_, AlCaHLTBitMon_QueryRunRegistry::string, and tcdsToken_.

Member Function Documentation

◆ adc_compare()

static bool ECALpedestalPCLworker::adc_compare ( uint16_t  a,
uint16_t  b 
)
inlinestaticprivate

Definition at line 65 of file ECALpedestalPCLworker.h.

65 { return (a & 0xFFF) < (b & 0xFFF); }

References a, and b.

Referenced by analyze().

◆ analyze()

void ECALpedestalPCLworker::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 37 of file ECALpedestalPCLworker.cc.

37  {
38  using namespace edm;
39 
41  iEvent.getByToken(digiTokenEB_, pDigiEB);
42 
44  iEvent.getByToken(digiTokenEE_, pDigiEE);
45 
46  // Only Events with stable beam
47 
48  if (requireStableBeam_) {
49  edm::Handle<TCDSRecord> tcdsData;
50  iEvent.getByToken(tcdsToken_, tcdsData);
51  int beamMode = tcdsData->getBST().getBeamMode();
52  if (beamMode != BSTRecord::BeamMode::STABLE)
53  return;
54  }
55 
56  for (EBDigiCollection::const_iterator pDigi = pDigiEB->begin(); pDigi != pDigiEB->end(); ++pDigi) {
57  EBDetId id = pDigi->id();
58  uint32_t hashedId = id.hashedIndex();
59 
60  EBDataFrame digi(*pDigi);
61 
62  if (checkSignal_) {
63  uint16_t maxdiff = *std::max_element(digi.frame().begin(), digi.frame().end(), adc_compare) -
64  *std::min_element(digi.frame().begin(), digi.frame().end(), adc_compare);
65  if (maxdiff > sThresholdEB_)
66  continue; // assume there is signal in this frame
67  }
68 
69  //for (auto& mgpasample : digi.frame()) meEB_[hashedId]->Fill(mgpasample&0xFFF);
70  for (edm::DataFrame::iterator mgpasample = digi.frame().begin();
71  mgpasample != digi.frame().begin() + pedestalSamples_;
72  ++mgpasample)
73  meEB_[hashedId]->Fill(*mgpasample & 0xFFF);
74 
75  } // eb digis
76 
77  for (EEDigiCollection::const_iterator pDigi = pDigiEE->begin(); pDigi != pDigiEE->end(); ++pDigi) {
78  EEDetId id = pDigi->id();
79  uint32_t hashedId = id.hashedIndex();
80 
81  EEDataFrame digi(*pDigi);
82 
83  if (checkSignal_) {
84  uint16_t maxdiff = *std::max_element(digi.frame().begin(), digi.frame().end(), adc_compare) -
85  *std::min_element(digi.frame().begin(), digi.frame().end(), adc_compare);
86  if (maxdiff > sThresholdEE_)
87  continue; // assume there is signal in this frame
88  }
89 
90  //for (auto& mgpasample : digi.frame()) meEE_[hashedId]->Fill(mgpasample&0xFFF);
91  for (edm::DataFrame::iterator mgpasample = digi.frame().begin();
92  mgpasample != digi.frame().begin() + pedestalSamples_;
93  ++mgpasample)
94  meEE_[hashedId]->Fill(*mgpasample & 0xFFF);
95 
96  } // ee digis
97 }

References adc_compare(), HLT_Fake1_cff::beamMode, edm::DataFrame::begin(), edm::DataFrameContainer::begin(), checkSignal_, digiTokenEB_, digiTokenEE_, edm::DataFrame::end(), edm::DataFrameContainer::end(), HcalObjRepresent::Fill(), EcalDataFrame::frame(), BSTRecord::getBeamMode(), TCDSRecord::getBST(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), iEvent, meEB_, meEE_, pedestalSamples_, requireStableBeam_, sThresholdEB_, sThresholdEE_, and tcdsToken_.

◆ bookHistograms()

void ECALpedestalPCLworker::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 105 of file ECALpedestalPCLworker.cc.

105  {
106  ibooker.cd();
107  ibooker.setCurrentFolder(dqmDir_);
108 
110  es.get<EcalPedestalsRcd>().get(peds);
111 
112  for (uint32_t i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
113  ibooker.setCurrentFolder(dqmDir_ + "/EB/" + std::to_string(int(i / 100)));
114 
115  std::string hname = "eb_" + std::to_string(i);
117  int centralBin = fixedBookingCenterBin_;
118 
119  if (dynamicBooking_) {
120  centralBin = int((peds->find(id))->mean_x12);
121  }
122 
123  int min = centralBin - nBins_ / 2;
124  int max = centralBin + nBins_ / 2;
125 
126  meEB_.push_back(ibooker.book1D(hname, hname, nBins_, min, max));
127  }
128 
129  for (uint32_t i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
130  ibooker.setCurrentFolder(dqmDir_ + "/EE/" + std::to_string(int(i / 100)));
131 
132  std::string hname = "ee_" + std::to_string(i);
133 
135  int centralBin = fixedBookingCenterBin_;
136 
137  if (dynamicBooking_) {
138  centralBin = int((peds->find(id))->mean_x12);
139  }
140 
141  int min = centralBin - nBins_ / 2;
142  int max = centralBin + nBins_ / 2;
143 
144  meEE_.push_back(ibooker.book1D(hname, hname, nBins_, min, max));
145  }
146 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), EBDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), dqmDir_, dynamicBooking_, EcalCondObjectContainer< T >::find(), fixedBookingCenterBin_, edm::EventSetup::get(), get, mps_fire::i, createfilelist::int, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, SiStripPI::max, meEB_, meEE_, min(), nBins_, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillDescriptions()

void ECALpedestalPCLworker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 99 of file ECALpedestalPCLworker.cc.

99  {
101  desc.setUnknown();
102  descriptions.addDefault(desc);
103 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

Member Data Documentation

◆ checkSignal_

bool ECALpedestalPCLworker::checkSignal_
private

Definition at line 51 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ digiTokenEB_

edm::EDGetTokenT<EBDigiCollection> ECALpedestalPCLworker::digiTokenEB_
private

Definition at line 43 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ digiTokenEE_

edm::EDGetTokenT<EEDigiCollection> ECALpedestalPCLworker::digiTokenEE_
private

Definition at line 44 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ dqmDir_

std::string ECALpedestalPCLworker::dqmDir_
private

Definition at line 60 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

◆ dynamicBooking_

bool ECALpedestalPCLworker::dynamicBooking_
private

Definition at line 57 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

◆ fixedBookingCenterBin_

int ECALpedestalPCLworker::fixedBookingCenterBin_
private

Definition at line 58 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

◆ meEB_

std::vector<MonitorElement *> ECALpedestalPCLworker::meEB_
private

Definition at line 47 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

◆ meEE_

std::vector<MonitorElement *> ECALpedestalPCLworker::meEE_
private

Definition at line 48 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

◆ nBins_

int ECALpedestalPCLworker::nBins_
private

Definition at line 59 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

◆ pedestalSamples_

uint32_t ECALpedestalPCLworker::pedestalSamples_
private

Definition at line 50 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ requireStableBeam_

bool ECALpedestalPCLworker::requireStableBeam_
private

Definition at line 62 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ sThresholdEB_

uint32_t ECALpedestalPCLworker::sThresholdEB_
private

Definition at line 52 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ sThresholdEE_

uint32_t ECALpedestalPCLworker::sThresholdEE_
private

Definition at line 55 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

◆ tcdsToken_

edm::EDGetTokenT<TCDSRecord> ECALpedestalPCLworker::tcdsToken_
private

Definition at line 45 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

EBDetId::hashedIndex
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:82
mps_fire.i
i
Definition: mps_fire.py:428
ECALpedestalPCLworker::nBins_
int nBins_
Definition: ECALpedestalPCLworker.h:59
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
min
T min(T a, T b)
Definition: MathUtil.h:58
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
EBDataFrame
Definition: EBDataFrame.h:11
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HLT_Fake1_cff.beamMode
beamMode
Definition: HLT_Fake1_cff.py:124
edm::Handle< EBDigiCollection >
EEDetId::detIdFromDenseIndex
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
DetId
Definition: DetId.h:17
ECALpedestalPCLworker::digiTokenEB_
edm::EDGetTokenT< EBDigiCollection > digiTokenEB_
Definition: ECALpedestalPCLworker.h:43
BSTRecord::getBeamMode
const uint16_t getBeamMode() const
Definition: BSTRecord.h:70
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
edm::ESHandle
Definition: DTSurvey.h:22
ECALpedestalPCLworker::tcdsToken_
edm::EDGetTokenT< TCDSRecord > tcdsToken_
Definition: ECALpedestalPCLworker.h:45
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
edm::DataFrame::iterator
data_type * iterator
Definition: DataFrame.h:20
b
double b
Definition: hdecay.h:118
ECALpedestalPCLworker::meEE_
std::vector< MonitorElement * > meEE_
Definition: ECALpedestalPCLworker.h:48
EEDetId
Definition: EEDetId.h:14
ECALpedestalPCLworker::meEB_
std::vector< MonitorElement * > meEB_
Definition: ECALpedestalPCLworker.h:47
a
double a
Definition: hdecay.h:119
ECALpedestalPCLworker::adc_compare
static bool adc_compare(uint16_t a, uint16_t b)
Definition: ECALpedestalPCLworker.h:65
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
EBDetId::detIdFromDenseIndex
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
ECALpedestalPCLworker::sThresholdEB_
uint32_t sThresholdEB_
Definition: ECALpedestalPCLworker.h:52
EEDetId::hashedIndex
int hashedIndex() const
Definition: EEDetId.h:183
ECALpedestalPCLworker::requireStableBeam_
bool requireStableBeam_
Definition: ECALpedestalPCLworker.h:62
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ECALpedestalPCLworker::sThresholdEE_
uint32_t sThresholdEE_
Definition: ECALpedestalPCLworker.h:55
ECALpedestalPCLworker::dqmDir_
std::string dqmDir_
Definition: ECALpedestalPCLworker.h:60
EBDetId::kSizeForDenseIndexing
Definition: EBDetId.h:155
ECALpedestalPCLworker::fixedBookingCenterBin_
int fixedBookingCenterBin_
Definition: ECALpedestalPCLworker.h:58
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ECALpedestalPCLworker::dynamicBooking_
bool dynamicBooking_
Definition: ECALpedestalPCLworker.h:57
TCDSRecord::getBST
const BSTRecord & getBST() const
Definition: TCDSRecord.h:100
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
EEDataFrame
Definition: EEDataFrame.h:12
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
ECALpedestalPCLworker::pedestalSamples_
uint32_t pedestalSamples_
Definition: ECALpedestalPCLworker.h:50
ECALpedestalPCLworker::checkSignal_
bool checkSignal_
Definition: ECALpedestalPCLworker.h:51
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
ECALpedestalPCLworker::digiTokenEE_
edm::EDGetTokenT< EEDigiCollection > digiTokenEE_
Definition: ECALpedestalPCLworker.h:44