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
ESRawDataTask Class Reference

#include <ESRawDataTask.h>

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

Public Member Functions

 ESRawDataTask (const edm::ParameterSet &ps)
 
virtual ~ESRawDataTask ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 Setup. More...
 
void endJob (void)
 EndJob. 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

edm::EDGetTokenT
< ESRawDataCollection
dccCollections_
 
edm::EDGetTokenT
< FEDRawDataCollection
FEDRawDataCollection_
 
int ievt_
 
MonitorElementmeBXDCCErrors_
 
MonitorElementmeBXDiff_
 
MonitorElementmeL1ADCCErrors_
 
MonitorElementmeL1ADiff_
 
MonitorElementmeOrbitNumberDCCErrors_
 
MonitorElementmeOrbitNumberDiff_
 
std::string prefixME_
 
int runNum_
 

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 15 of file ESRawDataTask.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file ESRawDataTask.cc.

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

30  {
31 
32  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
33 
34  FEDRawDataCollection_ = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("FEDRawDataCollection"));
35  dccCollections_ = consumes<ESRawDataCollection>(ps.getParameter<InputTag>("ESDCCCollections"));
36 
37  ievt_ = 0;
38 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: ESRawDataTask.h:40
std::string prefixME_
Definition: ESRawDataTask.h:37
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESRawDataTask.h:39
virtual ESRawDataTask::~ESRawDataTask ( )
inlinevirtual

Definition at line 20 of file ESRawDataTask.h.

20 {}

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 88 of file ESRawDataTask.cc.

References edm::EventBase::bunchCrossing(), FEDRawData::data(), ESDCCHeaderBlock::fedId(), ESDCCHeaderBlock::getBX(), edm::Event::getByToken(), ESDCCHeaderBlock::getLV1(), ESDCCHeaderBlock::getOrbitNumber(), edm::EventBase::id(), FEDHeader::lvl1ID(), edm::EventBase::orbitNumber(), edm::EventID::run(), and FEDRawData::size().

88  {
89 
90  ievt_++;
91  runNum_ = e.id().run();
92 
93  int gt_L1A = 0, gt_OrbitNumber = 0, gt_BX = 0;
94  int esDCC_L1A_MostFreqCounts = 0;
95  int esDCC_BX_MostFreqCounts = 0;
96  int esDCC_OrbitNumber_MostFreqCounts = 0;
97 
99  Handle<FEDRawDataCollection> allFedRawData;
100 
101  int gtFedDataSize = 0;
102 
103  if ( e.getByToken(FEDRawDataCollection_, allFedRawData) ) {
104 
105  // GT FED data
106  const FEDRawData& gtFedData = allFedRawData->FEDData(812);
107 
108  gtFedDataSize = gtFedData.size()/sizeof(uint64_t);
109 
110  if ( gtFedDataSize > 0 ) {
111 
112  FEDHeader header(gtFedData.data());
113 
114  gt_L1A = header.lvl1ID();
115  gt_OrbitNumber = e.orbitNumber();
116  gt_BX = e.bunchCrossing();
117  } else {
118 
119  map<int, int> esDCC_L1A_FreqMap;
120  map<int, int> esDCC_BX_FreqMap;
121  map<int, int> esDCC_OrbitNumber_FreqMap;
122 
123  if ( e.getByToken(dccCollections_, dccs) ) {
124  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
125  ESDCCHeaderBlock esdcc = (*dccItr);
126 
127  esDCC_L1A_FreqMap[esdcc.getLV1()]++;
128  esDCC_BX_FreqMap[esdcc.getBX()]++;
129  esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()]++;
130 
131  if (esDCC_L1A_FreqMap[esdcc.getLV1()] > esDCC_L1A_MostFreqCounts) {
132  esDCC_L1A_MostFreqCounts = esDCC_L1A_FreqMap[esdcc.getLV1()];
133  gt_L1A = esdcc.getLV1();
134  }
135 
136  if (esDCC_BX_FreqMap[esdcc.getBX()] > esDCC_BX_MostFreqCounts) {
137  esDCC_BX_MostFreqCounts = esDCC_BX_FreqMap[esdcc.getBX()];
138  gt_BX = esdcc.getBX();
139  }
140 
141  if (esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()] > esDCC_OrbitNumber_MostFreqCounts) {
142  esDCC_OrbitNumber_MostFreqCounts = esDCC_OrbitNumber_FreqMap[esdcc.getOrbitNumber()];
143  gt_OrbitNumber = esdcc.getOrbitNumber();
144  }
145 
146  }
147  } else {
148  LogWarning("ESRawDataTask") << "dccCollections not available";
149  }
150 
151  }
152  } else {
153  LogWarning("ESRawDataTask") << "FEDRawDataCollection not available";
154  }
155 
156  // DCC
157  vector<int> fiberStatus;
158  if ( e.getByToken(dccCollections_, dccs) ) {
159 
160  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
161  ESDCCHeaderBlock dcc = (*dccItr);
162 
163  //if (dcc.getRunNumber() != runNum_) {
164  //meRunNumberErrors_->Fill(dcc.fedId());
165  //cout<<"Run # err : "<<dcc.getRunNumber()<<" "<<runNum_<<endl;
166  //}
167 
168  if (dcc.getLV1() != gt_L1A) {
169  meL1ADCCErrors_->Fill(dcc.fedId());
170  //cout<<"L1A err : "<<dcc.getLV1()<<" "<<gt_L1A<<endl;
171  Float_t l1a_diff = dcc.getLV1() - gt_L1A;
172  if (l1a_diff > 100) l1a_diff = 100;
173  else if (l1a_diff < -100) l1a_diff = -100;
174  meL1ADiff_->Fill(l1a_diff);
175  }
176 
177  if (dcc.getBX() != gt_BX) {
178  meBXDCCErrors_->Fill(dcc.fedId());
179  //cout<<"BX err : "<<dcc.getBX()<<" "<<gt_BX<<endl;
180  Float_t bx_diff = dcc.getBX() - gt_BX;
181  if (bx_diff > 100) bx_diff = 100;
182  else if (bx_diff < -100) bx_diff = -100;
183  meBXDiff_->Fill(bx_diff);
184  }
185  if (dcc.getOrbitNumber() != gt_OrbitNumber) {
187  //cout<<"Orbit err : "<<dcc.getOrbitNumber()<<" "<<gt_OrbitNumber<<endl;
188  Float_t orbitnumber_diff = dcc.getOrbitNumber() - gt_OrbitNumber;
189  if (orbitnumber_diff > 100) orbitnumber_diff = 100;
190  else if (orbitnumber_diff < -100) orbitnumber_diff = -100;
191  meOrbitNumberDiff_->Fill(orbitnumber_diff);
192  }
193  }
194  }
195 
196 }
RunNumber_t run() const
Definition: EventID.h:39
MonitorElement * meOrbitNumberDiff_
Definition: ESRawDataTask.h:48
int getLV1() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
MonitorElement * meOrbitNumberDCCErrors_
Definition: ESRawDataTask.h:45
std::vector< ESDCCHeaderBlock >::const_iterator const_iterator
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: ESRawDataTask.h:40
int bunchCrossing() const
Definition: EventBase.h:66
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
MonitorElement * meL1ADCCErrors_
Definition: ESRawDataTask.h:43
int getBX() const
MonitorElement * meBXDCCErrors_
Definition: ESRawDataTask.h:44
int getOrbitNumber() const
int orbitNumber() const
Definition: EventBase.h:67
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESRawDataTask.h:39
unsigned long long uint64_t
Definition: Time.h:15
edm::EventID id() const
Definition: EventBase.h:60
MonitorElement * meL1ADiff_
Definition: ESRawDataTask.h:46
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
MonitorElement * meBXDiff_
Definition: ESRawDataTask.h:47
const int fedId() const
int lvl1ID()
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:20
void ESRawDataTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Setup.

Implements DQMEDAnalyzer.

Definition at line 40 of file ESRawDataTask.cc.

References DQMStore::IBooker::book1D(), timingPdfMaker::histo, MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

41 {
42  char histo[200];
43 
44  iBooker.setCurrentFolder(prefixME_ + "/ESRawDataTask");
45 
46  //sprintf(histo, "ES run number errors");
47  //meRunNumberErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
48  //meRunNumberErrors_->setAxisTitle("ES FED", 1);
49  //meRunNumberErrors_->setAxisTitle("Num of Events", 2);
50 
51  sprintf(histo, "ES L1A DCC errors");
52  meL1ADCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
53  meL1ADCCErrors_->setAxisTitle("ES FED", 1);
54  meL1ADCCErrors_->setAxisTitle("Num of Events", 2);
55 
56  sprintf(histo, "ES BX DCC errors");
57  meBXDCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
58  meBXDCCErrors_->setAxisTitle("ES FED", 1);
59  meBXDCCErrors_->setAxisTitle("Num of Events", 2);
60 
61  sprintf(histo, "ES Orbit Number DCC errors");
62  meOrbitNumberDCCErrors_ = iBooker.book1D(histo, histo, 56, 519.5, 575.5);
64  meOrbitNumberDCCErrors_->setAxisTitle("Num of Events", 2);
65 
66  sprintf(histo, "Difference between ES and GT L1A");
67  meL1ADiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
68  meL1ADiff_->setAxisTitle("ES - GT L1A", 1);
69  meL1ADiff_->setAxisTitle("Num of Events", 2);
70 
71  sprintf(histo, "Difference between ES and GT BX");
72  meBXDiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
73  meBXDiff_->setAxisTitle("ES - GT BX", 1);
74  meBXDiff_->setAxisTitle("Num of Events", 2);
75 
76  sprintf(histo, "Difference between ES and GT Orbit Number");
77  meOrbitNumberDiff_ = iBooker.book1D(histo, histo, 201, -100.5, 100.5);
78  meOrbitNumberDiff_->setAxisTitle("ES - GT orbit number", 1);
79  meOrbitNumberDiff_->setAxisTitle("Num of Events", 2);
80 }
MonitorElement * meOrbitNumberDiff_
Definition: ESRawDataTask.h:48
MonitorElement * meOrbitNumberDCCErrors_
Definition: ESRawDataTask.h:45
std::string prefixME_
Definition: ESRawDataTask.h:37
MonitorElement * meL1ADCCErrors_
Definition: ESRawDataTask.h:43
MonitorElement * meBXDCCErrors_
Definition: ESRawDataTask.h:44
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * meL1ADiff_
Definition: ESRawDataTask.h:46
MonitorElement * meBXDiff_
Definition: ESRawDataTask.h:47
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ESRawDataTask::endJob ( void  )
protected

EndJob.

Definition at line 82 of file ESRawDataTask.cc.

82  {
83 
84  LogInfo("ESRawDataTask") << "analyzed " << ievt_ << " events";
85 
86 }

Member Data Documentation

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

Definition at line 39 of file ESRawDataTask.h.

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

Definition at line 40 of file ESRawDataTask.h.

int ESRawDataTask::ievt_
private

Definition at line 35 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meBXDCCErrors_
private

Definition at line 44 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meBXDiff_
private

Definition at line 47 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meL1ADCCErrors_
private

Definition at line 43 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meL1ADiff_
private

Definition at line 46 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meOrbitNumberDCCErrors_
private

Definition at line 45 of file ESRawDataTask.h.

MonitorElement* ESRawDataTask::meOrbitNumberDiff_
private

Definition at line 48 of file ESRawDataTask.h.

std::string ESRawDataTask::prefixME_
private

Definition at line 37 of file ESRawDataTask.h.

int ESRawDataTask::runNum_
private

Definition at line 50 of file ESRawDataTask.h.