#include <IORawData/SiStripInputSources/plugins/FEDRawDataAnalyzer.h>
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< Temp > | temp_ |
Classes | |
class | Temp |
Definition at line 16 of file FEDRawDataAnalyzer.h.
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] |
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] |
std::string FEDRawDataAnalyzer::instance_ [private] |
std::string FEDRawDataAnalyzer::label_ [private] |
int32_t FEDRawDataAnalyzer::sleep_ [private] |
std::vector<Temp> FEDRawDataAnalyzer::temp_ [private] |
Definition at line 39 of file FEDRawDataAnalyzer.h.