PandaRoot
FWHM.h File Reference
#include <TH1.h>

Go to the source code of this file.

Functions

static double FWHM (TH1 *h1)
 

Function Documentation

◆ FWHM()

static double FWHM ( TH1 *  h1)
static

Definition at line 25 of file FWHM.h.

25  {
26  int bin1 = h1->FindFirstBinAbove(h1->GetMaximum()/2);
27  int bin2 = h1->FindLastBinAbove(h1->GetMaximum()/2);
28  double fwhm = h1->GetBinCenter(bin2) - h1->GetBinCenter(bin1);
29 
30 // std::cout << h1->GetName() << std::endl;
31 // std::cout << "FWHM: max: " << h1->GetMaximum() << " halfMax " << h1->GetMaximum()/2 << " bin1 - bin2 " << bin1 << " - " << bin2 << " fwhm " << fwhm << std::endl;
32  return fwhm;
33 }