1 //--------------------------------------------------------------------------
2 // Base macro for submitting single muon analysis.
4 // In case it is not run with full aliroot, it needs to have in the working directory:
12 // The macro reads ESDs and outputs file:
14 //--------------------------------------------------------------------------
16 void RunSingleMuonAnalysisFromESD(Bool_t local = kFALSE) {
21 gSystem->Load("libTree");
22 gSystem->Load("libGeom");
23 gSystem->Load("libVMC");
24 gSystem->Load("libANALYSIS");
25 gSystem->Load("libSTEERBase");
26 gSystem->Load("libAOD");
27 gSystem->Load("libESD");
28 gSystem->Load("libPWG3muon.so");
30 TChain* chain = new TChain("esdTree");
33 printf("*** Connect to AliEn ***\n");
34 TGrid::Connect("alien://");
35 TAlienCollection* coll = TAlienCollection::Open("wn.xml");
36 TGridResult* result = coll->GetGridResult("",0,0);
37 for(Int_t i = 0; i < result->GetEntries(); i++) {
38 printf("TURL = %s \n",result->GetKey(i,"turl"));
39 chain->Add(result->GetKey(i,"turl"));
42 chain->Add("/path_1_to/AliESDs.root");
43 chain->Add("/path_2_to/AliESDs.root");
44 chain->Add("/path_3_to/AliESDs.root");
47 //____________________________________________//
48 // Make the analysis manager
49 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
50 AliVEventHandler* esdH = new AliESDInputHandler;
51 mgr->SetInputEventHandler(esdH);
53 //____________________________________________//
55 AliAnalysisTaskSingleMuESD *task = new AliAnalysisTaskSingleMuESD("TaskSingleMuESD");
56 // force values for the trigger mask, for version where
57 // GetFiredTriggerClasses() does not work
58 //task->SetTriggerType("MUON");
61 // Create containers for input/output
64 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
67 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("ctree", TNtuple::Class(),AliAnalysisManager::kOutputContainer,"SingleMuESD.root");
68 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("chist", TH1F::Class(),AliAnalysisManager::kOutputContainer,"SingleMuESD.root");
70 //____________________________________________//
71 mgr->ConnectInput(task,0,cinput);
72 mgr->ConnectOutput(task,0,coutput1);
73 mgr->ConnectOutput(task,1,coutput2);
75 if (mgr->InitAnalysis()) {
77 mgr->StartAnalysis("local",chain);