CMS 3D CMS Logo

TableDataFormatter Class Reference

Id
TableDataFormatter.h,v 1.5 2007/04/12 08:36:47 franzoni Exp
More...

#include <EventFilter/EcalTBRawToDigi/src/TableDataFormatter.h>

List of all members.

Public Member Functions

void interpretRawData (const FEDRawData &data, EcalTBEventHeader &tbEventHeader)
 TableDataFormatter ()
virtual ~TableDataFormatter ()

Static Private Attributes

static const int nWordsPerEvent = 10


Detailed Description

Id
TableDataFormatter.h,v 1.5 2007/04/12 08:36:47 franzoni Exp

Definition at line 16 of file TableDataFormatter.h.


Constructor & Destructor Documentation

TableDataFormatter::TableDataFormatter (  ) 

Definition at line 6 of file TableDataFormatter.cc.

00006                                         {
00007 }

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

Definition at line 21 of file TableDataFormatter.h.

References LogDebug.

00021 {LogDebug("EcalTBRawToDigi") << "@SUB=TableDataFormatter" << "\n"; };


Member Function Documentation

void TableDataFormatter::interpretRawData ( const FEDRawData data,
EcalTBEventHeader tbEventHeader 
)

Definition at line 9 of file TableDataFormatter.cc.

References a, b, FEDRawData::data(), LogDebug, nWordsPerEvent, EcalTBEventHeader::setCrystalInBeam(), EcalTBEventHeader::setNextCrystalInBeam(), EcalTBEventHeader::setNominalCrystalInBeam(), EcalTBEventHeader::setPhiTableIndex(), EcalTBEventHeader::setTableIsMovingAtBegSpill(), EcalTBEventHeader::setThetaTableIndex(), FEDRawData::size(), and EBDetId::SMCRYSTALMODE.

Referenced by EcalDCCTB07UnpackingModule::produce(), and EcalDCCTBUnpackingModule::produce().

00011 {
00012   const ulong * buffer = ( reinterpret_cast<ulong*>(const_cast<unsigned char*> ( fedData.data())));
00013   int fedLenght                        = fedData.size(); // in Bytes
00014   
00015   // check ultimate fed size and strip off fed-header and -trailer
00016   if (fedLenght != (nWordsPerEvent *4) )
00017     {
00018       edm::LogError("TableDataFormatter") << "TableData has size "  <<  fedLenght
00019                                        <<" Bytes as opposed to expected " 
00020                                        << (nWordsPerEvent *4)
00021                                      << ". Returning.";
00022       return;
00023     }
00024 
00025   ulong a=1; // used to extract an 8 Bytes word from fed 
00026   ulong b=1; // used to manipulate the 8 Bytes word and get what needed
00027 
00028   int wordCounter =0;
00029   wordCounter +=4;
00030 
00031   a = buffer[wordCounter];wordCounter++;
00032   b = (a& 0xffffffff);
00033   tbEventHeader.setThetaTableIndex(b);
00034   LogDebug("TableDataFormatter") << "Table theta position:\t" << b;
00035   a = buffer[wordCounter];wordCounter++;
00036   b = (a& 0xffffffff);
00037   tbEventHeader.setPhiTableIndex(b);
00038   LogDebug("TableDataFormatter") << "Table phi position:\t" << b;
00039   a = buffer[wordCounter];wordCounter++;
00040   b = (a& 0xffff);
00041   tbEventHeader.setCrystalInBeam(EBDetId(1,b,EBDetId::SMCRYSTALMODE));
00042   LogDebug("TableDataFormatter") << "Actual Current crystal in beam:\t" << b;
00043   b = (a& 0xffff0000);
00044   b = b >> 16;
00045   tbEventHeader.setNominalCrystalInBeam(EBDetId(1,b,EBDetId::SMCRYSTALMODE));
00046   LogDebug("TableDataFormatter") << "Nominal Current crystal in beam:\t" << b;
00047   a = buffer[wordCounter];wordCounter++;
00048   b = (a& 0xffff);
00049   tbEventHeader.setNextCrystalInBeam(EBDetId(1,b,EBDetId::SMCRYSTALMODE));
00050   LogDebug("TableDataFormatter") << "Next crystal in beam:\t" << b;
00051   b = (a& 0x00010000); //Table is moving at the begin of the spill
00052   b = b >> 16;
00053   tbEventHeader.setTableIsMovingAtBegSpill(b & 0x1);
00054   LogDebug("TableDataFormatter") << "Table is moving at begin of the spill:\t" << b;
00055 }


Member Data Documentation

const int TableDataFormatter::nWordsPerEvent = 10 [static, private]

Definition at line 27 of file TableDataFormatter.h.

Referenced by interpretRawData().


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