1 /* *************************************************************************
2 * AliEbyE Analysis for Particle Ratio Fluctuation *
3 * Deepika Rathee | Satyajit Jena *
4 * drathee@cern.ch | sjena@cern.ch *
5 * Date: Wed Jul 9 18:38:30 CEST 2014 *
6 * New approch to find particle ratio to reduce memory *
8 ***************************************************************************/
10 AliAnalysisTask *AddEbyEPidRatioTask(const Char_t *name = "NuDyn", // 0
11 Int_t isModeDist = 1, // 1
12 Bool_t isModeEff = 0, // 2
13 Bool_t isModeDCA = 0, // 3
14 Bool_t isModeQA = 0, // 4
15 Int_t isRatio = 3, // 5
16 Bool_t isModeAOD = 0, // 6
17 Bool_t isSetExt = 0, // 7
18 Int_t aodFilterBit = 1024, // 8
19 Float_t gEta = 0.8, // 9
20 Int_t modeCuts = 0, // 10
21 Int_t modePID =-1, // 11
22 Float_t gMinPt = 0.3, // 12
23 Float_t gMaxPt = 2.5, // 13
24 Float_t gMinPtForTof = 0.21, // 14
25 Float_t gMaxPtForTPClow = 0.69, // 15
26 Float_t gMinPtEff = 0.3, // 16
27 Float_t gMaxPtEff = 2.5, // 17
28 Float_t gSigmaITS = 4.0, // 18
29 Float_t gSigmaTOF = 4.0, // 19
30 Float_t gSigmaTPC = 4.0, // 20
31 Float_t gSigmaTPClow = 3.0,
33 Int_t nSub = 25) { // 21
37 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
39 Error("AddTaskNetParticle", "No analysis manager found.");
43 Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
45 Info("AddTaskNetParticle", "This task has MC.");
47 AliEbyEPidRatioTask *task = new AliEbyEPidRatioTask("EbyEPidRatio");
49 Error("EbyEPidRatio", "Task could not be created.");
56 task->SetModeEffCreation(1); // => 1 = on | 0 = off (default)
58 task->SetModeDCACreation(1); // => 1 = on | 0 = off (default)
61 task->SetIsAOD(1); // => 1 = AOD | 0 = ESD (default)
62 task->SetTrackFilterBit(aodFilterBit);
65 task->SetModeQACreation(1); // => 1 = on | 0 = off (default)
67 task->SetModeDistCreation(isModeDist); // 0 nothing, 1 only dist, 2, with qa
68 task->SetIsRatio(isRatio);
70 Float_t minPt, maxPt, minPtEff, maxPtEff, minPtForTOF;
71 Float_t nSigmaITS, nSigmaTPC, nSigmaTPClow, nSigmaTOF, maxPtForTPClow;
72 Float_t etaMax, etaMaxEff, maxRap;
76 maxPtForTPClow = 0.69;
94 minPtForTOF = gMinPtForTof;
95 maxPtForTPClow = gMaxPtForTPClow;
101 nSigmaITS = gSigmaITS;
102 nSigmaTPC = gSigmaTPC;
103 nSigmaTPClow = gSigmaTPClow;
104 nSigmaTOF = gSigmaTOF;
107 if (modePID == -1) { // default
108 pidStrategy = 7; // 7: ITS + TPC + TOF (using minPtForTOF)
110 pidStrategy = 5; // 5: TPC + TOF (using minPtForTOF)
113 pidStrategy = modePID;
115 AliEbyEPidRatioHelper *helper = new AliEbyEPidRatioHelper;
117 Error("AddTaskNetParticle", "Helper could not be created.");
123 task->SetESDTrackCutMode(modeCuts); // => 0 = normal | 1 = LF
124 task->SetEtaMax(etaMax); // eta cut
125 task->SetEtaMaxEff(etaMaxEff); // eta cut for efficiency
126 task->SetPtRange(minPt, maxPt); // pt cut range for the analysis
127 task->SetPtRangeEff(minPtEff, maxPtEff); // pt cut range for the correction / efficiency / contamination creation
128 if (isPer) task->SetIsPer(); //
130 helper->SetVertexZMax(10.);
131 helper->SetCentralityBinMax(11);
132 helper->SetRapidityMax(maxRap);
133 helper->SetMinTrackLengthMC(70.);
134 helper->SetNSigmaMaxCdd(0.); // 3. || ->> Turn off sigmaDCA cuts for now
135 helper->SetNSigmaMaxCzz(0.); // 3. || ->> Turn off sigmaDCA cuts for now
136 helper->SetPhiRange(0., 3.88); // Only used if requested in task - default is TwoPi
137 helper->SetPIDStrategy(pidStrategy);
138 helper->SetNSigmaMaxITS(nSigmaITS);
139 helper->SetNSigmaMaxTPC(nSigmaTPC);
140 helper->SetNSigmaMaxTPClow(nSigmaTPClow);
141 helper->SetNSigmaMaxTOF(nSigmaTOF);
142 helper->SetMinPtForTOFRequired(minPtForTOF);
143 helper->SetMaxPtForTPClow(maxPtForTPClow);
144 helper->SetNSubSamples(nSub);
146 task->SetNetParticleHelper(helper);
149 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
150 TString outputFileName = Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name);
151 TString outputQAFileName = Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name);
153 AliAnalysisDataContainer *coutput = mgr->CreateContainer(name, TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
154 AliAnalysisDataContainer *coutputEff = mgr->CreateContainer(Form("%s_eff", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
155 AliAnalysisDataContainer *coutputCont = mgr->CreateContainer(Form("%s_cont", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
156 AliAnalysisDataContainer *coutputDca = mgr->CreateContainer(Form("%s_dca", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
158 AliAnalysisDataContainer *coutputQA = mgr->CreateContainer(Form("%sQA", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputQAFileName);
160 mgr->ConnectInput (task, 0, cinput );
161 mgr->ConnectOutput (task, 1, coutput);
162 mgr->ConnectOutput (task, 2, coutputEff);
163 mgr->ConnectOutput (task, 3, coutputCont);
164 mgr->ConnectOutput (task, 4, coutputDca);
165 mgr->ConnectOutput (task, 5, coutputQA);