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"))
96 std::string schemaNumber = key->ReadObj()->GetName();
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;
173 meanValue = sign *
cov_elements_pixelHit[indexOfTheHitogramInTheList]->GetBinContent(ptBin, etaBin, hitBin);
181 float value,
int schema,
int i,
int j,
float pt,
float eta,
int nHits,
int pixelHits,
float cii,
float cjj)
const {
184 float ref =
meanValue(i, j, 1., pt, eta, nHits, pixelHits, cii, cjj);
188 if (schema == 0 && i == j && (i == 2 || i == 0))
189 ref = 1. / (pt *
pt);
194 return (*
schemas.find(schema)).
second(i, j).pack(value, ref);
197 uint16_t packed,
int schema,
int i,
int j,
float pt,
float eta,
int nHits,
int pixelHits,
float cii,
float cjj)
201 float ref =
meanValue(i, j, 1., pt, eta, nHits, pixelHits, cii, cjj);
205 if (schema == 0 && i == j && (i == 2 || i == 0))
206 ref = 1. / (pt *
pt);
207 if (i == j && (*
schemas.find(schema)).
second(i, j).unpack(packed, ref) == 0)
210 return (*
schemas.find(schema)).
second(i, j).unpack(packed, ref);
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)
double unpack16log(int16_t i, double lmin, double lmax, uint16_t base=32768)
static float float16to32(uint16_t h)
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
U second(std::pair< T, U > const &p)
std::vector< float > params
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
static uint16_t float32to16(float x)
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
uint16_t pack(float value, float ref=0.) const
std::vector< TH3D * > cov_elements_pixelHit
float meanValue(int i, int j, int sign, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
std::string fullPath() const
float unpack(uint16_t packed, float ref=0.) const
std::unordered_map< uint16_t, CompressionSchema > schemas
int16_t pack16log(double x, double lmin, double lmax, uint16_t base=32768)
static float reduceMantissaToNbits(const float &f)
int etaBin(const l1t::HGCalMulticluster *cl)
std::vector< TH3D * > cov_elements_noPixelHit