//////////////////////////////////////////////////////////////////// /// \class RAT::PCAHists /// /// \brief Declaration of histograms for the PCA processor /// /// \author Freija Descamps /// /// REVISION HISTORY:\n /// 15 Feb 2013 : V1 - first version \n /// 08 Jan 2016 : F. Descamps - Add support for TGraph2D /// /// \details This class declares, initialises and writes out /// the histograms for the PCAProc processor - /// adapted from ECAHist /// /// /// /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_PCAHists__ #define __RAT_PCAHists__ class TH1F; class TH2D; class TH1D; class TH1I; class TFile; class TGraphErrors; class TGraph2D; namespace RAT { class PCAHists{ public: /// Constructor for the class, no parameters PCAHists(); /// Destructor virtual ~PCAHists(); bool IsInitialised(){ return fIsInitialised; } /// Initialisation, requires as input two booleans. void InitialiseHists( const bool DoTWPCA, ///< boolean to indicate if TW is performed const bool DoGFPCA ///< boolean to indicate if GF is performed ); /// Write out the histograms, requires as input two booleans and a rootfile void WriteHists( const bool DoTWPCA, ///< boolean to indicate if TW is performed const bool DoGFPCA, ///< boolean to indicate if GF is performed TFile *rootfile ///< rootfile to save the histograms ); /// Write out a single TH1D histogram, requires as input the histograms and a rootfile void WriteSingleHist(TH1D *inhist, ///< 1D histogram to be written out TFile *rootfile ///< rootfile to save the histogram ); /// Write out a single TH2D histogram, requires as input the histograms and a rootfile void WriteSingleHist(TH2D *inhist, ///< 2D histogram to be written out TFile *rootfile ///< rootfile to save the histograms ); /// Write out a single 2D graph, requires as input the histograms and a rootfile void WriteSingleHist(TGraphErrors *ingraph, ///< 2D graph to be written out TFile *rootfile ///< rootfile to save the histograms ); /// Write out a single 3D graph, requires as input the histograms and a rootfile void WriteSingleHist(TGraph2D *ingraph, ///< 3D graph to be written out TFile *rootfile ///< rootfile to save the histograms ); /// Set the histogram axis names, requires as input two booleans. void SetAxes( const bool DoTWPCA, ///< boolean to indicate if TW is performed const bool DoGFPCA ///< boolean to indicate if GF is performed ); /// Make the histograms pretty, no parameters void Beautify(); // 1D histograms to verify TW and find bad ADC behaviour TH1F *fRMSHist; ///< histogram of RMS for the extracted TW (1 entry per channel) TH1F *fTStepHist; ///< histogram of the step in time between TW interpolation points TH1F *fFlateHist; ///< histogram of Flate fraction (1 entry per channel) TH1F *fFoutHist; ///< histogram of Fout fraction (1 entry per channel) // 1D histogram to check statistics TH1I *fPCAhitsPerPMT; ///< histogram of hits per PMT // GF Comparison histograms: these show the difference in the extracted gain values and the DB/fitted values. // 2D comparison plots TH2D *fPCAdiffPEAKQHS; ///< diff(prev-new) of the extracted peak position versus lcn for QHS TH2D *fPCAdiffTHRESHQHS; ///< diff(prev-new) of the extracted threshold position versus lcn for QHS TH2D *fPCAdiffHHPQHS; ///< diff(prev-new) of the extracted hhp position versus lcn for QHS TH2D *fPCAdiffPEAKQHL; ///< diff(prev-new) of the extracted peak position versus lcn for QHL TH2D *fPCAdiffTHRESHQHL; ///< diff(prev-new) of the extracted threshold position versus lcn for QHL TH2D *fPCAdiffHHPQHL; ///< diff(prev-new) of the extracted hhp position versus lcn for QHL TH2D *fPCAhitsperPMTvsHHPdiffQHL; ///< hits per pmt versus diff(prev-new) of the extracted hhp position for QHL // 1D comparison histograms TH1F *fPCAdiffPEAKQHS1d; ///< histogram of diff(prev-new) of the extracted peak position for QHS TH1F *fPCAdiffTHRESHQHS1d; ///< histogram of diff(prev-new) of the extracted threshold position for QHS TH1F *fPCAdiffHHPQHS1d; ///< histogram of diff(prev-new) of the extracted hhp position for QHS TH1F *fPCAdiffPEAKQHL1d; ///< histogram of diff(prev-new) of the extracted peak position for QHL TH1F *fPCAdiffTHRESHQHL1d; ///< histogram of diff(prev-new) of the extracted threshold position for QHL TH1F *fPCAdiffHHPQHL1d; ///< histogram of diff(prev-new) of the extracted hhp position for QHL protected: // Define the range for the x-axis in the comparison histograms int fMinComDiff; ///< Minimum for the x-axis in the comparison histograms int fMaxComDiff; ///< Maximum for the x-axis in the comparison histograms bool fIsInitialised; ///< Boolean to indicate that the histograms were initialised }; } // namespace RAT #endif