2 /// \file AddTaskMuonAlignment.C
3 /// \brief Macro to add an AliMUONAlignmentTask to an analysis train
5 /// \author Javier Castillo, CEA/Saclay - Irfu/SPhN
7 AliMUONAlignmentTask4 *AddTaskMuonAlignment(bool readrecs, bool doalign, bool writerecs, const char *name = "AliMUONAlignmentTask", const char *newalignocdb = "local://ReAlignOCDB", const char *oldalignocdb = "alien://Folder=/alice/data/2010/OCDB", const char *defaultocdb = "alien://Folder=/alice/data/2011/OCDB", const char *geofilename = "geometry.root")
9 /// Creates a Muon Alignment 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("AddTaskMuonAlignment", "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();
24 if (!type.Contains("AOD")) {
25 ::Error("AddTaskMuonAlignment", "Alignment task is asked to read records but input data type is not AOD! Game over!");
29 if (!type.Contains("ESD")) {
30 ::Error("AddTaskMuonAlignment", "Alignment task is not asked to read records but input data type is not ESD! Game over!");
35 // Create the task, add it to the manager and configure it.
36 //===========================================================================
38 AliMUONAlignmentTask *muonalign = new AliMUONAlignmentTask(name, newalignocdb, oldalignocdb, defaultocdb, geofilename);
39 muonalign->SetLoadOCDBOnce(true);
40 muonalign->SetReadRecords(readrecs);
41 muonalign->SetDoAlignment(doalign);
42 muonalign->SetWriteRecords(writerecs);
43 mgr->AddTask(muonalign);
45 // // Cuts on primary tracks
46 // AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
47 // esdTrackCutsL->SetMinNClustersTPC(50);
49 // AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
50 // trackFilter->AddCuts(esdTrackCutsL);
52 // muonalign->SetTrackFilter(trackFilter);
55 // Create ONLY the output containers for the data produced by the task.
56 // Get and connect other common input/output containers via the manager as below
57 //==============================================================================
58 mgr->ConnectInput(muonalign, 0, mgr->GetCommonInputContainer());
60 AliAnalysisDataContainer *listOut = mgr->CreateContainer("output", TList::Class(), AliAnalysisManager::kOutputContainer, "measShifts.root");
61 mgr->ConnectOutput(muonalign, 1, listOut);
64 mgr->ConnectOutput(muonalign, 0, mgr->GetCommonOutputContainer());