]>
Commit | Line | Data |
---|---|---|
f3dc9369 | 1 | AliAnalysisTaskCheckCascade *AddTaskCheckCascade(Short_t lCollidingSystems=0 /*0 = pp, 1 = AA*/, |
2 | Short_t lRealData=0 /* 0 = MC data or 1 = real data (needed for trigger issues) */, | |
3 | const TString* lMasterJobSessionFlag = "") | |
4 | ||
cc1236ed | 5 | { |
6 | // Creates, configures and attaches to the train a cascades check task. | |
7 | // Get the pointer to the existing analysis manager via the static access method. | |
8 | //============================================================================== | |
9 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
10 | if (!mgr) { | |
11 | ::Error("AddTaskCheckCascade", "No analysis manager to connect to."); | |
12 | return NULL; | |
13 | } | |
14 | ||
15 | // Check the analysis type using the event handlers connected to the analysis manager. | |
16 | //============================================================================== | |
17 | if (!mgr->GetInputEventHandler()) { | |
18 | ::Error("AddTaskCheckCascade", "This task requires an input event handler"); | |
19 | return NULL; | |
20 | } | |
21 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
22 | ||
23 | // Create and configure the task | |
24 | AliAnalysisTaskCheckCascade *taskcheckcascade = new AliAnalysisTaskCheckCascade("TaskCheckCascade"); | |
25 | taskcheckcascade->SetCollidingSystems(lCollidingSystems); | |
26 | taskcheckcascade->SetAnalysisType(type); | |
f3dc9369 | 27 | taskcheckcascade->SetRealDataFlag(lRealData); |
28 | ||
cc1236ed | 29 | mgr->AddTask(taskcheckcascade); |
30 | ||
31 | // Create ONLY the output containers for the data produced by the task. | |
32 | // Get and connect other common input/output containers via the manager as below | |
33 | //============================================================================== | |
f3dc9369 | 34 | |
35 | // User file name (if need be) | |
36 | /* | |
37 | TString lCommonFileName = "sLHC09dxx-CheckCascade"; | |
38 | if(lMasterJobSessionFlag->Length()){ | |
39 | lCommonFileName += "-"; | |
40 | lCommonFileName += lMasterJobSessionFlag->Data(); | |
41 | } | |
42 | lCommonFileName += ".root"; | |
43 | mgr->SetCommonFileName( lCommonFileName.Data ); | |
44 | */ | |
45 | ||
1ba92c7e | 46 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); |
162aeefd | 47 | outputFileName += ":PWG2CheckCascade"; |
f3dc9369 | 48 | if (lCollidingSystems) outputFileName += "_AA_"; |
49 | else outputFileName += "_PP_"; | |
50 | if (mgr->GetMCtruthEventHandler()) outputFileName += "MC_"; | |
51 | if(lMasterJobSessionFlag->Length()) outputFileName += lMasterJobSessionFlag->Data(); | |
1ba92c7e | 52 | |
53 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCasc", | |
54 | TList::Class(), | |
55 | AliAnalysisManager::kOutputContainer, | |
56 | outputFileName ); | |
57 | ||
58 | mgr->ConnectInput(taskcheckcascade, 0, mgr->GetCommonInputContainer()); | |
f3dc9369 | 59 | |
cc1236ed | 60 | mgr->ConnectOutput(taskcheckcascade, 1, coutput1); |
61 | return taskcheckcascade; | |
62 | } |