]>
Commit | Line | Data |
---|---|---|
0bde631d | 1 | AliFourPion *AddTaskFourPion( |
2 | Bool_t LEGO=kTRUE, | |
3 | Bool_t MCcase=kFALSE, | |
4 | Bool_t PbPbcase=kTRUE, | |
5 | Bool_t GenerateSignal=kFALSE, | |
6214cea0 | 6 | Bool_t TabulatePairs=kFALSE, |
7 | Bool_t LinearInterpolate=kTRUE, | |
0bde631d | 8 | Int_t CentBinLowLimit=0, |
9 | Int_t CentBinHighLimit=1, | |
10 | Int_t RMax=11, | |
11 | Float_t fcSq=0.7, | |
12 | UInt_t FilterBit=7, | |
13 | Float_t MaxChi2NDF=10, | |
14 | Int_t MinTPCncls=0, | |
15 | Float_t MinSepPairEta=0.02, | |
16 | Float_t MinSepPairPhi=0.045, | |
17 | Float_t SigmaCutTPC=2.0, | |
18 | Float_t SigmaCutTOF=2.0, | |
19 | TString StWeightName="alien:///alice/cern.ch/user/d/dgangadh/WeightFile_FourPion.root", | |
20 | TString StMomResName="alien:///alice/cern.ch/user/d/dgangadh/MomResFile_FourPion.root", | |
b79b516e | 21 | TString StKName="alien:///alice/cern.ch/user/d/dgangadh/KFile_FourPion.root", |
22 | TString StMuonName="alien:///alice/cern.ch/user/d/dgangadh/MuonCorrection_FourPion.root" | |
23 | ) { | |
0bde631d | 24 | |
25 | //=========================================================================== | |
26 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
27 | if (!mgr) { | |
28 | ::Error("AddTaskFourPion", "No analysis manager to connect to."); | |
29 | return NULL; | |
30 | } | |
31 | ||
32 | ||
33 | //____________________________________________// | |
34 | // Create task | |
35 | AliFourPion *FourPionTask = new AliFourPion("FourPionTask"); | |
36 | if(!FourPionTask) return NULL; | |
37 | FourPionTask->SetLEGOCase(LEGO); | |
38 | FourPionTask->SetMCdecision(MCcase); | |
39 | FourPionTask->SetPbPbCase(PbPbcase); | |
40 | FourPionTask->SetGenerateSignal(GenerateSignal); | |
41 | FourPionTask->SetTabulatePairs(TabulatePairs); | |
6214cea0 | 42 | FourPionTask->SetInterpolationType(LinearInterpolate); |
0bde631d | 43 | FourPionTask->SetCentBinRange(CentBinLowLimit, CentBinHighLimit); |
44 | FourPionTask->SetRMax(RMax); | |
45 | FourPionTask->SetfcSq(fcSq); | |
46 | FourPionTask->SetFilterBit(FilterBit); | |
47 | FourPionTask->SetMaxChi2NDF(MaxChi2NDF); | |
48 | FourPionTask->SetMinTPCncls(MinTPCncls); | |
49 | FourPionTask->SetPairSeparationCutEta(MinSepPairEta); | |
50 | FourPionTask->SetPairSeparationCutPhi(MinSepPairPhi); | |
51 | FourPionTask->SetNsigmaTPC(SigmaCutTPC); | |
52 | FourPionTask->SetNsigmaTOF(SigmaCutTOF); | |
01d7aaf2 | 53 | // |
54 | FourPionTask->SetMixedChargeCut(kFALSE); | |
55 | FourPionTask->SetMinPt(0.16); | |
56 | FourPionTask->SetMaxPt(1.0); | |
57 | FourPionTask->SetKT3transition(0.3); | |
58 | FourPionTask->SetKT4transition(0.3); | |
0bde631d | 59 | mgr->AddTask(FourPionTask); |
60 | ||
61 | ||
62 | // Create ONLY the output containers for the data produced by the task. | |
63 | // Get and connect other common input/output containers via the manager as below | |
64 | //============================================================================== | |
65 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
66 | outputFileName += ":PWGCF.outputFourPionAnalysis.root"; | |
67 | AliAnalysisDataContainer *coutFourPion = mgr->CreateContainer("FourPionOutput", TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data()); | |
68 | mgr->ConnectInput(FourPionTask, 0, mgr->GetCommonInputContainer()); | |
69 | mgr->ConnectOutput(FourPionTask, 1, coutFourPion); | |
70 | ||
71 | ||
72 | TFile *inputFileWeight = 0; | |
73 | TFile *inputFileMomRes = 0; | |
74 | TFile *inputFileFSI = 0; | |
75 | ||
76 | ||
77 | if(!TabulatePairs){ | |
78 | inputFileWeight = TFile::Open(StWeightName,"OLD"); | |
79 | if (!inputFileWeight){ | |
80 | cout << "Requested file:" << inputFileWeight << " was not opened. ABORT." << endl; | |
81 | return NULL; | |
82 | } | |
83 | //////////////////////////////////////////////////// | |
84 | // C2 Weight File | |
85 | const Int_t ktbins_temp = FourPionTask->GetNumKtBins(); | |
86 | const Int_t cbins_temp = FourPionTask->GetNumCentBins(); | |
87 | const Int_t ktbins = ktbins_temp; | |
88 | const Int_t cbins = cbins_temp; | |
89 | ||
90 | TH3F *weightHisto[ktbins][cbins]; | |
91 | for(Int_t i=0; i<ktbins; i++){ | |
92 | for(Int_t j=0; j<cbins; j++){ | |
93 | TString name = "Weight_Kt_"; | |
94 | name += i; | |
95 | name += "_Ky_0_M_"; | |
96 | name += j; | |
97 | name += "_ED_0"; | |
98 | ||
99 | weightHisto[i][j] = (TH3F*)inputFileWeight->Get(name); | |
100 | } | |
101 | } | |
102 | FourPionTask->SetWeightArrays( kTRUE, weightHisto ); | |
103 | //////////////////////////////////////////////////// | |
104 | }// TabulatePairs check | |
105 | ||
106 | if(!MCcase && !TabulatePairs){ | |
107 | ||
108 | inputFileMomRes = TFile::Open(StMomResName,"OLD"); | |
109 | if (!inputFileMomRes){ | |
110 | cout << "Requested file:" << inputFileMomRes << " was not opened. ABORT." << endl; | |
111 | return NULL; | |
112 | } | |
113 | //////////////////////////////////////////////////// | |
114 | // Momentum Resolution File | |
03c241ef | 115 | TH2D *momResHisto2DSC = 0; |
116 | TH2D *momResHisto2DMC = 0; | |
117 | momResHisto2DSC = (TH2D*)inputFileMomRes->Get("MRC_C2_SC"); | |
118 | momResHisto2DMC = (TH2D*)inputFileMomRes->Get("MRC_C2_MC"); | |
119 | FourPionTask->SetMomResCorrections( kTRUE, momResHisto2DSC, momResHisto2DMC ); | |
0bde631d | 120 | //////////////////////////////////////////////////// |
b79b516e | 121 | |
122 | // Muon corrections | |
123 | inputFileMuon = TFile::Open(StMuonName,"OLD"); | |
124 | if (!inputFileMuon){ | |
125 | cout << "Requested file:" << inputFileMuon << " was not opened. ABORT." << endl; | |
126 | return NULL; | |
127 | } | |
128 | TH2D *muonHisto2D = 0; | |
129 | muonHisto2D = (TH2D*)inputFileMuon->Get("WeightmuonCorrection"); | |
130 | FourPionTask->SetMuonCorrections( kTRUE, muonHisto2D); | |
131 | ||
0bde631d | 132 | }// MCcase and TabulatePairs check |
133 | ||
134 | ||
135 | //////////////////////////////////////////////////// | |
136 | // FSI File | |
137 | inputFileFSI = TFile::Open(StKName,"OLD"); | |
138 | if (!inputFileFSI){ | |
139 | cout << "Requested file:" << inputFileFSI << " was not opened. ABORT." << endl; | |
140 | return NULL; | |
141 | } | |
142 | TH1D *FSIss[12]; | |
143 | TH1D *FSIos[12]; | |
144 | for(Int_t index=0; index<12; index++) { | |
145 | TString *nameSS=new TString("K2ss_"); | |
146 | *nameSS += index; | |
147 | FSIss[index] = (TH1D*)inputFileFSI->Get(nameSS->Data()); | |
148 | TString *nameOS=new TString("K2os_"); | |
149 | *nameOS += index; | |
150 | FSIos[index] = (TH1D*)inputFileFSI->Get(nameOS->Data()); | |
151 | // | |
152 | FSIss[index]->SetDirectory(0); | |
153 | FSIos[index]->SetDirectory(0); | |
154 | } | |
155 | // | |
156 | FourPionTask->SetFSICorrelations( kTRUE, FSIss, FSIos ); | |
157 | //////////////////////////////////////////////////// | |
158 | ||
159 | ||
160 | // Return the task pointer | |
161 | return FourPionTask; | |
162 | } |