CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

L1TFED Class Reference

#include <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 (void)
void endJob (void)

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_

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.

{

  // verbosity switch
  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
  rawl_  = ps.getParameter< InputTag >("rawTag");
  if(verbose_) cout << "L1TFED: constructor...." << endl;


  dbe = NULL;
  if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 
  {
    dbe = Service<DQMStore>().operator->();
    dbe->setVerbose(0);
  }

  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
  if ( outputFile_.size() != 0 ) {
    cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
  }

  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
  if(disable){
    outputFile_="";
  }
  
  l1feds_ = ps.getParameter<std::vector<int> >("L1FEDS");

  directory_ = ps.getUntrackedParameter<std::string>("FEDDirName","L1T/FEDIntegrity");


  if ( dbe !=NULL ) {
    dbe->setCurrentFolder(directory_);
  }

  stableROConfig_ = ps.getUntrackedParameter<bool>("stableROConfig", true);
}
L1TFED::~L1TFED ( ) [virtual]

Definition at line 57 of file L1TFED.cc.

{
}

Member Function Documentation

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

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, findQualityFiles::size, FEDRawData::size(), and lumiQTWidget::t.

{
  nev_++; 
  if(verbose_) cout << "L1T FED Integrity: analyze...." << endl;

  edm::Handle<FEDRawDataCollection> rawdata;
  bool t = e.getByLabel(rawl_,rawdata);
  
  if ( ! t ) {
    if(verbose_) cout << "can't find FEDRawDataCollection "<< endl;
  }
  
  else {

     if(verbose_) cout << "fedlist size = " << l1feds_.size() << endl;

     for (unsigned int i = 0; i<l1feds_.size(); i++){
        int fedId = l1feds_[i];
        if(verbose_) cout << "fedId = " << fedId << endl;
       
        const FEDRawData & data = rawdata->FEDData(fedId);
        
        if(size_t size=data.size()){
               
            fedentries->Fill(i);
            hfedsize->Fill(float(size));
            hfedprof->Fill(float(i),float(size));
            if(verbose_) cout << "header check = " << FEDHeader(data.data()).check() << endl;
            if(verbose_) cout << "trailer check = " << FEDTrailer(data.data()).check() << endl;

            if(!FEDHeader(data.data()).check()) fedfatal->Fill(i);

//            if(!FEDHeader(data.data()).check() || !FEDTrailer(data.data()).check()) fedfatal->Fill(i);
// fedtrailer check seems to be always 0.

//          for fedId dedicated integrity checks.
/*          switch(fedId){
         
               case 813:
               std::cout << "do something for GT 813 data corruption..." << std::endl; continue;
               fednonfatal->Fill(fedId);
            
               case 814:
               std::cout << "do something for GT 814 data corruption..." << std::endl; continue;
               fednonfatal->Fill(fedId);
            }
*/       
        } else {
        
         if(verbose_) cout << "empty fed " << i << endl;
         if(stableROConfig_) fedfatal->Fill(i);
        
        }
   }
  
 }

}
void L1TFED::beginJob ( void  ) [protected, virtual]

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().

{

  nev_ = 0;

  // get hold of back-end interface
  DQMStore* dbe = 0;
  dbe = Service<DQMStore>().operator->();

  if ( dbe ) {
    dbe->setCurrentFolder(directory_);
    dbe->rmdir(directory_);
  }


  if ( dbe ) 
  {
    dbe->setCurrentFolder(directory_);
    
    fedentries = dbe->book1D("FEDEntries", "Fed ID occupancy", l1feds_.size(), 0.,l1feds_.size() );       
    fedfatal = dbe->book1D("FEDFatal", "Fed ID non present ", l1feds_.size(), 0., l1feds_.size());        
    fednonfatal = dbe->book1D("FEDNonFatal", "Fed corrupted data ", l1feds_.size(), 0.,l1feds_.size() );
    hfedprof = dbe->bookProfile("fedprofile","FED Size by ID", l1feds_.size(), 0., l1feds_.size(),0,0.,5000.);
    for(unsigned int i=0;i<l1feds_.size();i++){
       ostringstream sfed;
       sfed << l1feds_[i];
       fedentries->setBinLabel(i+1,"FED "+ sfed.str());
       fedfatal->setBinLabel(i+1,"FED "+ sfed.str());
       fednonfatal->setBinLabel(i+1,"FED "+ sfed.str());
//       hfedprof->getTProfile()->GetXaxis()->SetBinLabel(i+1,"FED "+ sfed.str());

    }
          
    hfedsize = dbe->book1D("fedsize","FED Size Distribution",100,0.,10000.);

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

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file L1TFED.cc.

References gather_cfg::cout.

{
 
  if(verbose_) std::cout << "L1T FED Integrity: end job...." << std::endl;
  LogInfo("EndJob") << "analyzed " << nev_ << " events"; 

 if ( outputFile_.size() != 0  && dbe ) dbe->save(outputFile_);

 return;
}

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.

Definition at line 73 of file L1TFED.h.

Definition at line 74 of file L1TFED.h.

Definition at line 75 of file L1TFED.h.

Definition at line 83 of file L1TFED.h.

Definition at line 70 of file L1TFED.h.

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.

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.