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 edm::EDConsumerBase

Public Member Functions

 L1TFED (const edm::ParameterSet &ps)
 
virtual ~L1TFED ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
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)
 
void beginJob (void)
 
void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
 
void endJob (void)
 
- 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

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 42 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(), NULL, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 51 of file L1TFED.cc.

52 {
53 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 103 of file L1TFED.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file L1TFED.cc.

56 {
57  nev_ = 0;
58 }
int nev_
Definition: L1TFED.h:78
void L1TFED::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file L1TFED.cc.

References i.

61 {
62  if ( dbe ) {
65  }
66 
67 
68  if ( dbe )
69  {
71 
72  fedentries = dbe->book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0.,l1feds_.size() );
73  fedfatal = dbe->book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());
74  fednonfatal = dbe->book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0.,l1feds_.size() );
75  hfedprof = dbe->bookProfile("fedprofile","FED Size by ID", l1feds_.size(), 0., l1feds_.size(),0,0.,5000.);
76  for(unsigned int i=0;i<l1feds_.size();i++){
77  ostringstream sfed;
78  sfed << l1feds_[i];
79  fedentries->setBinLabel(i+1,"FED "+ sfed.str());
80  fedfatal->setBinLabel(i+1,"FED "+ sfed.str());
81  fednonfatal->setBinLabel(i+1,"FED "+ sfed.str());
82 // hfedprof->getTProfile()->GetXaxis()->SetBinLabel(i+1,"FED "+ sfed.str());
83 
84  }
85 
86  hfedsize = dbe->book1D("fedsize","FED Size Distribution",100,0.,10000.);
87 
88  }
89 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * fedentries
Definition: L1TFED.h:74
MonitorElement * hfedprof
Definition: L1TFED.h:71
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
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:76
MonitorElement * fedfatal
Definition: L1TFED.h:75
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:1186
std::string directory_
Definition: L1TFED.h:86
std::vector< int > l1feds_
Definition: L1TFED.h:82
DQMStore * dbe
Definition: L1TFED.h:67
MonitorElement * hfedsize
Definition: L1TFED.h:70
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void L1TFED::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file L1TFED.cc.

References gather_cfg::cout.

93 {
94 
95  if(verbose_) std::cout << "L1T FED Integrity: end job...." << std::endl;
96  LogInfo("EndJob") << "analyzed " << nev_ << " events";
97 
98  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
99 
100  return;
101 }
int nev_
Definition: L1TFED.h:78
std::string outputFile_
Definition: L1TFED.h:79
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
DQMStore * dbe
Definition: L1TFED.h:67
tuple cout
Definition: gather_cfg.py:121
bool verbose_
Definition: L1TFED.h:80

Member Data Documentation

DQMStore* L1TFED::dbe
private

Definition at line 67 of file L1TFED.h.

std::string L1TFED::directory_
private

Definition at line 86 of file L1TFED.h.

MonitorElement* L1TFED::fedentries
private

Definition at line 74 of file L1TFED.h.

MonitorElement* L1TFED::fedfatal
private

Definition at line 75 of file L1TFED.h.

MonitorElement* L1TFED::fednonfatal
private

Definition at line 76 of file L1TFED.h.

edm::InputTag L1TFED::fedSource_
private

Definition at line 84 of file L1TFED.h.

MonitorElement* L1TFED::hfedprof
private

Definition at line 71 of file L1TFED.h.

MonitorElement* L1TFED::hfedsize
private

Definition at line 70 of file L1TFED.h.

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

Definition at line 82 of file L1TFED.h.

std::ofstream L1TFED::logFile_
private

Definition at line 83 of file L1TFED.h.

bool L1TFED::monitorDaemon_
private

Definition at line 81 of file L1TFED.h.

int L1TFED::nev_
private

Definition at line 78 of file L1TFED.h.

std::string L1TFED::outputFile_
private

Definition at line 79 of file L1TFED.h.

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

Definition at line 85 of file L1TFED.h.

bool L1TFED::stableROConfig_
private

Definition at line 87 of file L1TFED.h.

bool L1TFED::verbose_
private

Definition at line 80 of file L1TFED.h.