Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // Date   : 30/05/2005
0002 // Author : N.Almeida (LIP)
0003 // falta fazer o update dos block sizes
0004 
0005 #ifndef DCCTBEVENTBLOCK_HH
0006 #define DCCTBEVENTBLOCK_HH
0007 
0008 #include "DCCBlockPrototype.h"
0009 
0010 class DCCTBTowerBlock;
0011 class DCCTBDataParser;
0012 class DCCTBTrailerBlock;
0013 class DCCTBTCCBlock;
0014 class DCCTBSRPBlock;
0015 
0016 class DCCTBEventBlock : public DCCTBBlockPrototype {
0017 public:
0018   DCCTBEventBlock(DCCTBDataParser* parser,
0019                   const uint32_t* buffer,
0020                   uint32_t numbBytes,
0021                   uint32_t wordsToEnd,
0022                   uint32_t wordBufferOffset = 0,
0023                   uint32_t wordEventOffset = 0);
0024 
0025   ~DCCTBEventBlock() override;
0026 
0027   void dataCheck();
0028 
0029   std::vector<DCCTBTowerBlock*>& towerBlocks();
0030   std::vector<DCCTBTCCBlock*>& tccBlocks();
0031   DCCTBSRPBlock* srpBlock();
0032   DCCTBTrailerBlock* trailerBlock();
0033   std::vector<DCCTBTowerBlock*> towerBlocksById(uint32_t towerId);
0034   using DCCTBBlockPrototype::compare;
0035   std::pair<bool, std::string> compare(DCCTBEventBlock*);
0036 
0037   bool eventHasErrors();
0038   std::string eventErrorString();
0039   void displayEvent(std::ostream& os = std::cout);
0040 
0041 protected:
0042   enum dccFields {
0043 
0044     PHYSICTRIGGER = 1,
0045     CALIBRATIONTRIGGER = 2,
0046     TESTTRIGGER = 3,
0047     TECHNICALTRIGGER = 4,
0048 
0049     CH_ENABLED = 0,
0050     CH_DISABLED = 1,
0051     CH_TIMEOUT = 2,
0052     CH_SUPPRESS = 7,
0053 
0054     SR_NREAD = 0,
0055 
0056     BOE = 0x5,
0057 
0058     DCCERROR_EMPTYEVENT = 0x1,
0059 
0060     TOWERHEADER_SIZE = 8,
0061     TRAILER_SIZE = 8
0062 
0063   };
0064 
0065   std::vector<DCCTBTowerBlock*> towerBlocks_;
0066   std::vector<DCCTBTCCBlock*> tccBlocks_;
0067   DCCTBTrailerBlock* dccTrailerBlock_;
0068   DCCTBSRPBlock* srpBlock_;
0069   uint32_t wordBufferOffset_;
0070   bool emptyEvent;
0071 };
0072 
0073 inline std::vector<DCCTBTowerBlock*>& DCCTBEventBlock::towerBlocks() { return towerBlocks_; }
0074 inline std::vector<DCCTBTCCBlock*>& DCCTBEventBlock::tccBlocks() { return tccBlocks_; }
0075 inline DCCTBSRPBlock* DCCTBEventBlock::srpBlock() { return srpBlock_; }
0076 inline DCCTBTrailerBlock* DCCTBEventBlock::trailerBlock() { return dccTrailerBlock_; }
0077 
0078 #endif