|
|
Go to the documentation of this file.
3 #include <fmt/printf.h>
5 #include <TParameter.h>
21 toCompress =
value / ref;
24 toCompress =
value - ref;
45 return *reinterpret_cast<uint16_t *>(&
r);
73 return unpacked * ref;
75 return unpacked + ref;
83 fmt::sprintf(
"DataFormats/PatCandidates/data/CovarianceParameterization_version%d.root",
version));
87 if (fileToRead.IsOpen()) {
90 TIter
next(((TDirectoryFile *)fileToRead.Get(
"schemas"))->GetListOfKeys());
92 while ((
key = (TKey *)
next())) {
93 TClass *
cl = gROOT->GetClass(
key->GetClassName());
94 if (!
cl->InheritsFrom(
"TDirectoryFile"))
97 uint16_t schemaN = std::stoi(schemaNumber);
100 for (
int i = 0;
i < 5;
i++) {
101 for (
int j =
i;
j < 5;
j++) {
106 std::vector<float> vParams;
107 TVector *
p = (TVector *)fileToRead.Get((
folder +
"/param").c_str());
108 vParams.reserve(
p->GetNoElements());
109 for (
int k = 0;
k <
p->GetNoElements();
k++) {
110 vParams.push_back((*
p)[
k]);
116 (
int)((TParameter<int> *)fileToRead.Get(bitString.c_str()))->GetVal(),
130 for (
int i = 0;
i < 5;
i++) {
131 for (
int j =
i;
j < 5;
j++) {
142 std::vector<TH3D *> *HistoVector,
std::string StringToAddInTheName,
int i,
int j, TFile &fileToRead) {
143 std::string List_covName[5] = {
"qoverp",
"lambda",
"phi",
"dxy",
"dsz"};
145 std::string histoNameString =
"covariance_" + List_covName[
i] +
"_" + List_covName[
j] + StringToAddInTheName +
147 TH3D *matrixElememtHistogramm = (TH3D *)fileToRead.Get(histoNameString.c_str());
148 HistoVector->push_back(matrixElememtHistogramm);
152 int i,
int j,
int sign,
float pt,
float eta,
int nHits,
int pixelHits,
float cii,
float cjj)
const {
153 int hitNumberToUse =
nHits;
154 if (hitNumberToUse < 2)
156 if (hitNumberToUse > 32)
169 int indexOfTheHitogramInTheList = ((9 - min_idx) * min_idx) / 2 + max_idx;
181 float value,
int schema,
int i,
int j,
float pt,
float eta,
int nHits,
int pixelHits,
float cii,
float cjj)
const {
188 if (schema == 0 &&
i ==
j && (
i == 2 ||
i == 0))
189 ref = 1. / (
pt *
pt);
197 uint16_t packed,
int schema,
int i,
int j,
float pt,
float eta,
int nHits,
int pixelHits,
float cii,
float cjj)
205 if (schema == 0 &&
i ==
j && (
i == 2 ||
i == 0))
206 ref = 1. / (
pt *
pt);
int16_t pack16log(double x, double lmin, double lmax, uint16_t base=32768)
int etaBin(const l1t::HGCalMulticluster *cl)
std::vector< float > params
U second(std::pair< T, U > const &p)
static float reduceMantissaToNbits(const float &f)
float pack(float value, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
float meanValue(int i, int j, int sign, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
std::vector< TH3D * > cov_elements_pixelHit
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
float unpack(uint16_t packed, float ref=0.) const
std::unordered_map< uint16_t, CompressionSchema > schemas
std::vector< TH3D * > cov_elements_noPixelHit
double unpack16log(int16_t i, double lmin, double lmax, uint16_t base=32768)
uint16_t pack(float value, float ref=0.) const
float unpack(uint16_t packed, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
void addTheHistogram(std::vector< TH3D * > *HistoVector, std::string StringToAddInTheName, int i, int j, TFile &fileToRead)
static float float16to32(uint16_t h)
Abs< T >::type abs(const T &t)
static uint16_t float32to16(float x)
std::string fullPath() const