Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-09 23:41:46

0001 #ifndef BLOCKFORMATTER_H
0002 #define BLOCKFORMATTER_H
0003 
0004 #include <iostream>
0005 #include <vector>
0006 #include <map>
0007 
0008 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0009 #include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>
0010 #include <DataFormats/FEDRawData/interface/FEDRawData.h>
0011 #include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>
0012 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0013 
0014 class BlockFormatter {
0015 public:
0016   typedef uint64_t Word64;
0017   typedef uint16_t Word16;
0018 
0019   struct Config {
0020     const std::vector<int32_t>* plistDCCId_;
0021     bool debug_;
0022 
0023     bool doBarrel_;
0024     bool doEndCap_;
0025     bool doTCC_;
0026     bool doSR_;
0027     bool doTower_;
0028   };
0029   struct Params {
0030     int orbit_number_;
0031     int bx_;
0032     unsigned int lv1_;
0033     edm::RunNumber_t runnumber_;
0034   };
0035 
0036   explicit BlockFormatter(Config const& iC, Params const& iP);
0037   static const int kCardsPerTower = 5;  // Number of VFE cards per trigger tower
0038   void DigiToRaw(FEDRawDataCollection* productRawData);
0039   void print(FEDRawData& rawdata);
0040   // void CleanUp(FEDRawDataCollection* productRawData);
0041   void CleanUp(FEDRawDataCollection* productRawData, std::map<int, std::map<int, int> >* FEDorder);
0042   void PrintSizes(FEDRawDataCollection* productRawData);
0043 
0044 protected:
0045   const std::vector<int32_t>* plistDCCId_;
0046 
0047   int orbit_number_;
0048   int bx_;
0049   unsigned int lv1_;
0050   edm::RunNumber_t runnumber_;
0051 
0052   const bool debug_;
0053 
0054   const bool doBarrel_;
0055   const bool doEndCap_;
0056   const bool doTCC_;
0057   const bool doSR_;
0058   const bool doTower_;
0059 };
0060 
0061 #endif