3 # include <AliAnalysisManager.h>
4 # include <AliESDEvent.h>
5 # include <AliMultiplicity.h>
6 # include <AliVEventHandler.h>
7 # include <AliESDVertex.h>
8 # include <AliProdInfo.h>
16 #include <AliAnalysisTaskSE.h>
26 DefineOutput(1, TList::Class());
27 DefineOutput(2, TList::Class());
28 fBranchNames =
"AliMultiplicity.,SPDVertex.,PrimaryVertex.";
38 fList->SetName(
"Sums");
41 fMult =
new TH2D(
"mult",
"SPD tracklets", 80, -2, 2, 10, -10, 10);
42 fMult->SetXTitle(
"#eta");
43 fMult->SetYTitle(
"v_{z} [cm]");
45 fMult->SetDirectory(0);
47 fVz =
new TH1D(
"vz",
"Interaction point", 10, -10, 10);
48 fVz->SetXTitle(
"v_{z} [cm]");
61 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
63 Info(
"",
"Got input handler");
64 TList *uiList = inputHandler->GetUserInfo();
66 Info(
"",
"Got user list:");
69 fProd =
new AliProdInfo(uiList);
70 Info(
"",
"Lising production information");
78 if (event->IsPileupFromSPD(3,0.8))
return;
80 const AliESDVertex* vtx =
event->GetPrimaryVertexSPD();
81 if (!vtx || !vtx->GetStatus())
return;
82 if (vtx->IsFromVertexerZ() &&
83 (vtx->GetDispersion() > 0.2 || vtx->GetZRes() > 1.25 * 0.2))
86 const AliMultiplicity* mult =
event->GetMultiplicity();
92 Int_t nTracklets = mult->GetNumberOfTracklets();
93 for (
Int_t i = 0; i < nTracklets; i++)
94 fMult->Fill(mult->GetEta(i), vz);
100 TList* l =
dynamic_cast<TList*
>(GetOutputData(1));
102 Warning(
"Terminate",
"No out data # 1 found");
106 TH2D* mult =
static_cast<TH2D*
>(l->FindObject(
"mult"));
107 TH1D* vz =
static_cast<TH1D*
>(l->FindObject(
"vz"));
109 Warning(
"Terminate",
"Either 'mult' (%p) or 'vz' (%p) or both not found",
115 output->SetName(
"Results");
118 TH2D* out =
static_cast<TH2D*
>(mult->Clone(
"dndeta"));
119 out->SetTitle(
"dN_{ch}/d#eta from SPD tracklets per vertex bin");
120 out->SetZTitle(
"#frac{1}{N}#frac{dN_{ch}}{d#eta}");
121 out->SetDirectory(0);
122 Int_t nVz = mult->GetNbinsY();
123 Int_t nEta = mult->GetNbinsX();
124 for (
Int_t iVz = 1; iVz <= nVz; iVz++) {
125 Double_t nEv = vz->GetBinContent(iVz);
127 Double_t sca = (nEv == 0 ? 0 : 1. / nEv);
128 for (
Int_t iEta = 1; iEta <= nEta; iEta++) {
129 Double_t c = mult->GetBinContent(iEta,iVz);
130 Double_t e = mult->GetBinError(iEta,iVz);
131 Double_t ee = TMath::Sqrt(c*c * e1*e1 + nEv*nEv * e*e) * sca*sca;
132 out->SetBinContent(iEta, iVz, sca * c);
133 out->SetBinError(iEta, iVz, ee);
136 Double_t etaMin = mult->GetXaxis()->GetXmin();
137 Double_t etaMax = mult->GetXaxis()->GetXmax();
138 out->Scale(
Double_t(nEta) / (etaMax-etaMin));
MyAnalysis(const char *name)
virtual void UserExec(Option_t *)
MyAnalysis(const MyAnalysis &o)
void Terminate(Option_t *)
MyAnalysis & operator=(const MyAnalysis &)
virtual void UserCreateOutputObjects()