CMS 3D CMS Logo

L1TFED Class Reference

#include <DQM/L1TMonitor/interface/L1TFED.h>

Inheritance diagram for L1TFED:

edm::EDAnalyzer

List of all members.

Public Member Functions

 L1TFED (const edm::ParameterSet &ps)
virtual ~L1TFED ()

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
void beginJob (const edm::EventSetup &c)
void endJob (void)

Private Attributes

DQMStoredbe
MonitorElementfedentries
MonitorElementfedfatal
MonitorElementfednonfatal
edm::InputTag fedSource_
MonitorElementhfedprof
MonitorElementhfedsize
std::vector< intl1feds_
ofstream logFile_
bool monitorDaemon_
int nev_
std::string outputFile_
bool verbose_


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 GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), l1feds_, NULL, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

00020 {
00021 
00022   // verbosity switch
00023   verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
00024 
00025   if(verbose_) cout << "L1TFED: constructor...." << endl;
00026 
00027 
00028   dbe = NULL;
00029   if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 
00030   {
00031     dbe = Service<DQMStore>().operator->();
00032     dbe->setVerbose(0);
00033   }
00034 
00035   outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
00036   if ( outputFile_.size() != 0 ) {
00037     cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
00038   }
00039 
00040   bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
00041   if(disable){
00042     outputFile_="";
00043   }
00044   
00045   l1feds_ = ps.getParameter<std::vector<int> >("L1FEDS");
00046 
00047 
00048   if ( dbe !=NULL ) {
00049     dbe->setCurrentFolder("L1T/FEDIntegrity");
00050   }
00051 
00052 
00053 }

L1TFED::~L1TFED (  )  [virtual]

Definition at line 55 of file L1TFED.cc.

00056 {
00057 }


Member Function Documentation

void L1TFED::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Implements edm::EDAnalyzer.

Definition at line 109 of file L1TFED.cc.

References HcalDataFrameFilter_impl::check(), GenMuonPlsPt100GeV_cfg::cout, data, FEDRawData::data(), lat::endl(), fedentries, fedfatal, MonitorElement::Fill(), edm::Event::getByType(), hfedprof, hfedsize, i, l1feds_, LogDebug, nev_, FEDRawData::size(), size, t, and verbose_.

00110 {
00111   nev_++; 
00112   if(verbose_) cout << "L1T FED Integrity: analyze...." << endl;
00113 
00114   edm::Handle<FEDRawDataCollection> rawdata;
00115   bool t = e.getByType(rawdata);
00116   
00117   if ( ! t ) {
00118      LogDebug("Product") << "can't find FEDRawDataCollection ";
00119   }
00120   
00121   else {
00122 
00123      if(verbose_) cout << "fedlist size = " << l1feds_.size() << endl;
00124 
00125      for (int i = 0; i<l1feds_.size(); i++){
00126         int fedId = l1feds_[i];
00127         if(verbose_) cout << "fedId = " << fedId << endl;
00128        
00129         const FEDRawData & data = rawdata->FEDData(fedId);
00130         
00131         if(size_t size=data.size()){
00132                
00133             fedentries->Fill(i);
00134             hfedsize->Fill(float(size));
00135             hfedprof->Fill(float(i),float(size));
00136             if(verbose_) cout << "header check = " << FEDHeader(data.data()).check() << endl;
00137             if(verbose_) cout << "trailer check = " << FEDTrailer(data.data()).check() << endl;
00138 
00139             if(!FEDHeader(data.data()).check()) fedfatal->Fill(i);
00140 
00141 //            if(!FEDHeader(data.data()).check() || !FEDTrailer(data.data()).check()) fedfatal->Fill(i);
00142 // fedtrailer check seems to be always 0.
00143 
00144 //          for fedId dedicated integrity checks.
00145 /*          switch(fedId){
00146          
00147                case 813:
00148                std::cout << "do something for GT 813 data corruption..." << std::endl; continue;
00149                fednonfatal->Fill(fedId);
00150             
00151                case 814:
00152                std::cout << "do something for GT 814 data corruption..." << std::endl; continue;
00153                fednonfatal->Fill(fedId);
00154             }
00155 */       
00156         } else {
00157         
00158          if(verbose_) cout << "empty fed " << i << endl;
00159          fedfatal->Fill(i);
00160         
00161         }
00162    }
00163   
00164  }
00165 
00166 }

void L1TFED::beginJob ( const edm::EventSetup c  )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 59 of file L1TFED.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), dbe, fedentries, fedfatal, fednonfatal, hfedprof, hfedsize, i, l1feds_, nev_, DQMStore::rmdir(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

00060 {
00061 
00062   nev_ = 0;
00063 
00064   // get hold of back-end interface
00065   DQMStore* dbe = 0;
00066   dbe = Service<DQMStore>().operator->();
00067 
00068   if ( dbe ) {
00069     dbe->setCurrentFolder("L1T/FEDIntegrity");
00070     dbe->rmdir("L1T/FEDIntegrity");
00071   }
00072 
00073 
00074   if ( dbe ) 
00075   {
00076     dbe->setCurrentFolder("L1T/FEDIntegrity");
00077     
00078     fedentries = dbe->book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0.,l1feds_.size() );       
00079     fedfatal = dbe->book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());        
00080     fednonfatal = dbe->book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0.,l1feds_.size() );
00081     hfedprof = dbe->bookProfile("fedprofile","FED Size by ID", l1feds_.size(), 0., l1feds_.size(),0,0.,5000.);
00082     for(int i=0;i<l1feds_.size();i++){
00083        ostringstream sfed;
00084        sfed << l1feds_[i];
00085        fedentries->setBinLabel(i+1,"FED "+ sfed.str());
00086        fedfatal->setBinLabel(i+1,"FED "+ sfed.str());
00087        fednonfatal->setBinLabel(i+1,"FED "+ sfed.str());
00088 //       hfedprof->getTProfile()->GetXaxis()->SetBinLabel(i+1,"FED "+ sfed.str());
00089 
00090     }
00091           
00092     hfedsize = dbe->book1D("fedsize","FED Size Distribution",100,0.,10000.);
00093 
00094    }
00095 }

void L1TFED::endJob ( void   )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file L1TFED.cc.

References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), nev_, outputFile_, DQMStore::save(), and verbose_.

00099 {
00100  
00101   if(verbose_) std::cout << "L1T FED Integrity: end job...." << std::endl;
00102   LogInfo("EndJob") << "analyzed " << nev_ << " events"; 
00103 
00104  if ( outputFile_.size() != 0  && dbe ) dbe->save(outputFile_);
00105 
00106  return;
00107 }


Member Data Documentation

DQMStore* L1TFED::dbe [private]

Definition at line 66 of file L1TFED.h.

Referenced by beginJob(), endJob(), and L1TFED().

MonitorElement* L1TFED::fedentries [private]

Definition at line 73 of file L1TFED.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TFED::fedfatal [private]

Definition at line 74 of file L1TFED.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TFED::fednonfatal [private]

Definition at line 75 of file L1TFED.h.

Referenced by beginJob().

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.

Referenced by analyze(), and beginJob().

MonitorElement* L1TFED::hfedsize [private]

Definition at line 69 of file L1TFED.h.

Referenced by analyze(), and beginJob().

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

Definition at line 81 of file L1TFED.h.

Referenced by analyze(), beginJob(), and L1TFED().

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.

Referenced by analyze(), beginJob(), and endJob().

std::string L1TFED::outputFile_ [private]

Definition at line 78 of file L1TFED.h.

Referenced by endJob(), and L1TFED().

bool L1TFED::verbose_ [private]

Definition at line 79 of file L1TFED.h.

Referenced by analyze(), endJob(), and L1TFED().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:03 2009 for CMSSW by  doxygen 1.5.4