CMS 3D CMS Logo

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

#include <ESRawDataTask.h>

Inheritance diagram for ESRawDataTask:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 ESRawDataTask (const edm::ParameterSet &ps)
 
 ~ESRawDataTask () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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
 Setup. More...
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

edm::EDGetTokenT< ESRawDataCollectiondccCollections_
 
edm::EDGetTokenT< FEDRawDataCollectionFEDRawDataCollection_
 
int ievt_
 
MonitorElementmeBXDCCErrors_
 
MonitorElementmeBXDiff_
 
MonitorElementmeL1ADCCErrors_
 
MonitorElementmeL1ADiff_
 
MonitorElementmeOrbitNumberDCCErrors_
 
MonitorElementmeOrbitNumberDiff_
 
std::string prefixME_
 
int runNum_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 13 of file ESRawDataTask.h.

Constructor & Destructor Documentation

◆ ESRawDataTask()

ESRawDataTask::ESRawDataTask ( const edm::ParameterSet ps)

Definition at line 28 of file ESRawDataTask.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

28  {
29  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
30 
31  FEDRawDataCollection_ = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("FEDRawDataCollection"));
32  dccCollections_ = consumes<ESRawDataCollection>(ps.getParameter<InputTag>("ESDCCCollections"));
33 
34  ievt_ = 0;
35 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: ESRawDataTask.h:31
std::string prefixME_
Definition: ESRawDataTask.h:28
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESRawDataTask.h:30

◆ ~ESRawDataTask()

ESRawDataTask::~ESRawDataTask ( )
inlineoverride

Definition at line 16 of file ESRawDataTask.h.

16 {}

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 78 of file ESRawDataTask.cc.

References edm::SortedCollection< T, SORT >::begin(), FEDRawData::data(), MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::end(), FEDRawDataCollection::FEDData(), ESDCCHeaderBlock::fedId(), ESDCCHeaderBlock::getBX(), ESDCCHeaderBlock::getLV1(), ESDCCHeaderBlock::getOrbitNumber(), RecoTauValidation_cfi::header, and FEDRawData::size().

78  {
79  ievt_++;
80  runNum_ = e.id().run();
81 
82  int gt_L1A = 0, gt_OrbitNumber = 0, gt_BX = 0;
83  int esDCC_L1A_MostFreqCounts = 0;
84  int esDCC_BX_MostFreqCounts = 0;
85  int esDCC_OrbitNumber_MostFreqCounts = 0;
86 
88  Handle<FEDRawDataCollection> allFedRawData;
89 
90  int gtFedDataSize = 0;
91 
92  if (e.getByToken(FEDRawDataCollection_, allFedRawData)) {
93  // GT FED data
94  const FEDRawData& gtFedData = allFedRawData->FEDData(812);
95 
96  gtFedDataSize = gtFedData.size() / sizeof(uint64_t);
97 
98  if (gtFedDataSize > 0) {
99  FEDHeader header(gtFedData.data());
100 
101  gt_L1A = header.lvl1ID();
102  gt_OrbitNumber = e.orbitNumber();
103  gt_BX = e.bunchCrossing();
104  } else {
105  map<int, int> esDCC_L1A_FreqMap;
106  map<int, int> esDCC_BX_FreqMap;
107  map<int, int> esDCC_OrbitNumber_FreqMap;
108 
109  if (e.getByToken(dccCollections_, dccs)) {
110  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
111  const ESDCCHeaderBlock& esdcc = (*dccItr);
112 
113  esDCC_L1A_FreqMap[esdcc.getLV1()]++;
114  esDCC_BX_FreqMap[esdcc.getBX()]++;
115  esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()]++;
116 
117  if (esDCC_L1A_FreqMap[esdcc.getLV1()] > esDCC_L1A_MostFreqCounts) {
118  esDCC_L1A_MostFreqCounts = esDCC_L1A_FreqMap[esdcc.getLV1()];
119  gt_L1A = esdcc.getLV1();
120  }
121 
122  if (esDCC_BX_FreqMap[esdcc.getBX()] > esDCC_BX_MostFreqCounts) {
123  esDCC_BX_MostFreqCounts = esDCC_BX_FreqMap[esdcc.getBX()];
124  gt_BX = esdcc.getBX();
125  }
126 
127  if (esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()] > esDCC_OrbitNumber_MostFreqCounts) {
128  esDCC_OrbitNumber_MostFreqCounts = esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()];
129  gt_OrbitNumber = esdcc.getOrbitNumber();
130  }
131  }
132  } else {
133  LogWarning("ESRawDataTask") << "dccCollections not available";
134  }
135  }
136  } else {
137  LogWarning("ESRawDataTask") << "FEDRawDataCollection not available";
138  }
139 
140  // DCC
141  vector<int> fiberStatus;
142  if (e.getByToken(dccCollections_, dccs)) {
143  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
144  const ESDCCHeaderBlock& dcc = (*dccItr);
145 
146  //if (dcc.getRunNumber() != runNum_) {
147  //meRunNumberErrors_->Fill(dcc.fedId());
148  //cout<<"Run # err : "<<dcc.getRunNumber()<<" "<<runNum_<<endl;
149  //}
150 
151  if (dcc.getLV1() != gt_L1A) {
152  meL1ADCCErrors_->Fill(dcc.fedId());
153  //cout<<"L1A err : "<<dcc.getLV1()<<" "<<gt_L1A<<endl;
154  Float_t l1a_diff = dcc.getLV1() - gt_L1A;
155  if (l1a_diff > 100)
156  l1a_diff = 100;
157  else if (l1a_diff < -100)
158  l1a_diff = -100;
159  meL1ADiff_->Fill(l1a_diff);
160  }
161 
162  if (dcc.getBX() != gt_BX) {
163  meBXDCCErrors_->Fill(dcc.fedId());
164  //cout<<"BX err : "<<dcc.getBX()<<" "<<gt_BX<<endl;
165  Float_t bx_diff = dcc.getBX() - gt_BX;
166  if (bx_diff > 100)
167  bx_diff = 100;
168  else if (bx_diff < -100)
169  bx_diff = -100;
170  meBXDiff_->Fill(bx_diff);
171  }
172  if (dcc.getOrbitNumber() != gt_OrbitNumber) {
174  //cout<<"Orbit err : "<<dcc.getOrbitNumber()<<" "<<gt_OrbitNumber<<endl;
175  Float_t orbitnumber_diff = dcc.getOrbitNumber() - gt_OrbitNumber;
176  if (orbitnumber_diff > 100)
177  orbitnumber_diff = 100;
178  else if (orbitnumber_diff < -100)
179  orbitnumber_diff = -100;
180  meOrbitNumberDiff_->Fill(orbitnumber_diff);
181  }
182  }
183  }
184 }
MonitorElement * meOrbitNumberDiff_
Definition: ESRawDataTask.h:39
MonitorElement * meOrbitNumberDCCErrors_
Definition: ESRawDataTask.h:36
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: ESRawDataTask.h:31
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
int getOrbitNumber() const
MonitorElement * meL1ADCCErrors_
Definition: ESRawDataTask.h:34
void Fill(long long x)
MonitorElement * meBXDCCErrors_
Definition: ESRawDataTask.h:35
int getLV1() const
const_iterator begin() const
const int fedId() const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const_iterator end() const
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESRawDataTask.h:30
unsigned long long uint64_t
Definition: Time.h:13
MonitorElement * meL1ADiff_
Definition: ESRawDataTask.h:37
MonitorElement * meBXDiff_
Definition: ESRawDataTask.h:38
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
Log< level::Warning, false > LogWarning

◆ bookHistograms()

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

Setup.

Implements DQMEDAnalyzer.

Definition at line 37 of file ESRawDataTask.cc.

References dqm::implementation::IBooker::book1D(), timingPdfMaker::histo, dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

37  {
38  char histo[200];
39 
40  iBooker.setCurrentFolder(prefixME_ + "/ESRawDataTask");
41 
42  //sprintf(histo, "ES run number errors");
43  //meRunNumberErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
44  //meRunNumberErrors_->setAxisTitle("ES FED", 1);
45  //meRunNumberErrors_->setAxisTitle("Num of Events", 2);
46 
47  sprintf(histo, "ES L1A DCC errors");
48  meL1ADCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
49  meL1ADCCErrors_->setAxisTitle("ES FED", 1);
50  meL1ADCCErrors_->setAxisTitle("Num of Events", 2);
51 
52  sprintf(histo, "ES BX DCC errors");
53  meBXDCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
54  meBXDCCErrors_->setAxisTitle("ES FED", 1);
55  meBXDCCErrors_->setAxisTitle("Num of Events", 2);
56 
57  sprintf(histo, "ES Orbit Number DCC errors");
58  meOrbitNumberDCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
60  meOrbitNumberDCCErrors_->setAxisTitle("Num of Events", 2);
61 
62  sprintf(histo, "Difference between ES and GT L1A");
63  meL1ADiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
64  meL1ADiff_->setAxisTitle("ES - GT L1A", 1);
65  meL1ADiff_->setAxisTitle("Num of Events", 2);
66 
67  sprintf(histo, "Difference between ES and GT BX");
68  meBXDiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
69  meBXDiff_->setAxisTitle("ES - GT BX", 1);
70  meBXDiff_->setAxisTitle("Num of Events", 2);
71 
72  sprintf(histo, "Difference between ES and GT Orbit Number");
73  meOrbitNumberDiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
74  meOrbitNumberDiff_->setAxisTitle("ES - GT orbit number", 1);
75  meOrbitNumberDiff_->setAxisTitle("Num of Events", 2);
76 }
MonitorElement * meOrbitNumberDiff_
Definition: ESRawDataTask.h:39
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * meOrbitNumberDCCErrors_
Definition: ESRawDataTask.h:36
std::string prefixME_
Definition: ESRawDataTask.h:28
MonitorElement * meL1ADCCErrors_
Definition: ESRawDataTask.h:34
MonitorElement * meBXDCCErrors_
Definition: ESRawDataTask.h:35
MonitorElement * meL1ADiff_
Definition: ESRawDataTask.h:37
MonitorElement * meBXDiff_
Definition: ESRawDataTask.h:38
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

◆ dccCollections_

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

Definition at line 30 of file ESRawDataTask.h.

◆ FEDRawDataCollection_

edm::EDGetTokenT<FEDRawDataCollection> ESRawDataTask::FEDRawDataCollection_
private

Definition at line 31 of file ESRawDataTask.h.

◆ ievt_

int ESRawDataTask::ievt_
private

Definition at line 26 of file ESRawDataTask.h.

◆ meBXDCCErrors_

MonitorElement* ESRawDataTask::meBXDCCErrors_
private

Definition at line 35 of file ESRawDataTask.h.

◆ meBXDiff_

MonitorElement* ESRawDataTask::meBXDiff_
private

Definition at line 38 of file ESRawDataTask.h.

◆ meL1ADCCErrors_

MonitorElement* ESRawDataTask::meL1ADCCErrors_
private

Definition at line 34 of file ESRawDataTask.h.

◆ meL1ADiff_

MonitorElement* ESRawDataTask::meL1ADiff_
private

Definition at line 37 of file ESRawDataTask.h.

◆ meOrbitNumberDCCErrors_

MonitorElement* ESRawDataTask::meOrbitNumberDCCErrors_
private

Definition at line 36 of file ESRawDataTask.h.

◆ meOrbitNumberDiff_

MonitorElement* ESRawDataTask::meOrbitNumberDiff_
private

Definition at line 39 of file ESRawDataTask.h.

◆ prefixME_

std::string ESRawDataTask::prefixME_
private

Definition at line 28 of file ESRawDataTask.h.

◆ runNum_

int ESRawDataTask::runNum_
private

Definition at line 41 of file ESRawDataTask.h.