1 #ifndef DataFormats_FTLRecHit_FTLCluster_h 2 #define DataFormats_FTLRecHit_FTLCluster_h 27 constexpr
FTLHit(uint16_t hit_x, uint16_t hit_y,
float hit_energy,
float hit_time,
float hit_time_error)
29 constexpr uint16_t
x() {
return x_; }
30 constexpr uint16_t
y() {
return y_; }
48 constexpr
int dx()
const {
return dx_; }
49 constexpr
int dy()
const {
return dy_; }
61 constexpr
int row()
const {
return row_; }
62 constexpr
int col()
const {
return col_; }
72 static constexpr
unsigned int MAXSPAN = 255;
73 static constexpr
unsigned int MAXPOS = 2047;
84 float const* time_errors,
98 for (
unsigned int i = 0;
i != isize; ++
i) {
120 inline float x()
const {
125 inline float y()
const {
131 float sumW2(0.
f), sumW(0.
f);
133 sumW2 += hitW * hitW;
137 return sigmaPos *
std::sqrt(sumW2) / sumW;
143 auto t = [
this](
unsigned int i) {
return this->
theHitTIME[
i]; };
234 template <
typename SumFunc,
typename OutFunc>
238 for (
unsigned int i = 0;
i <
weights.size(); ++
i) {
242 return outFunc(
tot, sumW);
245 template <
typename Value>
248 auto outFunc = [](
float x,
float y) {
257 template <
typename Err>
260 auto outFunc = [](
float x,
float y) {
262 return (
float)
sqrt(
x) /
y;
275 if (
one.minHitRow() <
other.minHitRow()) {
277 }
else if (
one.minHitRow() >
other.minHitRow()) {
279 }
else if (
one.minHitCol() <
other.minHitCol()) {
constexpr FTLHitPos(int row, int col)
void setClusterErrorTime(float errtime)
const std::vector< uint8_t > & hitOffset() const
void setClusterPosX(float posx)
constexpr Shift(int dx, int dy)
constexpr uint16_t time_error()
void setClusterErrorX(float errx)
std::vector< float > theHitTIME_ERROR
static constexpr unsigned int MAXPOS
const std::vector< float > & hitTIME() const
FTLCluster(DetId id, unsigned int isize, float const *energys, float const *times, float const *time_errors, uint16_t const *xpos, uint16_t const *ypos, uint16_t const xmin, uint16_t const ymin)
constexpr uint16_t time()
float getClusterErrorTime() const
static constexpr unsigned int MAXSPAN
constexpr uint16_t energy()
float getClusterErrorX() const
void packCol(uint16_t ymin, uint16_t yspan)
std::vector< uint8_t > theHitOffset
float positionError(const float sigmaPos) const
const DetId & detid() const
std::vector< float > theHitTIME
constexpr int row() const
reco::JetExtendedAssociation::JetExtendedData Value
constexpr FTLHit(uint16_t hit_x, uint16_t hit_y, float hit_energy, float hit_time, float hit_time_error)
void packRow(uint16_t xmin, uint16_t xspan)
float weighted_mean(const std::vector< float > &weights, Value &&value) const
float getClusterPosX() const
const std::vector< float > & hitENERGY() const
float weighted_sum(const std::vector< float > &weights, SumFunc &&sumFunc, OutFunc &&outFunc) const
std::vector< float > theHitENERGY
float weighted_mean_error(const std::vector< float > &weights, Err &&err) const
bool operator<(const FTLCluster &one, const FTLCluster &other)
const std::vector< float > & hitTIME_ERROR() const
static unsigned int const shift
constexpr FTLHitPos operator+(const Shift &shift) const
static int overflow_(uint16_t span)
constexpr int col() const