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
l1tpf_impl::COEFile::phiSlices
unsigned int phiSlices
Definition: COEFile.h:36
PFCandidate.h
l1tpf_impl
Definition: BitwisePFAlgo.h:8
l1tpf_impl::COEFile::debug_
int debug_
Definition: COEFile.h:40
l1tpf_impl::COEFile::close
void close()
Definition: COEFile.h:24
l1tpf_impl::COEFile::writeTracksToFile
void writeTracksToFile(const std::vector< Region > &regions, bool print=false)
Definition: COEFile.cc:40
l1tpf_impl::COEFile::coeFileName
std::string coeFileName
Definition: COEFile.h:35
l1tpf_impl::COEFile::~COEFile
~COEFile()
Definition: COEFile.cc:17
l1tpf_impl::COEFile::track_word_block_sizes
const std::vector< uint32_t > track_word_block_sizes
Definition: COEFile.h:39
Region.h
l1tpf_impl::COEFile::getBit
bool getBit(T value, unsigned bit)
Definition: COEFile.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
l1tpf_impl::COEFile::file
FILE * file
Definition: COEFile.h:34
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
value
Definition: value.py:1
l1tpf_impl::COEFile::is_open
bool is_open()
Definition: COEFile.h:29
l1tpf_impl::COEFile::COEFile
COEFile(const edm::ParameterSet &)
Definition: COEFile.cc:5
l1tpf_impl::COEFile::tracksize
static constexpr unsigned int tracksize
Definition: COEFile.h:37
T
long double T
Definition: Basic3DVectorLD.h:48
l1tpf_impl::COEFile::ntracksmax
unsigned int ntracksmax
Definition: COEFile.h:36
l1tpf_impl::COEFile
Definition: COEFile.h:19
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
ParameterSet.h
l1tpf_impl::COEFile::writeHeaderToFile
void writeHeaderToFile()
Definition: COEFile.cc:19
l1tpf_impl::COEFile::bset_string_
std::string bset_string_
Definition: COEFile.h:35
DiscretePFInputs.h
l1tpf_impl::COEFile::bset_
boost::dynamic_bitset bset_
Definition: COEFile.h:38