]>
Commit | Line | Data |
---|---|---|
b7fae104 | 1 | AliAnalysisTaskSEDvsMultiplicity *AddTaskDvsMultiplicity(Int_t system=0, |
2 | Bool_t readMC=kFALSE, | |
3 | Int_t MCOption=0, | |
4 | Int_t pdgMeson="411", | |
5 | TString finDirname="Loose", | |
6 | TString filename="", | |
7 | TString finAnObjname="AnalysisCuts", | |
f09fd3fe | 8 | TString estimatorFilename="") |
b7fae104 | 9 | { |
10 | // | |
11 | // Test macro for the AliAnalysisTaskSE for D+ candidates | |
12 | ||
13 | //Invariant mass histogram and | |
14 | // association with MC truth (using MC info in AOD) | |
15 | // R. Bala, bala@to.infn.it | |
16 | // Get the pointer to the existing analysis manager via the static access method. | |
17 | //============================================================================== | |
18 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
19 | if (!mgr) { | |
20 | ::Error("AddTaskDvsMultiplicity", "No analysis manager to connect to."); | |
21 | } | |
22 | ||
23 | Bool_t stdcuts=kFALSE; | |
24 | TFile* filecuts,fileEstimator; | |
25 | if( filename.EqualTo("") ) { | |
26 | stdcuts=kTRUE; | |
27 | } else { | |
28 | filecuts=TFile::Open(filename.Data()); | |
29 | if(!filecuts ||(filecuts&& !filecuts->IsOpen())){ | |
30 | AliFatal("Input file not found : check your cut object"); | |
31 | } | |
32 | } | |
33 | ||
34 | ||
35 | ||
36 | ||
b7fae104 | 37 | |
38 | ||
39 | //Analysis Task | |
40 | ||
41 | AliRDHFCuts *analysiscuts=0x0; | |
42 | ||
43 | TString Name; | |
44 | if(pdgMeson=411){ | |
45 | if(stdcuts) { | |
46 | analysiscuts = new AliRDHFCutsDplustoKpipi(); | |
47 | if (system == 0) analysiscuts->SetStandardCutsPP2010(); | |
48 | else analysiscuts->SetStandardCutsPbPb2011(); | |
49 | } | |
50 | else analysiscuts = (AliRDHFCutsDplustoKpipi*)filecuts->Get(finAnObjname); | |
51 | Name="Dplus"; | |
52 | }else if(pdgMeson=421){ | |
53 | ||
54 | if(stdcuts) { | |
55 | analysiscuts = new AliRDHFCutsD0toKpi(); | |
56 | if (system == 0) analysiscuts->SetStandardCutsPP2010(); | |
57 | else analysiscuts->SetStandardCutsPbPb2011(); | |
58 | } | |
59 | else analysiscuts = (AliRDHFCutsD0toKpi*)filecuts->Get(finAnObjname); | |
60 | Name="D0"; | |
61 | }else if(pdgMeson=413){ | |
62 | if(stdcuts) { | |
63 | analysiscuts = new AliRDHFCutsDStartoKpipi(); | |
64 | if (system == 0) analysiscuts->SetStandardCutsPP2010(); | |
65 | else analysiscuts->SetStandardCutsPbPb2011(); | |
66 | } | |
67 | else analysiscuts = (AliRDHFCutsDStartoKpipi*)filecuts->Get(finAnObjname); | |
68 | Name="DStar"; | |
69 | } | |
70 | ||
71 | ||
72 | ||
73 | AliAnalysisTaskSEDvsMultiplicity *dMultTask = new AliAnalysisTaskSEDvsMultiplicity("dMultAnalysis",pdgMeson,analysiscuts); | |
74 | dMultTask->SetReadMC(readMC); | |
75 | ||
76 | dMultTask->SetDebugLevel(0); | |
77 | ||
78 | dMultTask->SetUseBit(kTRUE); | |
79 | ||
80 | dMultTask->SetDoImpactParameterHistos(kFALSE); | |
f09fd3fe | 81 | |
82 | if( filename.EqualTo("") ) { | |
83 | printf("Estimator file not provided, multiplcity corrected histograms will not be filled\n"); | |
84 | }else{ | |
85 | const Char_t* periodNames[4] = {"LHC10b", "LHC10c", "LHC10d", "LHC10e"}; | |
86 | TProfile* multEstimatorAvg[4]; | |
87 | TFile* fileEstimator=TFile::Open(estimatorFilename.Data()); | |
88 | if(!fileEstimator) { | |
89 | AliFatal("File with multiplicity estimator not found\n"); | |
90 | return; | |
91 | } | |
92 | for(Int_t ip=0; ip<4; ip++) { | |
93 | multEstimatorAvg[ip] = (TProfile*)(fileEstimator->Get(Form("SPDmult10_%s",periodNames[ip]))->Clone(Form("SPDmult10_%s_clone",periodNames[ip]))); | |
94 | ||
95 | ||
96 | } | |
97 | SetMultiplVsZProfileLHC10b(multEstimatorAvg[0]); | |
98 | SetMultiplVsZProfileLHC10c(multEstimatorAvg[1]); | |
99 | SetMultiplVsZProfileLHC10d(multEstimatorAvg[2]); | |
100 | SetMultiplVsZProfileLHC10e(multEstimatorAvg[3]); | |
101 | } | |
b7fae104 | 102 | mgr->AddTask(dMultTask); |
103 | ||
104 | // Create containers for input/output | |
105 | ||
106 | TString inname = "cinput"; | |
107 | TString outname = "coutput"; | |
108 | TString cutsname = "coutputCuts"; | |
109 | TString normname = "coutputNorm"; | |
110 | ||
111 | inname += finDirname.Data(); | |
112 | outname += finDirname.Data(); | |
113 | cutsname += finDirname.Data(); | |
114 | normname += finDirname.Data(); | |
115 | ||
116 | ||
117 | ||
118 | ||
119 | ||
120 | TString contname=Form("cinput%s",Name.Data()); | |
121 | AliAnalysisDataContainer *cinput = mgr->CreateContainer(contname.Data(),TChain::Class(), | |
122 | AliAnalysisManager::kInputContainer); | |
123 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
124 | outputfile += ":PWG3_D2H_DMult"; | |
125 | ||
126 | contname=Form("coutputCuts%s",Name.Data()); | |
127 | AliAnalysisDataContainer *coutputCuts = mgr->CreateContainer(contname.Data(),TList::Class(), | |
128 | AliAnalysisManager::kOutputContainer, | |
129 | outputfile.Data()); | |
130 | ||
131 | contname=Form("coutput%s",Name.Data()); | |
132 | AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),TList::Class(), | |
133 | AliAnalysisManager::kOutputContainer, | |
134 | outputfile.Data()); | |
135 | contname=Form("coutputNorm%s",Name.Data()); | |
136 | AliAnalysisDataContainer *coutputNorm = mgr->CreateContainer(contname.Data(),TList::Class(), | |
137 | AliAnalysisManager::kOutputContainer, | |
138 | outputfile.Data()); | |
139 | ||
140 | ||
141 | mgr->ConnectInput(dMultTask,0,mgr->GetCommonInputContainer()); | |
142 | ||
143 | mgr->ConnectOutput(dMultTask,1,coutput); | |
144 | ||
145 | mgr->ConnectOutput(dMultTask,2,coutputCuts); | |
146 | ||
147 | mgr->ConnectOutput(dMultTask,3,coutputNorm); | |
148 | ||
149 | return dMultTask; | |
150 | } |