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 accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
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) 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
 
- 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
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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::ESIntegrityTask ( const edm::ParameterSet ps)

Definition at line 25 of file ESIntegrityTask.cc.

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 }

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.

◆ ~ESIntegrityTask()

ESIntegrityTask::~ESIntegrityTask ( )
inlineoverride

Definition at line 15 of file ESIntegrityTask.h.

15 {}

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

Definition at line 188 of file ESIntegrityTask.cc.

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 }

References edm::SortedCollection< T, SORT >::begin(), MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::end(), ESDCCHeaderBlock::fedId(), sistrip::extrainfo::gain_, ESKCHIPBlock::getBC(), ESDCCHeaderBlock::getBX(), 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.

◆ bookHistograms()

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

Definition at line 90 of file ESIntegrityTask.cc.

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  auto scope = DQMStore::IBooker::UseLumiScope(iBooker);
182  meDIFraction_ = iBooker.book2D(histo, histo, 3, 1.0, 3.0, 3, 1.0, 3.0);
183  }
184 }

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

◆ calculateDIFraction()

void ESIntegrityTask::calculateDIFraction ( void  )
protected

Calculate Data Integrity Fraction.

Definition at line 318 of file ESIntegrityTask.cc.

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 }

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

◆ dqmBeginLuminosityBlock()

void ESIntegrityTask::dqmBeginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotectedvirtual

Begin Lumi.

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 70 of file ESIntegrityTask.cc.

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 }

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

◆ dqmEndLuminosityBlock()

void ESIntegrityTask::dqmEndLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotectedvirtual

End Lumi.

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 85 of file ESIntegrityTask.cc.

85  {
86  if (doLumiAnalysis_)
88 }

◆ dqmEndRun()

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

EndRun.

Reimplemented from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

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 }

◆ endJob()

void ESIntegrityTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::one::EDProducerBase.

Definition at line 186 of file ESIntegrityTask.cc.

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

Member Data Documentation

◆ dac_

int ESIntegrityTask::dac_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ dccCollections_

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

Definition at line 43 of file ESIntegrityTask.h.

◆ doLumiAnalysis_

bool ESIntegrityTask::doLumiAnalysis_
private

Definition at line 70 of file ESIntegrityTask.h.

◆ eCount_

int ESIntegrityTask::eCount_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ fed_

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

Definition at line 69 of file ESIntegrityTask.h.

◆ fiber_

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

Definition at line 69 of file ESIntegrityTask.h.

◆ firstDAC_

int ESIntegrityTask::firstDAC_
private

Definition at line 68 of file ESIntegrityTask.h.

◆ gain_

int ESIntegrityTask::gain_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ ievt_

int ESIntegrityTask::ievt_
private

Definition at line 39 of file ESIntegrityTask.h.

◆ isPed_

int ESIntegrityTask::isPed_
private

Definition at line 68 of file ESIntegrityTask.h.

◆ kchip_

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

Definition at line 69 of file ESIntegrityTask.h.

◆ kchipCollections_

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

Definition at line 44 of file ESIntegrityTask.h.

◆ lookup_

edm::FileInPath ESIntegrityTask::lookup_
private

Definition at line 65 of file ESIntegrityTask.h.

◆ meDCCCRCErr_

MonitorElement* ESIntegrityTask::meDCCCRCErr_
private

Definition at line 50 of file ESIntegrityTask.h.

◆ meDCCErr_

MonitorElement* ESIntegrityTask::meDCCErr_
private

Definition at line 49 of file ESIntegrityTask.h.

◆ meDIErrors_

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

Definition at line 61 of file ESIntegrityTask.h.

◆ meDIErrorsLS_

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

Definition at line 62 of file ESIntegrityTask.h.

◆ meDIFraction_

MonitorElement* ESIntegrityTask::meDIFraction_
private

Definition at line 63 of file ESIntegrityTask.h.

◆ meEVDR_

MonitorElement* ESIntegrityTask::meEVDR_
private

Definition at line 56 of file ESIntegrityTask.h.

◆ meFED_

MonitorElement* ESIntegrityTask::meFED_
private

Definition at line 47 of file ESIntegrityTask.h.

◆ meFiberBadStatus_

MonitorElement* ESIntegrityTask::meFiberBadStatus_
private

Definition at line 53 of file ESIntegrityTask.h.

◆ meFiberErrCode_

MonitorElement* ESIntegrityTask::meFiberErrCode_
private

Definition at line 54 of file ESIntegrityTask.h.

◆ meFiberOff_

MonitorElement* ESIntegrityTask::meFiberOff_
private

Definition at line 55 of file ESIntegrityTask.h.

◆ meGain_

MonitorElement* ESIntegrityTask::meGain_
private

Definition at line 46 of file ESIntegrityTask.h.

◆ meKBC_

MonitorElement* ESIntegrityTask::meKBC_
private

Definition at line 59 of file ESIntegrityTask.h.

◆ meKEC_

MonitorElement* ESIntegrityTask::meKEC_
private

Definition at line 60 of file ESIntegrityTask.h.

◆ meKF1_

MonitorElement* ESIntegrityTask::meKF1_
private

Definition at line 57 of file ESIntegrityTask.h.

◆ meKF2_

MonitorElement* ESIntegrityTask::meKF2_
private

Definition at line 58 of file ESIntegrityTask.h.

◆ meOptoBC_

MonitorElement* ESIntegrityTask::meOptoBC_
private

Definition at line 52 of file ESIntegrityTask.h.

◆ meOptoRX_

MonitorElement* ESIntegrityTask::meOptoRX_
private

Definition at line 51 of file ESIntegrityTask.h.

◆ meSLinkCRCErr_

MonitorElement* ESIntegrityTask::meSLinkCRCErr_
private

Definition at line 48 of file ESIntegrityTask.h.

◆ nDAC_

int ESIntegrityTask::nDAC_
private

Definition at line 68 of file ESIntegrityTask.h.

◆ precision_

int ESIntegrityTask::precision_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ prefixME_

std::string ESIntegrityTask::prefixME_
private

Definition at line 41 of file ESIntegrityTask.h.

◆ runNum_

int ESIntegrityTask::runNum_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ runtype_

int ESIntegrityTask::runtype_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ seqtype_

int ESIntegrityTask::seqtype_
private

Definition at line 67 of file ESIntegrityTask.h.

◆ vDAC_

int ESIntegrityTask::vDAC_[5]
private

Definition at line 68 of file ESIntegrityTask.h.

ESIntegrityTask::meKEC_
MonitorElement * meKEC_
Definition: ESIntegrityTask.h:60
DDAxes::y
ESIntegrityTask::meGain_
MonitorElement * meGain_
Definition: ESIntegrityTask.h:46
mps_fire.i
i
Definition: mps_fire.py:355
ESKCHIPBlock::getFlag2
int getFlag2() const
Definition: ESKCHIPBlock.h:38
ESDCCHeaderBlock::getOptoRX2
int getOptoRX2() const
Definition: ESDCCHeaderBlock.h:95
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
ESKCHIPBlock::getBC
int getBC() const
Definition: ESKCHIPBlock.h:33
ESDCCHeaderBlock::getOptoBC0
int getOptoBC0() const
Definition: ESDCCHeaderBlock.h:96
ESIntegrityTask::meDIErrors_
MonitorElement * meDIErrors_[2][2]
Definition: ESIntegrityTask.h:61
ESIntegrityTask::gain_
int gain_
Definition: ESIntegrityTask.h:67
ESDCCHeaderBlock::getOptoRX0
int getOptoRX0() const
Definition: ESDCCHeaderBlock.h:93
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ESDCCHeaderBlock::getOptoRX1
int getOptoRX1() const
Definition: ESDCCHeaderBlock.h:94
ESDCCHeaderBlock::getFEChannelStatus
const std::vector< int > & getFEChannelStatus() const
Definition: ESDCCHeaderBlock.h:99
edm::LogInfo
Definition: MessageLogger.h:254
ESIntegrityTask::meDIFraction_
MonitorElement * meDIFraction_
Definition: ESIntegrityTask.h:63
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
ESIntegrityTask::dac_
int dac_
Definition: ESIntegrityTask.h:67
ESIntegrityTask::meFiberOff_
MonitorElement * meFiberOff_
Definition: ESIntegrityTask.h:55
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
edm::Handle
Definition: AssociativeIterator.h:50
ESIntegrityTask::ievt_
int ievt_
Definition: ESIntegrityTask.h:39
edm::FileInPath
Definition: FileInPath.h:64
ESIntegrityTask::meKF1_
MonitorElement * meKF1_
Definition: ESIntegrityTask.h:57
ESDCCHeaderBlock::getDCCErrors
int getDCCErrors() const
Definition: ESDCCHeaderBlock.h:84
ESIntegrityTask::fed_
int fed_[2][2][40][40]
Definition: ESIntegrityTask.h:69
ESDCCHeaderBlock::getOptoBC1
int getOptoBC1() const
Definition: ESDCCHeaderBlock.h:97
ESIntegrityTask::meOptoBC_
MonitorElement * meOptoBC_
Definition: ESIntegrityTask.h:52
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
ESIntegrityTask::lookup_
edm::FileInPath lookup_
Definition: ESIntegrityTask.h:65
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
ESKCHIPBlock::id
const int & id() const
Definition: ESKCHIPBlock.h:13
DDAxes::z
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
ESIntegrityTask::fiber_
int fiber_[2][2][40][40]
Definition: ESIntegrityTask.h:69
ESIntegrityTask::kchip_
int kchip_[2][2][40][40]
Definition: ESIntegrityTask.h:69
ESKCHIPBlock::getEC
int getEC() const
Definition: ESKCHIPBlock.h:34
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ESIntegrityTask::meKBC_
MonitorElement * meKBC_
Definition: ESIntegrityTask.h:59
ESDCCHeaderBlock::getPrecision
int getPrecision() const
Definition: ESDCCHeaderBlock.h:81
edm::LogWarning
Definition: MessageLogger.h:141
ESIntegrityTask::precision_
int precision_
Definition: ESIntegrityTask.h:67
ESIntegrityTask::meOptoRX_
MonitorElement * meOptoRX_
Definition: ESIntegrityTask.h:51
ESKCHIPBlock::getFlag1
int getFlag1() const
Definition: ESKCHIPBlock.h:37
ESIntegrityTask::doLumiAnalysis_
bool doLumiAnalysis_
Definition: ESIntegrityTask.h:70
ESIntegrityTask::meFiberErrCode_
MonitorElement * meFiberErrCode_
Definition: ESIntegrityTask.h:54
ESIntegrityTask::meDCCCRCErr_
MonitorElement * meDCCCRCErr_
Definition: ESIntegrityTask.h:50
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ESDCCHeaderBlock::getBX
int getBX() const
Definition: ESDCCHeaderBlock.h:79
ESIntegrityTask::runtype_
int runtype_
Definition: ESIntegrityTask.h:67
ESDCCHeaderBlock
Definition: ESDCCHeaderBlock.h:5
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
ESIntegrityTask::meFiberBadStatus_
MonitorElement * meFiberBadStatus_
Definition: ESIntegrityTask.h:53
ESDCCHeaderBlock::getSeqType
int getSeqType() const
Definition: ESDCCHeaderBlock.h:87
ESIntegrityTask::meDCCErr_
MonitorElement * meDCCErr_
Definition: ESIntegrityTask.h:49
dqm::implementation::IBooker::UseLumiScope
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:463
ESDCCHeaderBlock::getDAC
int getDAC() const
Definition: ESDCCHeaderBlock.h:82
ESDCCHeaderBlock::getGain
int getGain() const
Definition: ESDCCHeaderBlock.h:80
ESDCCHeaderBlock::fedId
const int fedId() const
Definition: ESDCCHeaderBlock.h:29
ESKCHIPBlock
Definition: ESKCHIPBlock.h:6
ESDCCHeaderBlock::getRunType
int getRunType() const
Definition: ESDCCHeaderBlock.h:86
ESIntegrityTask::prefixME_
std::string prefixME_
Definition: ESIntegrityTask.h:41
ESIntegrityTask::meFED_
MonitorElement * meFED_
Definition: ESIntegrityTask.h:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
heppy_batch.val
val
Definition: heppy_batch.py:351
ESIntegrityTask::seqtype_
int seqtype_
Definition: ESIntegrityTask.h:67
ESIntegrityTask::meEVDR_
MonitorElement * meEVDR_
Definition: ESIntegrityTask.h:56
ESIntegrityTask::meKF2_
MonitorElement * meKF2_
Definition: ESIntegrityTask.h:58
ESIntegrityTask::meSLinkCRCErr_
MonitorElement * meSLinkCRCErr_
Definition: ESIntegrityTask.h:48
ESIntegrityTask::dccCollections_
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESIntegrityTask.h:43
ESKCHIPBlock::getOptoBC
int getOptoBC() const
Definition: ESKCHIPBlock.h:35
ESKCHIPBlock::getOptoEC
int getOptoEC() const
Definition: ESKCHIPBlock.h:36
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
edm::InputTag
Definition: InputTag.h:15
ESIntegrityTask::kchipCollections_
edm::EDGetTokenT< ESLocalRawDataCollection > kchipCollections_
Definition: ESIntegrityTask.h:44
ESIntegrityTask::calculateDIFraction
void calculateDIFraction(void)
Calculate Data Integrity Fraction.
Definition: ESIntegrityTask.cc:318
ESDCCHeaderBlock::getOptoBC2
int getOptoBC2() const
Definition: ESDCCHeaderBlock.h:98
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37