CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/EventFilter/EcalRawToDigi/interface/DCCEventBlock.h

Go to the documentation of this file.
00001 #ifndef DCCEVENTBLOCK_HH
00002 #define DCCEVENTBLOCK_HH
00003 
00004 
00005 /*
00006  *\ Class DCCEventBlock
00007  *
00008  * Class responsible for managing the raw data unpacking.
00009  * The class instantes the DCCMemBlock 
00010  *
00011  * \file DCCEventBlock.h
00012  *
00013  * $Date: 2010/10/02 16:09:54 $
00014  * $Revision: 1.6 $
00015  *
00016  * \author N. Almeida
00017  * \author G. Franzoni
00018  *
00019 */
00020 
00021 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
00022 #include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
00023 #include "DCCRawDataDefinitions.h"
00024 
00025 class DCCFEBlock;
00026 class DCCTCCBlock;
00027 class DCCSRPBlock;
00028 class DCCDataUnpacker;
00029 class DCCMemBlock;
00030 class EcalElectronicsMapper;
00031 
00032 
00033 class DCCEventBlock {
00034         
00035   public :
00036 
00037    DCCEventBlock( DCCDataUnpacker * u, EcalElectronicsMapper * m, bool hU, bool srpU, bool tccU, bool feU, bool memU, bool forceToKeepFRdata);
00038         
00039    virtual ~DCCEventBlock();  
00040  
00041    virtual void unpack( uint64_t * buffer, unsigned int bufferSize, unsigned int expFedId){};
00042    
00043    void reset();
00044         
00045    void enableSyncChecks();
00046         
00047    void enableFeIdChecks();
00048 
00049    void updateCollectors();
00050         
00051    void display(std::ostream & o);
00052                 
00053    unsigned int smId()                  { return smId_;     }
00054    unsigned int fov()                   { return fov_;      }
00055    unsigned int mem()                   { return mem_;      }
00056    unsigned int l1A()                   { return l1_;       }
00057    unsigned int bx()                    { return bx_;       }
00058    DCCDataUnpacker  * unpacker(){ return unpacker_; }
00059    
00060    void setSRPSyncNumbers(short l1, short bx){ srpLv1_=l1; srpBx_=bx; }
00061    void setFESyncNumbers(short l1, short bx, short id){ feLv1_[id]= l1; feBx_[id]=bx;}
00062    void setTCCSyncNumbers(short l1, short bx, short id){ tccLv1_[id]= l1; tccBx_[id]=bx;}
00063    void setHLTChannel( int channel, short value ){ hlt_[channel-1] = value; }   
00064    short getHLTChannel(int channel){ return hlt_[channel-1];}
00065 
00066         
00067   protected :
00068      
00069     void addHeaderToCollection();
00070          
00071     int virtual unpackTCCBlocks(){ return BLOCK_UNPACKED;}
00072  
00073     DCCDataUnpacker  *  unpacker_;
00074     uint64_t         *  data_; 
00075     unsigned int eventSize_;
00076     unsigned int dwToEnd_;
00077    
00078     std::vector<short> feChStatus_;
00079     std::vector<short> tccChStatus_;
00080     std::vector<short> hlt_;
00081 
00082     std::vector<short> feLv1_; std::vector<short> feBx_;  
00083     std::vector<short> tccLv1_; std::vector<short> tccBx_;    
00084     short srpLv1_; short srpBx_; 
00085 
00086     
00087     unsigned int srChStatus_;
00088 
00089     unsigned int fov_;
00090     unsigned int fedId_;
00091     unsigned int bx_;
00092     unsigned int l1_;
00093     unsigned int triggerType_;
00094     unsigned int smId_;
00095     unsigned int blockLength_;  
00096     unsigned int dccErrors_;
00097     unsigned int runNumber_;
00098     unsigned int runType_;
00099     unsigned int detailedTriggerType_;
00100     
00101     unsigned int orbitCounter_;
00102     unsigned int mem_;
00103     unsigned int sr_;
00104     unsigned int zs_;
00105     unsigned int tzs_;
00106     
00107     DCCFEBlock             * towerBlock_;
00108     DCCTCCBlock            * tccBlock_;
00109     DCCMemBlock            * memBlock_;
00110     DCCSRPBlock            * srpBlock_;
00111     EcalElectronicsMapper  * mapper_;
00112          
00113     bool headerUnpacking_;
00114     bool srpUnpacking_;
00115     bool tccUnpacking_;
00116     bool feUnpacking_;
00117     bool memUnpacking_;
00118     bool forceToKeepFRdata_;
00119 
00120     std::auto_ptr<EcalRawDataCollection> *  dccHeaders_;
00121          
00122 
00123 };
00124 
00125 
00126 // this code intended for sync checking in files:
00127 //   DCC(FE|Mem|TCC|SRP)Block.cc
00128 
00129 enum BlockType {FE_MEM = 1, TCC_SRP = 2};
00130 
00131 bool isSynced(const unsigned int dccBx,
00132               const unsigned int bx,
00133               const unsigned int dccL1,
00134               const unsigned int l1,
00135               const BlockType type,
00136               const unsigned int fov);
00137 
00138 #endif