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:
DQMOneLumiEDAnalyzer<> DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... > 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 DQMOneLumiEDAnalyzer<>
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
 DQMOneLumiEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
bool getCanSaveByLumi () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
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
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 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)
 

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 (void)
 Calculate Data Integrity Fraction. More...
 
void dqmBeginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) override
 Begin Lumi. More...
 
void dqmEndLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) override
 End Lumi. More...
 
void dqmEndRun (const edm::Run &r, const edm::EventSetup &c) override
 EndRun. More...
 
void endJob (void) override
 EndJob. More...
 
- Protected Member Functions inherited from DQMOneLumiEDAnalyzer<>
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (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)
 
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)
 

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_
 
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::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
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 DQMOneLumiEDAnalyzer<>
edm::EDPutTokenT< DQMTokenlumiToken_
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 12 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, FrontierConditions_GlobalTag_cff::file, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::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 getParameter(std::string const &) const
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_
edm::FileInPath lookup_
std::string fullPath() const
Definition: FileInPath.cc:163
int kchip_[2][2][40][40]
ESIntegrityTask::~ESIntegrityTask ( )
inlineoverride

Member Function Documentation

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

Analyze.

Definition at line 188 of file ESIntegrityTask.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), 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(), 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(), and dqmiolumiharvest::j.

Referenced by ~ESIntegrityTask().

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

Implements DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

Definition at line 90 of file ESIntegrityTask.cc.

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

Referenced by ~ESIntegrityTask().

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

Calculate Data Integrity Fraction.

Definition at line 318 of file ESIntegrityTask.cc.

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

Referenced by ~ESIntegrityTask().

318  {
319  float nValidChannels = 0;
320  float nGlobalErrors = 0;
321 
322  for (int i = 0; i < 2; ++i) {
323  for (int j = 0; j < 2; ++j) {
324  float nValidChannelsES = 0;
325  float nGlobalErrorsES = 0;
326  float reportSummaryES = -1;
327  if (!meDIErrors_[i][j])
328  continue;
329  for (int x = 0; x < 40; ++x) {
330  for (int y = 0; y < 40; ++y) {
331  float val = meDIErrors_[i][j]->getBinContent(x + 1, y + 1);
332  if (fed_[i][j][x][y] == -1)
333  continue;
334  if (ievt_ != 0)
335  nGlobalErrors += val / ievt_;
336  nValidChannels++;
337  if (ievt_ != 0)
338  nGlobalErrorsES += val / ievt_;
339  nValidChannelsES++;
340  }
341  }
342  if (nValidChannelsES != 0)
343  reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES;
344  meDIFraction_->setBinContent(i + 1, j + 1, reportSummaryES);
345  }
346  }
347  float reportSummary = -1.0;
348  if (nValidChannels != 0)
349  reportSummary = 1.0 - nGlobalErrors / nValidChannels;
350  meDIFraction_->setBinContent(3, 3, reportSummary);
351 }
MonitorElement * meDIFraction_
int fed_[2][2][40][40]
MonitorElement * meDIErrors_[2][2]
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void ESIntegrityTask::dqmBeginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotected

Begin Lumi.

Definition at line 70 of file ESIntegrityTask.cc.

References mps_fire::i, and dqmiolumiharvest::j.

Referenced by ~ESIntegrityTask().

70  {
71  LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events";
72  // In case of Lumi based analysis SoftReset the Integrity histogram
73  if (doLumiAnalysis_) {
74  for (int i = 0; i < 2; ++i) {
75  for (int j = 0; j < 2; ++j) {
76  if (meDIErrors_[i][j]) {
77  meDIErrors_[i][j]->Reset();
78  }
79  }
80  }
81  ievt_ = 0;
82  }
83 }
virtual void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * meDIErrors_[2][2]
void ESIntegrityTask::dqmEndLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotected

End Lumi.

Definition at line 85 of file ESIntegrityTask.cc.

Referenced by ~ESIntegrityTask().

85  {
86  if (doLumiAnalysis_)
88 }
void calculateDIFraction(void)
Calculate Data Integrity Fraction.
void ESIntegrityTask::dqmEndRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

EndRun.

Definition at line 65 of file ESIntegrityTask.cc.

Referenced by ~ESIntegrityTask().

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 186 of file ESIntegrityTask.cc.

Referenced by ~ESIntegrityTask().

186 { LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events"; }

Member Data Documentation

int ESIntegrityTask::dac_
private

Definition at line 67 of file ESIntegrityTask.h.

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

Definition at line 43 of file ESIntegrityTask.h.

bool ESIntegrityTask::doLumiAnalysis_
private

Definition at line 70 of file ESIntegrityTask.h.

int ESIntegrityTask::eCount_
private

Definition at line 67 of file ESIntegrityTask.h.

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

Definition at line 69 of file ESIntegrityTask.h.

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

Definition at line 69 of file ESIntegrityTask.h.

int ESIntegrityTask::firstDAC_
private

Definition at line 68 of file ESIntegrityTask.h.

int ESIntegrityTask::gain_
private

Definition at line 67 of file ESIntegrityTask.h.

int ESIntegrityTask::ievt_
private

Definition at line 39 of file ESIntegrityTask.h.

int ESIntegrityTask::isPed_
private

Definition at line 68 of file ESIntegrityTask.h.

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

Definition at line 69 of file ESIntegrityTask.h.

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

Definition at line 44 of file ESIntegrityTask.h.

edm::FileInPath ESIntegrityTask::lookup_
private

Definition at line 65 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCCRCErr_
private

Definition at line 50 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCErr_
private

Definition at line 49 of file ESIntegrityTask.h.

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

Definition at line 61 of file ESIntegrityTask.h.

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

Definition at line 62 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDIFraction_
private

Definition at line 63 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meEVDR_
private

Definition at line 56 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFED_
private

Definition at line 47 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberBadStatus_
private

Definition at line 53 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberErrCode_
private

Definition at line 54 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberOff_
private

Definition at line 55 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meGain_
private

Definition at line 46 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKBC_
private

Definition at line 59 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKEC_
private

Definition at line 60 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF1_
private

Definition at line 57 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF2_
private

Definition at line 58 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoBC_
private

Definition at line 52 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoRX_
private

Definition at line 51 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meSLinkCRCErr_
private

Definition at line 48 of file ESIntegrityTask.h.

int ESIntegrityTask::nDAC_
private

Definition at line 68 of file ESIntegrityTask.h.

int ESIntegrityTask::precision_
private

Definition at line 67 of file ESIntegrityTask.h.

std::string ESIntegrityTask::prefixME_
private

Definition at line 41 of file ESIntegrityTask.h.

int ESIntegrityTask::runNum_
private

Definition at line 67 of file ESIntegrityTask.h.

int ESIntegrityTask::runtype_
private

Definition at line 67 of file ESIntegrityTask.h.

int ESIntegrityTask::seqtype_
private

Definition at line 67 of file ESIntegrityTask.h.

int ESIntegrityTask::vDAC_[5]
private

Definition at line 68 of file ESIntegrityTask.h.