]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0FlowMCHijing.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_PbPb / AliAnalysisTaskPi0FlowMCHijing.cxx
CommitLineData
7ea85581 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16// Extension to Pi0FlowMC, mimicing AliPHOSHijingEfficiency
17// by Dmitri Peressounko, 05.02.2013
18// Authors: Henrik Qvigstad, Dmitri Peressounko
19// Date : 05.04.2013
20/* $Id$ */
21
22#include "AliStack.h"
23#include "TParticle.h"
24#include "AliCaloPhoton.h"
25
26#include "AliAnalysisTaskPi0FlowMCHijing.h"
27
28ClassImp(AliAnalysisTaskPi0FlowMCHijing);
29
30AliAnalysisTaskPi0FlowMCHijing::AliAnalysisTaskPi0FlowMCHijing(const char* name, AliAnalysisTaskPi0Flow::Period period)
31: AliAnalysisTaskPi0FlowMC(name, period)
32{
33}
34
35AliAnalysisTaskPi0FlowMCHijing::~AliAnalysisTaskPi0FlowMCHijing()
36{
37}
38
39
40Double_t AliAnalysisTaskPi0FlowMCHijing::PrimaryWeight(Int_t primary)
41{
42 //Check who is the primary and introduce weight to correct primary spectrum
00c8d7ab 43
44 if(primary<0 || primary>=fStack->GetNtrack())
7ea85581 45 return 1 ;
46 //trace primaries up to IP
00c8d7ab 47 TParticle* particle = fStack->Particle(primary);
7ea85581 48 Double_t r=particle->R() ;
00c8d7ab 49 Int_t mother = particle->GetFirstMother() ;
7ea85581 50 while(mother>-1){
51 if(r<1. && particle->GetPdgCode()==111)
52 break ;
00c8d7ab 53 particle = fStack->Particle(mother);
54 mother = particle->GetFirstMother() ;
7ea85581 55 r=particle->R() ;
56 }
00c8d7ab 57
58 return TMath::Max(0.,PrimaryParticleWeight(particle)) ;
7ea85581 59}
60
61
62Double_t AliAnalysisTaskPi0FlowMCHijing::PrimaryParticleWeight(TParticle* particle)
63{
64 Int_t pdg = particle->GetPdgCode() ;
65 Int_t type=0 ;
66 if(pdg == 111 || TMath::Abs(pdg)==211){
67 type =1 ;
68 }
69 else{
70 if(TMath::Abs(pdg)<1000){ //Kaon-like
71 type =2 ;
72 }
73 else
74 type = 3; //baryons
75 }
76
77 Double_t pt = particle->Pt() ;
78 if(type==1){
79 if(fCentBin==0) //0-5
80 return (1.662990+1.140890*pt-0.192088*pt*pt)/(1.-0.806630*pt+0.304771*pt*pt)+0.141690*pt ;
81 if(fCentBin==1) //5-10
82 return (1.474351+0.791492*pt-0.066369*pt*pt)/(1.-0.839338*pt+0.317312*pt*pt)+0.093289*pt ;
83 if(fCentBin==2) //10-20
84 return (1.174728+0.959681*pt-0.137695*pt*pt)/(1.-0.788873*pt+0.299538*pt*pt)+0.128759*pt ;
85 if(fCentBin==3) //20-40
86 return (0.927335+0.475349*pt+0.004364*pt*pt)/(1.-0.817966*pt+0.309787*pt*pt)+0.086899*pt ;
87 if(fCentBin==4) //40-60
88 return (0.676878+0.190680*pt+0.077031*pt*pt)/(1.-0.790623*pt+0.305183*pt*pt)+0.064510*pt ;
89 if(fCentBin==5) //60-80
90 return (0.684726-0.606262*pt+0.409963*pt*pt)/(1.-1.080061*pt+0.456933*pt*pt)+0.005151*pt ;
91 }
92 if(type==2){
93 if(fCentBin==0) //0-5
94 return (-0.417131+2.253936*pt-0.337731*pt*pt)/(1.-0.909892*pt+0.316820*pt*pt)+0.157312*pt ;
95 if(fCentBin==1) //5-10
96 return (-0.352275+1.844466*pt-0.248598*pt*pt)/(1.-0.897048*pt+0.316462*pt*pt)+0.132461*pt ;
97 if(fCentBin==2) //10-20
98 return (-0.475481+1.975108*pt-0.336013*pt*pt)/(1.-0.801028*pt+0.276705*pt*pt)+0.188164*pt ;
99 if(fCentBin==3) //20-40
100 return (-0.198954+1.068789*pt-0.103540*pt*pt)/(1.-0.848354*pt+0.299209*pt*pt)+0.112939*pt ;
101 if(fCentBin==4) //40-60
102 return (-0.111052+0.664041*pt-0.019717*pt*pt)/(1.-0.804916*pt+0.300779*pt*pt)+0.095784*pt ;
103 if(fCentBin==5) //0-5
104 return (0.202788-0.439832*pt+0.564585*pt*pt)/(1.-1.254029*pt+0.679444*pt*pt)+0.016235*pt ;
105 }
106 if(type==3){
107 if(fCentBin==0) //0-5
108 return (-1.312732+2.743568*pt-0.375775*pt*pt)/(1.-0.717533*pt+0.164694*pt*pt)+0.164445*pt ;
109 if(fCentBin==1) //5-10
110 return (-1.229425+2.585889*pt-0.330164*pt*pt)/(1.-0.715892*pt+0.167386*pt*pt)+0.133085*pt ;
111 if(fCentBin==2) //10-20
112 return (-1.135677+2.397489*pt-0.320355*pt*pt)/(1.-0.709312*pt+0.164350*pt*pt)+0.146095*pt ;
113 if(fCentBin==3) //20-40
114 return (-0.889993+1.928263*pt-0.220785*pt*pt)/(1.-0.715991*pt+0.174729*pt*pt)+0.095098*pt ;
115 if(fCentBin==4) //40-60
116 return (-0.539237+1.329118*pt-0.115439*pt*pt)/(1.-0.722906*pt+0.186832*pt*pt)+0.059267*pt ;
117 if(fCentBin==5) //60-80
118 return (-0.518126+1.327628*pt-0.130881*pt*pt)/(1.-0.665649*pt+0.184300*pt*pt)+0.081701*pt ;
119 }
120 return 1. ;
00c8d7ab 121}