]>
Commit | Line | Data |
---|---|---|
204c7c83 | 1 | //=========================================================================// |
2 | // // | |
3 | // Analysis AddTask for Particle Ratio Fluctuation Study // | |
4 | // Author: Deepika Rathee || Satyajit Jenara // | |
5 | // drathee@cern.ch || sjena@cern.ch // | |
6 | // Thu Dec 19 09:09:38 CET 2013 | |
7 | // // | |
8 | //=========================================================================// | |
249ebe76 | 9 | |
204c7c83 | 10 | void AddAliEbyENetChargeFluctuationTask(const Char_t *taskname="TOFTPC", |
11 | const Char_t *centralityEstimator = "V0M", | |
12 | Bool_t isModeAOD = 1, | |
13 | Int_t aodFilterBit = 768, | |
14 | Int_t sysType = 0, // 0-pp,1-pA,2-AA, 3,4,5 mc | |
249ebe76 | 15 | Int_t cuttype = 9, // esd cut type |
16 | ||
204c7c83 | 17 | Int_t pidtype = 2, |
18 | Int_t requestTofPid = 1, | |
19 | Double_t nSigmaCut = 3., | |
20 | Double_t lptfortof = 0.5, | |
21 | ||
22 | Double_t ptl = 0.5, | |
23 | Double_t pth = 5.0, | |
24 | ||
25 | Double_t gEta = 0.8, | |
26 | Double_t gRap = 0.5, | |
249ebe76 | 27 | |
28 | Double_t dcaxy = 2.4, | |
29 | Double_t dcaz = 3.2, | |
204c7c83 | 30 | |
31 | Double_t vz = 10., | |
32 | Int_t nSample = 25, | |
249ebe76 | 33 | Int_t analType = 1) { |
204c7c83 | 34 | |
35 | Double_t vx = 3.; Double_t vy = 3.; | |
36 | ||
37 | ||
38 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
39 | if (!mgr) { | |
40 | ::Error("AddTaskFluctuations", "No analysis manager to connect to."); | |
41 | return NULL; | |
42 | } | |
43 | ||
44 | if (!mgr->GetInputEventHandler()) { | |
45 | ::Error("AddTaskFluctuations", "This task requires an input event handler"); | |
46 | return NULL; | |
47 | } | |
48 | ||
49 | Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL); | |
50 | if (isMC) | |
51 | Info("AddTaskNetParticle", "This task has MC."); | |
52 | ||
53 | AliEbyENetChargeFluctuationTask *task = new AliEbyENetChargeFluctuationTask(taskname); | |
54 | if (!task) { | |
55 | Error("EbyEPidRatio", "Task could not be created."); | |
56 | return NULL; | |
57 | } | |
58 | ||
ce85dc2c | 59 | |
60 | Printf("============================== I am here very great ================================"); | |
61 | ||
204c7c83 | 62 | if (isMC) task->SetIsMC(); |
63 | ||
64 | Int_t sysii = sysType; | |
65 | if (sysType > 2) {task->SetIsMC(); sysii = sysType - 3;} | |
66 | ||
67 | ||
68 | if (isModeAOD) { | |
69 | task->SetIsAOD(); | |
70 | task->SetTrackFilterBit(aodFilterBit); | |
71 | } | |
72 | task->SetSystemType(sysii); | |
73 | task->SetCentralityEstimator(centralityEstimator); | |
74 | task->SetVertexDiamond(vx,vy,vz); | |
75 | task->SetKinematicsCuts(ptl,pth,gEta,gRap); | |
76 | task->SetNSubSamples(nSample); | |
249ebe76 | 77 | task->SetDca(dcaxy,dcaz); |
204c7c83 | 78 | |
79 | if (!isModeAOD) { | |
80 | gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/PIDFluctuation/macros/configureNetChargeTrackCut.C"); | |
249ebe76 | 81 | // gROOT->LoadMacro("./configureNetChargeTrackCut.C"); |
0c58b4ad | 82 | AliESDtrackCuts *cuts = configureNetChargeTrackCut(taskname,cuttype,10001006, gEta, 5.,5.); |
249ebe76 | 83 | task->SetAnalysisCutObject(cuts); |
204c7c83 | 84 | } |
85 | ||
86 | AliHelperPID* help = new AliHelperPID(); | |
87 | help->SetNSigmaCut(nSigmaCut); | |
88 | help->SetPIDType(pidtype); // kNSigmaTPC,kNSigmaTOF, kNSigmaTPCTOF | |
89 | if (requestTofPid) { | |
90 | help->SetfRequestTOFPID(requestTofPid); | |
91 | if (ptl != 0 ) help->SetfPtTOFPID(lptfortof); | |
92 | } | |
93 | ||
94 | if (sysType > 2) help->SetisMC(1); else help->SetisMC(0); | |
95 | ||
96 | if (pidtype == 3){ | |
97 | AliPIDCombined *pidc=new AliPIDCombined(); | |
98 | pidc->SetDefaultTPCPriors(); | |
99 | help->SetPIDCombined(pidc); | |
100 | } | |
101 | task->SetHelperPID(help); | |
102 | task->SetAnal(analType); | |
103 | mgr->AddTask(task); | |
104 | ||
105 | ||
106 | TString commonname = Form("%s:%s", AliAnalysisManager::GetCommonFileName(),taskname); | |
107 | ||
108 | AliAnalysisDataContainer *cout1 | |
109 | = mgr->CreateContainer(Form("%s_phy",taskname), TList::Class(), | |
110 | AliAnalysisManager::kOutputContainer, commonname); | |
111 | AliAnalysisDataContainer *cout2 | |
112 | = mgr->CreateContainer(Form("%s_qa",taskname), TList::Class(), | |
113 | AliAnalysisManager::kOutputContainer, commonname); | |
114 | AliAnalysisDataContainer *cout3 | |
115 | = mgr->CreateContainer(Form("%s_dca",taskname), TList::Class(), | |
116 | AliAnalysisManager::kOutputContainer, commonname); | |
117 | AliAnalysisDataContainer *cout4 | |
118 | = mgr->CreateContainer(Form("%s_eff",taskname), TList::Class(), | |
119 | AliAnalysisManager::kOutputContainer, commonname); | |
120 | ||
121 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
122 | mgr->ConnectOutput(task, 1, cout1); | |
123 | mgr->ConnectOutput(task, 2, cout2); | |
124 | mgr->ConnectOutput(task, 3, cout3); | |
125 | mgr->ConnectOutput(task, 4, cout4); | |
126 | ||
127 | return; | |
128 | } |