Analysis Software
Documentation for sPHENIX simulation software
 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 //=====================
10  fDebug = 0;
11  fRho = NULL;
12  fInnerRadius=1.;
13  fOutterRadius=2.;
14  fHalfLength=1.;
15  fNRadialSteps=1;
18  fFileNameRoot="rho";
19 }
20 //=====================
22 }
23 //=====================
24 void QPileUp::Make() {
25  InitMaps();
26  SaveMaps();
27 }
28 //=====================
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]",
40  if(fDebug>0) printf("[DONE]\n");
41 }
42 //=====================
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 }