]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/macros/AddTaskCheckCascade.C
- fixed wrong constant
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / AddTaskCheckCascade.C
CommitLineData
7e504402 1AliAnalysisTaskCheckCascade *AddTaskCheckCascade(Short_t lCollidingSystems = 0 /*0 = pp, 1 = AA*/,
2 const TString lMasterJobSessionFlag = "")
cc1236ed 3{
4// Creates, configures and attaches to the train a cascades check task.
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if (!mgr) {
9 ::Error("AddTaskCheckCascade", "No analysis manager to connect to.");
10 return NULL;
11 }
12
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskCheckCascade", "This task requires an input event handler");
17 return NULL;
18 }
19 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
20
21 // Create and configure the task
22 AliAnalysisTaskCheckCascade *taskcheckcascade = new AliAnalysisTaskCheckCascade("TaskCheckCascade");
23 taskcheckcascade->SetCollidingSystems(lCollidingSystems);
24 taskcheckcascade->SetAnalysisType(type);
f3dc9369 25
cc1236ed 26 mgr->AddTask(taskcheckcascade);
27
28 // Create ONLY the output containers for the data produced by the task.
29 // Get and connect other common input/output containers via the manager as below
30 //==============================================================================
f3dc9369 31
32 // User file name (if need be)
33 /*
90926f02 34 TString DefaultCommonFileName = AliAnalysisManager::GetCommonFileName();
35
36 if(DefaultCommonFileName == "AnalysisResults.root"){
37 // Just change the Common File name IF it was not change before
38 // -> To avoid screwing-up the analysis train and send the output of the previous task to a non-existing file
39 TString lCommonFileName = "sLHC09-CheckCascade";
40 if(lMasterJobSessionFlag.Length()){
41 lCommonFileName += "-";
42 lCommonFileName += lMasterJobSessionFlag.Data();
43 }
44 lCommonFileName += ".root";
45
46 mgr->SetCommonFileName( lCommonFileName.Data() );
f3dc9369 47 }
f3dc9369 48 */
90926f02 49
1ba92c7e 50 TString outputFileName = AliAnalysisManager::GetCommonFileName();
162aeefd 51 outputFileName += ":PWG2CheckCascade";
f3dc9369 52 if (lCollidingSystems) outputFileName += "_AA_";
53 else outputFileName += "_PP_";
54 if (mgr->GetMCtruthEventHandler()) outputFileName += "MC_";
7e504402 55 if(lMasterJobSessionFlag.Length()) outputFileName += lMasterJobSessionFlag.Data();
90926f02 56
57 Printf("AddTaskCheckCascade - Set OutputFileName : \n %s\n", outputFileName.Data() );
1ba92c7e 58
59 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCasc",
60 TList::Class(),
61 AliAnalysisManager::kOutputContainer,
62 outputFileName );
63
7e504402 64 mgr->ConnectInput( taskcheckcascade, 0, mgr->GetCommonInputContainer());
cc1236ed 65 mgr->ConnectOutput(taskcheckcascade, 1, coutput1);
7e504402 66
cc1236ed 67 return taskcheckcascade;
68}