CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/EventFilter/EcalTBRawToDigi/src/DCCEventBlock.h

Go to the documentation of this file.
00001 // Date   : 30/05/2005
00002 // Author : N.Almeida (LIP)
00003 // falta fazer o update dos block sizes
00004 
00005 #ifndef DCCTBEVENTBLOCK_HH
00006 #define DCCTBEVENTBLOCK_HH
00007 
00008 
00009 #include "DCCBlockPrototype.h"
00010 
00011 class DCCTBTowerBlock;
00012 class DCCTBDataParser;
00013 class DCCTBTrailerBlock;
00014 class DCCTBTCCBlock;
00015 class DCCTBSRPBlock;
00016 
00017 class DCCTBEventBlock : public DCCTBBlockPrototype {
00018         
00019         public :
00020                 
00021                 DCCTBEventBlock(
00022                         DCCTBDataParser * parser, 
00023                         uint32_t * buffer, 
00024                         uint32_t numbBytes, 
00025                         uint32_t wordsToEnd, 
00026                         uint32_t wordBufferOffset = 0 , 
00027                         uint32_t wordEventOffset = 0 
00028                 );
00029                 
00030                 ~DCCTBEventBlock();
00031                 
00032                 void dataCheck(); 
00033                 
00034                 std::vector< DCCTBTowerBlock * > & towerBlocks();
00035                 std::vector< DCCTBTCCBlock *   > & tccBlocks();
00036                 DCCTBSRPBlock               * srpBlock();
00037                 DCCTBTrailerBlock           * trailerBlock();
00038                 std::vector< DCCTBTowerBlock * >   towerBlocksById(uint32_t towerId);
00039                 std::pair<bool,std::string> compare(DCCTBEventBlock * );
00040 
00041                 bool eventHasErrors();
00042                 std::string eventErrorString();
00043                 void displayEvent(std::ostream & os=std::cout);
00044         
00045                 
00046         protected :
00047                 enum dccFields{ 
00048                         
00049                         PHYSICTRIGGER        = 1,
00050                         CALIBRATIONTRIGGER   = 2,
00051                         TESTTRIGGER          = 3,
00052                         TECHNICALTRIGGER     = 4,
00053                         
00054                         CH_ENABLED           = 0,
00055                         CH_DISABLED          = 1,
00056                         CH_TIMEOUT           = 2,
00057                         CH_SUPPRESS          = 7,
00058                         
00059                         SR_NREAD              = 0,
00060                         
00061                 
00062                         BOE                  = 0x5, 
00063                         
00064                         DCCERROR_EMPTYEVENT  = 0x1, 
00065                         
00066                         TOWERHEADER_SIZE     = 8, 
00067                         TRAILER_SIZE         = 8
00068         
00069                 
00070                 };              
00071 
00072                 std::vector< DCCTBTowerBlock * > towerBlocks_      ;
00073                 std::vector< DCCTBTCCBlock   * > tccBlocks_        ;
00074                 DCCTBTrailerBlock       *   dccTrailerBlock_  ;
00075                 DCCTBSRPBlock           *   srpBlock_;
00076                 uint32_t wordBufferOffset_;
00077                 bool emptyEvent;
00078 };
00079 
00080 
00081 inline std::vector< DCCTBTowerBlock * > & DCCTBEventBlock::towerBlocks()  { return towerBlocks_;     }
00082 inline std::vector< DCCTBTCCBlock * >   & DCCTBEventBlock::tccBlocks()    { return tccBlocks_;       }
00083 inline DCCTBSRPBlock               * DCCTBEventBlock::srpBlock()     { return srpBlock_;        }
00084 inline DCCTBTrailerBlock           * DCCTBEventBlock::trailerBlock() { return dccTrailerBlock_; }
00085 
00086 #endif