CMS 3D CMS Logo

ESDataFormatter.h
Go to the documentation of this file.
1 #ifndef ESDATAFORMATTER_H
2 #define ESDATAFORMATTER_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <bitset>
7 #include <sstream>
8 #include <map>
9 
15 
17 public:
18  struct Meta_Data {
19  int run_number = 0;
20  int orbit_number = 0;
21  int bx = 0;
22  int lv1 = 0;
23  int kchip_bc = 0;
24  int kchip_ec = 0;
25  Meta_Data() = default;
26  Meta_Data(int r, int o, int b, int l, int k_bc, int k_ec)
27  : run_number(r), orbit_number(o), bx(b), lv1(l), kchip_bc(k_bc), kchip_ec(k_ec){};
28  };
29 
30  typedef std::vector<ESDataFrame> DetDigis;
31  typedef std::map<int, DetDigis> Digis;
32 
33  typedef uint8_t Word8;
34  typedef uint16_t Word16;
35  typedef uint32_t Word32;
36  typedef uint64_t Word64;
37 
39  : pset_(ps),
40  trgtype_(0),
41  debug_(pset_.getUntrackedParameter<bool>("debugMode", false)),
42  printInHex_(pset_.getUntrackedParameter<bool>("printInHex", false)){};
43  virtual ~ESDataFormatter(){};
44 
45  virtual void DigiToRaw(int fedId, Digis& digis, FEDRawData& fedRawData, const Meta_Data& meta_data) const = 0;
46 
47 protected:
49  const int trgtype_;
50  const bool debug_;
51  const bool printInHex_;
52 
55 
56  std::string print(const Word64& word) const;
57  std::string print(const Word16& word) const;
58 };
59 
60 #endif
std::map< int, DetDigis > Digis
uint64_t word
const int trgtype_
ESDataFormatter(const edm::ParameterSet &ps)
const bool printInHex_
unsigned long long uint64_t
Definition: Time.h:13
const edm::ParameterSet pset_
Meta_Data(int r, int o, int b, int l, int k_bc, int k_ec)
double b
Definition: hdecay.h:118
std::string print(const Word64 &word) const
const bool debug_
virtual void DigiToRaw(int fedId, Digis &digis, FEDRawData &fedRawData, const Meta_Data &meta_data) const =0
virtual ~ESDataFormatter()
std::vector< ESDataFrame > DetDigis