ATLAS Offline Software
Functions
comphists.h File Reference
#include <iostream>
#include <cassert>
#include "rootincludes.h"
#include "comphistpars.h"
Include dependency graph for comphists.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
bool checkCompat (TH1 *h1, TH1 *h2)
 
bool histsCompatible (TH1 *h1, TH1 *h2)
 

Function Documentation

◆ checkCompat()

template<class T >
bool checkCompat ( TH1 h1,
TH1 h2 
)

Definition at line 11 of file comphists.h.

11  {
12  T * hspecific_1 = dynamic_cast<T*>(h1);
13  T * hspecific_2 = dynamic_cast<T*>(h2);
14  if (!hspecific_1&&!hspecific_2)
15  return true;
16  if (!hspecific_1||!hspecific_2) {
17  REPORT("incompatible types");
18  return false;
19  }
20  return checkParameters<T>(hspecific_1,hspecific_2);
21 }

◆ histsCompatible()

bool histsCompatible ( TH1 h1,
TH1 h2 
)

Definition at line 24 of file comphists.h.

25 {
26  assert(h1!=h2);
27  assert(h1&&h2);
28  return checkCompat<TH1>(h1,h2)
29  && checkCompat<TH1F>(h1,h2)
30  && checkCompat<TH1D>(h1,h2)
31  && checkCompat<TH1S>(h1,h2)
32  && checkCompat<TH1I>(h1,h2)
33  && checkCompat<TH1C>(h1,h2)
34  && checkCompat<TH2>(h1,h2)
35  && checkCompat<TH2F>(h1,h2)
36  && checkCompat<TH2D>(h1,h2)
37  && checkCompat<TH2S>(h1,h2)
38  && checkCompat<TH2I>(h1,h2)
39  && checkCompat<TH2C>(h1,h2)
40  && checkCompat<TProfile>(h1,h2)
41  && checkCompat<TProfile2D>(h1,h2)
42  ;
43  //FIXME: Add more!!
44 }
REPORT
#define REPORT(x)
Definition: comphistpars.h:24
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35