CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trklet::TETableBase Class Reference

#include <TETableBase.h>

Inheritance diagram for trklet::TETableBase:
trklet::VMRouterPhiCorrTable

Public Member Functions

virtual void lookup (int, int)
 
 TETableBase (Settings const &settings)
 
void writeVMTable (std::string name, bool positive=true)
 
virtual ~TETableBase ()=default
 

Protected Attributes

int nbits_
 
Settings const & settings_
 
std::vector< int > table_
 

Detailed Description

Definition at line 16 of file TETableBase.h.

Constructor & Destructor Documentation

◆ TETableBase()

TETableBase::TETableBase ( Settings const &  settings)

Definition at line 6 of file TETableBase.cc.

6 : settings_(settings) {}

◆ ~TETableBase()

virtual trklet::TETableBase::~TETableBase ( )
virtualdefault

Member Function Documentation

◆ lookup()

virtual void trklet::TETableBase::lookup ( int  ,
int   
)
inlinevirtual

Definition at line 22 of file TETableBase.h.

22 {}

◆ writeVMTable()

void TETableBase::writeVMTable ( std::string  name,
bool  positive = true 
)

Definition at line 8 of file TETableBase.cc.

8  {
9  // Write LUT table.
10 
11  ofstream out(name);
12  if (out.fail())
13  throw cms::Exception("BadFile") << __FILE__ << " " << __LINE__ << " could not create file " << name;
14 
15  out << "{" << endl;
16  for (unsigned int i = 0; i < table_.size(); i++) {
17  if (i != 0) {
18  out << "," << endl;
19  }
20 
21  assert(nbits_ > 0);
22 
23  int itable = table_[i];
24  if (positive) {
25  if (table_[i] < 0) {
26  itable = (1 << nbits_) - 1;
27  }
28  }
29 
30  out << itable;
31  }
32  out << endl << "};" << endl;
33  out.close();
34 }

References cms::cuda::assert(), mps_fire::i, Skims_PA_cff::name, nbits_, MillePedeFileConverter_cfg::out, and table_.

Referenced by trklet::VMRouterPhiCorrTable::init().

Member Data Documentation

◆ nbits_

int trklet::TETableBase::nbits_
protected

◆ settings_

Settings const& trklet::TETableBase::settings_
protected

◆ table_

std::vector<int> trklet::TETableBase::table_
protected
mps_fire.i
i
Definition: mps_fire.py:428
cms::cuda::assert
assert(be >=bs)
trklet::TETableBase::table_
std::vector< int > table_
Definition: TETableBase.h:28
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
trklet::TETableBase::nbits_
int nbits_
Definition: TETableBase.h:29
trklet::TETableBase::settings_
Settings const & settings_
Definition: TETableBase.h:27