Logo ROOT   6.14/05
Reference Guide
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TH1Merger Class Reference

Definition at line 17 of file TH1Merger.h.

Public Types

enum  EMergerType {
  kNotCompatible = -1, kAllSameAxes = 0, kAllNoLimits = 1, kHasNewLimits = 2,
  kAllLabel = 3, kAutoP2HaveLimits = 4, kAutoP2NeedLimits = 5
}
 

Public Member Functions

 TH1Merger (TH1 &h, TCollection &l)
 
 ~TH1Merger ()
 
Bool_t operator() ()
 Function performing the actual merge. More...
 

Static Public Member Functions

static Bool_t AxesHaveLimits (const TH1 *h)
 
static Int_t FindBinNumber (Int_t ibin, const TAxis &inAxis, TAxis &outAxis)
 
static Int_t FindFixBinNumber (Int_t ibin, const TAxis &inAxis, const TAxis &outAxis)
 

Private Member Functions

Bool_t AutoP2BufferMerge ()
 
Bool_t AutoP2BuildAxes (TH1 *)
 Determine final boundaries and number of bins for histograms created in power-of-2 autobin mode. More...
 
Bool_t AutoP2Merge ()
 
Bool_t BufferMerge ()
 
void CopyBuffer (TH1 *hsrc, TH1 *hdes)
 
void DefineNewAxes ()
 Function to define new histogram axis when merging It is call only in case of merging with different axis or with the buffer (kHasNewLimits) More...
 
Bool_t DifferentAxesMerge ()
 Merged histogram when axis can be different. More...
 
EMergerType ExamineHistograms ()
 Examine the list of histograms to find out which type of Merge we need to do Pass the input list containing the histogram to merge and h0 which is the initial histogram on which all the histogram of the list will be merged This are the possible cases: More...
 
Bool_t LabelMerge ()
 Merge histograms with labels. More...
 
Bool_t SameAxesMerge ()
 

Private Attributes

TH1fH0
 
TH1fHClone
 histogram on which the list is merged More...
 
TList fInputList
 copy of fH0 - managed by this class More...
 
UInt_t fNewAxisFlag
 
TAxis fNewXAxis
 
TAxis fNewYAxis
 
TAxis fNewZAxis
 

#include </mnt/build/workspace/root-makedoc-v614/rootspi/rdoc/src/v6-14-00-patches/hist/hist/src/TH1Merger.h>

Member Enumeration Documentation

◆ EMergerType

Enumerator
kNotCompatible 
kAllSameAxes 
kAllNoLimits 
kHasNewLimits 
kAllLabel 
kAutoP2HaveLimits 
kAutoP2NeedLimits 

Definition at line 20 of file TH1Merger.h.

Constructor & Destructor Documentation

◆ TH1Merger()

TH1Merger::TH1Merger ( TH1 h,
TCollection l 
)
inline

Definition at line 50 of file TH1Merger.h.

◆ ~TH1Merger()

TH1Merger::~TH1Merger ( )
inline

Definition at line 58 of file TH1Merger.h.

Member Function Documentation

◆ AutoP2BufferMerge()

Bool_t TH1Merger::AutoP2BufferMerge ( )
private

Definition at line 573 of file TH1Merger.cxx.

◆ AutoP2BuildAxes()

Bool_t TH1Merger::AutoP2BuildAxes ( TH1 h)
private

Determine final boundaries and number of bins for histograms created in power-of-2 autobin mode.

Return kTRUE if compatible, updating fNewXaxis accordingly; return kFALSE if something wrong.

The histograms are not merge-compatible if

  1. have different variable-size bins
  2. larger bin size is not an integer multiple of the smaller one
  3. the final estimated range is smalle then the bin size

Definition at line 77 of file TH1Merger.cxx.

◆ AutoP2Merge()

Bool_t TH1Merger::AutoP2Merge ( )
private

Definition at line 616 of file TH1Merger.cxx.

◆ AxesHaveLimits()

Bool_t TH1Merger::AxesHaveLimits ( const TH1 h)
static

Definition at line 19 of file TH1Merger.cxx.

◆ BufferMerge()

Bool_t TH1Merger::BufferMerge ( )
private

Definition at line 714 of file TH1Merger.cxx.

◆ CopyBuffer()

void TH1Merger::CopyBuffer ( TH1 hsrc,
TH1 hdes 
)
private

Definition at line 540 of file TH1Merger.cxx.

◆ DefineNewAxes()

void TH1Merger::DefineNewAxes ( )
private

Function to define new histogram axis when merging It is call only in case of merging with different axis or with the buffer (kHasNewLimits)

Definition at line 474 of file TH1Merger.cxx.

◆ DifferentAxesMerge()

Bool_t TH1Merger::DifferentAxesMerge ( )
private

Merged histogram when axis can be different.

Histograms are merged looking at bin center positions

Definition at line 793 of file TH1Merger.cxx.

◆ ExamineHistograms()

TH1Merger::EMergerType TH1Merger::ExamineHistograms ( )
private

Examine the list of histograms to find out which type of Merge we need to do Pass the input list containing the histogram to merge and h0 which is the initial histogram on which all the histogram of the list will be merged This are the possible cases:

  • 1. All histogram have the same axis (allSameLimits = true)
  • 2. Histogram have different axis but compatible (allSameLimits = false) and sameLimitsX,Y,Z specifies which axis has different limits
  • 3. Histogram do not have limits (so the Buffer is used) allHaveLimits = false
  • 3b. One histogram has limits the other not : allHaveLimits = false AND initialLimitsFound = true
  • 4. Histogram Have labels = allHaveLabels = true

Definition at line 216 of file TH1Merger.cxx.

◆ FindBinNumber()

static Int_t TH1Merger::FindBinNumber ( Int_t  ibin,
const TAxis inAxis,
TAxis outAxis 
)
inlinestatic

Definition at line 41 of file TH1Merger.h.

◆ FindFixBinNumber()

static Int_t TH1Merger::FindFixBinNumber ( Int_t  ibin,
const TAxis inAxis,
const TAxis outAxis 
)
inlinestatic

Definition at line 32 of file TH1Merger.h.

◆ LabelMerge()

Bool_t TH1Merger::LabelMerge ( )
private

Merge histograms with labels.

Definition at line 884 of file TH1Merger.cxx.

◆ operator()()

Bool_t TH1Merger::operator() ( )

Function performing the actual merge.

Definition at line 27 of file TH1Merger.cxx.

◆ SameAxesMerge()

Bool_t TH1Merger::SameAxesMerge ( )
private

Definition at line 740 of file TH1Merger.cxx.

Member Data Documentation

◆ fH0

TH1* TH1Merger::fH0
private

Definition at line 91 of file TH1Merger.h.

◆ fHClone

TH1* TH1Merger::fHClone
private

histogram on which the list is merged

Definition at line 92 of file TH1Merger.h.

◆ fInputList

TList TH1Merger::fInputList
private

copy of fH0 - managed by this class

Definition at line 93 of file TH1Merger.h.

◆ fNewAxisFlag

UInt_t TH1Merger::fNewAxisFlag
private

Definition at line 97 of file TH1Merger.h.

◆ fNewXAxis

TAxis TH1Merger::fNewXAxis
private

Definition at line 94 of file TH1Merger.h.

◆ fNewYAxis

TAxis TH1Merger::fNewYAxis
private

Definition at line 95 of file TH1Merger.h.

◆ fNewZAxis

TAxis TH1Merger::fNewZAxis
private

Definition at line 96 of file TH1Merger.h.

Libraries for TH1Merger:
[legend]

The documentation for this class was generated from the following files: