CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ESIntegrityTask Class Reference

#include <ESIntegrityTask.h>

Inheritance diagram for ESIntegrityTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 ESIntegrityTask (const edm::ParameterSet &ps)
 
virtual ~ESIntegrityTask ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) override
 Begin Lumi. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void calculateDIFraction (void)
 Calculate Data Integrity Fraction. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &c) override
 End Lumi. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c) override
 EndRun. More...
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 13 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(), i, j, roll_playback::k, m, and detailsBasic3DVector::z.

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

Definition at line 18 of file ESIntegrityTask.h.

18 {}

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 208 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(), ESKCHIPBlock::getOptoBC(), ESDCCHeaderBlock::getOptoBC0(), ESDCCHeaderBlock::getOptoBC1(), ESDCCHeaderBlock::getOptoBC2(), ESKCHIPBlock::getOptoEC(), ESDCCHeaderBlock::getOptoRX0(), ESDCCHeaderBlock::getOptoRX1(), ESDCCHeaderBlock::getOptoRX2(), ESDCCHeaderBlock::getPrecision(), ESDCCHeaderBlock::getRunType(), ESDCCHeaderBlock::getSeqType(), i, ESKCHIPBlock::id(), and j.

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

Begin Lumi.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 84 of file ESIntegrityTask.cc.

References AlcaSiStripGainsHarvester_cff::DQMStore, i, j, and cppFunctionSkipper::operator.

84  {
85  DQMStore* dqmStore(edm::Service<DQMStore>().operator->());
86 
87  LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events";
88  // In case of Lumi based analysis SoftReset the Integrity histogram
89  if (doLumiAnalysis_) {
90  for (int i=0; i<2; ++i) {
91  for (int j=0; j<2; ++j) {
92  if (meDIErrors_[i][j]) {
93  dqmStore->softReset(meDIErrors_[i][j]);
94  }
95  }
96  }
97  ievt_ = 0;
98  }
99 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meDIErrors_[2][2]
int j
Definition: DBlmapReader.cc:9
void ESIntegrityTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 105 of file ESIntegrityTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), timingPdfMaker::histo, i, j, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and MonitorElement::setLumiFlag().

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

Calculate Data Integrity Fraction.

Definition at line 334 of file ESIntegrityTask.cc.

References i, j, getDQMSummary::reportSummary, x, and detailsBasic3DVector::y.

334  {
335 
336  float nValidChannels=0;
337  float nGlobalErrors=0;
338 
339  for (int i=0; i<2; ++i) {
340  for (int j=0; j<2; ++j) {
341  float nValidChannelsES=0;
342  float nGlobalErrorsES = 0;
343  float reportSummaryES = -1;
344  if (!meDIErrors_[i][j]) continue;
345  for (int x=0; x<40; ++x) {
346  for (int y=0; y<40; ++y) {
347  float val = meDIErrors_[i][j]->getBinContent(x+1, y+1);
348  if (fed_[i][j][x][y] == -1) continue;
349  if (ievt_ != 0) nGlobalErrors += val/ievt_;
350  nValidChannels++;
351  if (ievt_ != 0) nGlobalErrorsES += val/ievt_;
352  nValidChannelsES++;
353  }
354  }
355  if (nValidChannelsES != 0) reportSummaryES = 1 - nGlobalErrorsES/nValidChannelsES;
356  meDIFraction_->setBinContent(i+1, j+1, reportSummaryES);
357  }
358  }
359  float reportSummary = -1.0;
360  if (nValidChannels != 0) reportSummary = 1.0 - nGlobalErrors/nValidChannels;
361  meDIFraction_->setBinContent(3,3, reportSummary);
362 }
int i
Definition: DBlmapReader.cc:9
string reportSummary
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meDIFraction_
int fed_[2][2][40][40]
MonitorElement * meDIErrors_[2][2]
int j
Definition: DBlmapReader.cc:9
double getBinContent(int binx) const
get content of bin (1-D)
Definition: DDAxes.h:10
void ESIntegrityTask::endJob ( void  )
protected

EndJob.

Definition at line 202 of file ESIntegrityTask.cc.

202  {
203 
204  LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events";
205 
206 }
void ESIntegrityTask::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup c 
)
overrideprotectedvirtual

End Lumi.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 101 of file ESIntegrityTask.cc.

101  {
103 }
void calculateDIFraction(void)
Calculate Data Integrity Fraction.
void ESIntegrityTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotectedvirtual

EndRun.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 69 of file ESIntegrityTask.cc.

References AlcaSiStripGainsHarvester_cff::DQMStore, i, j, and cppFunctionSkipper::operator.

69  {
70  // In case of Lumi based analysis Disable SoftReset from Integrity histogram to get full statistics
71  DQMStore* dqmStore(edm::Service<DQMStore>().operator->());
72 
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  dqmStore->disableSoftReset(meDIErrors_[i][j]);
78  }
79  }
80  }
81  }
82 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meDIErrors_[2][2]
int j
Definition: DBlmapReader.cc:9

Member Data Documentation

int ESIntegrityTask::dac_
private

Definition at line 72 of file ESIntegrityTask.h.

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

Definition at line 48 of file ESIntegrityTask.h.

bool ESIntegrityTask::doLumiAnalysis_
private

Definition at line 75 of file ESIntegrityTask.h.

int ESIntegrityTask::eCount_
private

Definition at line 72 of file ESIntegrityTask.h.

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

Definition at line 74 of file ESIntegrityTask.h.

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

Definition at line 74 of file ESIntegrityTask.h.

int ESIntegrityTask::firstDAC_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::gain_
private

Definition at line 72 of file ESIntegrityTask.h.

int ESIntegrityTask::ievt_
private

Definition at line 44 of file ESIntegrityTask.h.

int ESIntegrityTask::isPed_
private

Definition at line 73 of file ESIntegrityTask.h.

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

Definition at line 74 of file ESIntegrityTask.h.

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

Definition at line 49 of file ESIntegrityTask.h.

edm::FileInPath ESIntegrityTask::lookup_
private

Definition at line 70 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCCRCErr_
private

Definition at line 55 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDCCErr_
private

Definition at line 54 of file ESIntegrityTask.h.

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

Definition at line 66 of file ESIntegrityTask.h.

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

Definition at line 67 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meDIFraction_
private

Definition at line 68 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meEVDR_
private

Definition at line 61 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFED_
private

Definition at line 52 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberBadStatus_
private

Definition at line 58 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberErrCode_
private

Definition at line 59 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meFiberOff_
private

Definition at line 60 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meGain_
private

Definition at line 51 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKBC_
private

Definition at line 64 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKEC_
private

Definition at line 65 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF1_
private

Definition at line 62 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meKF2_
private

Definition at line 63 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoBC_
private

Definition at line 57 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meOptoRX_
private

Definition at line 56 of file ESIntegrityTask.h.

MonitorElement* ESIntegrityTask::meSLinkCRCErr_
private

Definition at line 53 of file ESIntegrityTask.h.

int ESIntegrityTask::nDAC_
private

Definition at line 73 of file ESIntegrityTask.h.

int ESIntegrityTask::precision_
private

Definition at line 72 of file ESIntegrityTask.h.

std::string ESIntegrityTask::prefixME_
private

Definition at line 46 of file ESIntegrityTask.h.

int ESIntegrityTask::runNum_
private

Definition at line 72 of file ESIntegrityTask.h.

int ESIntegrityTask::runtype_
private

Definition at line 72 of file ESIntegrityTask.h.

int ESIntegrityTask::seqtype_
private

Definition at line 72 of file ESIntegrityTask.h.

int ESIntegrityTask::vDAC_[5]
private

Definition at line 73 of file ESIntegrityTask.h.