Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
QAHistManagerDef.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file QAHistManagerDef.cc
1
// $Id: $
2
11
#include "
QAHistManagerDef.h
"
12
13
#include <
fun4all/Fun4AllHistoManager.h
>
14
#include <
fun4all/Fun4AllServer.h
>
15
16
#include <TAxis.h>
17
18
#include <cassert>
19
#include <cmath>
20
#include <iosfwd>
// for std
21
#include <vector>
22
23
namespace
QAHistManagerDef
24
{
26
Fun4AllHistoManager
*
27
getHistoManager
()
28
{
29
Fun4AllServer
*se =
Fun4AllServer::instance
();
30
Fun4AllHistoManager
*hm = se->
getHistoManager
(
HistoManagerName
);
31
32
if
(not hm)
33
{
34
// std::cout
35
// << "QAHistManagerDef::get_HistoManager - Making Fun4AllHistoManager EMCalAna_HISTOS"
36
// << std::endl;
37
hm =
new
Fun4AllHistoManager
(
HistoManagerName
);
38
se->
registerHistoManager
(hm);
39
}
40
41
assert
(hm);
42
43
return
hm;
44
}
45
47
void
saveQARootFile
(
const
std::string
&file_name)
48
{
49
getHistoManager
()->
dumpHistos
(file_name);
50
}
51
53
void
useLogBins
(TAxis *axis)
54
{
55
assert
(axis);
56
assert
(axis->GetXmin() > 0);
57
assert
(axis->GetXmax() > 0);
58
59
const
int
bins
= axis->GetNbins();
60
61
Axis_t from = log10(axis->GetXmin());
62
Axis_t to = log10(axis->GetXmax());
63
Axis_t
width
= (to - from) / bins;
64
std::vector<Axis_t> new_bins(bins + 1);
65
66
for
(
int
i
= 0;
i
<=
bins
;
i
++)
67
{
68
new_bins[
i
] = pow(10, from +
i
* width);
69
}
70
axis->Set(bins, new_bins.data());
71
}
72
}
// namespace QAHistManagerDef
coresoftware
blob
master
offline
packages
QAUtils
QAHistManagerDef.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:08
using
1.8.2 with
sPHENIX GitHub integration