bug fixed
[u/mrichter/AliRoot.git] / MUON / AddTaskMuonAlignment.C
CommitLineData
4d610fd5 1/// \ingroup macros
2/// \file AddTaskMuonAlignment.C
3/// \brief Macro to add an AliMUONAlignmentTask to an analysis train
4///
5/// \author Javier Castillo, CEA/Saclay - Irfu/SPhN
6
023c4db7 7AliMUONAlignmentTask *AddTaskMuonAlignment(const char *name = "Muon alignment", const char *geofilename = "geometry.root", const char *defaultocdb = "raw://", const char *misalignocdb = "local://ReAlignOCDB")
4d610fd5 8{
9/// Creates a filter task and adds it to the analysis manager.
10
11 // Get the pointer to the existing analysis manager via the static access method.
12 //==============================================================================
13 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14 if (!mgr) {
15 ::Error("AddTaskMuonAlignment", "No analysis manager to connect to.");
16 return NULL;
17 }
18
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("AddTaskMuonAlignment", "ESD filtering task needs the manager to have an ESD input handler.");
25 return NULL;
26 }
27
28 // Create the task, add it to the manager and configure it.
29 //===========================================================================
30 // Muons
023c4db7 31 AliMUONAlignmentTask *muonalign = new AliMUONAlignmentTask(name, geofilename, defaultocdb, misalignocdb);
4d610fd5 32 mgr->AddTask(muonalign);
33
34// // Cuts on primary tracks
35// AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
36// esdTrackCutsL->SetMinNClustersTPC(50);
37
38// AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
39// trackFilter->AddCuts(esdTrackCutsL);
40
41// muonalign->SetTrackFilter(trackFilter);
42
43
44 // Create ONLY the output containers for the data produced by the task.
45 // Get and connect other common input/output containers via the manager as below
46 //==============================================================================
47 AliAnalysisDataContainer *listOut = mgr->CreateContainer("output", TList::Class(), AliAnalysisManager::kOutputContainer, "measShifts.root");
48 mgr->ConnectInput (muonalign, 0, mgr->GetCommonInputContainer());
49 mgr->ConnectOutput (muonalign, 0, listOut);
50 return muonalign;
51}