CMS 3D CMS Logo

L1GlobalTriggerRawToDigi Class Reference

Description: unpack raw data into digitized data. More...

#include <EventFilter/L1GlobalTriggerRawToDigi/interface/L1GlobalTriggerRawToDigi.h>

Inheritance diagram for L1GlobalTriggerRawToDigi:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 L1GlobalTriggerRawToDigi (const edm::ParameterSet &)
 constructor(s)
virtual ~L1GlobalTriggerRawToDigi ()
 destructor

Private Member Functions

virtual void beginJob ()
void dumpFedRawData (const unsigned char *, int, std::ostream &)
 dump FED raw data
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)
void unpackGMT (const unsigned char *, std::auto_ptr< L1MuGMTReadoutCollection > &, edm::Event &)
 unpack the GMT record
void unpackHeader (const unsigned char *, FEDHeader &)
 block unpackers
void unpackPSB (const edm::EventSetup &, const unsigned char *, L1GtPsbWord &)
 unpack PSB blocks unpacking is done in PSB class format methods are given later to translate from the PSB format to the physical input of the PSB
void unpackTrailer (const unsigned char *, FEDTrailer &)
 unpack trailer word

Private Attributes

boost::uint16_t m_activeBoardsMaskGt
 mask for active boards
int m_daqGtFedId
 FED Id for GT DAQ record default value defined in DataFormats/FEDRawData/src/FEDNumbering.cc.
edm::InputTag m_daqGtInputTag
 input tags for GT DAQ record
L1GtFdlWordm_gtFdlWord
L1GtfeWordm_gtfeWord
L1GtPsbWordm_gtPsbWord
bool m_isDebugEnabled
int m_lowSkipBxInEvent
 lowest bxInEvent to be unpacked in the event assume symmetrical number of BX around L1Accept
int m_recordLength0
 total Bx's in the event, obtained from GTFE block
int m_recordLength1
 corresponding to alternative 1 in altNrBxBoard()
int m_totalBxInEvent
 number of Bx for a board, obtained from GTFE block (record length & alternative)
const L1MuTriggerPtScalem_TriggerPtScale
const L1MuTriggerScalesm_TriggerScales
 muon trigger scales to convert unpacked data into physical quantities
int m_unpackBxInEvent
int m_uppSkipBxInEvent
 upper bxInEvent to be unpacked in the event assume symmetrical number of BX around L1Accept
int m_verbosity
 verbosity level


Detailed Description

Description: unpack raw data into digitized data.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna - GT

: Ivan Mikulec - HEPHY Vienna - GMT

$Date$ $Revision$

Definition at line 50 of file L1GlobalTriggerRawToDigi.h.


Constructor & Destructor Documentation

L1GlobalTriggerRawToDigi::L1GlobalTriggerRawToDigi ( const edm::ParameterSet pSet  )  [explicit]

constructor(s)

Definition at line 65 of file L1GlobaTriggerRawToDigi.cc.

References lat::endl(), LogDebug, m_activeBoardsMaskGt, m_daqGtFedId, m_daqGtInputTag, m_gtFdlWord, m_gtfeWord, m_gtPsbWord, m_isDebugEnabled, m_unpackBxInEvent, and m_verbosity.

00065                                                                               :
00066 
00067             // input tag for DAQ GT record
00068             m_daqGtInputTag(pSet.getParameter<edm::InputTag> ("DaqGtInputTag")),
00069 
00070             // FED Id for GT DAQ record
00071             // default value defined in DataFormats/FEDRawData/src/FEDNumbering.cc
00072             // default value: assume the DAQ record is the last GT record
00073             m_daqGtFedId(pSet.getUntrackedParameter<int> (
00074                     "DaqGtFedId", FEDNumbering::getTriggerGTPFEDIds().second)),
00075 
00076             // mask for active boards
00077             m_activeBoardsMaskGt(pSet.getParameter<unsigned int> ("ActiveBoardsMask")),
00078 
00079             // number of bunch crossing to be unpacked
00080             m_unpackBxInEvent(pSet.getParameter<int> ("UnpackBxInEvent")),
00081 
00082             // create GTFE, FDL, PSB cards once per producer
00083             // content will be reset whenever needed
00084 
00085             m_lowSkipBxInEvent(0), m_uppSkipBxInEvent(0),
00086 
00087             m_recordLength0(0), m_recordLength1(0),
00088 
00089             m_totalBxInEvent(0), m_verbosity(pSet.getUntrackedParameter<int> ("Verbosity", 0)),
00090 
00091             m_isDebugEnabled(edm::isDebugEnabled())
00092 
00093 {
00094 
00095     produces<L1GlobalTriggerReadoutRecord> ();
00096     produces<L1MuGMTReadoutCollection> ();
00097 
00098     produces<std::vector<L1MuRegionalCand> > ("DT");
00099     produces<std::vector<L1MuRegionalCand> > ("CSC");
00100     produces<std::vector<L1MuRegionalCand> > ("RPCb");
00101     produces<std::vector<L1MuRegionalCand> > ("RPCf");
00102     produces<std::vector<L1MuGMTCand> > ();
00103 
00104     // create GTFE, FDL, PSB cards once per producer
00105     // content will be reset whenever needed
00106     m_gtfeWord = new L1GtfeWord();
00107     m_gtFdlWord = new L1GtFdlWord();
00108     m_gtPsbWord = new L1GtPsbWord();
00109 
00110     if (m_verbosity && m_isDebugEnabled) {
00111 
00112         LogDebug("L1GlobalTriggerRawToDigi")
00113                 << "\nInput tag for DAQ GT record:             " << m_daqGtInputTag
00114                 << "\nFED Id for DAQ GT record:                " << m_daqGtFedId
00115                 << "\nMask for active boards (hex format):     " << std::hex
00116                 << std::setw(sizeof(m_activeBoardsMaskGt) * 2) << std::setfill('0')
00117                 << m_activeBoardsMaskGt
00118                 << std::dec << std::setfill(' ')
00119                 << "\nNumber of bunch crossing to be unpacked: "
00120                 << m_unpackBxInEvent << "\n"
00121                 << std::endl;
00122     }
00123 
00124     if ( ( m_unpackBxInEvent > 0 ) && ( ( m_unpackBxInEvent % 2 ) == 0 )) {
00125         m_unpackBxInEvent = m_unpackBxInEvent - 1;
00126 
00127         if (m_verbosity) {
00128             edm::LogInfo("L1GlobalTriggerRawToDigi")
00129                     << "\nWARNING: Number of bunch crossing to be unpacked rounded to: "
00130                     << m_unpackBxInEvent << "\n         The number must be an odd number!\n"
00131                     << std::endl;
00132         }
00133     }
00134 
00135 }

L1GlobalTriggerRawToDigi::~L1GlobalTriggerRawToDigi (  )  [virtual]

destructor

Definition at line 138 of file L1GlobaTriggerRawToDigi.cc.

References m_gtFdlWord, m_gtfeWord, and m_gtPsbWord.

00138                                                     {
00139 
00140     delete m_gtfeWord;
00141     delete m_gtFdlWord;
00142     delete m_gtPsbWord;
00143 
00144 }


Member Function Documentation

void L1GlobalTriggerRawToDigi::beginJob ( void   )  [private, virtual]

Definition at line 148 of file L1GlobaTriggerRawToDigi.cc.

00148                                         {
00149     // empty
00150 }

void L1GlobalTriggerRawToDigi::dumpFedRawData ( const unsigned char *  gtPtr,
int  gtSize,
std::ostream &  myCout 
) [private]

dump FED raw data

Definition at line 976 of file L1GlobaTriggerRawToDigi.cc.

References lat::endl(), i, LogDebug, LogTrace, L1GlobalTriggerReadoutSetup::UnitLength, and L1GlobalTriggerReadoutSetup::WordLength.

Referenced by produce().

00977                                                                     {
00978 
00979     LogDebug("L1GlobalTriggerRawToDigi") << "\nDump FED raw data.\n" << std::endl;
00980 
00981     int wLength = L1GlobalTriggerReadoutSetup::WordLength;
00982     int uLength = L1GlobalTriggerReadoutSetup::UnitLength;
00983 
00984     int gtWords = gtSize / uLength;
00985     LogTrace("L1GlobalTriggerRawToDigi") << "\nFED GT words (" << wLength << " bits):" << gtWords
00986             << "\n" << std::endl;
00987 
00988     const boost::uint64_t* payload =
00989             reinterpret_cast<boost::uint64_t*> (const_cast<unsigned char*> (gtPtr));
00990 
00991     for (unsigned int i = 0; i < gtSize / sizeof(boost::uint64_t); i++) {
00992         myCout << std::setw(4) << i << "  " << std::hex << std::setfill('0') << std::setw(16)
00993                 << payload[i] << std::dec << std::setfill(' ') << std::endl;
00994     }
00995 
00996 }

void L1GlobalTriggerRawToDigi::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 999 of file L1GlobaTriggerRawToDigi.cc.

00999                                       {
01000 
01001     // empty now
01002 }

void L1GlobalTriggerRawToDigi::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 153 of file L1GlobaTriggerRawToDigi.cc.

References L1GtfeWord::activeBoards(), L1GtfeWord::altNrBxBoard(), FEDRawData::data(), dumpFedRawData(), lat::endl(), FDL, edm::EventSetup::get(), edm::Event::getByLabel(), L1GtPsbWord::getSize(), L1GtfeWord::getSize(), L1GtFdlWord::getSize(), GMT, GTFE, edm::Handle< T >::isValid(), LogDebug, LogTrace, m_activeBoardsMaskGt, m_daqGtFedId, m_daqGtInputTag, m_gtFdlWord, m_gtfeWord, m_gtPsbWord, m_isDebugEnabled, m_lowSkipBxInEvent, m_recordLength0, m_recordLength1, m_totalBxInEvent, m_TriggerPtScale, m_TriggerScales, m_unpackBxInEvent, m_uppSkipBxInEvent, m_verbosity, max, L1GtFdlWord::print(), L1GtfeWord::print(), L1GtPsbWord::print(), edm::ESHandle< T >::product(), edm::Handle< T >::product(), PSB, edm::Event::put(), L1GtfeWord::recordLength(), L1GtfeWord::recordLength1(), L1GtFdlWord::reset(), L1GtPsbWord::reset(), L1GtfeWord::reset(), L1GtfeWord::setActiveBoards(), L1GtfeWord::setRecordLength(), L1GtfeWord::setRecordLength1(), FEDRawData::size(), TCS, TIM, L1GtFdlWord::unpack(), L1GtfeWord::unpack(), unpackGMT(), unpackHeader(), unpackPSB(), and unpackTrailer().

00153                                                                                      {
00154 
00155     // get records from EventSetup
00156 
00157     //  muon trigger scales
00158     edm::ESHandle<L1MuTriggerScales> trigscales_h;
00159     evSetup.get<L1MuTriggerScalesRcd> ().get(trigscales_h);
00160     m_TriggerScales = trigscales_h.product();
00161 
00162     edm::ESHandle<L1MuTriggerPtScale> trigptscale_h;
00163     evSetup.get<L1MuTriggerPtScaleRcd> ().get(trigptscale_h);
00164     m_TriggerPtScale = trigptscale_h.product();
00165 
00166     //  board maps
00167     edm::ESHandle<L1GtBoardMaps> l1GtBM;
00168     evSetup.get<L1GtBoardMapsRcd> ().get(l1GtBM);
00169 
00170     const std::vector<L1GtBoard> boardMaps = l1GtBM->gtBoardMaps();
00171     int boardMapsSize = boardMaps.size();
00172 
00173     typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
00174 
00175     // create an ordered vector for the GT DAQ record
00176     // header (pos 0 in record) and trailer (last position in record)
00177     // not included, as they are not in board list
00178     std::vector<L1GtBoard> gtRecordMap;
00179     gtRecordMap.reserve(boardMapsSize);
00180 
00181     for (int iPos = 0; iPos < boardMapsSize; ++iPos) {
00182         for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
00183 
00184             if (itBoard->gtPositionDaqRecord() == iPos) {
00185                 gtRecordMap.push_back(*itBoard);
00186                 break;
00187             }
00188 
00189         }
00190     }
00191 
00192     // raw collection
00193 
00194     edm::Handle<FEDRawDataCollection> fedHandle;
00195     iEvent.getByLabel(m_daqGtInputTag, fedHandle);
00196 
00197     if (!fedHandle.isValid()) {
00198         if (m_verbosity) {
00199             edm::LogWarning("L1GlobalTriggerRawToDigi")
00200                     << "\nWarning: FEDRawDataCollection with input tag " << m_daqGtInputTag
00201                     << "\nrequested in configuration, but not found in the event."
00202                     << "\nQuit unpacking this event" << std::endl;
00203         }
00204 
00205         std::auto_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(
00206                 new L1GlobalTriggerReadoutRecord());
00207 
00208         // produce also the GMT readout collection and set the reference in GT record
00209         std::auto_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection());
00210 
00211         std::auto_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<L1MuRegionalCand>);
00212         std::auto_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<L1MuRegionalCand>);
00213         std::auto_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<L1MuRegionalCand>);
00214         std::auto_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<L1MuRegionalCand>);
00215         std::auto_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
00216 
00217         // put empty records into event
00218 
00219         iEvent.put(gmtrc);
00220         iEvent.put(gtReadoutRecord);
00221 
00222         iEvent.put(DTCands, "DT");
00223         iEvent.put(CSCCands, "CSC");
00224         iEvent.put(RPCbCands, "RPCb");
00225         iEvent.put(RPCfCands, "RPCf");
00226         iEvent.put(GMTCands);
00227 
00228         return;
00229     }
00230 
00231     // retrieve data for Global Trigger FED (GT + GMT)
00232     const FEDRawData& raw = ( fedHandle.product() )->FEDData(m_daqGtFedId);
00233 
00234     int gtSize = raw.size();
00235 
00236     // get a const pointer to the beginning of the data buffer
00237     const unsigned char* ptrGt = raw.data();
00238 
00239     //
00240     if (m_verbosity && m_isDebugEnabled) {
00241 
00242         std::ostringstream myCoutStream;
00243         dumpFedRawData(ptrGt, gtSize, myCoutStream);
00244         LogTrace("L1GlobalTriggerRawToDigi") << "\n Size of raw data: " << gtSize << "\n"
00245                 << "\n Dump FEDRawData\n" << myCoutStream.str() << "\n" << std::endl;
00246 
00247     }
00248 
00249     // unpack header
00250     int headerSize = 8;
00251 
00252     FEDHeader cmsHeader(ptrGt);
00253     FEDTrailer cmsTrailer(ptrGt + gtSize - headerSize);
00254 
00255     unpackHeader(ptrGt, cmsHeader);
00256     ptrGt += headerSize; // advance with header size
00257 
00258     // unpack first GTFE to find the length of the record and the active boards
00259     // here GTFE assumed immediately after the header
00260 
00261     bool gtfeUnpacked = false;
00262 
00263     for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
00264 
00265         if (itBoard->gtBoardType() == GTFE) {
00266 
00267             // unpack GTFE
00268             if (itBoard->gtPositionDaqRecord() == 1) {
00269 
00270                 m_gtfeWord->unpack(ptrGt);
00271                 ptrGt += m_gtfeWord->getSize(); // advance with GTFE block size
00272                 gtfeUnpacked = true;
00273 
00274                 if (m_verbosity && m_isDebugEnabled) {
00275 
00276                     std::ostringstream myCoutStream;
00277                     m_gtfeWord->print(myCoutStream);
00278                     LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n" << std::endl;
00279                 }
00280 
00281                 // break the loop - GTFE was found
00282                 break;
00283 
00284             } else {
00285 
00286                 if (m_verbosity) {
00287                     edm::LogWarning("L1GlobalTriggerRawToDigi")
00288                             << "\nWarning: GTFE block found in raw data does not follow header."
00289                             << "\nAssumed start position of the block is wrong!"
00290                             << "\nQuit unpacking this event" << std::endl;
00291                 }
00292 
00293                 std::auto_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(
00294                         new L1GlobalTriggerReadoutRecord());
00295 
00296                 // produce also the GMT readout collection and set the reference in GT record
00297                 std::auto_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection());
00298 
00299                 std::auto_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<
00300                         L1MuRegionalCand>);
00301                 std::auto_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<
00302                         L1MuRegionalCand>);
00303                 std::auto_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<
00304                         L1MuRegionalCand>);
00305                 std::auto_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<
00306                         L1MuRegionalCand>);
00307                 std::auto_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
00308 
00309                 // put empty records into event
00310 
00311                 iEvent.put(gmtrc);
00312                 iEvent.put(gtReadoutRecord);
00313 
00314                 iEvent.put(DTCands, "DT");
00315                 iEvent.put(CSCCands, "CSC");
00316                 iEvent.put(RPCbCands, "RPCb");
00317                 iEvent.put(RPCfCands, "RPCf");
00318                 iEvent.put(GMTCands);
00319 
00320                 return;
00321             }
00322 
00323         }
00324     }
00325 
00326     // quit if no GTFE found
00327     if (!gtfeUnpacked) {
00328 
00329         if (m_verbosity) {
00330             edm::LogWarning("L1GlobalTriggerRawToDigi")
00331                     << "\nWarning: no GTFE block found in raw data."
00332                     << "\nCan not find the record length (BxInEvent) and the active boards!"
00333                     << "\nQuit unpacking this event" << std::endl;
00334         }
00335 
00336         std::auto_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(
00337                 new L1GlobalTriggerReadoutRecord());
00338 
00339         // produce also the GMT readout collection and set the reference in GT record
00340         std::auto_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection());
00341 
00342         std::auto_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<L1MuRegionalCand>);
00343         std::auto_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<L1MuRegionalCand>);
00344         std::auto_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<L1MuRegionalCand>);
00345         std::auto_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<L1MuRegionalCand>);
00346         std::auto_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
00347 
00348         // put empty records into event
00349 
00350         iEvent.put(gmtrc);
00351         iEvent.put(gtReadoutRecord);
00352 
00353         iEvent.put(DTCands, "DT");
00354         iEvent.put(CSCCands, "CSC");
00355         iEvent.put(RPCbCands, "RPCb");
00356         iEvent.put(RPCfCands, "RPCf");
00357         iEvent.put(GMTCands);
00358 
00359         return;
00360     }
00361 
00362     // life normal here, GTFE found
00363 
00364     // get list of active blocks
00365     // blocks not active are not written to the record
00366     boost::uint16_t activeBoardsGtInitial = m_gtfeWord->activeBoards();
00367     boost::uint16_t altNrBxBoardInitial = m_gtfeWord->altNrBxBoard();
00368 
00369     // mask some boards, if needed
00370     boost::uint16_t activeBoardsGt = activeBoardsGtInitial & m_activeBoardsMaskGt;
00371     m_gtfeWord->setActiveBoards(activeBoardsGt);
00372 
00373     if (m_verbosity) {
00374         LogDebug("L1GlobalTriggerRawToDigi") << "\nActive boards before masking: 0x" << std::hex
00375                 << std::setw(sizeof ( activeBoardsGtInitial ) * 2) << std::setfill('0')
00376                 << activeBoardsGtInitial << std::dec << std::setfill(' ')
00377                 << "\nActive boards after masking:  0x" << std::hex << std::setw(
00378                 sizeof ( activeBoardsGt ) * 2) << std::setfill('0') << activeBoardsGt << std::dec
00379                 << std::setfill(' ') << " \n" << std::endl;
00380     }
00381 
00382     // loop over other blocks in the raw record, count them if they are active
00383 
00384     int numberGtfeBoards = 0;
00385     int numberFdlBoards = 0;
00386     int numberPsbBoards = 0;
00387     int numberGmtBoards = 0;
00388     int numberTcsBoards = 0;
00389     int numberTimBoards = 0;
00390 
00391     for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
00392 
00393         int iActiveBit = itBoard->gtBitDaqActiveBoards();
00394         bool activeBoardToUnpack = false;
00395 
00396         if (iActiveBit >= 0) {
00397             activeBoardToUnpack = activeBoardsGt & ( 1 << iActiveBit );
00398         } else {
00399             // board not in the ActiveBoards for the record
00400             continue;
00401         }
00402 
00403         if (activeBoardToUnpack) {
00404 
00405             switch (itBoard->gtBoardType()) {
00406                 case GTFE: {
00407                     numberGtfeBoards++;
00408                 }
00409 
00410                     break;
00411                 case FDL: {
00412                     numberFdlBoards++;
00413                 }
00414 
00415                     break;
00416                 case PSB: {
00417                     numberPsbBoards++;
00418                 }
00419 
00420                     break;
00421                 case GMT: {
00422                     numberGmtBoards++;
00423                 }
00424 
00425                     break;
00426                 case TCS: {
00427                     numberTcsBoards++;
00428                 }
00429 
00430                     break;
00431                 case TIM: {
00432                     numberTimBoards++;
00433                 }
00434 
00435                     break;
00436                 default: {
00437                     // do nothing, all blocks are given in GtBoardType enum
00438                     if (m_verbosity) {
00439                         LogDebug("L1GlobalTriggerRawToDigi") << "\nBoard of type "
00440                                 << itBoard->gtBoardType() << " not expected  in record.\n"
00441                                 << std::endl;
00442                     }
00443                 }
00444 
00445                     break;
00446             }
00447         }
00448 
00449     }
00450 
00451     // produce the L1GlobalTriggerReadoutRecord now, after we found the maximum number of
00452     // BxInEvent the record has and how many boards are active (it is just reserving space
00453     // for vectors)
00454     //LogDebug("L1GlobalTriggerRawToDigi")
00455     //<< "\nL1GlobalTriggerRawToDigi: producing L1GlobalTriggerReadoutRecord\n"
00456     //<< "\nL1GlobalTriggerRawToDigi: producing L1MuGMTReadoutCollection;\n"
00457     //<< std::endl;
00458 
00459     // get number of Bx in the event from GTFE block corresponding to alternative 0 and 1 in
00460     m_recordLength0 = m_gtfeWord->recordLength();
00461     m_recordLength1 = m_gtfeWord->recordLength1();
00462 
00463     int maxBxInEvent = std::max(m_recordLength0, m_recordLength1);
00464 
00465 
00466     std::auto_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(new L1GlobalTriggerReadoutRecord(
00467             maxBxInEvent, numberFdlBoards, numberPsbBoards));
00468 
00469     // produce also the GMT readout collection and set the reference in GT record
00470     std::auto_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection(maxBxInEvent));
00471 
00472     //edm::RefProd<L1MuGMTReadoutCollection> refProdMuGMT = iEvent.getRefBeforePut<
00473     //        L1MuGMTReadoutCollection> ();
00474 
00475     //if (m_verbosity) {
00476     //    LogDebug("L1GlobalTriggerRawToDigi")
00477     //            << "\nL1GlobalTriggerRawToDigi: set L1MuGMTReadoutCollection RefProd"
00478     //            << " in L1GlobalTriggerReadoutRecord.\n" << std::endl;
00479     //}
00480     //gtReadoutRecord->setMuCollectionRefProd(refProdMuGMT);
00481 
00482 
00483     // ... then unpack modules other than GTFE, if requested
00484 
00485     for (CItBoardMaps itBoard = gtRecordMap.begin(); itBoard != gtRecordMap.end(); ++itBoard) {
00486 
00487         int iActiveBit = itBoard->gtBitDaqActiveBoards();
00488 
00489         bool activeBoardToUnpack = false;
00490         bool activeBoardInitial = false;
00491 
00492         int altNrBxBoardVal = -1;
00493 
00494         if (iActiveBit >= 0) {
00495             activeBoardInitial = activeBoardsGtInitial & ( 1 << iActiveBit );
00496             activeBoardToUnpack = activeBoardsGt & ( 1 << iActiveBit );
00497 
00498             altNrBxBoardVal = (altNrBxBoardInitial & ( 1 << iActiveBit )) >> iActiveBit;
00499 
00500             if (altNrBxBoardVal == 1) {
00501                 m_totalBxInEvent = m_recordLength1;
00502             } else if (altNrBxBoardVal == 0) {
00503                 m_totalBxInEvent = m_recordLength0;
00504             } else {
00505                 if (m_verbosity) {
00506                     edm::LogWarning("L1GlobalTriggerRawToDigi")
00507                             << "\n\nWARNING: Wrong value altNrBxBoardVal = " << altNrBxBoardVal
00508                             << " for board " << std::hex << ( itBoard->gtBoardId() ) << std::dec
00509                             << "\n  iActiveBit =            " << iActiveBit
00510                             << "\n  altNrBxBoardInitial = 0x" << std::hex << altNrBxBoardInitial <<  std::dec
00511                             << "\n  activeBoardsGt =      0x" << std::hex << activeBoardsGt <<  std::dec
00512                             << "\n  activeBoardInitial =    " << activeBoardInitial
00513                             << "\n  activeBoardToUnpack =   " << activeBoardToUnpack
00514                             << "\n Set altNrBxBoardVal tentatively to "
00515                             << m_recordLength0 << "\n Job may crash or produce wrong results!\n\n"
00516                             << std::endl;
00517                 }
00518 
00519                 m_totalBxInEvent = m_recordLength0;
00520             }
00521 
00522             // number of BX required to be unpacked
00523 
00524             if (m_unpackBxInEvent > m_totalBxInEvent) {
00525                 if (m_verbosity) {
00526                     LogDebug("L1GlobalTriggerRawToDigi")
00527                             << "\nWARNING: Number of available bunch crosses for board"
00528                             << ( itBoard->gtBoardId() ) << " in the record ( " << m_totalBxInEvent
00529                             << " ) \n is smaller than the number of bunch crosses requested to be unpacked ("
00530                             << m_unpackBxInEvent << " )!!! \n         Unpacking only "
00531                             << m_totalBxInEvent << " bunch crosses.\n" << std::endl;
00532                 }
00533 
00534                 m_lowSkipBxInEvent = 0;
00535                 m_uppSkipBxInEvent = m_totalBxInEvent;
00536 
00537             } else if (m_unpackBxInEvent < 0) {
00538 
00539                 m_lowSkipBxInEvent = 0;
00540                 m_uppSkipBxInEvent = m_totalBxInEvent;
00541 
00542                 if (m_verbosity) {
00543                     LogDebug("L1GlobalTriggerRawToDigi") << "\nUnpacking all " << m_totalBxInEvent
00544                             << " bunch crosses available." << "\n" << std::endl;
00545                 }
00546 
00547 
00548             } else if (m_unpackBxInEvent == 0) {
00549 
00550                 m_lowSkipBxInEvent = m_totalBxInEvent;
00551                 m_uppSkipBxInEvent = m_totalBxInEvent;
00552 
00553                 if (m_verbosity) {
00554                     LogDebug("L1GlobalTriggerRawToDigi")
00555                             << "\nNo bxInEvent required to be unpacked from " << m_totalBxInEvent
00556                             << " bunch crosses available." << "\n" << std::endl;
00557                 }
00558 
00559                 // change RecordLength
00560                 // cast int to boost::uint16_t (there are normally 3 or 5 BxInEvent)
00561                 m_gtfeWord->setRecordLength(static_cast<boost::uint16_t> (m_unpackBxInEvent));
00562                 m_gtfeWord->setRecordLength1(static_cast<boost::uint16_t> (m_unpackBxInEvent));
00563 
00564             } else {
00565 
00566                 m_lowSkipBxInEvent = ( m_totalBxInEvent - m_unpackBxInEvent ) / 2;
00567                 m_uppSkipBxInEvent = m_totalBxInEvent - m_lowSkipBxInEvent;
00568 
00569                 if (m_verbosity) {
00570                     LogDebug("L1GlobalTriggerRawToDigi") << "\nUnpacking " << m_unpackBxInEvent
00571                             << " bunch crosses from " << m_totalBxInEvent
00572                             << " bunch crosses available." << "\n" << std::endl;
00573                 }
00574 
00575                 // change RecordLength
00576                 // cast int to boost::uint16_t (there are normally 3 or 5 BxInEvent)
00577                 m_gtfeWord->setRecordLength(static_cast<boost::uint16_t> (m_unpackBxInEvent));
00578                 m_gtfeWord->setRecordLength1(static_cast<boost::uint16_t> (m_unpackBxInEvent));
00579 
00580             }
00581 
00582         } else {
00583             // board not in the ActiveBoards for the record
00584             continue;
00585         }
00586 
00587         if (!activeBoardInitial) {
00588             if (m_verbosity) {
00589                 LogDebug("L1GlobalTriggerRawToDigi") << "\nBoard of type "
00590                         << itBoard->gtBoardName() << " with index " << itBoard->gtBoardIndex()
00591                         << " not active initially in raw data.\n" << std::endl;
00592             }
00593             continue;
00594         }
00595 
00596         // active board initially, could unpack it
00597         switch (itBoard->gtBoardType()) {
00598 
00599             case FDL: {
00600                 for (int iFdl = 0; iFdl < m_totalBxInEvent; ++iFdl) {
00601 
00602                     // unpack only if requested, otherwise skip it
00603                     if (activeBoardToUnpack) {
00604 
00605                         // unpack only bxInEvent requested, otherwise skip it
00606                         if ( ( iFdl >= m_lowSkipBxInEvent ) && ( iFdl < m_uppSkipBxInEvent )) {
00607 
00608                             m_gtFdlWord->unpack(ptrGt);
00609 
00610                             // add FDL block to GT readout record
00611                             gtReadoutRecord->setGtFdlWord(*m_gtFdlWord);
00612 
00613                             if (m_verbosity && m_isDebugEnabled) {
00614 
00615                                 std::ostringstream myCoutStream;
00616                                 m_gtFdlWord->print(myCoutStream);
00617                                 LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n"
00618                                         << std::endl;
00619                             }
00620 
00621                             // ... and reset it
00622                             m_gtFdlWord->reset();
00623                         }
00624 
00625                     }
00626 
00627                     ptrGt += m_gtFdlWord->getSize(); // advance with FDL block size
00628 
00629                 }
00630             }
00631 
00632                 break;
00633             case PSB: {
00634                 for (int iPsb = 0; iPsb < m_totalBxInEvent; ++iPsb) {
00635 
00636                     // unpack only if requested, otherwise skip it
00637                     if (activeBoardToUnpack) {
00638 
00639                         // unpack only bxInEvent requested, otherwise skip it
00640                         if ( ( iPsb >= m_lowSkipBxInEvent ) && ( iPsb < m_uppSkipBxInEvent )) {
00641 
00642                             unpackPSB(evSetup, ptrGt, *m_gtPsbWord);
00643 
00644                             // add PSB block to GT readout record
00645                             gtReadoutRecord->setGtPsbWord(*m_gtPsbWord);
00646 
00647                             if (m_verbosity && m_isDebugEnabled) {
00648 
00649                                 std::ostringstream myCoutStream;
00650                                 m_gtPsbWord->print(myCoutStream);
00651                                 LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n"
00652                                         << std::endl;
00653                             }
00654 
00655                             // ... and reset it
00656                             m_gtPsbWord->reset();
00657                         }
00658 
00659                     }
00660 
00661                     ptrGt += m_gtPsbWord->getSize(); // advance with PSB block size
00662 
00663                 }
00664             }
00665                 break;
00666             case GMT: {
00667 
00668                 // unpack only if requested, otherwise skip it
00669                 if (activeBoardToUnpack) {
00670                     unpackGMT(ptrGt, gmtrc, iEvent);
00671                 }
00672 
00673                 // 17*64/8 TODO FIXME ask Ivan for a getSize() function for GMT record
00674                 unsigned int gmtRecordSize = 136;
00675                 unsigned int gmtCollSize = m_totalBxInEvent * gmtRecordSize;
00676 
00677                 ptrGt += gmtCollSize; // advance with GMT block size
00678             }
00679                 break;
00680             default: {
00681                 // do nothing, all blocks are given in GtBoardType enum
00682                 if (m_verbosity) {
00683 
00684                     LogDebug("L1GlobalTriggerRawToDigi") << "\nBoard of type "
00685                             << itBoard->gtBoardType() << " not expected  in record.\n" << std::endl;
00686                 }
00687             }
00688                 break;
00689 
00690         }
00691 
00692     }
00693 
00694     // add GTFE block to GT readout record, after updating active boards and record length
00695 
00696     gtReadoutRecord->setGtfeWord(*m_gtfeWord);
00697 
00698     // ... and reset it
00699     m_gtfeWord->reset();
00700 
00701 
00702 
00703     // unpack trailer
00704     unpackTrailer(ptrGt, cmsTrailer);
00705 
00706     if (m_verbosity && m_isDebugEnabled) {
00707         std::ostringstream myCoutStream;
00708         gtReadoutRecord->print(myCoutStream);
00709         LogTrace("L1GlobalTriggerRawToDigi")
00710                 << "\n The following L1 GT DAQ readout record was unpacked.\n"
00711                 << myCoutStream.str() << "\n" << std::endl;
00712     }
00713 
00714     // put records into event
00715 
00716     iEvent.put(gmtrc);
00717     iEvent.put(gtReadoutRecord);
00718 
00719 }

void L1GlobalTriggerRawToDigi::unpackGMT ( const unsigned char *  chp,
std::auto_ptr< L1MuGMTReadoutCollection > &  gmtrc,
edm::Event iEvent 
) [private]

unpack the GMT record

Definition at line 813 of file L1GlobaTriggerRawToDigi.cc.

References L1MuRegionalCand::empty(), L1MuGMTCand::empty(), lat::endl(), L1MuRegionalCand::eta_packed(), L1MuGMTCand::etaIndex(), L1MuScale::getCenter(), L1MuTriggerScales::getGMTEtaScale(), L1MuScale::getLowEdge(), L1MuTriggerScales::getPhiScale(), L1MuTriggerPtScale::getPtScale(), L1MuTriggerScales::getRegionalEtaScale(), LogTrace, m_lowSkipBxInEvent, m_totalBxInEvent, m_TriggerPtScale, m_TriggerScales, m_uppSkipBxInEvent, p, L1MuRegionalCand::phi_packed(), L1MuGMTCand::phiIndex(), L1MuRegionalCand::pt_packed(), L1MuGMTCand::ptIndex(), edm::Event::put(), L1MuGMTReadoutRecord::setBCERR(), L1MuGMTReadoutRecord::setBxInEvent(), L1MuGMTReadoutRecord::setBxNr(), L1MuGMTCand::setEtaValue(), L1MuRegionalCand::setEtaValue(), L1MuGMTReadoutRecord::setEvNr(), L1MuGMTReadoutRecord::setGMTBrlCand(), L1MuGMTReadoutRecord::setGMTCand(), L1MuGMTReadoutRecord::setGMTFwdCand(), L1MuGMTReadoutRecord::setInputCand(), L1MuGMTCand::setPhiValue(), L1MuRegionalCand::setPhiValue(), L1MuGMTCand::setPtValue(), L1MuRegionalCand::setPtValue(), L1MuRegionalCand::setType(), and L1MuRegionalCand::type_idx().

Referenced by produce().

00814                                                             {
00815 
00816     //LogDebug("L1GlobalTriggerRawToDigi")
00817     //<< "\nUnpacking GMT collection.\n"
00818     //<< std::endl;
00819 
00820     // 17*64/2 TODO FIXME ask Ivan for a getSize() function for GMT record
00821     const unsigned int gmtRecordSize32 = 34;
00822 
00823     std::auto_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<L1MuRegionalCand>);
00824     std::auto_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<L1MuRegionalCand>);
00825     std::auto_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<L1MuRegionalCand>);
00826     std::auto_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<L1MuRegionalCand>);
00827     std::auto_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
00828 
00829     const unsigned* p = (const unsigned*) chp;
00830 
00831     // min Bx's in the event, computed after m_totalBxInEvent is obtained from GTFE block
00832     // assume symmetrical number of BX around L1Accept
00833     int iBxInEvent = ( m_totalBxInEvent + 1 ) / 2 - m_totalBxInEvent;
00834 
00835     for (int iGmtRec = 0; iGmtRec < m_totalBxInEvent; ++iGmtRec) {
00836 
00837         // unpack only bxInEvent requested, otherwise skip it
00838         if ( ( iGmtRec >= m_lowSkipBxInEvent ) && ( iGmtRec < m_uppSkipBxInEvent )) {
00839 
00840             // Dump the block
00841             const boost::uint64_t* bp =
00842                     reinterpret_cast<boost::uint64_t*> (const_cast<unsigned*> (p));
00843             for (int iWord = 0; iWord < 17; iWord++) {
00844                 LogTrace("L1GlobalTriggerRawToDigi") << std::setw(4) << iWord << "  " << std::hex
00845                         << std::setfill('0') << std::setw(16) << *bp++ << std::dec << std::setfill(
00846                         ' ') << std::endl;
00847             }
00848 
00849             L1MuGMTReadoutRecord gmtrr(iBxInEvent);
00850 
00851             gmtrr.setEvNr( ( *p ) & 0xffffff);
00852             gmtrr.setBCERR( ( ( *p ) >> 24 ) & 0xff);
00853             p++;
00854 
00855             gmtrr.setBxNr( ( *p ) & 0xfff);
00856             if ( ( ( *p ) >> 15 ) & 1) {
00857                 gmtrr.setBxInEvent( ( ( ( *p ) >> 12 ) & 7 ) - 8);
00858             } else {
00859                 gmtrr.setBxInEvent( ( ( ( *p ) >> 12 ) & 7 ));
00860             }
00861             // to do: check here the block length and the board id
00862             p++;
00863 
00864             for (int im = 0; im < 16; im++) {
00865                 // flip the pt and quality bits -- this should better be done by GMT input chips
00866                 unsigned waux = *p++;
00867                 waux = ( waux & 0xffff00ff ) | ( ( ~waux ) & 0x0000ff00 );
00868                 L1MuRegionalCand cand(waux, iBxInEvent);
00869                 // fix the type assignment (csc=2, rpcb=1) -- should be done by GMT input chips
00870                 if (im >= 4 && im < 8) cand.setType(1);
00871                 if (im >= 8 && im < 12) cand.setType(2);
00872                 cand.setPhiValue(m_TriggerScales->getPhiScale()->getLowEdge(cand.phi_packed()));
00873                 cand.setEtaValue(m_TriggerScales->getRegionalEtaScale(cand.type_idx())->getCenter(
00874                         cand.eta_packed()));
00875                 cand.setPtValue(m_TriggerPtScale->getPtScale()->getLowEdge(cand.pt_packed()));
00876                 gmtrr.setInputCand(im, cand);
00877                 if (!cand.empty()) {
00878                     if (im < 4) DTCands->push_back(cand);
00879                     if (im >= 4 && im < 8) RPCbCands->push_back(cand);
00880                     if (im >= 8 && im < 12) CSCCands->push_back(cand);
00881                     if (im >= 12) RPCfCands->push_back(cand);
00882                 }
00883             }
00884 
00885             unsigned char* prank = (unsigned char*) ( p + 12 );
00886 
00887             for (int im = 0; im < 12; im++) {
00888                 unsigned waux = *p++;
00889                 unsigned raux = im < 8 ? *prank++ : 0; // only fwd and brl cands have valid rank
00890                 L1MuGMTExtendedCand cand(waux, raux, iBxInEvent);
00891                 cand.setPhiValue(m_TriggerScales->getPhiScale()->getLowEdge(cand.phiIndex()));
00892                 cand.setEtaValue(m_TriggerScales->getGMTEtaScale()->getCenter(cand.etaIndex()));
00893                 cand.setPtValue(m_TriggerPtScale->getPtScale()->getLowEdge(cand.ptIndex()));
00894                 if (im < 4)
00895                     gmtrr.setGMTBrlCand(im, cand);
00896                 else if (im < 8)
00897                     gmtrr.setGMTFwdCand(im - 4, cand);
00898                 else {
00899                     gmtrr.setGMTCand(im - 8, cand);
00900                     if (!cand.empty()) GMTCands->push_back(cand);
00901                 }
00902             }
00903 
00904             // skip the two sort rank words and two chip BX words
00905             p += 4;
00906 
00907             gmtrc->addRecord(gmtrr);
00908 
00909         } else {
00910             // increase the pointer with the GMT record size
00911             p += gmtRecordSize32;
00912         }
00913 
00914         // increase the BxInEvent number
00915         iBxInEvent++;
00916 
00917     }
00918 
00919     iEvent.put(DTCands, "DT");
00920     iEvent.put(CSCCands, "CSC");
00921     iEvent.put(RPCbCands, "RPCb");
00922     iEvent.put(RPCfCands, "RPCf");
00923     iEvent.put(GMTCands);
00924 
00925 }

void L1GlobalTriggerRawToDigi::unpackHeader ( const unsigned char *  gtPtr,
FEDHeader cmsHeader 
) [private]

block unpackers

unpack header

Definition at line 722 of file L1GlobaTriggerRawToDigi.cc.

References FEDHeader::bxID(), lat::endl(), LogDebug, FEDHeader::lvl1ID(), m_isDebugEnabled, m_verbosity, FEDHeader::moreHeaders(), FEDHeader::sourceID(), FEDHeader::triggerType(), and FEDHeader::version().

Referenced by produce().

00722                                                                                             {
00723 
00724     // TODO  if needed in another format
00725 
00726     // print the header info
00727     if (m_verbosity && m_isDebugEnabled) {
00728 
00729         const boost::uint64_t* payload =
00730                 reinterpret_cast<boost::uint64_t*> (const_cast<unsigned char*> (gtPtr));
00731 
00732         std::ostringstream myCoutStream;
00733 
00734         // one word only
00735         int iWord = 0;
00736 
00737         myCoutStream << std::setw(4) << iWord << "  " << std::hex << std::setfill('0')
00738                 << std::setw(16) << payload[iWord] << std::dec << std::setfill(' ') << "\n"
00739                 << std::endl;
00740 
00741         myCoutStream << "  Event_type:  " << std::hex << " hex: " << "     " << std::setw(1)
00742                 << std::setfill('0') << cmsHeader.triggerType() << std::setfill(' ') << std::dec
00743                 << " dec: " << cmsHeader.triggerType() << std::endl;
00744 
00745         myCoutStream << "  LVL1_Id:     " << std::hex << " hex: " << "" << std::setw(6)
00746                 << std::setfill('0') << cmsHeader.lvl1ID() << std::setfill(' ') << std::dec
00747                 << " dec: " << cmsHeader.lvl1ID() << std::endl;
00748 
00749         myCoutStream << "  BX_Id:       " << std::hex << " hex: " << "   " << std::setw(3)
00750                 << std::setfill('0') << cmsHeader.bxID() << std::setfill(' ') << std::dec
00751                 << " dec: " << cmsHeader.bxID() << std::endl;
00752 
00753         myCoutStream << "  Source_Id:   " << std::hex << " hex: " << "   " << std::setw(3)
00754                 << std::setfill('0') << cmsHeader.sourceID() << std::setfill(' ') << std::dec
00755                 << " dec: " << cmsHeader.sourceID() << std::endl;
00756 
00757         myCoutStream << "  FOV:         " << std::hex << " hex: " << "     " << std::setw(1)
00758                 << std::setfill('0') << cmsHeader.version() << std::setfill(' ') << std::dec
00759                 << " dec: " << cmsHeader.version() << std::endl;
00760 
00761         myCoutStream << "  H:           " << std::hex << " hex: " << "     " << std::setw(1)
00762                 << std::setfill('0') << cmsHeader.moreHeaders() << std::setfill(' ') << std::dec
00763                 << " dec: " << cmsHeader.moreHeaders() << std::endl;
00764 
00765         LogDebug("L1GlobalTriggerRawToDigi") << "\n CMS Header \n" << myCoutStream.str() << "\n"
00766                 << std::endl;
00767 
00768     }
00769 
00770 }

void L1GlobalTriggerRawToDigi::unpackPSB ( const edm::EventSetup evSetup,
const unsigned char *  psbPtr,
L1GtPsbWord psbWord 
) [private]

unpack PSB blocks unpacking is done in PSB class format methods are given later to translate from the PSB format to the physical input of the PSB

Definition at line 774 of file L1GlobaTriggerRawToDigi.cc.

References lat::endl(), L1GtPsbWord::getSize(), LogTrace, L1GtPsbWord::setAData(), L1GtPsbWord::setBData(), L1GtPsbWord::setBoardId(), L1GtPsbWord::setBxInEvent(), L1GtPsbWord::setBxNr(), L1GtPsbWord::setEventNr(), L1GtPsbWord::setLocalBxNr(), and L1GlobalTriggerReadoutSetup::UnitLength.

Referenced by produce().

00775                                                                                          {
00776 
00777     //LogDebug("L1GlobalTriggerRawToDigi")
00778     //<< "\nUnpacking PSB block.\n"
00779     //<< std::endl;
00780 
00781     int uLength = L1GlobalTriggerReadoutSetup::UnitLength;
00782 
00783     int psbSize = psbWord.getSize();
00784     int psbWords = psbSize / uLength;
00785 
00786     const boost::uint64_t* payload =
00787             reinterpret_cast<boost::uint64_t*> (const_cast<unsigned char*> (psbPtr));
00788 
00789     for (int iWord = 0; iWord < psbWords; ++iWord) {
00790 
00791         // fill PSB
00792         // the second argument must match the word index defined in L1GtPsbWord class
00793 
00794         psbWord.setBoardId(payload[iWord], iWord);
00795         psbWord.setBxInEvent(payload[iWord], iWord);
00796         psbWord.setBxNr(payload[iWord], iWord);
00797         psbWord.setEventNr(payload[iWord], iWord);
00798 
00799         psbWord.setAData(payload[iWord], iWord);
00800         psbWord.setBData(payload[iWord], iWord);
00801 
00802         psbWord.setLocalBxNr(payload[iWord], iWord);
00803 
00804         LogTrace("L1GlobalTriggerRawToDigi") << std::setw(4) << iWord << "  " << std::hex
00805                 << std::setfill('0') << std::setw(16) << payload[iWord] << std::dec
00806                 << std::setfill(' ') << std::endl;
00807 
00808     }
00809 
00810 }

void L1GlobalTriggerRawToDigi::unpackTrailer ( const unsigned char *  trlPtr,
FEDTrailer cmsTrailer 
) [private]

unpack trailer word

Definition at line 929 of file L1GlobaTriggerRawToDigi.cc.

References FEDTrailer::crc(), lat::endl(), FEDTrailer::evtStatus(), FEDTrailer::lenght(), LogDebug, m_isDebugEnabled, m_verbosity, FEDTrailer::moreTrailers(), and FEDTrailer::ttsBits().

Referenced by produce().

00929                                                                                                 {
00930 
00931     // TODO  if needed in another format
00932 
00933     // print the trailer info
00934     if (m_verbosity && m_isDebugEnabled) {
00935 
00936         const boost::uint64_t* payload =
00937                 reinterpret_cast<boost::uint64_t*> (const_cast<unsigned char*> (trlPtr));
00938 
00939         std::ostringstream myCoutStream;
00940 
00941         // one word only
00942         int iWord = 0;
00943 
00944         myCoutStream << std::setw(4) << iWord << "  " << std::hex << std::setfill('0')
00945                 << std::setw(16) << payload[iWord] << std::dec << std::setfill(' ') << "\n"
00946                 << std::endl;
00947 
00948         myCoutStream << "  Event_length:  " << std::hex << " hex: " << "" << std::setw(6)
00949                 << std::setfill('0') << cmsTrailer.lenght() << std::setfill(' ') << std::dec
00950                 << " dec: " << cmsTrailer.lenght() << std::endl;
00951 
00952         myCoutStream << "  CRC:           " << std::hex << " hex: " << "  " << std::setw(4)
00953                 << std::setfill('0') << cmsTrailer.crc() << std::setfill(' ') << std::dec
00954                 << " dec: " << cmsTrailer.crc() << std::endl;
00955 
00956         myCoutStream << "  Event_status:  " << std::hex << " hex: " << "    " << std::setw(2)
00957                 << std::setfill('0') << cmsTrailer.evtStatus() << std::setfill(' ') << std::dec
00958                 << " dec: " << cmsTrailer.evtStatus() << std::endl;
00959 
00960         myCoutStream << "  TTS_bits:      " << std::hex << " hex: " << "     " << std::setw(1)
00961                 << std::setfill('0') << cmsTrailer.ttsBits() << std::setfill(' ') << std::dec
00962                 << " dec: " << cmsTrailer.ttsBits() << std::endl;
00963 
00964         myCoutStream << "  More trailers: " << std::hex << " hex: " << "     " << std::setw(1)
00965                 << std::setfill('0') << cmsTrailer.moreTrailers() << std::setfill(' ') << std::dec
00966                 << " dec: " << cmsTrailer.moreTrailers() << std::endl;
00967 
00968         LogDebug("L1GlobalTriggerRawToDigi") << "\n CMS Trailer \n" << myCoutStream.str() << "\n"
00969                 << std::endl;
00970 
00971     }
00972 
00973 }


Member Data Documentation

boost::uint16_t L1GlobalTriggerRawToDigi::m_activeBoardsMaskGt [private]

mask for active boards

Definition at line 105 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), and produce().

int L1GlobalTriggerRawToDigi::m_daqGtFedId [private]

FED Id for GT DAQ record default value defined in DataFormats/FEDRawData/src/FEDNumbering.cc.

Definition at line 102 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), and produce().

edm::InputTag L1GlobalTriggerRawToDigi::m_daqGtInputTag [private]

input tags for GT DAQ record

Definition at line 98 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), and produce().

L1GtFdlWord* L1GlobalTriggerRawToDigi::m_gtFdlWord [private]

Definition at line 95 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), produce(), and ~L1GlobalTriggerRawToDigi().

L1GtfeWord* L1GlobalTriggerRawToDigi::m_gtfeWord [private]

Definition at line 93 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), produce(), and ~L1GlobalTriggerRawToDigi().

L1GtPsbWord* L1GlobalTriggerRawToDigi::m_gtPsbWord [private]

Definition at line 94 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), produce(), and ~L1GlobalTriggerRawToDigi().

bool L1GlobalTriggerRawToDigi::m_isDebugEnabled [private]

Definition at line 138 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), produce(), unpackHeader(), and unpackTrailer().

int L1GlobalTriggerRawToDigi::m_lowSkipBxInEvent [private]

lowest bxInEvent to be unpacked in the event assume symmetrical number of BX around L1Accept

Definition at line 112 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce(), and unpackGMT().

int L1GlobalTriggerRawToDigi::m_recordLength0 [private]

total Bx's in the event, obtained from GTFE block

corresponding to alternative 0 in altNrBxBoard()

Definition at line 121 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce().

int L1GlobalTriggerRawToDigi::m_recordLength1 [private]

corresponding to alternative 1 in altNrBxBoard()

Definition at line 124 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce().

int L1GlobalTriggerRawToDigi::m_totalBxInEvent [private]

number of Bx for a board, obtained from GTFE block (record length & alternative)

Definition at line 127 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce(), and unpackGMT().

const L1MuTriggerPtScale* L1GlobalTriggerRawToDigi::m_TriggerPtScale [private]

Definition at line 132 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce(), and unpackGMT().

const L1MuTriggerScales* L1GlobalTriggerRawToDigi::m_TriggerScales [private]

muon trigger scales to convert unpacked data into physical quantities

Definition at line 131 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce(), and unpackGMT().

int L1GlobalTriggerRawToDigi::m_unpackBxInEvent [private]

Definition at line 108 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), and produce().

int L1GlobalTriggerRawToDigi::m_uppSkipBxInEvent [private]

upper bxInEvent to be unpacked in the event assume symmetrical number of BX around L1Accept

Definition at line 116 of file L1GlobalTriggerRawToDigi.h.

Referenced by produce(), and unpackGMT().

int L1GlobalTriggerRawToDigi::m_verbosity [private]

verbosity level

Definition at line 137 of file L1GlobalTriggerRawToDigi.h.

Referenced by L1GlobalTriggerRawToDigi(), produce(), unpackHeader(), and unpackTrailer().


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