]>
Commit | Line | Data |
---|---|---|
2fbb7748 | 1 | AliAnalysisTaskSEDplus *AddTaskDplus(Int_t system=0/*0=pp,1=PbPb*/, |
2 | Float_t minC=0, Float_t maxC=100, | |
3 | Bool_t storeNtuple=kFALSE, | |
504df8ba | 4 | Bool_t readMC=kFALSE, |
2fbb7748 | 5 | TString finDirname="Loose", |
6 | TString filename="DplustoKpipiCuts.root", | |
7 | TString finAnObjname="AnalysisCuts", TString finProdObjname="ProduCuts") | |
95e5b6b5 | 8 | { |
9 | // | |
10 | // Test macro for the AliAnalysisTaskSE for D+ candidates | |
11 | ||
12 | //Invariant mass histogram and | |
13 | // association with MC truth (using MC info in AOD) | |
14 | // R. Bala, bala@to.infn.it | |
15 | // Get the pointer to the existing analysis manager via the static access method. | |
16 | //============================================================================== | |
17 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
18 | if (!mgr) { | |
19 | ::Error("AddTaskDplus", "No analysis manager to connect to."); | |
95e5b6b5 | 20 | } |
21 | ||
ae39ad32 | 22 | Bool_t stdcuts=kFALSE; |
fad29dfd | 23 | TFile* filecuts=new TFile(filename.Data()); |
24 | if(!filecuts->IsOpen()){ | |
ae39ad32 | 25 | cout<<"Input file not found: using standard cuts"<<endl; |
26 | stdcuts=kTRUE; | |
95e5b6b5 | 27 | } |
fad29dfd | 28 | |
29 | ||
30 | //Analysis Task | |
95e5b6b5 | 31 | |
fad29dfd | 32 | |
ae39ad32 | 33 | AliRDHFCutsDplustoKpipi* analysiscuts=new AliRDHFCutsDplustoKpipi(); |
2fbb7748 | 34 | if(stdcuts) { |
35 | if(system==0) analysiscuts->SetStandardCutsPP2010(); | |
36 | else if(system==1){ | |
37 | analysiscuts->SetStandardCutsPbPb2010(); | |
38 | analysiscuts->SetMinCentrality(minC); | |
39 | analysiscuts->SetMaxCentrality(maxC); | |
40 | // analysiscuts->SetUseAOD049(kTRUE); | |
41 | analysiscuts->SetUseCentrality(AliRDHFCuts::kCentV0M); | |
42 | } | |
43 | } | |
44 | else analysiscuts = (AliRDHFCutsDplustoKpipi*)filecuts->Get(finAnObjname); | |
95e5b6b5 | 45 | |
fad29dfd | 46 | AliRDHFCutsDplustoKpipi* prodcuts=new AliRDHFCutsDplustoKpipi(); |
2fbb7748 | 47 | if(stdcuts) { |
48 | if(system==0) prodcuts->SetStandardCutsPP2010(); | |
49 | else if(system==1) { | |
50 | prodcuts->SetStandardCutsPbPb2010(); | |
51 | prodcuts->SetMinCentrality(minC); | |
52 | prodcuts->SetMaxCentrality(maxC); | |
53 | // prodcuts->SetUseAOD049(kTRUE); | |
54 | prodcuts->SetUseCentrality(AliRDHFCuts::kCentV0M); | |
55 | } | |
56 | } | |
57 | else prodcuts = (AliRDHFCutsDplustoKpipi*)filecuts->Get(finProdObjname); | |
73173a6a | 58 | |
fad29dfd | 59 | //AliRDHFCutsDplustoKpipi *prodcuts = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("ProdCuts"); |
60 | //AliRDHFCutsDplustoKpipi *analysiscuts = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("AnalysisCuts"); | |
95e5b6b5 | 61 | |
fad29dfd | 62 | |
95e5b6b5 | 63 | AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",analysiscuts,prodcuts,storeNtuple); |
64 | dplusTask->SetReadMC(readMC); | |
5fc4893f | 65 | dplusTask->SetDoLikeSign(kFALSE); |
73173a6a | 66 | // dplusTask->SetUseTPCpid(kTRUE); |
67 | //dplusTask->SetUseTOFpid(kTRUE); | |
95e5b6b5 | 68 | dplusTask->SetDebugLevel(0); |
fad29dfd | 69 | dplusTask->SetMassLimits(0.2); |
5fc4893f | 70 | dplusTask->SetUseBit(kTRUE); |
2fbb7748 | 71 | |
72 | if (system==0) dplusTask->SetDoImpactParameterHistos(kTRUE); | |
73 | ||
95e5b6b5 | 74 | mgr->AddTask(dplusTask); |
fad29dfd | 75 | |
76 | // Create containers for input/output | |
2fbb7748 | 77 | |
78 | TString inname = "cinputDplus"; | |
79 | TString outname = "coutputDplus"; | |
80 | TString cutsname = "coutputDplusCuts"; | |
81 | TString normname = "coutputDplusNorm"; | |
82 | TString ntuplename = "coutputDplus2"; | |
83 | inname += finDirname.Data(); | |
84 | outname += finDirname.Data(); | |
85 | cutsname += finDirname.Data(); | |
86 | normname += finDirname.Data(); | |
87 | ntuplename += finDirname.Data(); | |
88 | TString centr=Form("%.0f%.0f",analysiscuts->GetMinCentrality(),analysiscuts->GetMaxCentrality()); | |
89 | inname += centr; | |
90 | outname += centr; | |
91 | cutsname += centr; | |
92 | normname += centr; | |
93 | ntuplename += centr; | |
94 | ||
95 | ||
96 | AliAnalysisDataContainer *cinputDplus = mgr->CreateContainer(inname,TChain::Class(), | |
fad29dfd | 97 | AliAnalysisManager::kInputContainer); |
95e5b6b5 | 98 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
99 | outputfile += ":PWG3_D2H_InvMassDplus"; | |
fad29dfd | 100 | |
2fbb7748 | 101 | AliAnalysisDataContainer *coutputDplusCuts = mgr->CreateContainer(cutsname,TList::Class(), |
fad29dfd | 102 | AliAnalysisManager::kOutputContainer, |
103 | outputfile.Data()); | |
104 | ||
2fbb7748 | 105 | AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer(outname,TList::Class(), |
fad29dfd | 106 | AliAnalysisManager::kOutputContainer, |
95e5b6b5 | 107 | outputfile.Data()); |
2fbb7748 | 108 | AliAnalysisDataContainer *coutputDplusNorm = mgr->CreateContainer(normname,AliNormalizationCounter::Class(), |
a96083b9 | 109 | AliAnalysisManager::kOutputContainer, |
110 | outputfile.Data()); | |
fad29dfd | 111 | |
95e5b6b5 | 112 | if(storeNtuple){ |
2fbb7748 | 113 | AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer(ntuplename,TNtuple::Class(), |
fad29dfd | 114 | AliAnalysisManager::kOutputContainer, |
115 | "InvMassDplus_nt1.root"); | |
116 | ||
95e5b6b5 | 117 | coutputDplus2->SetSpecialOutput(); |
118 | } | |
119 | mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer()); | |
fad29dfd | 120 | |
95e5b6b5 | 121 | mgr->ConnectOutput(dplusTask,1,coutputDplus); |
fad29dfd | 122 | |
95e5b6b5 | 123 | mgr->ConnectOutput(dplusTask,2,coutputDplusCuts); |
a96083b9 | 124 | |
125 | mgr->ConnectOutput(dplusTask,3,coutputDplusNorm); | |
95e5b6b5 | 126 | if(storeNtuple){ |
a96083b9 | 127 | mgr->ConnectOutput(dplusTask,4,coutputDplus2); |
95e5b6b5 | 128 | } |
129 | return dplusTask; | |
130 | } |