CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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< ESLSCache > > 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< ESLSCache > >
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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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< ESLSCacheglobalBeginLuminosityBlock (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< ESLSCache > >
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- 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)
 
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 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<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
< ESRawDataCollection
dccCollections_
 
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
< ESLocalRawDataCollection
kchipCollections_
 
edm::FileInPath lookup_
 
MonitorElementmeDCCCRCErr_
 
MonitorElementmeDCCErr_
 
MonitorElementmeDIErrors_ [2][2]
 
MonitorElementmeDIErrorsLS_ [2][2]
 
MonitorElementmeDIFraction_
 
MonitorElementmeEVDR_
 
MonitorElementmeFED_
 
MonitorElementmeFiberBadStatus_
 
MonitorElementmeFiberErrCode_
 
MonitorElementmeFiberOff_
 
MonitorElementmeGain_
 
MonitorElementmeKBC_
 
MonitorElementmeKEC_
 
MonitorElementmeKF1_
 
MonitorElementmeKF2_
 
MonitorElementmeOptoBC_
 
MonitorElementmeOptoRX_
 
MonitorElementmeSLinkCRCErr_
 
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< ESLSCache > >
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
 
- 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< ESLSCache > >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 17 of file ESIntegrityTask.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file ESIntegrityTask.cc.

References gather_cfg::cout, mergeVDriftHistosByStation::file, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, 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  doLumiAnalysis_ = ps.getParameter<bool>("DoLumiAnalysis");
33 
34  // read in look-up table
35  for (int i = 0; i < 2; ++i)
36  for (int j = 0; j < 2; ++j)
37  for (int k = 0; k < 40; ++k)
38  for (int m = 0; m < 40; ++m) {
39  fed_[i][j][k][m] = -1;
40  kchip_[i][j][k][m] = -1;
41  fiber_[i][j][k][m] = -1;
42  }
43 
44  int nLines_, z, iz, ip, ix, iy, fed, kchip, pace, bundle, fiber, optorx;
45  ifstream file;
46  file.open(lookup_.fullPath().c_str());
47  if (file.is_open()) {
48  file >> nLines_;
49 
50  for (int i = 0; i < nLines_; ++i) {
51  file >> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
52 
53  z = (iz == -1) ? 2 : iz;
54  fed_[z - 1][ip - 1][ix - 1][iy - 1] = fed;
55  kchip_[z - 1][ip - 1][ix - 1][iy - 1] = kchip;
56  fiber_[z - 1][ip - 1][ix - 1][iy - 1] = (fiber - 1) + (optorx - 1) * 12;
57  }
58  } else {
59  cout << "ESIntegrityTask : Look up table file can not be found in " << lookup_.fullPath().c_str() << endl;
60  }
61 
62  ievt_ = 0;
63 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
int fed_[2][2][40][40]
int fiber_[2][2][40][40]
edm::EDGetTokenT< ESLocalRawDataCollection > kchipCollections_
std::string prefixME_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::FileInPath lookup_
std::string fullPath() const
Definition: FileInPath.cc:161
tuple cout
Definition: gather_cfg.py:144
int kchip_[2][2][40][40]
ESIntegrityTask::~ESIntegrityTask ( )
inlineoverride

Definition at line 20 of file ESIntegrityTask.h.

20 {}

Member Function Documentation

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

Analyze.

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

Definition at line 192 of file ESIntegrityTask.cc.

References ESDCCHeaderBlock::fedId(), sistrip::extrainfo::gain_, ESKCHIPBlock::getBC(), ESDCCHeaderBlock::getBX(), edm::Event::getByToken(), ESDCCHeaderBlock::getDAC(), ESDCCHeaderBlock::getDCCErrors(), ESKCHIPBlock::getEC(), ESDCCHeaderBlock::getFEChannelStatus(), ESKCHIPBlock::getFlag1(), ESKCHIPBlock::getFlag2(), ESDCCHeaderBlock::getGain(), edm::Event::getLuminosityBlock(), ESKCHIPBlock::getOptoBC(), ESDCCHeaderBlock::getOptoBC0(), ESDCCHeaderBlock::getOptoBC1(), ESDCCHeaderBlock::getOptoBC2(), ESKCHIPBlock::getOptoEC(), ESDCCHeaderBlock::getOptoRX0(), ESDCCHeaderBlock::getOptoRX1(), ESDCCHeaderBlock::getOptoRX2(), ESDCCHeaderBlock::getPrecision(), ESDCCHeaderBlock::getRunType(), ESDCCHeaderBlock::getSeqType(), mps_fire::i, ESKCHIPBlock::id(), edm::LuminosityBlock::index(), and dqmiolumiharvest::j.

192  {
193  ievt_++;
194  auto lumiCache = luminosityBlockCache(e.getLuminosityBlock().index());
195  ++(lumiCache->ievtLS_);
196 
199 
200  // Fill # of events
201  meDCCErr_->Fill(575, 2, 1);
202  meDCCCRCErr_->Fill(575, 2, 1);
203  meOptoRX_->Fill(575, 2, 1);
204  meOptoBC_->Fill(575, 2, 1);
205  meFiberBadStatus_->Fill(575, 36, 1);
206  meFiberOff_->Fill(575, 36, 1);
207  meEVDR_->Fill(575, 36, 1);
208 
209  // # of DI errors
210  Double_t nDIErr[56][36];
211  for (int i = 0; i < 56; ++i)
212  for (int j = 0; j < 36; ++j)
213  nDIErr[i][j] = 0;
214 
215  // DCC
216  vector<int> fiberStatus;
217  if (e.getByToken(dccCollections_, dccs)) {
218  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
219  ESDCCHeaderBlock dcc = (*dccItr);
220 
221  meFED_->Fill(dcc.fedId());
222 
223  meDCCErr_->Fill(dcc.fedId(), dcc.getDCCErrors());
224 
225  // SLink CRC error
226  if (dcc.getDCCErrors() == 101) {
227  meSLinkCRCErr_->Fill(dcc.fedId());
228  for (int j = 0; j < 36; ++j)
229  nDIErr[dcc.fedId() - 520][j]++;
230  }
231 
232  if (dcc.getOptoRX0() == 129) {
233  meOptoRX_->Fill(dcc.fedId(), 0);
234  if (((dcc.getOptoBC0() - 15) & 0x0fff) != dcc.getBX())
235  meOptoBC_->Fill(dcc.fedId(), 0);
236  }
237  if (dcc.getOptoRX1() == 129) {
238  meOptoRX_->Fill(dcc.fedId(), 1);
239  if (((dcc.getOptoBC1() - 15) & 0x0fff) != dcc.getBX())
240  meOptoBC_->Fill(dcc.fedId(), 1);
241  }
242  if (dcc.getOptoRX2() == 129) {
243  meOptoRX_->Fill(dcc.fedId(), 2);
244  if (((dcc.getOptoBC2() - 15) & 0x0fff) != dcc.getBX())
245  meOptoBC_->Fill(dcc.fedId(), 2);
246  }
247 
248  if (dcc.getOptoRX0() == 128) {
249  meDCCCRCErr_->Fill(dcc.fedId(), 0);
250  for (int j = 0; j < 12; ++j)
251  nDIErr[dcc.fedId() - 520][j]++;
252  }
253  if (dcc.getOptoRX1() == 128) {
254  meDCCCRCErr_->Fill(dcc.fedId(), 1);
255  for (int j = 12; j < 24; ++j)
256  nDIErr[dcc.fedId() - 520][j]++;
257  }
258  if (dcc.getOptoRX2() == 128) {
259  meDCCCRCErr_->Fill(dcc.fedId(), 2);
260  for (int j = 24; j < 36; ++j)
261  nDIErr[dcc.fedId() - 520][j]++;
262  }
263 
264  fiberStatus = dcc.getFEChannelStatus();
265 
266  for (unsigned int i = 0; i < fiberStatus.size(); ++i) {
267  if (fiberStatus[i] == 4 || fiberStatus[i] == 8 || fiberStatus[i] == 10 || fiberStatus[i] == 11 ||
268  fiberStatus[i] == 12) {
269  meFiberBadStatus_->Fill(dcc.fedId(), i + 1, 1);
270  meFiberErrCode_->Fill(fiberStatus[i]);
271  nDIErr[dcc.fedId() - 520][i]++;
272  }
273  if (fiberStatus[i] == 7)
274  meFiberOff_->Fill(dcc.fedId(), i + 1, 1);
275  if (fiberStatus[i] == 6) {
276  meFiberErrCode_->Fill(fiberStatus[i]);
277  meEVDR_->Fill(dcc.fedId(), i + 1, 1);
278  }
279  }
280 
281  runtype_ = dcc.getRunType();
282  seqtype_ = dcc.getSeqType();
283  dac_ = dcc.getDAC();
284  gain_ = dcc.getGain();
285  precision_ = dcc.getPrecision();
286 
287  meGain_->Fill(gain_);
288  }
289  } else {
290  LogWarning("ESIntegrityTask") << "dccCollections not available";
291  }
292 
293  // KCHIP's
294  if (e.getByToken(kchipCollections_, kchips)) {
295  for (ESLocalRawDataCollection::const_iterator kItr = kchips->begin(); kItr != kchips->end(); ++kItr) {
296  ESKCHIPBlock kchip = (*kItr);
297 
298  meKF1_->Fill(kchip.id(), kchip.getFlag1());
299  meKF2_->Fill(kchip.id(), kchip.getFlag2());
300  if (kchip.getBC() != kchip.getOptoBC())
301  meKBC_->Fill(kchip.id());
302  if (kchip.getEC() != kchip.getOptoEC())
303  meKEC_->Fill(kchip.id());
304  }
305  } else {
306  LogWarning("ESIntegrityTask") << "kchipCollections not available";
307  }
308 
309  // Fill # of DI errors
310  for (int iz = 0; iz < 2; ++iz)
311  for (int ip = 0; ip < 2; ++ip)
312  for (int ix = 0; ix < 40; ++ix)
313  for (int iy = 0; iy < 40; ++iy) {
314  if (fed_[iz][ip][ix][iy] == -1)
315  continue;
316 
317  if (nDIErr[fed_[iz][ip][ix][iy] - 520][fiber_[iz][ip][ix][iy]] > 0) {
318  meDIErrors_[iz][ip]->Fill(ix + 1, iy + 1, 1);
319  if (doLumiAnalysis_)
320  (lumiCache->DIErrorsLS_)[iz][ip][ix][iy] += 1;
321  }
322  }
323 }
MonitorElement * meGain_
int getOptoBC2() const
int getGain() const
MonitorElement * meDCCErr_
const int & id() const
Definition: ESKCHIPBlock.h:13
MonitorElement * meKEC_
LuminosityBlockIndex index() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * meDCCCRCErr_
MonitorElement * meFED_
std::vector< T >::const_iterator const_iterator
int getEC() const
Definition: ESKCHIPBlock.h:34
int getOptoRX0() const
MonitorElement * meFiberBadStatus_
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
MonitorElement * meFiberOff_
int getOptoRX1() const
int getFlag1() const
Definition: ESKCHIPBlock.h:37
int getBC() const
Definition: ESKCHIPBlock.h:33
int fed_[2][2][40][40]
int getOptoBC1() const
const std::vector< int > & getFEChannelStatus() const
void Fill(long long x)
int getBX() const
MonitorElement * meKF1_
int getRunType() const
int fiber_[2][2][40][40]
MonitorElement * meDIErrors_[2][2]
MonitorElement * meOptoRX_
MonitorElement * meFiberErrCode_
int getFlag2() const
Definition: ESKCHIPBlock.h:38
int getSeqType() const
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:100
edm::EDGetTokenT< ESLocalRawDataCollection > kchipCollections_
int getOptoEC() const
Definition: ESKCHIPBlock.h:36
int getOptoBC0() const
MonitorElement * meEVDR_
int getPrecision() const
MonitorElement * meKF2_
int getDCCErrors() const
int getDAC() const
int getOptoBC() const
Definition: ESKCHIPBlock.h:35
const int fedId() const
Log< level::Warning, false > LogWarning
int getOptoRX2() const
MonitorElement * meSLinkCRCErr_
MonitorElement * meOptoBC_
MonitorElement * meKBC_
void ESIntegrityTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

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

Definition at line 95 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().

95  {
96  char histo[200];
97 
98  iBooker.setCurrentFolder(prefixME_ + "/ESIntegrityTask");
99 
100  sprintf(histo, "ES FEDs used for data taking");
101  meFED_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
102  meFED_->setAxisTitle("ES FED", 1);
103  meFED_->setAxisTitle("Num of Events", 2);
104 
105  sprintf(histo, "ES Gain used for data taking");
106  meGain_ = iBooker.book1D(histo, histo, 2, -0.5, 1.5);
107  meGain_->setAxisTitle("ES Gain", 1);
108  meGain_->setAxisTitle("Num of Events", 2);
109 
110  sprintf(histo, "ES DCC Error codes");
111  meDCCErr_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 6, -0.5, 5.5);
112  meDCCErr_->setAxisTitle("ES FED", 1);
113  meDCCErr_->setAxisTitle("ES DCC Error code", 2);
114 
115  sprintf(histo, "ES SLink CRC Errors");
116  meSLinkCRCErr_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
117  meSLinkCRCErr_->setAxisTitle("ES FED", 1);
118  meSLinkCRCErr_->setAxisTitle("Num of Events", 2);
119 
120  sprintf(histo, "ES DCC CRC Errors");
121  meDCCCRCErr_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
122  meDCCCRCErr_->setAxisTitle("ES FED", 1);
123  meDCCCRCErr_->setAxisTitle("ES OptoRX", 2);
124 
125  sprintf(histo, "ES OptoRX used for data taking");
126  meOptoRX_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
127  meOptoRX_->setAxisTitle("ES FED", 1);
128  meOptoRX_->setAxisTitle("ES OptoRX", 2);
129 
130  sprintf(histo, "ES OptoRX BC mismatch");
131  meOptoBC_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 3, -0.5, 2.5);
132  meOptoBC_->setAxisTitle("ES FED", 1);
133  meOptoBC_->setAxisTitle("ES OptoRX", 2);
134 
135  sprintf(histo, "ES Fiber Bad Status");
136  meFiberBadStatus_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
137  meFiberBadStatus_->setAxisTitle("ES FED", 1);
138  meFiberBadStatus_->setAxisTitle("Fiber Number", 2);
139 
140  sprintf(histo, "ES Fiber Error Code");
141  meFiberErrCode_ = iBooker.book1D(histo, histo, 17, -0.5, 16.5);
142  meFiberErrCode_->setAxisTitle("Fiber Error Code", 1);
143 
144  sprintf(histo, "ES Fiber Off");
145 
146  meFiberOff_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
147  meFiberOff_->setAxisTitle("ES FED", 1);
148  meFiberOff_->setAxisTitle("Fiber Number", 2);
149 
150  sprintf(histo, "ES Warning Event Dropped");
151  meEVDR_ = iBooker.book2D(histo, histo, 56, 519.5, 575.5, 36, 0.5, 36.5);
152  meEVDR_->setAxisTitle("ES FED", 1);
153  meEVDR_->setAxisTitle("Fiber Number", 2);
154 
155  sprintf(histo, "ES KChip Flag 1 Error codes");
156  meKF1_ = iBooker.book2D(histo, histo, 1550, -0.5, 1549.5, 16, -0.5, 15.5);
157  meKF1_->setAxisTitle("ES KChip", 1);
158  meKF1_->setAxisTitle("ES KChip F1 Error Code ", 2);
159 
160  sprintf(histo, "ES KChip Flag 2 Error codes");
161  meKF2_ = iBooker.book2D(histo, histo, 1550, -0.5, 1549.5, 16, -0.5, 15.5);
162  meKF2_->setAxisTitle("ES KChip", 1);
163  meKF2_->setAxisTitle("ES KChip F1 Error Code ", 2);
164 
165  sprintf(histo, "ES KChip BC mismatch with OptoRX");
166  meKBC_ = iBooker.book1D(histo, histo, 1550, -0.5, 1549.5);
167  meKBC_->setAxisTitle("ES KChip", 1);
168  meKBC_->setAxisTitle("Num of BC mismatch", 2);
169 
170  sprintf(histo, "ES KChip EC mismatch with OptoRX");
171  meKEC_ = iBooker.book1D(histo, histo, 1550, -0.5, 1549.5);
172  meKEC_->setAxisTitle("ES KChip", 1);
173  meKEC_->setAxisTitle("Num of EC mismatch", 2);
174 
175  for (int i = 0; i < 2; ++i)
176  for (int j = 0; j < 2; ++j) {
177  int iz = (i == 0) ? 1 : -1;
178  sprintf(histo, "ES Integrity Errors Z %d P %d", iz, j + 1);
179  meDIErrors_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
180  meDIErrors_[i][j]->setAxisTitle("Si X", 1);
181  meDIErrors_[i][j]->setAxisTitle("Si Y", 2);
182  }
183 
184  if (doLumiAnalysis_) {
185  sprintf(histo, "ES Good Channel Fraction");
186  meDIFraction_ = iBooker.book2D(histo, histo, 3, 1.0, 3.0, 3, 1.0, 3.0);
187  }
188 }
MonitorElement * meGain_
MonitorElement * meDCCErr_
MonitorElement * meKEC_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * meDIFraction_
MonitorElement * meDCCCRCErr_
MonitorElement * meFED_
MonitorElement * meFiberBadStatus_
MonitorElement * meFiberOff_
MonitorElement * meKF1_
MonitorElement * meDIErrors_[2][2]
MonitorElement * meOptoRX_
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:177
MonitorElement * meEVDR_
MonitorElement * meKF2_
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 * meKBC_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ESIntegrityTask::calculateDIFraction ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
protected

Calculate Data Integrity Fraction.

Definition at line 327 of file ESIntegrityTask.cc.

References mps_fire::i, edm::LuminosityBlock::index(), dqmiolumiharvest::j, and hgcalPerformanceValidation::val.

327  {
328  float nValidChannels = 0;
329  float nGlobalErrors = 0;
330  auto lumiCache = luminosityBlockCache(lumi.index());
331 
332  for (int i = 0; i < 2; ++i) {
333  for (int j = 0; j < 2; ++j) {
334  float nValidChannelsES = 0;
335  float nGlobalErrorsES = 0;
336  float reportSummaryES = -1;
337  for (int x = 0; x < 40; ++x) {
338  for (int y = 0; y < 40; ++y) {
339  float val = 1.0 * ((lumiCache->DIErrorsLS_)[i][j][x][y]);
340  if (fed_[i][j][x][y] == -1)
341  continue;
342  if ((lumiCache->ievtLS_) != 0)
343  nGlobalErrors += val / (lumiCache->ievtLS_);
344  nValidChannels++;
345  if ((lumiCache->ievtLS_) != 0)
346  nGlobalErrorsES += val / (lumiCache->ievtLS_);
347  nValidChannelsES++;
348  }
349  }
350  if (nValidChannelsES != 0)
351  reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES;
352  meDIFraction_->setBinContent(i + 1, j + 1, reportSummaryES);
353  }
354  }
355  float reportSummary = -1.0;
356  if (nValidChannels != 0)
357  reportSummary = 1.0 - nGlobalErrors / nValidChannels;
358  meDIFraction_->setBinContent(3, 3, reportSummary);
359 }
LuminosityBlockIndex index() const
MonitorElement * meDIFraction_
int fed_[2][2][40][40]
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void ESIntegrityTask::dqmEndRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotectedvirtual

EndRun.

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

Definition at line 65 of file ESIntegrityTask.cc.

65  {
66  // In case of Lumi based analysis Disable SoftReset from Integrity histogram to get full statistics
67  // TODO: no longer possible, clone histo beforehand if full statisticcs at end of run are required.
68 }
void ESIntegrityTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::one::EDProducerBase.

Definition at line 190 of file ESIntegrityTask.cc.

190 { LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events"; }
Log< level::Info, false > LogInfo
std::shared_ptr< ESLSCache > ESIntegrityTask::globalBeginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
) const
overrideprotected

Begin Lumi.

Definition at line 70 of file ESIntegrityTask.cc.

71  {
72  LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events";
73  // In case of Lumi based analysis SoftReset the Integrity histogram
74  auto lumiCache = std::make_shared<ESLSCache>();
75  lumiCache->ievtLS_ = 0;
76  if (doLumiAnalysis_) {
77  for (int iz = 0; iz < 2; ++iz) {
78  for (int ip = 0; ip < 2; ++ip) {
79  for (int ix = 0; ix < 40; ++ix) {
80  for (int iy = 0; iy < 40; ++iy) {
81  (lumiCache->DIErrorsLS_)[iz][ip][ix][iy] = 0;
82  }
83  }
84  }
85  }
86  }
87  return lumiCache;
88 }
Log< level::Info, false > LogInfo
void ESIntegrityTask::globalEndLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotected

End Lumi.

Definition at line 90 of file ESIntegrityTask.cc.

90  {
91  if (doLumiAnalysis_)
92  calculateDIFraction(lumi, c);
93 }
void calculateDIFraction(const edm::LuminosityBlock &lumi, const edm::EventSetup &c)
Calculate Data Integrity Fraction.

Member Data Documentation

int ESIntegrityTask::dac_
private

Definition at line 73 of file ESIntegrityTask.h.

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

Definition at line 49 of file ESIntegrityTask.h.

bool ESIntegrityTask::doLumiAnalysis_
private

Definition at line 76 of file ESIntegrityTask.h.

int ESIntegrityTask::eCount_
private

Definition at line 73 of file ESIntegrityTask.h.

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

Definition at line 75 of file ESIntegrityTask.h.

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

Definition at line 75 of file ESIntegrityTask.h.

int ESIntegrityTask::firstDAC_
private

Definition at line 74 of file ESIntegrityTask.h.

int ESIntegrityTask::gain_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::ievt_
private

Definition at line 45 of file ESIntegrityTask.h.

int ESIntegrityTask::isPed_
private

Definition at line 74 of file ESIntegrityTask.h.

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

Definition at line 75 of file ESIntegrityTask.h.

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

Definition at line 50 of file ESIntegrityTask.h.

edm::FileInPath ESIntegrityTask::lookup_
private

Definition at line 71 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCCRCErr_
private

Definition at line 56 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCErr_
private

Definition at line 55 of file ESIntegrityTask.h.

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

Definition at line 67 of file ESIntegrityTask.h.

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

Definition at line 68 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDIFraction_
private

Definition at line 69 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meEVDR_
private

Definition at line 62 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFED_
private

Definition at line 53 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberBadStatus_
private

Definition at line 59 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberErrCode_
private

Definition at line 60 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberOff_
private

Definition at line 61 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meGain_
private

Definition at line 52 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKBC_
private

Definition at line 65 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKEC_
private

Definition at line 66 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF1_
private

Definition at line 63 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF2_
private

Definition at line 64 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoBC_
private

Definition at line 58 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoRX_
private

Definition at line 57 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meSLinkCRCErr_
private

Definition at line 54 of file ESIntegrityTask.h.

int ESIntegrityTask::nDAC_
private

Definition at line 74 of file ESIntegrityTask.h.

int ESIntegrityTask::precision_
private

Definition at line 73 of file ESIntegrityTask.h.

std::string ESIntegrityTask::prefixME_
private

Definition at line 47 of file ESIntegrityTask.h.

int ESIntegrityTask::runNum_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::runtype_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::seqtype_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::vDAC_[5]
private

Definition at line 74 of file ESIntegrityTask.h.