]>
Commit | Line | Data |
---|---|---|
c683985a | 1 | |
2 | ||
3 | AliAnalysisTask *AddTaskTPCTOFpA(Int_t identifier = 0, Bool_t isMC = kFALSE, Bool_t isTPConly = kFALSE, Bool_t writeOwnFile = kFALSE, Bool_t saveMotherPDG = kFALSE, Bool_t useEvenDcaBinning = kFALSE, Bool_t smallTHnSparse = kFALSE, Double_t nSigmaTPCLow= -3., Double_t nSigmaTPCHigh = 3., Double_t rapidityLow = -0.5, Double_t rapidityHigh = 0.5, Bool_t ispA=kTRUE, Bool_t rapCMS = kFALSE, TString multEst = "V0A", Bool_t setTrackCuts = kFALSE, AliESDtrackCuts *ESDtrackCuts = 0){ | |
4 | ||
5 | ||
6 | //get the current analysis manager | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | Error("AddTask_janielsk_TPCTOFpA", "No analysis manager found."); | |
10 | return 0; | |
11 | } | |
12 | //============= Set Task Name =================== | |
13 | //TString taskName=("AliAnalysisTPCTOFpA.cxx+g"); | |
14 | //=============================================== | |
15 | // Load the task | |
16 | //gROOT->LoadMacro(taskName.Data()); | |
17 | ||
18 | ||
19 | ||
20 | //========= Add task to the ANALYSIS manager ===== | |
21 | ||
22 | //normal tracks | |
23 | AliAnalysisTPCTOFpA *task = new AliAnalysisTPCTOFpA("janielskTaskTPCTOFpA"); | |
24 | //task->SelectCollisionCandidates(trigger.Data()); | |
25 | ||
26 | //switches | |
27 | if (isMC) task->SetIsMCtrue(isMC); | |
28 | if (isTPConly)task->SetUseTPConlyTracks(isTPConly); | |
29 | if (saveMotherPDG) task->SetSaveMotherPDG(saveMotherPDG); | |
30 | if (useEvenDcaBinning) task->SetEvenDCAbinning(kTRUE); | |
31 | if (smallTHnSparse){ | |
32 | task->SetSmallTHnSparse(kTRUE); | |
33 | task->SetTPCnSigmaCuts(nSigmaTPCLow,nSigmaTPCHigh); | |
34 | task->SetRapidityCuts(rapidityLow,rapidityHigh); | |
35 | } | |
36 | if (ispA) task->SetIspA(kTRUE); | |
37 | if (rapCMS) task->SetRapCMS(kTRUE); | |
38 | task->SetCentEst(multEst.Data()); | |
39 | ||
40 | //initialize task | |
41 | task->Initialize(); | |
42 | ||
43 | //esd cuts need to be set after initialize or cuts will be replaced by standard cuts in initialize | |
44 | if (setTrackCuts) task->SetESDtrackCuts(ESDtrackCuts); | |
45 | ||
46 | //add task to manager | |
47 | mgr->AddTask(task); | |
48 | ||
49 | ||
50 | ||
51 | ||
52 | //================================================ | |
53 | // data containers | |
54 | //================================================ | |
55 | // find input container | |
56 | //below the trunk version | |
57 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
58 | ||
59 | /* | |
60 | //dumm output container | |
61 | AliAnalysisDataContainer *coutput0 = | |
62 | mgr->CreateContainer(Form("akalweit_tree%i",identifier), | |
63 | TTree::Class(), | |
64 | AliAnalysisManager::kExchangeContainer, | |
65 | Form("akalweit_default%i",identifier)); | |
66 | ||
67 | ||
68 | //define output containers, please use 'username'_'somename' | |
69 | AliAnalysisDataContainer *coutput1 = | |
70 | mgr->CreateContainer(Form("akalweit_TPCTOFpA%i",identifier), TList::Class(), | |
71 | AliAnalysisManager::kOutputContainer,Form("akalweit_TPCTOFpA%i.root",identifier)); | |
72 | */ | |
73 | ||
74 | AliAnalysisDataContainer *coutput1; | |
75 | ||
76 | if (!writeOwnFile) { | |
77 | coutput1 = mgr->CreateContainer(Form("janielsk_TPCTOFpA%i",identifier), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:janielsk_TPCTOFpA", AliAnalysisManager::GetCommonFileName())); | |
78 | } | |
79 | else { | |
80 | coutput1 = mgr->CreateContainer(Form("janielsk_TPCTOFpA%i",identifier), TList::Class(), AliAnalysisManager::kOutputContainer, Form("janielsk_TPCTOFpA.root")); | |
81 | } | |
82 | ||
83 | ||
84 | ||
85 | //connect containers | |
86 | ||
87 | // | |
88 | mgr->ConnectInput (task, 0, cinput ); | |
89 | //mgr->ConnectOutput (task, 0, coutput0); | |
90 | mgr->ConnectOutput (task, 1, coutput1); | |
91 | ||
92 | return task; | |
93 | } |