]>
Commit | Line | Data |
---|---|---|
cc61645f | 1 | AliAnalysisTaskSEDs *AddTaskDs(Int_t system=0/*0=pp,1=PbPb*/, |
4c3b884b | 2 | Int_t storeNtuple=0,Bool_t readMC=kFALSE, |
3 | TString filename="", TString postname="") | |
1f796bc2 | 4 | { |
4c3b884b | 5 | // |
1f796bc2 | 6 | // Test macro for the AliAnalysisTaskSE for Ds candidates |
7 | ||
8 | //Invariant mass histogram and | |
4c3b884b | 9 | // association with MC truth (using MC info in AOD) |
1f796bc2 | 10 | // Origin: R. Bala, bala@to.infn.it |
11 | // Modified for Ds meson: G.M. Innocenti innocent@to.infn.it | |
4c3b884b | 12 | // Get the pointer to the existing analysis manager via the static access method. |
13 | //============================================================================== | |
1f796bc2 | 14 | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) { | |
17 | ::Error("AddTaskDs", "No analysis manager to connect to."); | |
18 | } | |
1f796bc2 | 19 | |
cc61645f | 20 | Bool_t stdcuts=kFALSE; |
21 | TFile* filecuts; | |
22 | if( filename.EqualTo("") ) { | |
23 | stdcuts=kTRUE; | |
24 | } else { | |
25 | filecuts=TFile::Open(filename.Data()); | |
26 | if(!filecuts ||(filecuts&& !filecuts->IsOpen())){ | |
27 | AliFatal("Cut object not found: analysis will not start!\n"); | |
28 | } | |
29 | else printf("Cut object correctly found\n"); | |
30 | } | |
1f796bc2 | 31 | |
32 | //Analysis Task | |
33 | ||
34 | AliRDHFCutsDstoKKpi* analysiscuts=new AliRDHFCutsDstoKKpi(); | |
cc61645f | 35 | |
36 | if(stdcuts) { | |
37 | if(system==0) { | |
38 | printf("Cut object not found: standard pp cut object used\n"); | |
39 | analysiscuts->SetStandardCutsPP2010(); | |
40 | } | |
41 | else AliFatal("Standard cut object not available for PbPb: analysis will not start!\n"); | |
42 | } | |
43 | else analysiscuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("AnalysisCuts"); | |
44 | ||
1f796bc2 | 45 | AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis",analysiscuts,storeNtuple); |
46 | ||
47 | dsTask->SetReadMC(readMC); | |
48 | //dsTask->SetDoLikeSign(kTRUE); | |
49 | // dsTask->SetUseTPCpid(kTRUE); | |
50 | //dsTask->SetUseTOFpid(kTRUE); | |
ef619708 | 51 | dsTask->SetDebugLevel(0); |
1f796bc2 | 52 | dsTask->SetUseSelectionBit(kTRUE); |
53 | //dsTask->SetMassLimits(0.2); | |
54 | mgr->AddTask(dsTask); | |
55 | ||
56 | // Create containers for input/output | |
4c3b884b | 57 | TString name="cinputDs"; |
58 | name+=postname; | |
59 | AliAnalysisDataContainer *cinputDs = mgr->CreateContainer(name,TChain::Class(), | |
60 | AliAnalysisManager::kInputContainer); | |
1f796bc2 | 61 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
62 | outputfile += ":PWG3_D2H_InvMassDs"; | |
4c3b884b | 63 | outputfile+=postname; |
1f796bc2 | 64 | |
4c3b884b | 65 | name="coutputDsCuts"; name+=postname; |
66 | AliAnalysisDataContainer *coutputDsCuts = mgr->CreateContainer(name,TList::Class(), | |
67 | AliAnalysisManager::kOutputContainer, | |
68 | outputfile.Data()); | |
1f796bc2 | 69 | |
4c3b884b | 70 | name="coutputDs"; name+=postname; |
71 | AliAnalysisDataContainer *coutputDs = mgr->CreateContainer(name,TList::Class(), | |
72 | AliAnalysisManager::kOutputContainer, | |
73 | outputfile.Data()); | |
74 | name="coutputDsNorm"; name+=postname; | |
75 | AliAnalysisDataContainer *coutputDsNorm = mgr->CreateContainer(name,AliNormalizationCounter::Class(), | |
1f796bc2 | 76 | AliAnalysisManager::kOutputContainer, |
77 | outputfile.Data()); | |
4c3b884b | 78 | |
79 | name="coutputDs2"; name+=postname; | |
80 | if(storeNtuple){ | |
81 | AliAnalysisDataContainer *coutputDs2 = mgr->CreateContainer(name,TNtuple::Class(), | |
1f796bc2 | 82 | AliAnalysisManager::kOutputContainer, |
83 | outputfile.Data()); | |
1f796bc2 | 84 | coutputDs2->SetSpecialOutput(); |
85 | } | |
86 | ||
87 | mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer()); | |
88 | ||
89 | mgr->ConnectOutput(dsTask,1,coutputDs); | |
90 | ||
91 | mgr->ConnectOutput(dsTask,2,coutputDsCuts); | |
92 | ||
93 | mgr->ConnectOutput(dsTask,3,coutputDsNorm); | |
94 | ||
95 | if(storeNtuple){ | |
96 | mgr->ConnectOutput(dsTask,4,coutputDs2); | |
97 | } | |
98 | ||
99 | return dsTask; | |
100 | } |