CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ESIntegrityTask Class Reference

#include <ESIntegrityTask.h>

Inheritance diagram for ESIntegrityTask:
DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESIntegrityTask (const edm::ParameterSet &ps)
 
 ~ESIntegrityTask () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
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::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void calculateDIFraction (const edm::LuminosityBlock &lumi, const edm::EventSetup &c)
 Calculate Data Integrity Fraction. More...
 
void dqmEndRun (const edm::Run &r, const edm::EventSetup &c) override
 EndRun. More...
 
void endJob (void) override
 EndJob. More...
 
std::shared_ptr< ESIntLSCacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) const override
 Begin Lumi. More...
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) override
 End Lumi. More...
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Attributes

int dac_
 
edm::EDGetTokenT< ESRawDataCollectiondccCollections_
 
bool doLumiAnalysis_
 
int eCount_
 
int fed_ [2][2][40][40]
 
int fiber_ [2][2][40][40]
 
int firstDAC_
 
int gain_
 
int ievt_
 
int isPed_
 
int kchip_ [2][2][40][40]
 
edm::EDGetTokenT< ESLocalRawDataCollectionkchipCollections_
 
edm::FileInPath lookup_
 
MonitorElementmeDCCCRCErr_
 
MonitorElementmeDCCCRCErrByLS_
 
MonitorElementmeDCCErr_
 
MonitorElementmeDIErrors_ [2][2]
 
MonitorElementmeDIErrorsByLS_ [2][2]
 
MonitorElementmeDIFraction_
 
MonitorElementmeEVDR_
 
MonitorElementmeFED_
 
MonitorElementmeFiberBadStatus_
 
MonitorElementmeFiberErrCode_
 
MonitorElementmeFiberErrCodeByLS_
 
MonitorElementmeFiberOff_
 
MonitorElementmeFiberOffByLS_
 
MonitorElementmeGain_
 
MonitorElementmeKBC_
 
MonitorElementmeKEC_
 
MonitorElementmeKF1_
 
MonitorElementmeKF2_
 
MonitorElementmeOptoBC_
 
MonitorElementmeOptoBCByLS_
 
MonitorElementmeOptoRX_
 
MonitorElementmeSLinkCRCErr_
 
MonitorElementmeSLinkCRCErrByLS_
 
int nDAC_
 
int precision_
 
std::string prefixME_
 
int runNum_
 
int runtype_
 
int seqtype_
 
int vDAC_ [5]
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >
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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 17 of file ESIntegrityTask.h.

Constructor & Destructor Documentation

◆ ESIntegrityTask()

ESIntegrityTask::ESIntegrityTask ( const edm::ParameterSet ps)

Definition at line 25 of file ESIntegrityTask.cc.

References gather_cfg::cout, FCDTask_cfi::fiber, geometryDiff::file, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), dqmiolumiharvest::j, isotrackApplyRegressor::k, and visualization-live-secondInstance_cfg::m.

25  {
26  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
27  lookup_ = ps.getUntrackedParameter<FileInPath>("LookupTable");
28 
29  dccCollections_ = consumes<ESRawDataCollection>(ps.getParameter<InputTag>("ESDCCCollections"));
30  kchipCollections_ = consumes<ESLocalRawDataCollection>(ps.getParameter<InputTag>("ESKChipCollections"));
31 
32  // read in look-up table
33  for (int i = 0; i < 2; ++i)
34  for (int j = 0; j < 2; ++j)
35  for (int k = 0; k < 40; ++k)
36  for (int m = 0; m < 40; ++m) {
37  fed_[i][j][k][m] = -1;
38  kchip_[i][j][k][m] = -1;
39  fiber_[i][j][k][m] = -1;
40  }
41 
42  int nLines_, z, iz, ip, ix, iy, fed, kchip, pace, bundle, fiber, optorx;
43  ifstream file;
44  file.open(lookup_.fullPath().c_str());
45  if (file.is_open()) {
46  file >> nLines_;
47 
48  for (int i = 0; i < nLines_; ++i) {
49  file >> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
50 
51  z = (iz == -1) ? 2 : iz;
52  fed_[z - 1][ip - 1][ix - 1][iy - 1] = fed;
53  kchip_[z - 1][ip - 1][ix - 1][iy - 1] = kchip;
54  fiber_[z - 1][ip - 1][ix - 1][iy - 1] = (fiber - 1) + (optorx - 1) * 12;
55  }
56  } else {
57  cout << "ESIntegrityTask : Look up table file can not be found in " << lookup_.fullPath().c_str() << endl;
58  }
59 
60  ievt_ = 0;
61 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
int fed_[2][2][40][40]
T getUntrackedParameter(std::string const &, T const &) const
int fiber_[2][2][40][40]
edm::EDGetTokenT< ESLocalRawDataCollection > kchipCollections_
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
std::string prefixME_
edm::FileInPath lookup_
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const std::string & fullPath() const
Definition: FileInPath.cc:144
int kchip_[2][2][40][40]

◆ ~ESIntegrityTask()

ESIntegrityTask::~ESIntegrityTask ( )
inlineoverride

Definition at line 20 of file ESIntegrityTask.h.

20 {}

Member Function Documentation

◆ analyze()

void ESIntegrityTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >.

Definition at line 231 of file ESIntegrityTask.cc.

References edm::SortedCollection< T, SORT >::begin(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::dcc(), MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::end(), sistrip::extrainfo::gain_, ESKCHIPBlock::getBC(), ESKCHIPBlock::getEC(), ESKCHIPBlock::getFlag1(), ESKCHIPBlock::getFlag2(), ESKCHIPBlock::getOptoBC(), ESKCHIPBlock::getOptoEC(), mps_fire::i, ESKCHIPBlock::id(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), and dqmiolumiharvest::j.

231  {
232  ievt_++;
233  auto lumiCache = luminosityBlockCache(e.getLuminosityBlock().index());
234  ++(lumiCache->ievtLS_);
235 
238 
239  // Fill # of events
240  meDCCErr_->Fill(575, 2, 1);
241  meDCCCRCErr_->Fill(575, 2, 1);
242  meDCCCRCErrByLS_->Fill(575, 2, 1);
243  meOptoRX_->Fill(575, 2, 1);
244  meOptoBC_->Fill(575, 2, 1);
245  meOptoBCByLS_->Fill(575, 2, 1);
246  meFiberBadStatus_->Fill(575, 36, 1);
247  meFiberOff_->Fill(575, 36, 1);
248  meFiberOffByLS_->Fill(575, 36, 1);
249  meEVDR_->Fill(575, 36, 1);
250 
251  // # of DI errors
252  Double_t nDIErr[56][36];
253  for (int i = 0; i < 56; ++i)
254  for (int j = 0; j < 36; ++j)
255  nDIErr[i][j] = 0;
256 
257  // DCC
258  vector<int> fiberStatus;
259  if (e.getByToken(dccCollections_, dccs)) {
260  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
261  const ESDCCHeaderBlock& dcc = (*dccItr);
262 
263  meFED_->Fill(dcc.fedId());
264 
265  meDCCErr_->Fill(dcc.fedId(), dcc.getDCCErrors());
266 
267  // SLink CRC error
268  if (dcc.getDCCErrors() == 101) {
269  meSLinkCRCErr_->Fill(dcc.fedId());
270  meSLinkCRCErrByLS_->Fill(dcc.fedId());
271  for (int j = 0; j < 36; ++j)
272  nDIErr[dcc.fedId() - 520][j]++;
273  }
274 
275  if (dcc.getOptoRX0() == 129) {
276  meOptoRX_->Fill(dcc.fedId(), 0);
277  if (((dcc.getOptoBC0() - 15) & 0x0fff) != dcc.getBX()) {
278  meOptoBC_->Fill(dcc.fedId(), 0);
279  meOptoBCByLS_->Fill(dcc.fedId(), 0);
280  }
281  }
282  if (dcc.getOptoRX1() == 129) {
283  meOptoRX_->Fill(dcc.fedId(), 1);
284  if (((dcc.getOptoBC1() - 15) & 0x0fff) != dcc.getBX()) {
285  meOptoBC_->Fill(dcc.fedId(), 1);
286  meOptoBCByLS_->Fill(dcc.fedId(), 1);
287  }
288  }
289  if (dcc.getOptoRX2() == 129) {
290  meOptoRX_->Fill(dcc.fedId(), 2);
291  if (((dcc.getOptoBC2() - 15) & 0x0fff) != dcc.getBX()) {
292  meOptoBC_->Fill(dcc.fedId(), 2);
293  meOptoBCByLS_->Fill(dcc.fedId(), 2);
294  }
295  }
296 
297  if (dcc.getOptoRX0() == 128) {
298  meDCCCRCErr_->Fill(dcc.fedId(), 0);
299  meDCCCRCErrByLS_->Fill(dcc.fedId(), 0);
300  for (int j = 0; j < 12; ++j)
301  nDIErr[dcc.fedId() - 520][j]++;
302  }
303  if (dcc.getOptoRX1() == 128) {
304  meDCCCRCErr_->Fill(dcc.fedId(), 1);
305  meDCCCRCErrByLS_->Fill(dcc.fedId(), 1);
306  for (int j = 12; j < 24; ++j)
307  nDIErr[dcc.fedId() - 520][j]++;
308  }
309  if (dcc.getOptoRX2() == 128) {
310  meDCCCRCErr_->Fill(dcc.fedId(), 2);
311  meDCCCRCErrByLS_->Fill(dcc.fedId(), 2);
312  for (int j = 24; j < 36; ++j)
313  nDIErr[dcc.fedId() - 520][j]++;
314  }
315 
316  fiberStatus = dcc.getFEChannelStatus();
317 
318  for (unsigned int i = 0; i < fiberStatus.size(); ++i) {
319  if (fiberStatus[i] == 4 || fiberStatus[i] == 8 || fiberStatus[i] == 10 || fiberStatus[i] == 11 ||
320  fiberStatus[i] == 12) {
321  meFiberBadStatus_->Fill(dcc.fedId(), i + 1, 1);
322  meFiberErrCode_->Fill(fiberStatus[i]);
323  meFiberErrCodeByLS_->Fill(fiberStatus[i]);
324  nDIErr[dcc.fedId() - 520][i]++;
325  }
326  if (fiberStatus[i] == 7) {
327  meFiberOff_->Fill(dcc.fedId(), i + 1, 1);
328  meFiberOffByLS_->Fill(dcc.fedId(), i + 1, 1);
329  }
330  if (fiberStatus[i] == 6) {
331  meFiberErrCode_->Fill(fiberStatus[i]);
332  meFiberErrCodeByLS_->Fill(fiberStatus[i]);
333  meEVDR_->Fill(dcc.fedId(), i + 1, 1);
334  }
335  }
336 
337  runtype_ = dcc.getRunType();
338  seqtype_ = dcc.getSeqType();
339  dac_ = dcc.getDAC();
340  gain_ = dcc.getGain();
341  precision_ = dcc.getPrecision();
342 
343  meGain_->Fill(gain_);
344  }
345  } else {
346  LogWarning("ESIntegrityTask") << "dccCollections not available";
347  }
348 
349  // KCHIP's
350  if (e.getByToken(kchipCollections_, kchips)) {
351  for (ESLocalRawDataCollection::const_iterator kItr = kchips->begin(); kItr != kchips->end(); ++kItr) {
352  ESKCHIPBlock kchip = (*kItr);
353 
354  meKF1_->Fill(kchip.id(), kchip.getFlag1());
355  meKF2_->Fill(kchip.id(), kchip.getFlag2());
356  if (kchip.getBC() != kchip.getOptoBC())
357  meKBC_->Fill(kchip.id());
358  if (kchip.getEC() != kchip.getOptoEC())
359  meKEC_->Fill(kchip.id());
360  }
361  } else {
362  LogWarning("ESIntegrityTask") << "kchipCollections not available";
363  }
364 
365  // Fill # of DI errors
366  for (int iz = 0; iz < 2; ++iz)
367  for (int ip = 0; ip < 2; ++ip)
368  for (int ix = 0; ix < 40; ++ix)
369  for (int iy = 0; iy < 40; ++iy) {
370  if (fed_[iz][ip][ix][iy] == -1)
371  continue;
372 
373  if (nDIErr[fed_[iz][ip][ix][iy] - 520][fiber_[iz][ip][ix][iy]] > 0) {
374  meDIErrors_[iz][ip]->Fill(ix + 1, iy + 1, 1);
375  (lumiCache->DIErrorsByLS_)[iz][ip][ix][iy] += 1;
376  meDIErrorsByLS_[iz][ip]->Fill(ix + 1, iy + 1, 1);
377  }
378  }
379 }
MonitorElement * meGain_
int getBC() const
Definition: ESKCHIPBlock.h:33
MonitorElement * meDCCErr_
MonitorElement * meKEC_
int getFlag2() const
Definition: ESKCHIPBlock.h:38
MonitorElement * meDCCCRCErr_
MonitorElement * meFED_
std::vector< T >::const_iterator const_iterator
MonitorElement * meFiberBadStatus_
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
MonitorElement * meFiberOff_
MonitorElement * meFiberOffByLS_
int getOptoEC() const
Definition: ESKCHIPBlock.h:36
int fed_[2][2][40][40]
void Fill(long long x)
MonitorElement * meKF1_
int fiber_[2][2][40][40]
MonitorElement * meDIErrors_[2][2]
int getEC() const
Definition: ESKCHIPBlock.h:34
MonitorElement * meOptoRX_
MonitorElement * meOptoBCByLS_
MonitorElement * meFiberErrCode_
const_iterator begin() const
edm::EDGetTokenT< ESLocalRawDataCollection > kchipCollections_
const_iterator end() const
int getOptoBC() const
Definition: ESKCHIPBlock.h:35
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
MonitorElement * meEVDR_
MonitorElement * meKF2_
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
MonitorElement * meSLinkCRCErrByLS_
MonitorElement * meDCCCRCErrByLS_
Log< level::Warning, false > LogWarning
const int & id() const
Definition: ESKCHIPBlock.h:13
MonitorElement * meSLinkCRCErr_
MonitorElement * meOptoBC_
MonitorElement * meDIErrorsByLS_[2][2]
MonitorElement * meFiberErrCodeByLS_
int getFlag1() const
Definition: ESKCHIPBlock.h:37
MonitorElement * meKBC_

◆ bookHistograms()

void ESIntegrityTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >.

Definition at line 99 of file ESIntegrityTask.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), timingPdfMaker::histo, mps_fire::i, dqmiolumiharvest::j, dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

99  {
100  char histo[200];
101 
102  iBooker.setCurrentFolder(prefixME_ + "/ESIntegrityTask");
103 
104  sprintf(histo, "ES FEDs used for data taking");
105  meFED_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
106  meFED_->setAxisTitle("ES FED", 1);
107  meFED_->setAxisTitle("Num of Events", 2);
108 
109  sprintf(histo, "ES Gain used for data taking");
110  meGain_ = iBooker.book1D(histo, histo, 2, -0.5, 1.5);
111  meGain_->setAxisTitle("ES Gain", 1);
112  meGain_->setAxisTitle("Num of Events", 2);
113 
114  sprintf(histo, "ES DCC Error codes");
115  meDCCErr_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 6, -0.5, 5.5);
116  meDCCErr_->setAxisTitle("ES FED", 1);
117  meDCCErr_->setAxisTitle("ES DCC Error code", 2);
118 
119  sprintf(histo, "ES SLink CRC Errors");
120  meSLinkCRCErr_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
121  meSLinkCRCErr_->setAxisTitle("ES FED", 1);
122  meSLinkCRCErr_->setAxisTitle("Num of Events", 2);
123 
124  sprintf(histo, "ES DCC CRC Errors");
125  meDCCCRCErr_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
126  meDCCCRCErr_->setAxisTitle("ES FED", 1);
127  meDCCCRCErr_->setAxisTitle("ES OptoRX", 2);
128 
129  sprintf(histo, "ES OptoRX used for data taking");
130  meOptoRX_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
131  meOptoRX_->setAxisTitle("ES FED", 1);
132  meOptoRX_->setAxisTitle("ES OptoRX", 2);
133 
134  sprintf(histo, "ES OptoRX BC mismatch");
135  meOptoBC_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
136  meOptoBC_->setAxisTitle("ES FED", 1);
137  meOptoBC_->setAxisTitle("ES OptoRX", 2);
138 
139  sprintf(histo, "ES Fiber Bad Status");
140  meFiberBadStatus_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
141  meFiberBadStatus_->setAxisTitle("ES FED", 1);
142  meFiberBadStatus_->setAxisTitle("Fiber Number", 2);
143 
144  sprintf(histo, "ES Fiber Error Code");
145  meFiberErrCode_ = iBooker.book1D(histo, histo, 17, -0.5, 16.5);
146  meFiberErrCode_->setAxisTitle("Fiber Error Code", 1);
147 
148  sprintf(histo, "ES Fiber Off");
149 
150  meFiberOff_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
151  meFiberOff_->setAxisTitle("ES FED", 1);
152  meFiberOff_->setAxisTitle("Fiber Number", 2);
153 
154  sprintf(histo, "ES Warning Event Dropped");
155  meEVDR_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
156  meEVDR_->setAxisTitle("ES FED", 1);
157  meEVDR_->setAxisTitle("Fiber Number", 2);
158 
159  sprintf(histo, "ES KChip Flag 1 Error codes");
160  meKF1_ = iBooker.book2D(histo, histo, 1550, -0.5, 1549.5, 16, -0.5, 15.5);
161  meKF1_->setAxisTitle("ES KChip", 1);
162  meKF1_->setAxisTitle("ES KChip F1 Error Code ", 2);
163 
164  sprintf(histo, "ES KChip Flag 2 Error codes");
165  meKF2_ = iBooker.book2D(histo, histo, 1550, -0.5, 1549.5, 16, -0.5, 15.5);
166  meKF2_->setAxisTitle("ES KChip", 1);
167  meKF2_->setAxisTitle("ES KChip F1 Error Code ", 2);
168 
169  sprintf(histo, "ES KChip BC mismatch with OptoRX");
170  meKBC_ = iBooker.book1D(histo, histo, 1550, -0.5, 1549.5);
171  meKBC_->setAxisTitle("ES KChip", 1);
172  meKBC_->setAxisTitle("Num of BC mismatch", 2);
173 
174  sprintf(histo, "ES KChip EC mismatch with OptoRX");
175  meKEC_ = iBooker.book1D(histo, histo, 1550, -0.5, 1549.5);
176  meKEC_->setAxisTitle("ES KChip", 1);
177  meKEC_->setAxisTitle("Num of EC mismatch", 2);
178 
179  for (int i = 0; i < 2; ++i)
180  for (int j = 0; j < 2; ++j) {
181  int iz = (i == 0) ? 1 : -1;
182  sprintf(histo, "ES Integrity Errors Z %d P %d", iz, j + 1);
183  meDIErrors_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
184  meDIErrors_[i][j]->setAxisTitle("Si X", 1);
185  meDIErrors_[i][j]->setAxisTitle("Si Y", 2);
186  }
187 
188  // LS-based histos
189  sprintf(histo, "ES Good Channel Fraction");
190  meDIFraction_ = iBooker.book2D(histo, histo, 3, 1.0, 3.0, 3, 1.0, 3.0);
191 
192  iBooker.setCurrentFolder(prefixME_ + "/ByLumiSection");
193 
194  sprintf(histo, "ES SLink CRC Errors");
195  meSLinkCRCErrByLS_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
196  meSLinkCRCErrByLS_->setAxisTitle("ES FED", 1);
197  meSLinkCRCErrByLS_->setAxisTitle("Num of Events", 2);
198 
199  sprintf(histo, "ES DCC CRC Errors");
200  meDCCCRCErrByLS_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
201  meDCCCRCErrByLS_->setAxisTitle("ES FED", 1);
202  meDCCCRCErrByLS_->setAxisTitle("ES OptoRX", 2);
203 
204  sprintf(histo, "ES OptoRX BC mismatch");
205  meOptoBCByLS_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
206  meOptoBCByLS_->setAxisTitle("ES FED", 1);
207  meOptoBCByLS_->setAxisTitle("ES OptoRX", 2);
208 
209  sprintf(histo, "ES Fiber Error Code");
210  meFiberErrCodeByLS_ = iBooker.book1D(histo, histo, 17, -0.5, 16.5);
211  meFiberErrCodeByLS_->setAxisTitle("Fiber Error Code", 1);
212 
213  sprintf(histo, "ES Fiber Off");
214  meFiberOffByLS_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
215  meFiberOffByLS_->setAxisTitle("ES FED", 1);
216  meFiberOffByLS_->setAxisTitle("Fiber Number", 2);
217 
218  for (int i = 0; i < 2; ++i) {
219  for (int j = 0; j < 2; ++j) {
220  int iz = (i == 0) ? 1 : -1;
221  sprintf(histo, "ES Integrity Errors Z %d P %d", iz, j + 1);
222  meDIErrorsByLS_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
223  meDIErrorsByLS_[i][j]->setAxisTitle("Si X", 1);
224  meDIErrorsByLS_[i][j]->setAxisTitle("Si Y", 2);
225  }
226  }
227 }
MonitorElement * meGain_
MonitorElement * meDCCErr_
MonitorElement * meKEC_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * meDIFraction_
MonitorElement * meDCCCRCErr_
MonitorElement * meFED_
MonitorElement * meFiberBadStatus_
MonitorElement * meFiberOff_
MonitorElement * meFiberOffByLS_
MonitorElement * meKF1_
MonitorElement * meDIErrors_[2][2]
MonitorElement * meOptoRX_
MonitorElement * meOptoBCByLS_
MonitorElement * meFiberErrCode_
std::string prefixME_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
MonitorElement * meEVDR_
MonitorElement * meKF2_
MonitorElement * meSLinkCRCErrByLS_
MonitorElement * meDCCCRCErrByLS_
MonitorElement * meSLinkCRCErr_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * meOptoBC_
MonitorElement * meDIErrorsByLS_[2][2]
MonitorElement * meFiberErrCodeByLS_
MonitorElement * meKBC_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ calculateDIFraction()

void ESIntegrityTask::calculateDIFraction ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
protected

Calculate Data Integrity Fraction.

Definition at line 383 of file ESIntegrityTask.cc.

References mps_fire::i, dqmiolumiharvest::j, heppy_batch::val, and x.

383  {
384  float nValidChannels = 0;
385  float nGlobalErrors = 0;
386  auto lumiCache = luminosityBlockCache(lumi.index());
387 
388  for (int i = 0; i < 2; ++i) {
389  for (int j = 0; j < 2; ++j) {
390  float nValidChannelsES = 0;
391  float nGlobalErrorsES = 0;
392  float reportSummaryES = -1;
393  for (int x = 0; x < 40; ++x) {
394  for (int y = 0; y < 40; ++y) {
395  float val = 1.0 * ((lumiCache->DIErrorsByLS_)[i][j][x][y]);
396  if (fed_[i][j][x][y] == -1)
397  continue;
398  if ((lumiCache->ievtLS_) != 0)
399  nGlobalErrors += val / (lumiCache->ievtLS_);
400  nValidChannels++;
401  if ((lumiCache->ievtLS_) != 0)
402  nGlobalErrorsES += val / (lumiCache->ievtLS_);
403  nValidChannelsES++;
404  }
405  }
406  if (nValidChannelsES != 0)
407  reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES;
408  meDIFraction_->setBinContent(i + 1, j + 1, reportSummaryES);
409  }
410  }
411  float reportSummary = -1.0;
412  if (nValidChannels != 0)
413  reportSummary = 1.0 - nGlobalErrors / nValidChannels;
414  meDIFraction_->setBinContent(3, 3, reportSummary);
415 }
MonitorElement * meDIFraction_
int fed_[2][2][40][40]
virtual void setBinContent(int binx, double content)
set content of bin (1-D)

◆ dqmEndRun()

void ESIntegrityTask::dqmEndRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotectedvirtual

EndRun.

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< ESIntLSCache > >.

Definition at line 63 of file ESIntegrityTask.cc.

63  {
64  // In case of Lumi based analysis Disable SoftReset from Integrity histogram to get full statistics
65  // TODO: no longer possible, clone histo beforehand if full statisticcs at end of run are required.
66 }

◆ endJob()

void ESIntegrityTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::one::EDProducerBase.

Definition at line 229 of file ESIntegrityTask.cc.

229 { LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events"; }
Log< level::Info, false > LogInfo

◆ globalBeginLuminosityBlock()

std::shared_ptr< ESIntLSCache > ESIntegrityTask::globalBeginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
) const
overrideprotected

Begin Lumi.

Definition at line 68 of file ESIntegrityTask.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy().

69  {
70  LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events";
71  // In case of Lumi based analysis SoftReset the Integrity histogram
72  auto lumiCache = std::make_shared<ESIntLSCache>();
73  lumiCache->ievtLS_ = 0;
74 
75  for (int iz = 0; iz < 2; ++iz) {
76  for (int ip = 0; ip < 2; ++ip) {
77  meDIErrorsByLS_[iz][ip]->Reset();
78  for (int ix = 0; ix < 40; ++ix) {
79  for (int iy = 0; iy < 40; ++iy) {
80  (lumiCache->DIErrorsByLS_)[iz][ip][ix][iy] = 0;
81  }
82  }
83  }
84  }
85 
91 
92  return lumiCache;
93 }
MonitorElement * meFiberOffByLS_
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * meOptoBCByLS_
Log< level::Info, false > LogInfo
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
MonitorElement * meSLinkCRCErrByLS_
MonitorElement * meDCCCRCErrByLS_
MonitorElement * meDIErrorsByLS_[2][2]
MonitorElement * meFiberErrCodeByLS_

◆ globalEndLuminosityBlock()

void ESIntegrityTask::globalEndLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotected

End Lumi.

Definition at line 95 of file ESIntegrityTask.cc.

References DummyCfis::c.

95  {
97 }
void calculateDIFraction(const edm::LuminosityBlock &lumi, const edm::EventSetup &c)
Calculate Data Integrity Fraction.

Member Data Documentation

◆ dac_

int ESIntegrityTask::dac_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ dccCollections_

edm::EDGetTokenT<ESRawDataCollection> ESIntegrityTask::dccCollections_
private

Definition at line 49 of file ESIntegrityTask.h.

◆ doLumiAnalysis_

bool ESIntegrityTask::doLumiAnalysis_
private

Definition at line 81 of file ESIntegrityTask.h.

◆ eCount_

int ESIntegrityTask::eCount_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ fed_

int ESIntegrityTask::fed_[2][2][40][40]
private

Definition at line 80 of file ESIntegrityTask.h.

◆ fiber_

int ESIntegrityTask::fiber_[2][2][40][40]
private

Definition at line 80 of file ESIntegrityTask.h.

◆ firstDAC_

int ESIntegrityTask::firstDAC_
private

Definition at line 79 of file ESIntegrityTask.h.

◆ gain_

int ESIntegrityTask::gain_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ ievt_

int ESIntegrityTask::ievt_
private

Definition at line 45 of file ESIntegrityTask.h.

◆ isPed_

int ESIntegrityTask::isPed_
private

Definition at line 79 of file ESIntegrityTask.h.

◆ kchip_

int ESIntegrityTask::kchip_[2][2][40][40]
private

Definition at line 80 of file ESIntegrityTask.h.

◆ kchipCollections_

edm::EDGetTokenT<ESLocalRawDataCollection> ESIntegrityTask::kchipCollections_
private

Definition at line 50 of file ESIntegrityTask.h.

◆ lookup_

edm::FileInPath ESIntegrityTask::lookup_
private

Definition at line 76 of file ESIntegrityTask.h.

◆ meDCCCRCErr_

MonitorElement* ESIntegrityTask::meDCCCRCErr_
private

Definition at line 57 of file ESIntegrityTask.h.

◆ meDCCCRCErrByLS_

MonitorElement* ESIntegrityTask::meDCCCRCErrByLS_
private

Definition at line 58 of file ESIntegrityTask.h.

◆ meDCCErr_

MonitorElement* ESIntegrityTask::meDCCErr_
private

Definition at line 56 of file ESIntegrityTask.h.

◆ meDIErrors_

MonitorElement* ESIntegrityTask::meDIErrors_[2][2]
private

Definition at line 72 of file ESIntegrityTask.h.

◆ meDIErrorsByLS_

MonitorElement* ESIntegrityTask::meDIErrorsByLS_[2][2]
private

Definition at line 73 of file ESIntegrityTask.h.

◆ meDIFraction_

MonitorElement* ESIntegrityTask::meDIFraction_
private

Definition at line 74 of file ESIntegrityTask.h.

◆ meEVDR_

MonitorElement* ESIntegrityTask::meEVDR_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ meFED_

MonitorElement* ESIntegrityTask::meFED_
private

Definition at line 53 of file ESIntegrityTask.h.

◆ meFiberBadStatus_

MonitorElement* ESIntegrityTask::meFiberBadStatus_
private

Definition at line 62 of file ESIntegrityTask.h.

◆ meFiberErrCode_

MonitorElement* ESIntegrityTask::meFiberErrCode_
private

Definition at line 63 of file ESIntegrityTask.h.

◆ meFiberErrCodeByLS_

MonitorElement* ESIntegrityTask::meFiberErrCodeByLS_
private

Definition at line 64 of file ESIntegrityTask.h.

◆ meFiberOff_

MonitorElement* ESIntegrityTask::meFiberOff_
private

Definition at line 65 of file ESIntegrityTask.h.

◆ meFiberOffByLS_

MonitorElement* ESIntegrityTask::meFiberOffByLS_
private

Definition at line 66 of file ESIntegrityTask.h.

◆ meGain_

MonitorElement* ESIntegrityTask::meGain_
private

Definition at line 52 of file ESIntegrityTask.h.

◆ meKBC_

MonitorElement* ESIntegrityTask::meKBC_
private

Definition at line 70 of file ESIntegrityTask.h.

◆ meKEC_

MonitorElement* ESIntegrityTask::meKEC_
private

Definition at line 71 of file ESIntegrityTask.h.

◆ meKF1_

MonitorElement* ESIntegrityTask::meKF1_
private

Definition at line 68 of file ESIntegrityTask.h.

◆ meKF2_

MonitorElement* ESIntegrityTask::meKF2_
private

Definition at line 69 of file ESIntegrityTask.h.

◆ meOptoBC_

MonitorElement* ESIntegrityTask::meOptoBC_
private

Definition at line 60 of file ESIntegrityTask.h.

◆ meOptoBCByLS_

MonitorElement* ESIntegrityTask::meOptoBCByLS_
private

Definition at line 61 of file ESIntegrityTask.h.

◆ meOptoRX_

MonitorElement* ESIntegrityTask::meOptoRX_
private

Definition at line 59 of file ESIntegrityTask.h.

◆ meSLinkCRCErr_

MonitorElement* ESIntegrityTask::meSLinkCRCErr_
private

Definition at line 54 of file ESIntegrityTask.h.

◆ meSLinkCRCErrByLS_

MonitorElement* ESIntegrityTask::meSLinkCRCErrByLS_
private

Definition at line 55 of file ESIntegrityTask.h.

◆ nDAC_

int ESIntegrityTask::nDAC_
private

Definition at line 79 of file ESIntegrityTask.h.

◆ precision_

int ESIntegrityTask::precision_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ prefixME_

std::string ESIntegrityTask::prefixME_
private

Definition at line 47 of file ESIntegrityTask.h.

◆ runNum_

int ESIntegrityTask::runNum_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ runtype_

int ESIntegrityTask::runtype_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ seqtype_

int ESIntegrityTask::seqtype_
private

Definition at line 78 of file ESIntegrityTask.h.

◆ vDAC_

int ESIntegrityTask::vDAC_[5]
private

Definition at line 79 of file ESIntegrityTask.h.