1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoCutMonitorParticleEtCorr - the cut monitor for particles //
4 // which saves particles' et histogram and makes the bin-by-bin correlation //
6 // Author: Adam.Kisiel@cern.ch //
8 ////////////////////////////////////////////////////////////////////////////////
9 #include "AliFemtoCutMonitorParticleEtCorr.h"
10 #include "AliFemtoModelHiddenInfo.h"
16 AliFemtoCutMonitorParticleEtCorr::AliFemtoCutMonitorParticleEtCorr():
24 // Default constructor
25 for (int ib=0; ib<200; ib++) {
27 fMultSumEvent[ib] = 0;
31 AliFemtoCutMonitorParticleEtCorr::AliFemtoCutMonitorParticleEtCorr(const char *aName, int aPhiBins):
41 snprintf(name, 200, "EtCorrAvgPt%s", aName);
42 fPtPerPhi = new TH1D(name, "Average Pt Per Phi", aPhiBins, -0.5, aPhiBins-0.5);
43 snprintf(name, 200, "EtCorrMult%s", aName);
44 fPtMultPerPhi = new TH2D(name, "Multiplicity Per Phi", aPhiBins, -0.5, aPhiBins-0.5, aPhiBins, -0.5, aPhiBins-0.5);
45 snprintf(name, 200, "EtCorrAvgPtCov%s", aName);
46 fPtCovPerPhi = new TH2D(name, "Covariance of Average Pt Per Phi", aPhiBins, -0.5, aPhiBins-0.5, aPhiBins, -0.5, aPhiBins-0.5);
49 fPtCovPerPhi->Sumw2();
50 fPtMultPerPhi->Sumw2();
53 for (int ib=0; ib<200; ib++) {
55 fMultSumEvent[ib] = 0;
60 AliFemtoCutMonitorParticleEtCorr::AliFemtoCutMonitorParticleEtCorr(const AliFemtoCutMonitorParticleEtCorr &aCut):
69 if (fPtCovPerPhi) delete fPtCovPerPhi;
70 fPtCovPerPhi = new TH2D(*aCut.fPtCovPerPhi);
71 if (fPtPerPhi) delete fPtPerPhi;
72 fPtPerPhi = new TH1D(*aCut.fPtPerPhi);
73 if (fPtMultPerPhi) delete fPtMultPerPhi;
74 fPtMultPerPhi = new TH2D(*aCut.fPtMultPerPhi);
75 fPhiBins = aCut.fPhiBins;
76 fNEventsProcessed = aCut.fNEventsProcessed;
78 for (int ib=0; ib<200; ib++) {
80 fMultSumEvent[ib] = 0;
84 AliFemtoCutMonitorParticleEtCorr::~AliFemtoCutMonitorParticleEtCorr()
92 AliFemtoCutMonitorParticleEtCorr& AliFemtoCutMonitorParticleEtCorr::operator=(const AliFemtoCutMonitorParticleEtCorr& aCut)
94 // assignment operator
98 if (fPtCovPerPhi) delete fPtCovPerPhi;
99 fPtCovPerPhi = new TH2D(*aCut.fPtCovPerPhi);
100 if (fPtPerPhi) delete fPtPerPhi;
101 fPtPerPhi = new TH1D(*aCut.fPtPerPhi);
102 if (fPtMultPerPhi) delete fPtMultPerPhi;
103 fPtMultPerPhi = new TH2D(*aCut.fPtMultPerPhi);
104 fPhiBins = aCut.fPhiBins;
105 fNEventsProcessed = aCut.fNEventsProcessed;
110 AliFemtoString AliFemtoCutMonitorParticleEtCorr::Report(){
111 // Prepare report from the execution
112 string stemp = "*** AliFemtoCutMonitorParticleEtCorr report";
113 AliFemtoString returnThis = stemp;
117 void AliFemtoCutMonitorParticleEtCorr::Fill(const AliFemtoTrack* aTrack)
119 // Fill in the monitor histograms with the values from the current track
120 // float tEnergy = ::sqrt(aTrack->P().mag2()+fMass*fMass);
121 // float tRapidity = 0.5*::log((tEnergy+aTrack->P().z())/(tEnergy-aTrack->P().z()));
122 float tPt = ::sqrt((aTrack->P().x())*(aTrack->P().x())+(aTrack->P().y())*(aTrack->P().y()));
123 // float tEta = -TMath::Log(TMath::Tan(aTrack->P().theta()/2.0));
124 float tPhi = aTrack->P().Phi();
125 Double_t tPiTwo = TMath::Pi()*2;
127 while (tPhi > tPiTwo) tPhi -= tPiTwo;
128 while (tPhi < 0) tPhi += tPiTwo;
130 int nbin = (int) floor(tPhi * fPhiBins / tPiTwo);
131 fPtSumEvent[nbin] += tPt;
132 fMultSumEvent[nbin] += 1;
135 void AliFemtoCutMonitorParticleEtCorr::Write()
137 // Write out the relevant histograms
139 fPtCovPerPhi->Write();
140 fPtMultPerPhi->Write();
143 TList *AliFemtoCutMonitorParticleEtCorr::GetOutputList()
145 TList *tOutputList = new TList();
146 tOutputList->Add(fPtPerPhi);
147 tOutputList->Add(fPtCovPerPhi);
148 tOutputList->Add(fPtMultPerPhi);
153 void AliFemtoCutMonitorParticleEtCorr::EventBegin(const AliFemtoEvent* aEvent)
156 for (int iter=0; iter<fPhiBins; iter++) {
157 fPtSumEvent[iter] = 0;
158 fMultSumEvent[iter] = 0;
162 void AliFemtoCutMonitorParticleEtCorr::EventEnd(const AliFemtoEvent* aEvent)
165 for (int ispt=0; ispt<fPhiBins; ispt++) {
166 fPtPerPhi->Fill(ispt, fPtSumEvent[ispt]);
167 for (int ispt2=0; ispt2<fPhiBins; ispt2++) {
168 fPtCovPerPhi->Fill(ispt, ispt2, fPtSumEvent[ispt]*fPtSumEvent[ispt2]);
169 fPtMultPerPhi->Fill(ispt, ispt2, fMultSumEvent[ispt]*fMultSumEvent[ispt2]);