42 if (v_userEnvelope.size() % 3)
43 throw cms::Exception(
"Invalid tfilterEnvelope definition") <<
"Must be one energy and two times per point";
45 for (
unsigned int i = 0;
i < v_userEnvelope.size();
i += 3) {
46 int intGeV = (
int)(v_userEnvelope[
i] + 0.5);
47 std::pair<double, double> pairOfTimes = std::make_pair(v_userEnvelope[
i + 1], v_userEnvelope[
i + 2]);
48 if ((pairOfTimes.first > 0) || (pairOfTimes.second < 0))
50 <<
"Min and max time values must straddle t=0; use win_offset to shift";
57 std::cout <<
"Timing Energy/Time parameters are:" << std::endl;
58 TfilterEnvelope_t::const_iterator it;
60 std::cout <<
"\t" << it->first <<
" GeV\t" << it->second.first <<
" ns\t" << it->second.second <<
" ns"
81 double twinmin, twinmax;
82 double rhtime =
hbhe.time();
96 TfilterEnvelope_t::const_iterator it;
99 if (
energy < (
double)it->first)
114 std::map<int, std::pair<double, double> >::const_iterator prev = it;
118 double energy1 = prev->first;
119 double lim1 = prev->second.second;
120 double energy2 = it->first;
121 double lim2 = it->second.second;
123 twinmax = lim1 + ((lim2 - lim1) * (
energy - energy1) / (energy2 - energy1));
126 lim1 = prev->second.first;
127 lim2 = it->second.first;
129 twinmin = lim1 + ((lim2 - lim1) * (
energy - energy1) / (energy2 - energy1));
138 if (rhtime <= twinmin || rhtime >= twinmax)