2 /// \file AddTaskMuonReAlign.C
3 /// \brief Macro to add an AliMUONReAlignTask to an analysis train
5 /// \author Javier Castillo, CEA/Saclay - Irfu/SPhN
7 AliMUONReAlignTask *AddTaskMuonReAlign()
9 /// Creates a filter task and adds it to the analysis manager.
11 // Get the pointer to the existing analysis manager via the static access method.
12 //==============================================================================
13 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
15 ::Error("AddTaskMuonReAlign", "No analysis manager to connect to.");
19 // This task requires an ESD input handler.
20 // Check this using the analysis manager.
21 //===============================================================================
22 TString type = mgr->GetInputEventHandler()->GetDataType();
23 if (!type.Contains("ESD")) {
24 ::Error("AddTaskMuonReAlign", "ESD filtering task needs the manager to have an ESD input handler.");
28 // Create the task, add it to the manager and configure it.
29 //===========================================================================
31 AliMUONReAlignTask *muonrealign = new AliMUONReAlignTask("Muon realign");
32 mgr->AddTask(muonrealign);
34 // // Cuts on primary tracks
35 // AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
36 // esdTrackCutsL->SetMinNClustersTPC(50);
38 // AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
39 // trackFilter->AddCuts(esdTrackCutsL);
41 // muonalign->SetTrackFilter(trackFilter);
45 // Create ONLY the output containers for the data produced by the task.
46 // Get and connect other common input/output containers via the manager as below
47 //==============================================================================
48 AliAnalysisDataContainer *treeOut = mgr->CreateContainer("output", TTree::Class(), AliAnalysisManager::kOutputContainer, "clusterInfo.root");
49 mgr->ConnectInput (muonrealign, 0, mgr->GetCommonInputContainer());
50 mgr->ConnectOutput (muonrealign, 0, treeOut);