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 13 of file FWHM.h.

13  {
14  int bin1 = h1->FindFirstBinAbove(h1->GetMaximum()/2);
15  int bin2 = h1->FindLastBinAbove(h1->GetMaximum()/2);
16  double fwhm = h1->GetBinCenter(bin2) - h1->GetBinCenter(bin1);
17 
18 // std::cout << h1->GetName() << std::endl;
19 // std::cout << "FWHM: max: " << h1->GetMaximum() << " halfMax " << h1->GetMaximum()/2 << " bin1 - bin2 " << bin1 << " - " << bin2 << " fwhm " << fwhm << std::endl;
20  return fwhm;
21 }