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
QPileUp.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file QPileUp.cxx
1
#include "
QPileUp.h
"
2
#include <string>
3
4
#include "TH3F.h"
5
#include "TFile.h"
6
#include "TMath.h"
7
8
//=====================
9
QPileUp::QPileUp
() {
10
fDebug
= 0;
11
fRho
= NULL;
12
fInnerRadius
=1.;
13
fOutterRadius
=2.;
14
fHalfLength
=1.;
15
fNRadialSteps
=1;
16
fNAzimuthalSteps
=1;
17
fNLongitudinalSteps
=1;
18
fFileNameRoot
=
"rho"
;
19
}
20
//=====================
21
QPileUp::~QPileUp
() {
22
}
23
//=====================
24
void
QPileUp::Make
() {
25
InitMaps
();
26
SaveMaps
();
27
}
28
//=====================
29
void
QPileUp::InitMaps
() {
30
if
(
fDebug
>0)
printf
(
"QPileUp is initializing rho map ... "
);
31
if
(
fDebug
>1) {
32
printf
(
"\nTPC radial axis from %f to %f cm. spanned in %d steps\n"
,
fInnerRadius
,
fOutterRadius
,
fNRadialSteps
);
33
printf
(
"TPC longitudinal axis from %f to %f cm. spanned in %d steps\n"
,-
fHalfLength
,
fHalfLength
,
fNLongitudinalSteps
);
34
printf
(
"TPC azimuthal axis spanned in %d steps\n"
,
fNAzimuthalSteps
);
35
}
36
fRho
=
new
TH3F(
"rho"
,
"ChargeDensity [fC/cm^3];Radial [cm];Azimuthal [rad];Longitudinal [cm]"
,
37
fNRadialSteps
,
fInnerRadius
,
fOutterRadius
,
38
fNAzimuthalSteps
,0,
TMath::TwoPi
(),
39
fNLongitudinalSteps
,-
fHalfLength
,+
fHalfLength
);
40
if
(
fDebug
>0)
printf
(
"[DONE]\n"
);
41
}
42
//=====================
43
void
QPileUp::SaveMaps
() {
44
const
char
*outputfile= Form(
"%s_0.root"
,
fFileNameRoot
.data());
45
if
(
fDebug
>0)
printf
(
"QPileUp saving maps into %s ... "
,outputfile);
46
TFile *
ofile
=
new
TFile(outputfile,
"RECREATE"
);
47
ofile->WriteObject(
fRho
,
"rho"
);
48
ofile->Close();
49
if
(
fDebug
>0)
printf
(
"[DONE]\n"
);
50
}
analysis
blob
master
TPC
SCDCorrections
QPileUp.cxx
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:58
using
1.8.2 with
sPHENIX GitHub integration