32 bool ignorelowest,
bool ignorehighest,
33 double win_offset,
double win_gain)
48 if (v_userEnvelope.size()%3)
50 "Must be one energy and two times per point";
52 for (
unsigned int i=0;
i<v_userEnvelope.size();
i+=3) {
53 int intGeV = (
int)(v_userEnvelope[
i]+0.5);
54 std::pair<double,double> pairOfTimes = std::make_pair(v_userEnvelope[
i+1],
56 if ((pairOfTimes.first > 0) ||
57 (pairOfTimes.second < 0) )
59 "Min and max time values must straddle t=0; use win_offset to shift";
68 std::cout <<
"Timing Energy/Time parameters are:"<<std::endl;
69 TfilterEnvelope_t::const_iterator it;
71 std::cout <<
"\t"<<it->first<<
" GeV\t"<<it->second.first<<
" ns\t"<<it->second.second<<
" ns"<<std::endl;
93 double twinmin, twinmax;
94 double rhtime=hbhe.
time();
95 double energy=hbhe.
energy();
110 TfilterEnvelope_t::const_iterator it;
114 if (energy < (
double)it->first)
132 std::map<int,std::pair<double,double> >::const_iterator prev = it; prev--;
135 double energy1 = prev->first;
136 double lim1 = prev->second.second;
137 double energy2 = it->first;
138 double lim2 = it->second.second;
140 twinmax=lim1+((lim2-lim1)*(energy-energy1)/(energy2-energy1));
143 lim1 = prev->second.first;
144 lim2 = it->second.first;
146 twinmin=lim1+((lim2-lim1)*(energy-energy1)/(energy2-energy1));
155 if (rhtime<=twinmin || rhtime >= twinmax)
constexpr float energy() const
constexpr void setFlagField(uint32_t value, int base, int width=1)
HBHETimingShapedFlagSetter()
constexpr float time() const
int timingStatus(const HBHERecHit &hbhe)
TfilterEnvelope_t tfilterEnvelope_
void SetTimingShapedFlags(HBHERecHit &hbhe)
~HBHETimingShapedFlagSetter()
void makeTfilterEnvelope(const std::vector< double > &v_userEnvelope)