ATLAS Offline Software
comphists.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <iostream>
6 #include <cassert>
7 #include "rootincludes.h"
8 #include "comphistpars.h"
9 
10 template <class T>
11 bool checkCompat(TH1*h1,TH1*h2) {
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 }
22 
23 
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
comphistpars.h
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
checkCompat
bool checkCompat(TH1 *h1, TH1 *h2)
Definition: comphists.h:11
rootincludes.h
TH1
Definition: rootspy.cxx:268
histsCompatible
bool histsCompatible(TH1 *h1, TH1 *h2)
Definition: comphists.h:24
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35