CMS 3D CMS Logo

COEFile.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1ParticleFlow_CoeFile_h
2 #define L1Trigger_Phase2L1ParticleFlow_CoeFile_h
3 
4 // system include files
5 #include <vector>
6 #include <string>
7 #include <numeric>
8 #include <cstdio>
9 #include <boost/dynamic_bitset.hpp>
10 #include <boost/multiprecision/cpp_int.hpp>
11 
12 // user include files
17 
18 namespace l1tpf_impl {
19  class COEFile {
20  public:
21  COEFile(const edm::ParameterSet&);
22  ~COEFile();
23 
24  void close() { fclose(file); }
25  template <typename T>
26  bool getBit(T value, unsigned bit) {
27  return (value >> bit) & 1;
28  }
29  bool is_open() { return (file != nullptr); }
30  void writeHeaderToFile();
31  void writeTracksToFile(const std::vector<Region>& regions, bool print = false);
32 
33  protected:
34  FILE* file;
36  unsigned int ntracksmax, phiSlices;
37  static constexpr unsigned int tracksize = 96;
38  boost::dynamic_bitset<> bset_;
39  const std::vector<uint32_t> track_word_block_sizes = {14, 1, 12, 16, 12, 13, 4, 3, 7, 14};
40  int debug_;
41  };
42 } // namespace l1tpf_impl
43 
44 #endif
static constexpr unsigned int tracksize
Definition: COEFile.h:37
bool getBit(T value, unsigned bit)
Definition: COEFile.h:26
const std::vector< uint32_t > track_word_block_sizes
Definition: COEFile.h:39
COEFile(const edm::ParameterSet &)
Definition: COEFile.cc:5
unsigned int phiSlices
Definition: COEFile.h:36
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
std::string bset_string_
Definition: COEFile.h:35
Definition: value.py:1
unsigned int ntracksmax
Definition: COEFile.h:36
boost::dynamic_bitset bset_
Definition: COEFile.h:38
void writeHeaderToFile()
Definition: COEFile.cc:19
void writeTracksToFile(const std::vector< Region > &regions, bool print=false)
Definition: COEFile.cc:40
long double T
std::string coeFileName
Definition: COEFile.h:35