2 #include "StEStructSigAnal.h"
3 #include "StEStructSigAnal.h"
13 printf(
"Creating StEStructSigAnal object.\n");
14 mInputFile = strdup( inputFile );
15 mpreFix = strdup( prefix );
19 StEStructSigAnal::~StEStructSigAnal() {
25 void StEStructSigAnal::newFile(
char *inputFile ) {
32 mInputFile = strdup( inputFile );
33 mInFile =
new TFile( mInputFile );
37 void StEStructSigAnal::closeFile() {
48 void StEStructSigAnal::getLimits() {
50 TH2F *hnBins = (TH2F *) gDirectory->Get(
"nBins");
51 mNPhiBins = hnBins->GetNbinsX();
52 mNEtaBins = hnBins->GetNbinsY();
54 mNFiles = hnBins->GetBinContent(mNPhiBins,mNEtaBins);
56 TH1F *hEtaLimits = (TH1F *) gDirectory->Get(
"EtaLimits");
57 mEtaMin = hEtaLimits->GetBinContent(1) / mNFiles;
58 mEtaMax = hEtaLimits->GetBinContent(2) / mNFiles;
60 void StEStructSigAnal::normalizeCounters() {
62 TH2F *hnBins = (TH2F *) gDirectory->Get(
"nBins");
63 hnBins->Scale( 1.0/mNFiles );
64 TH2F *hoffset = (TH2F *) gDirectory->Get(
"offset");
65 hoffset->Scale( 1.0/mNFiles );
66 TH2F *hfUnique = (TH2F *) gDirectory->Get(
"fUnique");
67 hfUnique->Scale( 1.0/mNFiles );
70 void StEStructSigAnal::fillHistograms() {
71 for (
int i=0;i<mnSigmas;i++) {
72 mSigma[i]->fillHistograms();
75 void StEStructSigAnal::writeHistograms(TFile* sig) {
78 for (
int i=0;i<mnSigmas;i++) {
79 mSigma[i]->writeHistograms();
83 void StEStructSigAnal::initArrays() {
92 mInFile =
new TFile( mInputFile );
94 printf(
"Scanning for centrality bins.\n");
96 for (
int i=0;i<100;i++) {
97 sprintf( hist,
"NSum%i_0", i );
98 if (gDirectory->Get(hist)) {
102 printf(
"Found %i centrality bins. \n", mnCents);
104 for (
int i=0;i<100;i++) {
105 sprintf( hist,
"%sNSum0_%i_0", mpreFix, i );
106 if (gDirectory->Get(hist)) {
110 printf(
"Found %i Pt bins. \n", mnPts);
112 for (
int i=0;i<100;i++) {
113 sprintf( hist,
"%sNSum%i_0_0", mpreFix, i );
114 if (gDirectory->Get(hist)) {
118 printf(
"Found %i Pt centrality bins. \n", mnPtCents);
124 mnSigmas = mnCents + mnPts*mnPtCents;
127 for (
int i=0;i<mnCents;i++) {
129 mSigma[i] =
new StEStructSigmas(key,mNPhiBins,mNEtaBins,mEtaMin,mEtaMax);
132 for (
int i=0;i<mnPtCents;i++) {
133 for (
int j=0;j<mnPts;j++) {
134 sprintf(key,
"%i_%i",i,j);
136 mEtaMin,mEtaMax,mpreFix);
140 mInFile =
new TFile( mInputFile );
144 void StEStructSigAnal::deleteArrays() {
145 for (
int i=0;i<mnSigmas;i++) {