ATLAS Offline Software
Loading...
Searching...
No Matches
HistoHelperRoot.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JETTAGTOOLS_HISTOHELPERROOT_H
6#define JETTAGTOOLS_HISTOHELPERROOT_H
7
8/******************************************************
9 @class HistoHelper
10********************************************************/
11
12#include <string>
13#include <map>
14#include <vector>
15
17#include "GaudiKernel/LockedHandle.h"
19
20class ITHistSvc;
21class TH1;
22class TH2;
23class TH3;
24
25
26namespace Analysis
27{
28
34
36{
37
38 public:
39
41 HistoHelperRoot(ITHistSvc*);
43
44 std::string baseName(const std::string& fullHistoName); // removes the path and return the histogram name
45 void bookHisto(const std::string& histoName, const std::string& histoTitle, unsigned int bins, double minx, double maxx);
46 void bookHisto(const std::string& histoName, const std::string& histoTitle, unsigned int bins, double* edge);
47 void bookHisto(const std::string& histoName, const std::string& histoTitle, unsigned int binsx, double minx, double maxx, unsigned int binsy, double miny, double maxy);
48 void bookHisto(const std::string& histoName, const std::string& histoTitle, unsigned int binsx, double* edgex, unsigned int binsy, double* edgey);
49 void bookHisto(const std::string& histoName, const std::string& histoTitle, unsigned int binsx, double minx, double maxx, unsigned int binsy, double miny, double maxy, unsigned int binsz, double minz, double maxz);
50 void fillHisto(const std::string& histoName, double ) const;
51 void fillHistoWithWeight(const std::string& histoName, double ,double) const;
52 void fillHisto(const std::string& histoName, double, double ) const;
53 void fillHisto(const std::string& histoName, double, double, double) const;
54
56 TH1* getHisto1D ATLAS_NOT_THREAD_SAFE (const std::string& histoName);
57 TH2* getHisto2D ATLAS_NOT_THREAD_SAFE (const std::string& histoName);
58 TH3* getHisto3D ATLAS_NOT_THREAD_SAFE (const std::string& histoName);
60
61 // Interpolating
62 static double Interpol1d(double, TH1*);
63 static double Interpol2d(double, double, TH2*);
64 static double Interpol3d(double, double, double, TH3*);
65 // Smoothing (ASH)
66 static void smoothASH2D(TH2*, int m1=3, int m2=3, bool debug=false);
67 static void smoothASH3D(TH3*, int m1=3, int m2=3, int m3=2, bool debug=false);
68
69 //changing directory
70 //void setHistoDir(std::string name) {m_histoDir = name;};
72 void print();
73
74 private:
75
76 ITHistSvc* m_histoSvc;
77 std::map<std::string, LockedHandle<TH1>> m_histoMap1D;
78 std::map<std::string, LockedHandle<TH2>> m_histoMap2D;
79 std::map<std::string, LockedHandle<TH3>> m_histoMap3D;
80 std::map<std::string, HistoLimits> m_histoLimitsMap1D;
81 std::map<std::string, HistoLimits> m_histoLimitsMap2D;
82 std::map<std::string, HistoLimits> m_histoLimitsMap3D;
84};
85
86}
87#endif
88
const bool debug
static const std::vector< std::string > bins
Define macros for attributes used to control the static checker.
std::map< std::string, HistoLimits > m_histoLimitsMap2D
static double Interpol3d(double, double, double, TH3 *)
std::map< std::string, HistoLimits > m_histoLimitsMap1D
TH2 *getHisto2D ATLAS_NOT_THREAD_SAFE(const std::string &histoName)
std::map< std::string, LockedHandle< TH2 > > m_histoMap2D
static double Interpol1d(double, TH1 *)
std::map< std::string, LockedHandle< TH1 > > m_histoMap1D
HistoHelperRoot(ITHistSvc *)
Constructor with histoSvc only.
static double Interpol2d(double, double, TH2 *)
std::map< std::string, HistoLimits > m_histoLimitsMap3D
static void smoothASH2D(TH2 *, int m1=3, int m2=3, bool debug=false)
static void smoothASH3D(TH3 *, int m1=3, int m2=3, int m3=2, bool debug=false)
std::string baseName(const std::string &fullHistoName)
TH3 *getHisto3D ATLAS_NOT_THREAD_SAFE(const std::string &histoName)
TH1 *getHisto1D ATLAS_NOT_THREAD_SAFE(const std::string &histoName)
Histogram accessors (not thread-safe because exposed bare pointer)
void bookHisto(const std::string &histoName, const std::string &histoTitle, unsigned int bins, double minx, double maxx)
std::map< std::string, LockedHandle< TH3 > > m_histoMap3D
void fillHistoWithWeight(const std::string &histoName, double, double) const
void fillHisto(const std::string &histoName, double) const
The namespace of all packages in PhysicsAnalysis/JetTagging.