CMS 3D CMS Logo

FEDRawDataAnalyzer Class Reference

Analyzes contents of FEDRawData collection. More...

#include <IORawData/SiStripInputSources/plugins/FEDRawDataAnalyzer.h>

Inheritance diagram for FEDRawDataAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
void beginJob (edm::EventSetup const &)
void endJob ()
 FEDRawDataAnalyzer (const edm::ParameterSet &)
virtual ~FEDRawDataAnalyzer ()

Private Attributes

std::string instance_
std::string label_
int32_t sleep_
std::vector< Temptemp_

Classes

class  Temp


Detailed Description

Analyzes contents of FEDRawData collection.

Definition at line 16 of file FEDRawDataAnalyzer.h.


Constructor & Destructor Documentation

FEDRawDataAnalyzer::FEDRawDataAnalyzer ( const edm::ParameterSet pset  ) 

Definition at line 17 of file FEDRawDataAnalyzer.cc.

References LogTrace, and sistrip::mlRawToDigi_.

00018   : label_( pset.getUntrackedParameter<std::string>("ProductLabel","source") ),
00019     instance_( pset.getUntrackedParameter<std::string>("ProductInstance","") ),
00020     sleep_( pset.getUntrackedParameter<int>("pause_us",0) )
00021 {
00022   LogTrace(mlRawToDigi_)
00023     << "[FEDRawDataAnalyzer::" << __func__ << "]"
00024     << " Constructing object...";
00025 }

virtual FEDRawDataAnalyzer::~FEDRawDataAnalyzer (  )  [inline, virtual]

Definition at line 21 of file FEDRawDataAnalyzer.h.

00021 {;}


Member Function Documentation

void FEDRawDataAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup setup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 29 of file FEDRawDataAnalyzer.cc.

References sistrip::CMS_FED_ID_MAX, fedt_struct::conscheck, FEDRawData::data(), data, lat::endl(), instance_, edm::isDebugEnabled(), label_, LogTrace, sistrip::mlRawToDigi_, FEDRawData::size(), sleep_, and ss.

00030                                                                {
00031   
00032   // Introduce optional delay
00033   if ( sleep_ > 0 ) { for ( int ii = 0; ii < sleep_; ++ii ) { usleep(1); } }
00034   
00035   // Retrieve FED raw data
00036   edm::Handle<FEDRawDataCollection> buffers;
00037   event.getByLabel( label_, instance_, buffers ); 
00038   
00039   // Some init
00040   std::stringstream ss; 
00041   ss << std::endl;
00042   uint16_t cntr = 0;
00043   bool trigger_fed = false;
00044   
00045   // Check FEDRawDataCollection
00046   for ( uint16_t ifed = 0; ifed < sistrip::CMS_FED_ID_MAX; ifed++ ) {
00047     const FEDRawData& fed = buffers->FEDData( static_cast<int>(ifed) );
00048     if ( fed.size() ) { 
00049       cntr++;
00050       if ( edm::isDebugEnabled() ) {
00051         ss << " #FEDs: " 
00052            << std::setw(3) << std::setfill(' ') << cntr
00053            << "  FED id: " 
00054            << std::setw(4) << std::setfill(' ') << ifed 
00055            << "  Buffer size [chars]: " 
00056            << std::setw(6) << std::setfill(' ') << fed.size();
00057       }
00058       uint8_t* data = const_cast<uint8_t*>( fed.data() );
00059       fedt_t* fed_trailer = reinterpret_cast<fedt_t*>( data + fed.size() - sizeof(fedt_t) );
00060       if ( fed_trailer->conscheck == 0xDEADFACE ) { 
00061         ss << " (Candidate for \"trigger FED\"!)";
00062         trigger_fed = true; 
00063       } 
00064       ss << std::endl;
00065     }
00066   }
00067   
00068   // Print out debug
00069   std::stringstream sss;
00070   sss << "[FEDRawDataAnalyzer::" << __func__ << "]"
00071       << " Number of FED buffers (with non-zero size) found in collection is "
00072       << cntr;
00073   if ( trigger_fed ) { sss << " (One buffer contains the \"trigger FED\" info!)"; }
00074   edm::LogVerbatim(mlRawToDigi_) << sss.str();
00075   
00076   LogTrace(mlRawToDigi_) 
00077     << "[FEDRawDataAnalyzer::" << __func__ << "]"
00078     << " Buffer size for " << cntr << " FEDs: "
00079     << ss.str();
00080   
00081 }

void FEDRawDataAnalyzer::beginJob ( edm::EventSetup const &   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 85 of file FEDRawDataAnalyzer.cc.

00085 {;}

void FEDRawDataAnalyzer::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file FEDRawDataAnalyzer.cc.

00089 {;}


Member Data Documentation

std::string FEDRawDataAnalyzer::instance_ [private]

Definition at line 42 of file FEDRawDataAnalyzer.h.

Referenced by analyze().

std::string FEDRawDataAnalyzer::label_ [private]

Definition at line 41 of file FEDRawDataAnalyzer.h.

Referenced by analyze().

int32_t FEDRawDataAnalyzer::sleep_ [private]

Definition at line 43 of file FEDRawDataAnalyzer.h.

Referenced by analyze().

std::vector<Temp> FEDRawDataAnalyzer::temp_ [private]

Definition at line 39 of file FEDRawDataAnalyzer.h.


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