]>
Commit | Line | Data |
---|---|---|
da819170 | 1 | AliAnalysisTaskBadChunkID *AddTaskBadChunkID( const TString lMasterJobSessionFlag = "") |
2 | { | |
3 | // Creates, configures and attaches to the train a cascades check task. | |
4 | // Get the pointer to the existing analysis manager via the static access method. | |
5 | //============================================================================== | |
6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
7 | if (!mgr) { | |
8 | ::Error("AddTaskBadChunkID", "No analysis manager to connect to."); | |
9 | return NULL; | |
10 | } | |
11 | ||
12 | // Check the analysis type using the event handlers connected to the analysis manager. | |
13 | //============================================================================== | |
14 | if (!mgr->GetInputEventHandler()) { | |
15 | ::Error("AddTaskBadChunkID", "This task requires an input event handler"); | |
16 | return NULL; | |
17 | } | |
18 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
19 | ||
20 | // Create and configure the task | |
21 | AliAnalysisTaskBadChunkID *taskbadchunkID = new AliAnalysisTaskBadChunkID("taskbadchunkID"); | |
22 | mgr->AddTask(taskbadchunkID); | |
23 | ||
24 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
25 | ||
26 | outputFileName += ":BADCHUNKCHECK"; | |
27 | //if (lSwitchIsNuclear) outputFileName += "_AA"; | |
28 | //outputFileName += "_PP"; | |
29 | if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC"; | |
30 | //if(lMasterJobSessionFlag.Length()) outputFileName += lMasterJobSessionFlag.Data(); | |
31 | ||
32 | Printf("Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
33 | ||
34 | AliAnalysisDataContainer *coutputList = mgr->CreateContainer("clist", | |
35 | TList::Class(), | |
36 | AliAnalysisManager::kOutputContainer, | |
37 | outputFileName ); | |
38 | AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTree", | |
39 | TTree::Class(), | |
40 | AliAnalysisManager::kOutputContainer, | |
41 | outputFileName ); | |
42 | ||
43 | //This one you should merge in file-resident ways... | |
44 | coutputTree->SetSpecialOutput(); | |
45 | ||
46 | //Recommendation: Tree as a single output slot | |
47 | mgr->ConnectInput( taskbadchunkID, 0, mgr->GetCommonInputContainer()); | |
48 | mgr->ConnectOutput(taskbadchunkID, 1, coutputList); | |
49 | mgr->ConnectOutput(taskbadchunkID, 2, coutputTree); | |
50 | ||
51 | return taskbadchunkID; | |
52 | } |