Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
intt_pool.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file intt_pool.h
1 #ifndef FUN4ALLRAW_INTT_POOL_H
2 #define FUN4ALLRAW_INTT_POOL_H
3 
4 #include <Event/packet.h>
5 
6 #include <algorithm>
7 #include <array>
8 #include <cstdint>
9 #include <functional>
10 #include <map>
11 #include <set>
12 #include <string>
13 #include <vector>
14 
15 
16 class intt_pool {
17 
18 
19 public:
20  intt_pool( const unsigned int required_depth=1000, const unsigned int low_mark =100);
21  virtual ~intt_pool() {};
22 
23  virtual int addPacket( Packet *p);
24 
25  virtual void drain() { _low_mark = 0;};
26 
27  virtual unsigned int rawValue(const int fee, const int index);
28 
29  virtual int iValue(const int hit, const int field);
30 
31 
32  virtual int iValue(const int hit,const char * what);
33 
34  virtual long long lValue(const int hit, const int field);
35  virtual long long lValue(const int hit,const char * what);
36 
37  //void dump ( std::ostream& os = std::cout);
38  virtual unsigned int min_depth() const; // the lowest vector length
39  virtual bool depth_ok() const;
40  virtual int next();
41 
42  virtual void dump ( OSTREAM& os = std::cout);
43  virtual int getIdentifier() const {return _myPacketid;};
44 
45 
46  //int iValue(const int , const int, const char * what);
47  void Verbosity(const int i) {verbosity = i;}
48  void Name(const std::string &n) {name = n;}
49  std::string Name() const {return name;}
50 
51 
52 protected:
53  int intt_decode ();
54 
55  int intt_decode_hitlist (std::vector<unsigned int> & /*hitlist*/ , const int /*fee*/);
56 
57  static const int MAX_FEECOUNT {16};
58 
59  int verbosity {0};
60  int _is_decoded {0};
61 
62  unsigned int _required_depth;
63  unsigned int _low_mark;
64  int _myPacketid {-1}; // we are not locked in yet
65 
66  struct intt_hit
67  {
68  uint64_t bco;
69  uint16_t fee;
70  uint16_t channel_id;
71  uint16_t chip_id;
72  uint16_t adc;
73  uint16_t FPHX_BCO;
74  uint16_t full_FPHX;
75  uint16_t full_ROC;
76  uint16_t amplitude;
77  uint16_t full_fphx;
78  uint32_t event_counter;
79  uint32_t word;
80  };
81 
82 
83  std::vector<unsigned int> fee_data[MAX_FEECOUNT];
84  std::vector<intt_hit *> intt_hits;
85 
86  std::array<unsigned int,MAX_FEECOUNT> last_index;
87  std::map<unsigned int, uint64_t> last_bco;
89 };
90 
91 
92 #endif