CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
trackerTFP::DataFormats Class Reference

Class to calculate and provide dataformats used by Track Trigger emulator. More...

#include <DataFormats.h>

Public Member Functions

template<int it, typename... Ts>
void attachStub (Process p, const tuple< Ts... > &data, TTBV &ttBV) const
 
template<int it, typename... Ts>
void attachTrack (Process p, const tuple< Ts... > &data, TTBV &ttBV) const
 
double base (Variable v, Process p) const
 
double chosenRofPhi () const
 
template<typename... Ts>
void convertStub (Process p, const Frame &bv, tuple< Ts... > &data) const
 
template<typename... Ts>
void convertStub (Process p, const tt::Frame &bv, std::tuple< Ts... > &data) const
 
template<typename... Ts>
void convertStub (Process p, const std::tuple< Ts... > &data, tt::Frame &bv) const
 
template<typename... Ts>
void convertTrack (Process p, const Frame &bv, tuple< Ts... > &data) const
 
template<typename... Ts>
void convertTrack (Process p, const tt::Frame &bv, std::tuple< Ts... > &data) const
 
template<typename... Ts>
void convertTrack (Process p, const std::tuple< Ts... > &data, tt::Frame &bv) const
 
 DataFormats ()
 
 DataFormats (const edm::ParameterSet &iConfig, const tt::Setup *setup)
 
const DataFormatformat (Variable v, Process p) const
 
bool hybrid () const
 
int numChannel (Process p) const
 
int numStreams (Process p) const
 
int numStreamsStubs (Process p) const
 
int numStreamsTracks (Process p) const
 
int numUnusedBitsStubs (Process p) const
 
int numUnusedBitsTracks (Process p) const
 
const tt::Setupsetup () const
 
int width (Variable v, Process p) const
 
 ~DataFormats ()
 

Private Member Functions

template<int it = 0, typename... Ts>
void attachStub (Process p, const std::tuple< Ts... > &data, TTBV &ttBV) const
 
template<int it = 0, typename... Ts>
void attachTrack (Process p, const std::tuple< Ts... > &data, TTBV &ttBV) const
 
template<Variable v = Variable::begin, Process p = Process::begin>
void countFormats ()
 
template<int it = 0, typename... Ts>
void extractStub (Process p, TTBV &ttBV, std::tuple< Ts... > &data) const
 
template<int it = 0, typename... Ts>
void extractTrack (Process p, TTBV &ttBV, std::tuple< Ts... > &data) const
 
template<Variable v = Variable::begin, Process p = Process::begin>
void fillDataFormats ()
 
template<Variable v, Process p, Process it = Process::begin>
void fillFormats ()
 

Private Attributes

std::vector< DataFormatdataFormats_
 
std::vector< std::vector< DataFormat * > > formats_
 
edm::ParameterSet iConfig_
 
std::vector< int > numChannel_
 
int numDataFormats_
 
std::vector< int > numStreams_
 
std::vector< int > numStreamsStubs_
 
std::vector< int > numStreamsTracks_
 
std::vector< int > numUnusedBitsStubs_
 
std::vector< int > numUnusedBitsTracks_
 
const tt::Setupsetup_
 

Static Private Attributes

static constexpr std::array< std::array< Process,+Process::end >,+Variable::endconfig_
 
static constexpr std::array< std::initializer_list< Variable >,+Process::endstubs_
 
static constexpr std::array< std::initializer_list< Variable >,+Process::endtracks_
 

Detailed Description

Class to calculate and provide dataformats used by Track Trigger emulator.

Author
Thomas Schuh
Date
2020, June

Definition at line 216 of file DataFormats.h.

Constructor & Destructor Documentation

◆ DataFormats() [1/2]

DataFormats::DataFormats ( )

Definition at line 20 of file DataFormats.cc.

References countFormats(), dataFormats_, trackerTFP::end, numDataFormats_, numStreams_, numStreamsStubs_, numStreamsTracks_, and setup_.

21  : numDataFormats_(0),
22  formats_(+Variable::end, std::vector<DataFormat*>(+Process::end, nullptr)),
26  setup_ = nullptr;
27  countFormats();
29  numStreams_.reserve(+Process::end);
32  }
std::vector< int > numUnusedBitsStubs_
Definition: DataFormats.h:543
const tt::Setup * setup_
Definition: DataFormats.h:537
std::vector< int > numStreamsTracks_
Definition: DataFormats.h:553
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
std::vector< DataFormat > dataFormats_
Definition: DataFormats.h:539
std::vector< int > numUnusedBitsTracks_
Definition: DataFormats.h:545
std::vector< int > numStreamsStubs_
Definition: DataFormats.h:551
std::vector< int > numChannel_
Definition: DataFormats.h:547
static constexpr int S_
Definition: TTBV.h:22
std::vector< int > numStreams_
Definition: DataFormats.h:549

◆ DataFormats() [2/2]

DataFormats::DataFormats ( const edm::ParameterSet iConfig,
const tt::Setup setup 
)

Definition at line 46 of file DataFormats.cc.

References trackerTFP::dtc, trackerTFP::end, fillDataFormats(), formats_, trackerTFP::gp, trackerTFP::ht, tt::Setup::htNumBinsInv2R(), iConfig_, trackerTFP::kf, trackerTFP::kfin, tt::Setup::kfNumWorker(), trackerTFP::mht, numChannel_, tt::Setup::numDTCsPerRegion(), tt::Setup::numDTCsPerTFP(), tt::Setup::numLayers(), tt::Setup::numRegions(), tt::Setup::numSectors(), numStreams_, numStreamsStubs_, numStreamsTracks_, numUnusedBitsStubs_, numUnusedBitsTracks_, AlCaHLTBitMon_ParallelJobs::p, trackerTFP::pp, trackerTFP::Processes, setup(), setup_, stubs_, tracks_, HcalDetIdTransform::transform(), findQualityFiles::v, and trackerTFP::zht.

46  : DataFormats() {
47  iConfig_ = iConfig;
48  setup_ = setup;
50  for (const Process p : Processes)
51  for (const Variable v : stubs_[+p])
52  numUnusedBitsStubs_[+p] -= formats_[+v][+p] ? formats_[+v][+p]->width() : 0;
53  for (const Process p : Processes)
54  for (const Variable v : tracks_[+p])
55  numUnusedBitsTracks_[+p] -= formats_[+v][+p] ? formats_[+v][+p]->width() : 0;
64  transform(numChannel_.begin(), numChannel_.end(), back_inserter(numStreams_), [this](int channel) {
65  return channel * setup_->numRegions();
66  });
69  numStreamsTracks_ = vector<int>(+Process::end, 0);
72  // Print digi data format of all variables of any specified algo step
73  //for (const Variable v : tracks_[+Process::kf]) {
74  // const DataFormat& f = format(v, Process::kf);
75  // cout <<" KF "<< f.base() << " " << f.range() << " " << f.width() << endl;
76  //}
77  }
constexpr std::initializer_list< Process > Processes
Definition: DataFormats.h:53
std::vector< int > numUnusedBitsStubs_
Definition: DataFormats.h:543
const tt::Setup * setup_
Definition: DataFormats.h:537
int htNumBinsInv2R() const
Definition: Setup.h:435
int numDTCsPerRegion() const
Definition: Setup.h:351
std::vector< int > numStreamsTracks_
Definition: DataFormats.h:553
int numSectors() const
Definition: Setup.h:426
int kfNumWorker() const
Definition: Setup.h:487
static constexpr std::array< std::initializer_list< Variable >,+Process::end > stubs_
Definition: DataFormats.h:393
int numLayers() const
Definition: Setup.h:215
int numDTCsPerTFP() const
Definition: Setup.h:375
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
const tt::Setup * setup() const
Definition: DataFormats.h:488
edm::ParameterSet iConfig_
Definition: DataFormats.h:535
int numRegions() const
Definition: Setup.h:345
static constexpr std::array< std::initializer_list< Variable >,+Process::end > tracks_
Definition: DataFormats.h:444
std::vector< int > numUnusedBitsTracks_
Definition: DataFormats.h:545
std::vector< int > numStreamsStubs_
Definition: DataFormats.h:551
std::vector< int > numChannel_
Definition: DataFormats.h:547
std::vector< int > numStreams_
Definition: DataFormats.h:549
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ ~DataFormats()

trackerTFP::DataFormats::~DataFormats ( )
inline

Definition at line 472 of file DataFormats.h.

472 {}

Member Function Documentation

◆ attachStub() [1/2]

template<int it, typename... Ts>
void trackerTFP::DataFormats::attachStub ( Process  p,
const tuple< Ts... > &  data,
TTBV ttBV 
) const

Definition at line 128 of file DataFormats.cc.

References trackerTFP::begin, data, formats_, GetRecoTauVFromDQM_MC_cff::next, AlCaHLTBitMon_ParallelJobs::p, stubs_, and findQualityFiles::v.

128  {
129  Variable v = *next(stubs_[+p].begin(), it);
130  formats_[+v][+p]->attach(get<it>(data), ttBV);
131  if constexpr (it + 1 != sizeof...(Ts))
132  attachStub<it + 1>(p, data, ttBV);
133  }
static constexpr std::array< std::initializer_list< Variable >,+Process::end > stubs_
Definition: DataFormats.h:393
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ attachStub() [2/2]

template<int it = 0, typename... Ts>
void trackerTFP::DataFormats::attachStub ( Process  p,
const std::tuple< Ts... > &  data,
TTBV ttBV 
) const
private

Referenced by convertStub().

◆ attachTrack() [1/2]

template<int it, typename... Ts>
void trackerTFP::DataFormats::attachTrack ( Process  p,
const tuple< Ts... > &  data,
TTBV ttBV 
) const

Definition at line 161 of file DataFormats.cc.

References trackerTFP::begin, data, formats_, GetRecoTauVFromDQM_MC_cff::next, AlCaHLTBitMon_ParallelJobs::p, tracks_, and findQualityFiles::v.

161  {
162  Variable v = *next(tracks_[+p].begin(), it);
163  formats_[+v][+p]->attach(get<it>(data), ttBV);
164  if constexpr (it + 1 != sizeof...(Ts))
165  attachTrack<it + 1>(p, data, ttBV);
166  }
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static constexpr std::array< std::initializer_list< Variable >,+Process::end > tracks_
Definition: DataFormats.h:444

◆ attachTrack() [2/2]

template<int it = 0, typename... Ts>
void trackerTFP::DataFormats::attachTrack ( Process  p,
const std::tuple< Ts... > &  data,
TTBV ttBV 
) const
private

Referenced by convertTrack().

◆ base()

double trackerTFP::DataFormats::base ( Variable  v,
Process  p 
) const
inline

◆ chosenRofPhi()

double trackerTFP::DataFormats::chosenRofPhi ( ) const
inline

◆ convertStub() [1/3]

template<typename... Ts>
void trackerTFP::DataFormats::convertStub ( Process  p,
const Frame bv,
tuple< Ts... > &  data 
) const

Definition at line 104 of file DataFormats.cc.

References data, extractStub(), and AlCaHLTBitMon_ParallelJobs::p.

104  {
105  TTBV ttBV(bv);
106  extractStub(p, ttBV, data);
107  }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
void extractStub(Process p, TTBV &ttBV, std::tuple< Ts... > &data) const
Definition: DataFormats.cc:111
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ convertStub() [2/3]

template<typename... Ts>
void trackerTFP::DataFormats::convertStub ( Process  p,
const tt::Frame bv,
std::tuple< Ts... > &  data 
) const

◆ convertStub() [3/3]

template<typename... Ts>
void DataFormats::convertStub ( Process  p,
const std::tuple< Ts... > &  data,
tt::Frame bv 
) const

Definition at line 120 of file DataFormats.cc.

References attachStub(), TTBV::bs(), data, numUnusedBitsStubs_, and AlCaHLTBitMon_ParallelJobs::p.

120  {
121  TTBV ttBV(1, numUnusedBitsStubs_[+p]);
122  attachStub(p, data, ttBV);
123  bv = ttBV.bs();
124  }
std::vector< int > numUnusedBitsStubs_
Definition: DataFormats.h:543
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
void attachStub(Process p, const std::tuple< Ts... > &data, TTBV &ttBV) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ convertTrack() [1/3]

template<typename... Ts>
void trackerTFP::DataFormats::convertTrack ( Process  p,
const Frame bv,
tuple< Ts... > &  data 
) const

Definition at line 137 of file DataFormats.cc.

References data, extractTrack(), and AlCaHLTBitMon_ParallelJobs::p.

137  {
138  TTBV ttBV(bv);
139  extractTrack(p, ttBV, data);
140  }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
void extractTrack(Process p, TTBV &ttBV, std::tuple< Ts... > &data) const
Definition: DataFormats.cc:144
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ convertTrack() [2/3]

template<typename... Ts>
void trackerTFP::DataFormats::convertTrack ( Process  p,
const tt::Frame bv,
std::tuple< Ts... > &  data 
) const

◆ convertTrack() [3/3]

template<typename... Ts>
void DataFormats::convertTrack ( Process  p,
const std::tuple< Ts... > &  data,
tt::Frame bv 
) const

Definition at line 153 of file DataFormats.cc.

References attachTrack(), TTBV::bs(), data, numUnusedBitsTracks_, and AlCaHLTBitMon_ParallelJobs::p.

153  {
154  TTBV ttBV(1, numUnusedBitsTracks_[+p]);
155  attachTrack(p, data, ttBV);
156  bv = ttBV.bs();
157  }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
void attachTrack(Process p, const std::tuple< Ts... > &data, TTBV &ttBV) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::vector< int > numUnusedBitsTracks_
Definition: DataFormats.h:545

◆ countFormats()

template<Variable v, Process p>
void DataFormats::countFormats ( )
private

Definition at line 36 of file DataFormats.cc.

References config_, trackerTFP::end, numDataFormats_, AlCaHLTBitMon_ParallelJobs::p, and findQualityFiles::v.

Referenced by DataFormats().

36  {
37  if constexpr (config_[+v][+p] == p)
39  if constexpr (++p != Process::end)
40  countFormats<v, ++p>();
41  else if constexpr (++v != Variable::end)
42  countFormats<++v>();
43  }
static constexpr std::array< std::array< Process,+Process::end >,+Variable::end > config_
Definition: DataFormats.h:219

◆ extractStub()

template<int it, typename... Ts>
void DataFormats::extractStub ( Process  p,
TTBV ttBV,
std::tuple< Ts... > &  data 
) const
private

Definition at line 111 of file DataFormats.cc.

References trackerTFP::begin, data, formats_, GetRecoTauVFromDQM_MC_cff::next, AlCaHLTBitMon_ParallelJobs::p, stubs_, and findQualityFiles::v.

Referenced by convertStub().

111  {
112  Variable v = *next(stubs_[+p].begin(), sizeof...(Ts) - 1 - it);
113  formats_[+v][+p]->extract(ttBV, get<sizeof...(Ts) - 1 - it>(data));
114  if constexpr (it + 1 != sizeof...(Ts))
115  extractStub<it + 1>(p, ttBV, data);
116  }
static constexpr std::array< std::initializer_list< Variable >,+Process::end > stubs_
Definition: DataFormats.h:393
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ extractTrack()

template<int it, typename... Ts>
void DataFormats::extractTrack ( Process  p,
TTBV ttBV,
std::tuple< Ts... > &  data 
) const
private

Definition at line 144 of file DataFormats.cc.

References trackerTFP::begin, data, formats_, GetRecoTauVFromDQM_MC_cff::next, AlCaHLTBitMon_ParallelJobs::p, tracks_, and findQualityFiles::v.

Referenced by convertTrack().

144  {
145  Variable v = *next(tracks_[+p].begin(), sizeof...(Ts) - 1 - it);
146  formats_[+v][+p]->extract(ttBV, get<sizeof...(Ts) - 1 - it>(data));
147  if constexpr (it + 1 != sizeof...(Ts))
148  extractTrack<it + 1>(p, ttBV, data);
149  }
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static constexpr std::array< std::initializer_list< Variable >,+Process::end > tracks_
Definition: DataFormats.h:444

◆ fillDataFormats()

template<Variable v, Process p>
void DataFormats::fillDataFormats ( )
private

Definition at line 81 of file DataFormats.cc.

References config_, dataFormats_, trackerTFP::end, iConfig_, AlCaHLTBitMon_ParallelJobs::p, setup_, and findQualityFiles::v.

Referenced by DataFormats().

81  {
82  if constexpr (config_[+v][+p] == p) {
83  dataFormats_.emplace_back(Format<v, p>(iConfig_, setup_));
84  fillFormats<v, p>();
85  }
86  if constexpr (++p != Process::end)
87  fillDataFormats<v, ++p>();
88  else if constexpr (++v != Variable::end)
89  fillDataFormats<++v>();
90  }
const tt::Setup * setup_
Definition: DataFormats.h:537
static constexpr std::array< std::array< Process,+Process::end >,+Variable::end > config_
Definition: DataFormats.h:219
edm::ParameterSet iConfig_
Definition: DataFormats.h:535
std::vector< DataFormat > dataFormats_
Definition: DataFormats.h:539

◆ fillFormats()

template<Variable v, Process p, Process it>
void DataFormats::fillFormats ( )
private

Definition at line 94 of file DataFormats.cc.

References config_, dataFormats_, trackerTFP::end, formats_, AlCaHLTBitMon_ParallelJobs::p, and findQualityFiles::v.

94  {
95  if (config_[+v][+it] == p) {
96  formats_[+v][+it] = &dataFormats_.back();
97  }
98  if constexpr (++it != Process::end)
99  fillFormats<v, p, ++it>();
100  }
std::vector< std::vector< DataFormat * > > formats_
Definition: DataFormats.h:541
static constexpr std::array< std::array< Process,+Process::end >,+Variable::end > config_
Definition: DataFormats.h:219
std::vector< DataFormat > dataFormats_
Definition: DataFormats.h:539

◆ format()

const DataFormat& trackerTFP::DataFormats::format ( Variable  v,
Process  p 
) const
inline

◆ hybrid()

bool trackerTFP::DataFormats::hybrid ( ) const
inline

Definition at line 474 of file DataFormats.h.

References edm::ParameterSet::getParameter(), and iConfig_.

Referenced by chosenRofPhi(), trackerTFP::KalmanFilter::consume(), and trackerTFP::StubKF::StubKF().

474 { return iConfig_.getParameter<bool>("UseHybrid"); }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ParameterSet iConfig_
Definition: DataFormats.h:535

◆ numChannel()

int trackerTFP::DataFormats::numChannel ( Process  p) const
inline

◆ numStreams()

int trackerTFP::DataFormats::numStreams ( Process  p) const
inline

◆ numStreamsStubs()

int trackerTFP::DataFormats::numStreamsStubs ( Process  p) const
inline

◆ numStreamsTracks()

int trackerTFP::DataFormats::numStreamsTracks ( Process  p) const
inline

◆ numUnusedBitsStubs()

int trackerTFP::DataFormats::numUnusedBitsStubs ( Process  p) const
inline

Definition at line 494 of file DataFormats.h.

References numUnusedBitsStubs_, and AlCaHLTBitMon_ParallelJobs::p.

◆ numUnusedBitsTracks()

int trackerTFP::DataFormats::numUnusedBitsTracks ( Process  p) const
inline

Definition at line 496 of file DataFormats.h.

References numUnusedBitsTracks_, and AlCaHLTBitMon_ParallelJobs::p.

◆ setup()

const tt::Setup* trackerTFP::DataFormats::setup ( ) const
inline

◆ width()

int trackerTFP::DataFormats::width ( Variable  v,
Process  p 
) const
inline

Member Data Documentation

◆ config_

constexpr std::array<std::array<Process, +Process::end>, +Variable::end> trackerTFP::DataFormats::config_
staticprivate

Definition at line 219 of file DataFormats.h.

Referenced by countFormats(), fillDataFormats(), and fillFormats().

◆ dataFormats_

std::vector<DataFormat> trackerTFP::DataFormats::dataFormats_
private

Definition at line 539 of file DataFormats.h.

Referenced by DataFormats(), fillDataFormats(), and fillFormats().

◆ formats_

std::vector<std::vector<DataFormat*> > trackerTFP::DataFormats::formats_
private

◆ iConfig_

edm::ParameterSet trackerTFP::DataFormats::iConfig_
private

Definition at line 535 of file DataFormats.h.

Referenced by DataFormats(), fillDataFormats(), and hybrid().

◆ numChannel_

std::vector<int> trackerTFP::DataFormats::numChannel_
private

Definition at line 547 of file DataFormats.h.

Referenced by DataFormats(), and numChannel().

◆ numDataFormats_

int trackerTFP::DataFormats::numDataFormats_
private

Definition at line 512 of file DataFormats.h.

Referenced by countFormats(), and DataFormats().

◆ numStreams_

std::vector<int> trackerTFP::DataFormats::numStreams_
private

Definition at line 549 of file DataFormats.h.

Referenced by DataFormats(), and numStreams().

◆ numStreamsStubs_

std::vector<int> trackerTFP::DataFormats::numStreamsStubs_
private

Definition at line 551 of file DataFormats.h.

Referenced by DataFormats(), and numStreamsStubs().

◆ numStreamsTracks_

std::vector<int> trackerTFP::DataFormats::numStreamsTracks_
private

Definition at line 553 of file DataFormats.h.

Referenced by DataFormats(), and numStreamsTracks().

◆ numUnusedBitsStubs_

std::vector<int> trackerTFP::DataFormats::numUnusedBitsStubs_
private

Definition at line 543 of file DataFormats.h.

Referenced by convertStub(), DataFormats(), and numUnusedBitsStubs().

◆ numUnusedBitsTracks_

std::vector<int> trackerTFP::DataFormats::numUnusedBitsTracks_
private

Definition at line 545 of file DataFormats.h.

Referenced by convertTrack(), DataFormats(), and numUnusedBitsTracks().

◆ setup_

const tt::Setup* trackerTFP::DataFormats::setup_
private

◆ stubs_

constexpr std::array<std::initializer_list<Variable>, +Process::end> trackerTFP::DataFormats::stubs_
staticprivate

Definition at line 393 of file DataFormats.h.

Referenced by attachStub(), DataFormats(), and extractStub().

◆ tracks_

constexpr std::array<std::initializer_list<Variable>, +Process::end> trackerTFP::DataFormats::tracks_
staticprivate