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 
18  public :
19  struct Meta_Data {
20  int run_number = 0;
21  int orbit_number = 0;
22  int bx = 0;
23  int lv1 = 0;
24  int kchip_bc = 0;
25  int kchip_ec = 0;
26  Meta_Data() = default;
27  Meta_Data(int r, int o, int b, int l, int k_bc, int k_ec): 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), trgtype_(0),
40  debug_(pset_.getUntrackedParameter<bool>("debugMode", false)),
41  printInHex_(pset_.getUntrackedParameter<bool>("printInHex", false))
42  { };
43  virtual ~ESDataFormatter() {};
44 
45  virtual void DigiToRaw(int fedId, Digis & digis, FEDRawData& fedRawData, const Meta_Data& meta_data) const = 0;
46  protected :
47 
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 
61 #endif
virtual void DigiToRaw(int fedId, Digis &digis, FEDRawData &fedRawData, const Meta_Data &meta_data) const =0
std::map< int, DetDigis > Digis
const int trgtype_
ESDataFormatter(const edm::ParameterSet &ps)
const bool printInHex_
unsigned long long uint64_t
Definition: Time.h:15
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:120
const bool debug_
std::string print(const Word64 &word) const
virtual ~ESDataFormatter()
std::vector< ESDataFrame > DetDigis