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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 ECALpedestalPCLworker (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
virtual void endJob ()
 

Static Private Member Functions

static bool adc_compare (uint16_t a, uint16_t b)
 

Private Attributes

bool checkSignal_
 
edm::InputTag digiTagEB_
 
edm::InputTag digiTagEE_
 
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_
 
uint32_t sThresholdEB_
 
uint32_t sThresholdEE_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 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)
 

Detailed Description

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

Definition at line 34 of file ECALpedestalPCLworker.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file ECALpedestalPCLworker.cc.

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

16 {
17  digiTagEB_= iConfig.getParameter<edm::InputTag>("BarrelDigis");
18  digiTagEE_= iConfig.getParameter<edm::InputTag>("EndcapDigis");
19 
20  digiTokenEB_ = consumes<EBDigiCollection>(digiTagEB_);
21  digiTokenEE_ = consumes<EEDigiCollection>(digiTagEE_);
22 
23  pedestalSamples_ = iConfig.getParameter<uint32_t>("pedestalSamples");
24  checkSignal_ = iConfig.getParameter<bool>("checkSignal");
25  sThresholdEB_ = iConfig.getParameter<uint32_t>("sThresholdEB");
26  sThresholdEE_ = iConfig.getParameter<uint32_t>("sThresholdEE");
27 
28  dynamicBooking_ = iConfig.getParameter<bool>("dynamicBooking");
29  fixedBookingCenterBin_ = iConfig.getParameter<int>("fixedBookingCenterBin");
30  nBins_ = iConfig.getParameter<int>("nBins");
31  dqmDir_ = iConfig.getParameter<std::string>("dqmDir");
32 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > digiTokenEE_
edm::EDGetTokenT< EBDigiCollection > digiTokenEB_

Member Function Documentation

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

Definition at line 70 of file ECALpedestalPCLworker.h.

Referenced by analyze().

70 { return ( a&0xFFF ) < (b&0xFFF);}
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void ECALpedestalPCLworker::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Definition at line 38 of file ECALpedestalPCLworker.cc.

References adc_compare(), edm::DataFrame::begin(), edm::DataFrameContainer::begin(), checkSignal_, digiTagEB_, digiTagEE_, edm::DataFrame::end(), edm::DataFrameContainer::end(), HcalObjRepresent::Fill(), EcalDataFrame::frame(), edm::Event::getByLabel(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), meEB_, meEE_, pedestalSamples_, sThresholdEB_, and sThresholdEE_.

39 {
40  using namespace edm;
41 
43  iEvent.getByLabel(digiTagEB_,pDigiEB);
44 
46  iEvent.getByLabel(digiTagEE_,pDigiEE);
47 
48 
49 
50  for (EBDigiCollection::const_iterator pDigi=pDigiEB->begin(); pDigi!=pDigiEB->end(); ++pDigi){
51 
52  EBDetId id = pDigi->id();
53  uint32_t hashedId = id.hashedIndex();
54 
55  EBDataFrame digi( *pDigi );
56 
57  if (checkSignal_){
58  uint16_t maxdiff = *std::max_element(digi.frame().begin(), digi.frame().end(), adc_compare ) -
59  *std::min_element(digi.frame().begin(), digi.frame().end(), adc_compare );
60  if ( maxdiff> sThresholdEB_ ) continue; // assume there is signal in this frame
61  }
62 
63  //for (auto& mgpasample : digi.frame()) meEB_[hashedId]->Fill(mgpasample&0xFFF);
64  for (edm::DataFrame::iterator mgpasample = digi.frame().begin();
65  mgpasample!=digi.frame().begin()+pedestalSamples_;
66  ++mgpasample )
67  meEB_[hashedId]->Fill(*mgpasample&0xFFF);
68 
69  } // eb digis
70 
71 
72 
73  for (EEDigiCollection::const_iterator pDigi=pDigiEE->begin(); pDigi!=pDigiEE->end(); ++pDigi){
74 
75  EEDetId id = pDigi->id();
76  uint32_t hashedId = id.hashedIndex();
77 
78  EEDataFrame digi( *pDigi );
79 
80  if (checkSignal_){
81  uint16_t maxdiff = *std::max_element(digi.frame().begin(), digi.frame().end(), adc_compare ) -
82  *std::min_element(digi.frame().begin(), digi.frame().end(), adc_compare );
83  if ( maxdiff> sThresholdEE_ ) continue; // assume there is signal in this frame
84  }
85 
86  //for (auto& mgpasample : digi.frame()) meEE_[hashedId]->Fill(mgpasample&0xFFF);
87  for (edm::DataFrame::iterator mgpasample = digi.frame().begin();
88  mgpasample!=digi.frame().begin()+pedestalSamples_;
89  ++mgpasample )
90  meEE_[hashedId]->Fill(*mgpasample&0xFFF);
91 
92  } // ee digis
93 
94 
95 
96 
97 }
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:86
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const_iterator begin() const
std::vector< MonitorElement * > meEE_
static bool adc_compare(uint16_t a, uint16_t b)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:416
int hashedIndex() const
Definition: EEDetId.h:182
const_iterator end() const
std::vector< MonitorElement * > meEB_
HLT enums.
data_type * iterator
Definition: DataFrame.h:21
void ECALpedestalPCLworker::beginJob ( void  )
privatevirtual

Definition at line 101 of file ECALpedestalPCLworker.cc.

102 {
103 }
void ECALpedestalPCLworker::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
privatevirtual

Implements DQMEDAnalyzer.

Definition at line 121 of file ECALpedestalPCLworker.cc.

References DQMStore::IBooker::book1D(), 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, hpstanc_transforms::max, meEB_, meEE_, min(), nBins_, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

121  {
122 
123  ibooker.cd();
124  ibooker.setCurrentFolder(dqmDir_);
125 
127  es.get<EcalPedestalsRcd>().get(peds);
128 
129 
130  for ( uint32_t i = 0 ; i< EBDetId::kSizeForDenseIndexing; ++i){
131 
132 
133  ibooker.setCurrentFolder(dqmDir_+"/EB/"+std::to_string(int(i/100)));
134 
135  std::string hname = "eb_" + std::to_string(i);
137  int centralBin = fixedBookingCenterBin_;
138 
139  if (dynamicBooking_){
140  centralBin = int ((peds->find(id))->mean_x12) ;
141  }
142 
143  int min = centralBin - nBins_/2;
144  int max = centralBin + nBins_/2;
145 
146  meEB_.push_back(ibooker.book1D(hname,hname,nBins_,min,max));
147  }
148 
149  for ( uint32_t i = 0 ; i< EEDetId::kSizeForDenseIndexing; ++i){
150 
151  ibooker.setCurrentFolder(dqmDir_+"/EE/"+std::to_string(int(i/100)));
152 
153  std::string hname = "ee_" + std::to_string(i);
154 
156  int centralBin = fixedBookingCenterBin_;
157 
158  if (dynamicBooking_){
159  centralBin = int ((peds->find(id))->mean_x12) ;
160  }
161 
162  int min = centralBin - nBins_/2;
163  int max = centralBin + nBins_/2;
164 
165  meEE_.push_back(ibooker.book1D(hname,hname,nBins_,min,max));
166 
167  }
168 
169 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
void cd(void)
Definition: DQMStore.cc:269
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
std::vector< MonitorElement * > meEE_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
Definition: DetId.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::vector< MonitorElement * > meEB_
const_iterator find(uint32_t rawId) const
void ECALpedestalPCLworker::endJob ( void  )
privatevirtual

Definition at line 107 of file ECALpedestalPCLworker.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

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

Member Data Documentation

bool ECALpedestalPCLworker::checkSignal_
private

Definition at line 57 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

edm::InputTag ECALpedestalPCLworker::digiTagEB_
private

Definition at line 48 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

edm::InputTag ECALpedestalPCLworker::digiTagEE_
private

Definition at line 49 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

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

Definition at line 50 of file ECALpedestalPCLworker.h.

Referenced by ECALpedestalPCLworker().

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

Definition at line 51 of file ECALpedestalPCLworker.h.

Referenced by ECALpedestalPCLworker().

std::string ECALpedestalPCLworker::dqmDir_
private

Definition at line 66 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

bool ECALpedestalPCLworker::dynamicBooking_
private

Definition at line 63 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

int ECALpedestalPCLworker::fixedBookingCenterBin_
private

Definition at line 64 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

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

Definition at line 53 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 54 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and bookHistograms().

int ECALpedestalPCLworker::nBins_
private

Definition at line 65 of file ECALpedestalPCLworker.h.

Referenced by bookHistograms(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::pedestalSamples_
private

Definition at line 56 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::sThresholdEB_
private

Definition at line 58 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().

uint32_t ECALpedestalPCLworker::sThresholdEE_
private

Definition at line 61 of file ECALpedestalPCLworker.h.

Referenced by analyze(), and ECALpedestalPCLworker().