CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CTPPSTotemDataFormatter.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of the TOTEM offline software.
4  * Authors:
5  *
6  ****************************************************************************/
7 
8 #ifndef EventFilter_CTPPSRawToDigi_CTPPSTotemDataFormatter_h
9 #define EventFilter_CTPPSRawToDigi_CTPPSTotemDataFormatter_h
10 
13 
15 
19 
24 #include <cstdint>
25 #include <vector>
26 #include <map>
31 
32 //brief Collection of code to convert TOTEM raw data into digi.
33 
34 class FEDRawData;
36 
38 private:
39  typedef uint16_t Word16;
40  typedef uint32_t Word32;
41  typedef uint64_t Word64;
42 
45 
46 public:
47  typedef std::unordered_map<int, FEDRawData> RawData;
48  typedef std::vector<TotemRPDigi> DetDigis;
49  typedef std::unordered_map<cms_uint32_t, DetDigis> Digis;
50 
51  CTPPSTotemDataFormatter(std::map<TotemFramePosition, TotemVFATInfo> const& mapping);
52 
53  int nWords() const { return m_WordCounter; }
54  int nDigis() const { return m_DigiCounter; }
55 
56  struct PPSStripIndex {
57  uint32_t id;
58  unsigned int hwid;
59  short unsigned int fedid;
60  short unsigned int idxinfiber;
61  short unsigned int gohid;
62  };
63 
64  void formatRawData(unsigned int lvl1_ID,
65  RawData& fedRawData,
66  const Digis& digis,
67  std::vector<PPSStripIndex> v_iDdet2fed);
68 
69  static bool compare(const PPSStripIndex& a, const PPSStripIndex& b) { return a.id < b.id; }
70 
71  std::string print(const Word64& word) const;
72 };
73 
74 #endif
std::string print(const Word64 &word) const
CTPPSTotemDataFormatter(std::map< TotemFramePosition, TotemVFATInfo > const &mapping)
std::unordered_map< cms_uint32_t, DetDigis > Digis
uint64_t word
std::unordered_map< int, FEDRawData > RawData
std::vector< TotemRPDigi > DetDigis
static bool compare(const PPSStripIndex &a, const PPSStripIndex &b)
unsigned long long uint64_t
Definition: Time.h:13
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
cms_uint64_t Word64
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, std::vector< PPSStripIndex > v_iDdet2fed)