Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:37

0001 /*--------------------------------------------------------------*/
0002 /* DCC TCC BLOCK CLASS                                          */
0003 /*                                                              */
0004 /* Author : N.Almeida (LIP)  Date   : 30/05/2005                */
0005 /*--------------------------------------------------------------*/
0006 #ifndef DCCTBTCCBLOCK_HH
0007 #define DCCTBTCCBLOCK_HH
0008 
0009 #include <iostream>  //STL
0010 #include <string>
0011 #include <vector>
0012 #include <map>
0013 #include <utility>
0014 
0015 #include "DCCBlockPrototype.h"  //DATA DECODER
0016 #include "DCCDataParser.h"
0017 #include "DCCDataMapper.h"
0018 #include "DCCEventBlock.h"
0019 
0020 class DCCTBEventBlock;
0021 class DCCTBDataParser;
0022 
0023 class DCCTBTCCBlock : public DCCTBBlockPrototype {
0024 public:
0025   /**
0026      Class constructor
0027   */
0028   DCCTBTCCBlock(DCCTBEventBlock* dccBlock,
0029                 DCCTBDataParser* parser,
0030                 const uint32_t* buffer,
0031                 uint32_t numbBytes,
0032                 uint32_t wordsToEnd,
0033                 uint32_t wordEventOffset,
0034                 uint32_t expectedId);
0035 
0036   std::vector<std::pair<int, bool> > triggerSamples();
0037 
0038   std::vector<int> triggerFlags();
0039 
0040 protected:
0041   /**
0042      Checks header's data
0043   */
0044   void dataCheck();
0045 
0046   /**
0047      Adds a new TCC block
0048   */
0049   using DCCTBBlockPrototype::increment;
0050   void increment(uint32_t numb);
0051 
0052   /**
0053      Define TCC block fields
0054      BXMASK (mask for BX, 12bit)
0055      L1MASK (mask for LV1, 12 bit)
0056      BPOSITION_BLOCKID (bit position for TCC block id, bit=61/29 for 64/32bit words
0057      BLOCKID (TCC block id B'011' = 3)
0058   */
0059   enum tccFields {
0060     BXMASK = 0xFFF,
0061     L1MASK = 0xFFF,
0062     BPOSITION_BLOCKID = 29,
0063     BLOCKID = 3,
0064     BPOSITION_FGVB = 8,
0065     ETMASK = 0xFF
0066   };
0067 
0068   DCCTBEventBlock* dccBlock_;
0069   uint32_t expectedId_;
0070 };
0071 
0072 #endif