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

#include <L1TFED.h>

Inheritance diagram for L1TFED:
edm::EDAnalyzer

Public Member Functions

 L1TFED (const edm::ParameterSet &ps)
 
virtual ~L1TFED ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 44 of file L1TFED.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file L1TFED.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), NULL, and cppFunctionSkipper::operator.

20 {
21 
22  // verbosity switch
23  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
24  rawl_ = ps.getParameter< InputTag >("rawTag");
25  if(verbose_) cout << "L1TFED: constructor...." << endl;
26 
27 
28  dbe = NULL;
29  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
30  {
32  dbe->setVerbose(0);
33  }
34 
35  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
36  if ( outputFile_.size() != 0 ) {
37  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
38  }
39 
40  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
41  if(disable){
42  outputFile_="";
43  }
44 
45  l1feds_ = ps.getParameter<std::vector<int> >("L1FEDS");
46 
47  directory_ = ps.getUntrackedParameter<std::string>("FEDDirName","L1T/FEDIntegrity");
48 
49 
50  if ( dbe !=NULL ) {
51  dbe->setCurrentFolder(directory_);
52  }
53 
54  stableROConfig_ = ps.getUntrackedParameter<bool>("stableROConfig", true);
55 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
bool stableROConfig_
Definition: L1TFED.h:86
std::string outputFile_
Definition: L1TFED.h:78
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
edm::InputTag rawl_
Definition: L1TFED.h:84
std::string directory_
Definition: L1TFED.h:85
std::vector< int > l1feds_
Definition: L1TFED.h:81
DQMStore * dbe
Definition: L1TFED.h:66
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
bool verbose_
Definition: L1TFED.h:79
L1TFED::~L1TFED ( )
virtual

Definition at line 57 of file L1TFED.cc.

58 {
59 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 111 of file L1TFED.cc.

References CastorDataFrameFilter_impl::check(), gather_cfg::cout, FEDRawData::data(), data, edm::Event::getByLabel(), i, lumiPlot::rawdata, FEDRawData::size(), findQualityFiles::size, and lumiQTWidget::t.

112 {
113  nev_++;
114  if(verbose_) cout << "L1T FED Integrity: analyze...." << endl;
115 
117  bool t = e.getByLabel(rawl_,rawdata);
118 
119  if ( ! t ) {
120  if(verbose_) cout << "can't find FEDRawDataCollection "<< endl;
121  }
122 
123  else {
124 
125  if(verbose_) cout << "fedlist size = " << l1feds_.size() << endl;
126 
127  for (unsigned int i = 0; i<l1feds_.size(); i++){
128  int fedId = l1feds_[i];
129  if(verbose_) cout << "fedId = " << fedId << endl;
130 
131  const FEDRawData & data = rawdata->FEDData(fedId);
132 
133  if(size_t size=data.size()){
134 
135  fedentries->Fill(i);
136  hfedsize->Fill(float(size));
137  hfedprof->Fill(float(i),float(size));
138  if(verbose_) cout << "header check = " << FEDHeader(data.data()).check() << endl;
139  if(verbose_) cout << "trailer check = " << FEDTrailer(data.data()).check() << endl;
140 
141  if(!FEDHeader(data.data()).check()) fedfatal->Fill(i);
142 
143 // if(!FEDHeader(data.data()).check() || !FEDTrailer(data.data()).check()) fedfatal->Fill(i);
144 // fedtrailer check seems to be always 0.
145 
146 // for fedId dedicated integrity checks.
147 /* switch(fedId){
148 
149  case 813:
150  std::cout << "do something for GT 813 data corruption..." << std::endl; continue;
151  fednonfatal->Fill(fedId);
152 
153  case 814:
154  std::cout << "do something for GT 814 data corruption..." << std::endl; continue;
155  fednonfatal->Fill(fedId);
156  }
157 */
158  } else {
159 
160  if(verbose_) cout << "empty fed " << i << endl;
162 
163  }
164  }
165 
166  }
167 
168 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * fedentries
Definition: L1TFED.h:73
int nev_
Definition: L1TFED.h:77
MonitorElement * hfedprof
Definition: L1TFED.h:70
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void Fill(long long x)
MonitorElement * fedfatal
Definition: L1TFED.h:74
bool stableROConfig_
Definition: L1TFED.h:86
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag rawl_
Definition: L1TFED.h:84
std::vector< int > l1feds_
Definition: L1TFED.h:81
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:29
MonitorElement * hfedsize
Definition: L1TFED.h:69
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
tuple size
Write out results.
bool verbose_
Definition: L1TFED.h:79
void L1TFED::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 61 of file L1TFED.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), i, cppFunctionSkipper::operator, DQMStore::rmdir(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

62 {
63 
64  nev_ = 0;
65 
66  // get hold of back-end interface
67  DQMStore* dbe = 0;
68  dbe = Service<DQMStore>().operator->();
69 
70  if ( dbe ) {
73  }
74 
75 
76  if ( dbe )
77  {
79 
80  fedentries = dbe->book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0.,l1feds_.size() );
81  fedfatal = dbe->book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());
82  fednonfatal = dbe->book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0.,l1feds_.size() );
83  hfedprof = dbe->bookProfile("fedprofile","FED Size by ID", l1feds_.size(), 0., l1feds_.size(),0,0.,5000.);
84  for(unsigned int i=0;i<l1feds_.size();i++){
85  ostringstream sfed;
86  sfed << l1feds_[i];
87  fedentries->setBinLabel(i+1,"FED "+ sfed.str());
88  fedfatal->setBinLabel(i+1,"FED "+ sfed.str());
89  fednonfatal->setBinLabel(i+1,"FED "+ sfed.str());
90 // hfedprof->getTProfile()->GetXaxis()->SetBinLabel(i+1,"FED "+ sfed.str());
91 
92  }
93 
94  hfedsize = dbe->book1D("fedsize","FED Size Distribution",100,0.,10000.);
95 
96  }
97 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * fedentries
Definition: L1TFED.h:73
int nev_
Definition: L1TFED.h:77
MonitorElement * hfedprof
Definition: L1TFED.h:70
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
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:75
MonitorElement * fedfatal
Definition: L1TFED.h:74
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
std::string directory_
Definition: L1TFED.h:85
std::vector< int > l1feds_
Definition: L1TFED.h:81
DQMStore * dbe
Definition: L1TFED.h:66
MonitorElement * hfedsize
Definition: L1TFED.h:69
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void L1TFED::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file L1TFED.cc.

References gather_cfg::cout.

101 {
102 
103  if(verbose_) std::cout << "L1T FED Integrity: end job...." << std::endl;
104  LogInfo("EndJob") << "analyzed " << nev_ << " events";
105 
106  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
107 
108  return;
109 }
int nev_
Definition: L1TFED.h:77
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
std::string outputFile_
Definition: L1TFED.h:78
DQMStore * dbe
Definition: L1TFED.h:66
tuple cout
Definition: gather_cfg.py:121
bool verbose_
Definition: L1TFED.h:79

Member Data Documentation

DQMStore* L1TFED::dbe
private

Definition at line 66 of file L1TFED.h.

std::string L1TFED::directory_
private

Definition at line 85 of file L1TFED.h.

MonitorElement* L1TFED::fedentries
private

Definition at line 73 of file L1TFED.h.

MonitorElement* L1TFED::fedfatal
private

Definition at line 74 of file L1TFED.h.

MonitorElement* L1TFED::fednonfatal
private

Definition at line 75 of file L1TFED.h.

edm::InputTag L1TFED::fedSource_
private

Definition at line 83 of file L1TFED.h.

MonitorElement* L1TFED::hfedprof
private

Definition at line 70 of file L1TFED.h.

MonitorElement* L1TFED::hfedsize
private

Definition at line 69 of file L1TFED.h.

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

Definition at line 81 of file L1TFED.h.

ofstream L1TFED::logFile_
private

Definition at line 82 of file L1TFED.h.

bool L1TFED::monitorDaemon_
private

Definition at line 80 of file L1TFED.h.

int L1TFED::nev_
private

Definition at line 77 of file L1TFED.h.

std::string L1TFED::outputFile_
private

Definition at line 78 of file L1TFED.h.

edm::InputTag L1TFED::rawl_
private

Definition at line 84 of file L1TFED.h.

bool L1TFED::stableROConfig_
private

Definition at line 86 of file L1TFED.h.

bool L1TFED::verbose_
private

Definition at line 79 of file L1TFED.h.