Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:14:59

0001 #ifndef EventFilter_ESRawToDigi_ESUnpacker_h
0002 #define EventFilter_ESRawToDigi_ESUnpacker_h
0003 
0004 #include <iostream>
0005 #include <vector>
0006 #include <bitset>
0007 #include <sstream>
0008 #include <map>
0009 
0010 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0011 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
0012 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0013 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/ParameterSet/interface/FileInPath.h"
0016 #include "DataFormats/EcalRawData/interface/ESDCCHeaderBlock.h"
0017 #include "DataFormats/EcalRawData/interface/ESKCHIPBlock.h"
0018 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
0019 
0020 class ESDigiToRaw;
0021 
0022 class ESUnpacker {
0023 public:
0024   typedef unsigned int Word32;
0025   typedef unsigned long long Word64;
0026 
0027   ESUnpacker(const edm::ParameterSet& ps);
0028   ~ESUnpacker();
0029 
0030   void interpretRawData(int fedId,
0031                         const FEDRawData& rawData,
0032                         ESRawDataCollection& dccs,
0033                         ESLocalRawDataCollection& kchips,
0034                         ESDigiCollection& digis);
0035   void word2digi(int kchip, int kPACE[4], const Word64& word, ESDigiCollection& digis);
0036 
0037   void setRunNumber(int i) { run_number_ = i; };
0038   void setOrbitNumber(int i) { orbit_number_ = i; };
0039   void setBX(int i) { bx_ = i; };
0040   void setLV1(int i) { lv1_ = i; };
0041   void setTriggerType(int i) { trgtype_ = i; };
0042 
0043 private:
0044   const edm::ParameterSet pset_;
0045 
0046   int fedId_;
0047   int run_number_;
0048   int orbit_number_;
0049   int bx_;
0050   int lv1_;
0051   int dac_;
0052   int gain_;
0053   int precision_;
0054   int runtype_;
0055   int seqtype_;
0056   int trgtype_;
0057   int vminor_;
0058   int vmajor_;
0059   int optoRX0_;
0060   int optoRX1_;
0061   int optoRX2_;
0062   int FEch_[36];
0063 
0064   bool debug_;
0065   edm::FileInPath lookup_;
0066 
0067   std::string print(const Word64& word) const;
0068 
0069 protected:
0070   Word64 m1, m2, m4, m5, m6, m8, m12, m16, m32;
0071 
0072   int zside_[4288][4], pl_[4288][4], x_[4288][4], y_[4288][4];
0073 };
0074 
0075 #endif