CMS 3D CMS Logo

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

#include <L1TFED.h>

Inheritance diagram for L1TFED:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 L1TFED (const edm::ParameterSet &ps)
 
 ~L1TFED () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

std::string directory_
 
MonitorElementfedentries
 
MonitorElementfedfatal
 
MonitorElementfednonfatal
 
edm::InputTag fedSource_
 
MonitorElementhfedprof
 
MonitorElementhfedsize
 
std::vector< int > l1feds_
 
std::ofstream logFile_
 
bool monitorDaemon_
 
int nev_
 
edm::EDGetTokenT< FEDRawDataCollectionrawl_
 
bool stableROConfig_
 
bool verbose_
 

Detailed Description

Definition at line 41 of file L1TFED.h.

Constructor & Destructor Documentation

L1TFED::L1TFED ( const edm::ParameterSet ps)

Definition at line 13 of file L1TFED.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

14 {
15  // verbosity switch
16  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
17  l1feds_ = ps.getParameter<std::vector<int> >("L1FEDS");
18  directory_ = ps.getUntrackedParameter<std::string>("FEDDirName","L1T/FEDIntegrity");
19  stableROConfig_ = ps.getUntrackedParameter<bool>("stableROConfig", true);
20  rawl_ = consumes<FEDRawDataCollection>(ps.getParameter< InputTag >("rawTag"));
21 
22  if(verbose_) cout << "L1TFED: constructor...." << endl;
23  nev_ = 0;
24 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int nev_
Definition: L1TFED.h:67
edm::EDGetTokenT< FEDRawDataCollection > rawl_
Definition: L1TFED.h:73
bool stableROConfig_
Definition: L1TFED.h:75
std::string directory_
Definition: L1TFED.h:74
std::vector< int > l1feds_
Definition: L1TFED.h:70
bool verbose_
Definition: L1TFED.h:68
L1TFED::~L1TFED ( )
override

Definition at line 26 of file L1TFED.cc.

27 {
28 }

Member Function Documentation

void L1TFED::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Definition at line 51 of file L1TFED.cc.

References trackerTree::check(), gather_cfg::cout, FEDRawData::data(), data, FEDRawDataCollection::FEDData(), l1t::stage2::layer2::fedId, edm::Event::getByToken(), mps_fire::i, matplotRender::rawdata, FEDRawData::size(), findQualityFiles::size, and protons_cff::t.

52 {
53  nev_++;
54  if(verbose_) cout << "L1T FED Integrity: analyze...." << endl;
55 
57  bool t = e.getByToken(rawl_,rawdata);
58 
59  if ( ! t ) {
60  if(verbose_) cout << "can't find FEDRawDataCollection "<< endl;
61  }
62 
63  else {
64 
65  if(verbose_) cout << "fedlist size = " << l1feds_.size() << endl;
66 
67  for (unsigned int i = 0; i<l1feds_.size(); i++){
68  int fedId = l1feds_[i];
69  if(verbose_) cout << "fedId = " << fedId << endl;
70 
71  const FEDRawData & data = rawdata->FEDData(fedId);
72 
73  if(size_t size=data.size()){
74 
75  fedentries->Fill(i);
76  hfedsize->Fill(float(size));
77  hfedprof->Fill(float(i),float(size));
78  if(verbose_) cout << "header check = " << FEDHeader(data.data()).check() << endl;
79  if(verbose_) cout << "trailer check = " << FEDTrailer(data.data()).check() << endl;
80 
81  if(!FEDHeader(data.data()).check()) fedfatal->Fill(i);
82 
83  } else {
84 
85  if(verbose_) cout << "empty fed " << i << endl;
87 
88  }
89  }
90  }
91 }
size
Write out results.
MonitorElement * fedentries
Definition: L1TFED.h:63
int nev_
Definition: L1TFED.h:67
MonitorElement * hfedprof
Definition: L1TFED.h:61
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< FEDRawDataCollection > rawl_
Definition: L1TFED.h:73
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
MonitorElement * fedfatal
Definition: L1TFED.h:64
bool stableROConfig_
Definition: L1TFED.h:75
std::vector< int > l1feds_
Definition: L1TFED.h:70
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
MonitorElement * hfedsize
Definition: L1TFED.h:60
def check(config)
Definition: trackerTree.py:14
bool verbose_
Definition: L1TFED.h:68
void L1TFED::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 30 of file L1TFED.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookProfile(), mps_fire::i, MonitorElement::setBinLabel(), and DQMStore::IBooker::setCurrentFolder().

31 {
33 
34  fedentries = ibooker.book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0.,l1feds_.size() );
35  fedfatal = ibooker.book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());
36  fednonfatal = ibooker.book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0.,l1feds_.size() );
37  hfedprof = ibooker.bookProfile("fedprofile","FED Size by ID", l1feds_.size(), 0., l1feds_.size(),0,0.,10000.);
38  for(unsigned int i=0;i<l1feds_.size();i++){
39  ostringstream sfed;
40  sfed << l1feds_[i];
41  fedentries->setBinLabel(i+1,"FED "+ sfed.str());
42  fedfatal->setBinLabel(i+1,"FED "+ sfed.str());
43  fednonfatal->setBinLabel(i+1,"FED "+ sfed.str());
44  hfedprof->setBinLabel(i+1,"FED "+ sfed.str());
45  }
46 
47  hfedsize = ibooker.book1D("fedsize","FED Size Distribution",100,0.,10000.);
48 }
MonitorElement * fedentries
Definition: L1TFED.h:63
MonitorElement * hfedprof
Definition: L1TFED.h:61
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * fednonfatal
Definition: L1TFED.h:65
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * fedfatal
Definition: L1TFED.h:64
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::string directory_
Definition: L1TFED.h:74
std::vector< int > l1feds_
Definition: L1TFED.h:70
MonitorElement * hfedsize
Definition: L1TFED.h:60

Member Data Documentation

std::string L1TFED::directory_
private

Definition at line 74 of file L1TFED.h.

MonitorElement* L1TFED::fedentries
private

Definition at line 63 of file L1TFED.h.

MonitorElement* L1TFED::fedfatal
private

Definition at line 64 of file L1TFED.h.

MonitorElement* L1TFED::fednonfatal
private

Definition at line 65 of file L1TFED.h.

edm::InputTag L1TFED::fedSource_
private

Definition at line 72 of file L1TFED.h.

MonitorElement* L1TFED::hfedprof
private

Definition at line 61 of file L1TFED.h.

MonitorElement* L1TFED::hfedsize
private

Definition at line 60 of file L1TFED.h.

std::vector<int> L1TFED::l1feds_
private

Definition at line 70 of file L1TFED.h.

std::ofstream L1TFED::logFile_
private

Definition at line 71 of file L1TFED.h.

bool L1TFED::monitorDaemon_
private

Definition at line 69 of file L1TFED.h.

int L1TFED::nev_
private

Definition at line 67 of file L1TFED.h.

edm::EDGetTokenT<FEDRawDataCollection> L1TFED::rawl_
private

Definition at line 73 of file L1TFED.h.

bool L1TFED::stableROConfig_
private

Definition at line 75 of file L1TFED.h.

bool L1TFED::verbose_
private

Definition at line 68 of file L1TFED.h.