File indexing completed on 2024-04-06 12:04:53
0001 #ifndef DATAFORMATS_PATCANDIDATES_INTERFACE_IOREAD_PACKEDGEN_H
0002 #define DATAFORMATS_PATCANDIDATES_INTERFACE_IOREAD_PACKEDGEN_H
0003
0004 #include "DataFormats/Math/interface/libminifloat.h"
0005 #include "DataFormats/Candidate/interface/Candidate.h"
0006 int16_t convertPackedEtaToPackedY(int16_t packedPt_, int16_t packedEta_, int16_t packedM_) {
0007 reco::Candidate::PolarLorentzVector p4(MiniFloatConverter::float16to32(packedPt_),
0008 int16_t(packedEta_) * 6.0f / std::numeric_limits<int16_t>::max(),
0009 0,
0010 MiniFloatConverter::float16to32(packedM_));
0011
0012 return int16_t(p4.Rapidity() / 6.0f * std::numeric_limits<int16_t>::max());
0013 }
0014
0015 #endif