File indexing completed on 2024-04-06 12:10:32
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
0013 class BlockFormatter {
0014 public:
0015 typedef uint64_t Word64;
0016 typedef uint16_t Word16;
0017
0018 struct Config {
0019 const std::vector<int32_t>* plistDCCId_;
0020 bool debug_;
0021
0022 bool doBarrel_;
0023 bool doEndCap_;
0024 bool doTCC_;
0025 bool doSR_;
0026 bool doTower_;
0027 };
0028 struct Params {
0029 int counter_;
0030 int orbit_number_;
0031 int bx_;
0032 int lv1_;
0033 int runnumber_;
0034 };
0035
0036 explicit BlockFormatter(Config const& iC, Params const& iP);
0037 static const int kCardsPerTower = 5;
0038 void DigiToRaw(FEDRawDataCollection* productRawData);
0039 void print(FEDRawData& rawdata);
0040
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 counter_;
0048 int orbit_number_;
0049 int bx_;
0050 int lv1_;
0051 int runnumber_;
0052
0053 const bool debug_;
0054
0055 const bool doBarrel_;
0056 const bool doEndCap_;
0057 const bool doTCC_;
0058 const bool doSR_;
0059 const bool doTower_;
0060 };
0061
0062 #endif