Skip to content

Commit

Permalink
update validator after losing the data
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Alves authored and bfonta committed Sep 15, 2020
1 parent f0f8264 commit 3989e04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DataFormats/HGCRecHit/interface/HGCRecHit.h
Expand Up @@ -67,7 +67,8 @@ class HGCRecHit : public CaloRecHit {

HGCRecHit();
// by default a recHit is greated with no flag
HGCRecHit(const DetId& id, float energy, float time, uint32_t flags = 0, uint32_t flagBits = 0);
HGCRecHit(const DetId& id, float energy, float time, uint32_t flags = 0, uint32_t flagBits = 0,
uint8_t son=0, float timeError=0.f);
/// get the id
// For the moment not returning a specific id for subdetector
DetId id() const { return DetId(detid()); }
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/HGCRecHit/src/HGCRecHit.cc
Expand Up @@ -9,8 +9,8 @@

HGCRecHit::HGCRecHit() : CaloRecHit(), flagBits_(0) {}

HGCRecHit::HGCRecHit(const DetId& id, float energy, float time, uint32_t flags, uint32_t flagBits)
: CaloRecHit(id, energy, time, flags), flagBits_(flagBits) {}
HGCRecHit::HGCRecHit(const DetId& id, float energy, float time, uint32_t flags, uint32_t flagBits, uint8_t son, float timeError)
: CaloRecHit(id, energy, time, flags), flagBits_(flagBits), signalOverSigmaNoise_(son), timeError_(timeError) {}

float HGCRecHit::chi2() const {
uint32_t rawChi2 = 0x7F & (flags() >> 4);
Expand Down
Expand Up @@ -25,6 +25,7 @@ void make_rechit(unsigned int tid, HGCRecHitSoA& dst_soa, HGCUncalibratedRecHitS
float son = __fdividef( dst_soa.energy_[tid], sigmaNoiseGeV);
float son_norm = fminf(32.f, son) / 32.f * ((1 << 8)-1);
long int son_round = lroundf( son_norm );
//there is an extra 0.125 factor in HGCRecHit::signalOverSigmaNoise()
dst_soa.son_[tid] = static_cast<uint8_t>( son_round );

if(heb_flag==0)
Expand Down
Expand Up @@ -241,7 +241,7 @@ void HeterogeneousHGCalHEFRecHitProducer::convert_soa_data_to_collection_(HGCRec
for(uint i=0; i<nhits; ++i)
{
DetId id_converted( d->id_[i] );
rechits.emplace_back( HGCRecHit(id_converted, d->energy_[i], d->time_[i], 0, d->flagBits_[i]) );
rechits.emplace_back( HGCRecHit(id_converted, d->energy_[i], d->time_[i], 0, d->flagBits_[i], d->son_[i], d->timeError_[i]) );
}
}

Expand Down

0 comments on commit 3989e04

Please sign in to comment.