Go to the documentation of this file.
20 template <
class TC,
class TO,
class TN,
class TW,
class TH,
class TV>
21 class p1 :
public b1<TC,TO,TN,TW,TH> {
27 typedef std::vector<TV>
vs_t;
33 bool equals(
const p1& a_from,
const TW& a_prec,TW(*a_fabs)(TW))
const {
42 bool equals_TH(
const p1& a_from,
const TW& a_prec,TW(*a_fabs)(TW))
const {
73 TV _mean = (svw / sw);
74 TV _rms = ::sqrt(::fabs((sv2w/sw) - _mean * _mean));
76 return _rms/::sqrt(sw);
128 bool fill(TC aX,TV aV,TW aWeight = 1) {
138 if(!
parent::m_axes[0].coord_to_absolute_index(aX,ibin))
return false;
145 TC xw = aX * aWeight;
151 if(ibin==0) inRange =
false;
152 else if(ibin==(
parent::m_axes[0].m_number_of_bins+1)) inRange =
false;
166 TV vw = aV * aWeight;
178 if(a_ibin==0) inRange =
false;
179 else if(a_ibin==(
parent::m_axes[0].m_number_of_bins+1)) inRange =
false;
216 bool get_bin_content(
bn_t a_ibin,TN& a_entries,TW& a_Sw,TW& a_Sw2,TC& a_Sxw,TC& a_Sx2w,TC& a_Svw,TC& a_Sv2w) {
218 a_entries = 0;a_Sw = 0;a_Sw2 = 0;a_Sxw = 0;a_Sx2w = 0;
222 a_entries = 0;a_Sw = 0;a_Sw2 = 0;a_Sxw = 0;a_Sx2w = 0;
249 TV _mean = (svw / sw);
250 return ::sqrt(::fabs((sv2w / sw) - _mean * _mean));
271 if(!a_factor)
return false;
280 bn_t new_n = n/a_factor;
281 if(a_factor*new_n!=n)
return false;
287 const std::vector<TC>& _edges = _axis.
edges();
288 std::vector<TC> new_edges(new_n+1);
289 for(
bn_t ibin=0;ibin<new_n;ibin++) {
290 new_edges[ibin] = _edges[ibin*a_factor];
292 new_edges[new_n] = _edges[n];
295 if(!new_h)
return false;
301 bn_t offset,new_offset,offac;
302 for(
bn_t ibin=0;ibin<new_n;ibin++) {
304 offset = a_factor*ibin+1;
305 for(
unsigned int ifac=0;ifac<a_factor;ifac++) {
330 new_offset = new_n+1;
349 p1(
const std::string& a_title,
bn_t aXnumber,TC aXmin,TC aXmax)
350 :
parent(a_title,aXnumber,aXmin,aXmax)
359 p1(
const std::string& a_title,
bn_t aXnumber,TC aXmin,TC aXmax,TV aVmin,TV aVmax)
360 :
parent(a_title,aXnumber,aXmin,aXmax)
369 p1(
const std::string& a_title,
const std::vector<TC>& a_edges)
379 p1(
const std::string& a_title,
const std::vector<TC>& a_edges,TV aVmin,TV aVmax)
442 bool configure(
const std::vector<TC>& a_edges,TV aVmin,TV aVmax) {