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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 14 of file ESRawDataTask.h.

Constructor & Destructor Documentation

◆ ESRawDataTask()

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

Definition at line 28 of file ESRawDataTask.cc.

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 }

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

◆ ~ESRawDataTask()

ESRawDataTask::~ESRawDataTask ( )
inlineoverride

Definition at line 17 of file ESRawDataTask.h.

17 {}

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.

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  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  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 }

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().

◆ 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.

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 }

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

Member Data Documentation

◆ dccCollections_

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

Definition at line 31 of file ESRawDataTask.h.

◆ FEDRawDataCollection_

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

Definition at line 32 of file ESRawDataTask.h.

◆ ievt_

int ESRawDataTask::ievt_
private

Definition at line 27 of file ESRawDataTask.h.

◆ meBXDCCErrors_

MonitorElement* ESRawDataTask::meBXDCCErrors_
private

Definition at line 36 of file ESRawDataTask.h.

◆ meBXDiff_

MonitorElement* ESRawDataTask::meBXDiff_
private

Definition at line 39 of file ESRawDataTask.h.

◆ meL1ADCCErrors_

MonitorElement* ESRawDataTask::meL1ADCCErrors_
private

Definition at line 35 of file ESRawDataTask.h.

◆ meL1ADiff_

MonitorElement* ESRawDataTask::meL1ADiff_
private

Definition at line 38 of file ESRawDataTask.h.

◆ meOrbitNumberDCCErrors_

MonitorElement* ESRawDataTask::meOrbitNumberDCCErrors_
private

Definition at line 37 of file ESRawDataTask.h.

◆ meOrbitNumberDiff_

MonitorElement* ESRawDataTask::meOrbitNumberDiff_
private

Definition at line 40 of file ESRawDataTask.h.

◆ prefixME_

std::string ESRawDataTask::prefixME_
private

Definition at line 29 of file ESRawDataTask.h.

◆ runNum_

int ESRawDataTask::runNum_
private

Definition at line 42 of file ESRawDataTask.h.

edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
ESRawDataTask::FEDRawDataCollection_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: ESRawDataTask.h:32
ESDCCHeaderBlock::getLV1
int getLV1() const
Definition: ESDCCHeaderBlock.h:78
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESRawDataTask::meOrbitNumberDCCErrors_
MonitorElement * meOrbitNumberDCCErrors_
Definition: ESRawDataTask.h:37
edm::Handle
Definition: AssociativeIterator.h:50
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
edm::LogWarning
Definition: MessageLogger.h:141
ESRawDataTask::meOrbitNumberDiff_
MonitorElement * meOrbitNumberDiff_
Definition: ESRawDataTask.h:40
ESRawDataTask::dccCollections_
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESRawDataTask.h:31
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ESDCCHeaderBlock::getBX
int getBX() const
Definition: ESDCCHeaderBlock.h:79
ESDCCHeaderBlock::getOrbitNumber
int getOrbitNumber() const
Definition: ESDCCHeaderBlock.h:90
ESDCCHeaderBlock
Definition: ESDCCHeaderBlock.h:5
ESRawDataTask::meL1ADiff_
MonitorElement * meL1ADiff_
Definition: ESRawDataTask.h:38
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
ESRawDataTask::runNum_
int runNum_
Definition: ESRawDataTask.h:42
ESRawDataTask::meBXDiff_
MonitorElement * meBXDiff_
Definition: ESRawDataTask.h:39
ESDCCHeaderBlock::fedId
const int fedId() const
Definition: ESDCCHeaderBlock.h:29
ESRawDataTask::prefixME_
std::string prefixME_
Definition: ESRawDataTask.h:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESRawDataTask::meBXDCCErrors_
MonitorElement * meBXDCCErrors_
Definition: ESRawDataTask.h:36
ESRawDataTask::ievt_
int ievt_
Definition: ESRawDataTask.h:27
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
ESRawDataTask::meL1ADCCErrors_
MonitorElement * meL1ADCCErrors_
Definition: ESRawDataTask.h:35
FEDHeader
Definition: FEDHeader.h:14
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
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37