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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ECALpedestalPCLworker (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endJob () 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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 12 of file ECALpedestalPCLworker.cc.

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

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 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > digiTokenEE_
edm::EDGetTokenT< EBDigiCollection > digiTokenEB_
edm::EDGetTokenT< TCDSRecord > tcdsToken_

Member Function Documentation

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

Definition at line 67 of file ECALpedestalPCLworker.h.

Referenced by analyze().

67 { return (a & 0xFFF) < (b & 0xFFF); }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
void ECALpedestalPCLworker::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 37 of file ECALpedestalPCLworker.cc.

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

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 }
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:82
const BSTRecord & getBST() const
Definition: TCDSRecord.h:100
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< EEDigiCollection > digiTokenEE_
const_iterator begin() const
uint16_t const getBeamMode() const
Definition: BSTRecord.h:70
std::vector< MonitorElement * > meEE_
static bool adc_compare(uint16_t a, uint16_t b)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int hashedIndex() const
Definition: EEDetId.h:183
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::EDGetTokenT< EBDigiCollection > digiTokenEB_
const_iterator end() const
std::vector< MonitorElement * > meEB_
HLT enums.
data_type * iterator
Definition: DataFrame.h:20
edm::EDGetTokenT< TCDSRecord > tcdsToken_
void ECALpedestalPCLworker::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 99 of file ECALpedestalPCLworker.cc.

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

Implements DQMEDAnalyzer.

Definition at line 109 of file ECALpedestalPCLworker.cc.

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

109  {
110  ibooker.cd();
111  ibooker.setCurrentFolder(dqmDir_);
112 
114  es.get<EcalPedestalsRcd>().get(peds);
115 
116  for (uint32_t i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
117  ibooker.setCurrentFolder(dqmDir_ + "/EB/" + std::to_string(int(i / 100)));
118 
119  std::string hname = "eb_" + std::to_string(i);
121  int centralBin = fixedBookingCenterBin_;
122 
123  if (dynamicBooking_) {
124  centralBin = int((peds->find(id))->mean_x12);
125  }
126 
127  int min = centralBin - nBins_ / 2;
128  int max = centralBin + nBins_ / 2;
129 
130  meEB_.push_back(ibooker.book1D(hname, hname, nBins_, min, max));
131  }
132 
133  for (uint32_t i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
134  ibooker.setCurrentFolder(dqmDir_ + "/EE/" + std::to_string(int(i / 100)));
135 
136  std::string hname = "ee_" + std::to_string(i);
137 
139  int centralBin = fixedBookingCenterBin_;
140 
141  if (dynamicBooking_) {
142  centralBin = int((peds->find(id))->mean_x12);
143  }
144 
145  int min = centralBin - nBins_ / 2;
146  int max = centralBin + nBins_ / 2;
147 
148  meEE_.push_back(ibooker.book1D(hname, hname, nBins_, min, max));
149  }
150 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
std::vector< MonitorElement * > meEE_
T min(T a, T b)
Definition: MathUtil.h:58
Definition: DetId.h:17
std::vector< MonitorElement * > meEB_
const_iterator find(uint32_t rawId) const
void ECALpedestalPCLworker::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 101 of file ECALpedestalPCLworker.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

101 {}
void ECALpedestalPCLworker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Member Data Documentation

bool ECALpedestalPCLworker::checkSignal_
private

Definition at line 53 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

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

Definition at line 45 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

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

Definition at line 46 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

std::string ECALpedestalPCLworker::dqmDir_
private

Definition at line 62 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

bool ECALpedestalPCLworker::dynamicBooking_
private

Definition at line 59 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

int ECALpedestalPCLworker::fixedBookingCenterBin_
private

Definition at line 60 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

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

Definition at line 49 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 50 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

int ECALpedestalPCLworker::nBins_
private

Definition at line 61 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::pedestalSamples_
private

Definition at line 52 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

bool ECALpedestalPCLworker::requireStableBeam_
private

Definition at line 64 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::sThresholdEB_
private

Definition at line 54 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::sThresholdEE_
private

Definition at line 57 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

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

Definition at line 47 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().