Reseting the MC label to a default value of -1 before evaluating them (Philippe P...
[u/mrichter/AliRoot.git] / PWG3 / muondep / MuonTrackingEffAnalysis.C
CommitLineData
128a8042 1// 2008
2// Macro for the running of the AliAnalysisTaskMuonTrackingEff
3//
4
5// ROOT includes
6#include <TROOT.h>
7#include <TSystem.h>
8#include <TChain.h>
9#include <TFile.h>
10#include <TClonesArray.h>
11
12// PWG3 includes
13#include "AliAnalysisTaskMuonTrackingEff.h"
14
15// ANALYSIS includes
16#include "AliAnalysisManager.h"
17#include "AliAnalysisDataContainer.h"
18
19// STEER includes
20#include "AliESDInputHandler.h"
21#include "AliCDBManager.h"
22
23// MUON includes
24#include "AliMUONGeometryTransformer.h"
25
26
27
28void MuonTrackingEffAnalysis(const Bool_t alien = false, const Int_t run = 100, const char * fileName = "AliESDs.root", const char * geometryFileName = "geometry.root")
29{
30//Chain construction
31 TChain *chain = new TChain("esdTree");
32 chain->Add(fileName);
33
34//Load OCD
35 AliCDBManager* man = AliCDBManager::Instance();
36 TString ocdbPath;
37 if(alien)
38 {
39 ocdbPath = "alien://folder=/alice/data/2008/LHC08a/OCDB";
40 }
41 else
42 {
162637e4 43 ocdbPath = "local://$ALICE_ROOT/OCDB";
128a8042 44 }
45
46 man->SetDefaultStorage(ocdbPath.Data());
47 man->SetSpecificStorage("MUON/Calib/Mapping",ocdbPath);
48 man->SetRun(run);
49
50//Load Geometry
51 AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer();
52 transformer->LoadGeometryData(geometryFileName);
53
54
55//Make analysis manager:
56 AliAnalysisManager* mgr = new AliAnalysisManager("Manager", "Manager");
57 AliAnalysisTaskMuonTrackingEff* ESDTask = new AliAnalysisTaskMuonTrackingEff("ESDTask", transformer);
58 AliESDInputHandler* inHandler = new AliESDInputHandler();
59
60 mgr->SetInputEventHandler (inHandler );
61// mgr->SetDebugLevel(10);
62 mgr->AddTask(ESDTask);
63
64//Create containers for input/output
8a546c82 65 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
128a8042 66 AliAnalysisDataContainer *coutput1 =
67 mgr->CreateContainer("chistlist1", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, "MuonTrackingChamberEffHistos.root");
68
69//Connection
70 mgr->ConnectInput (ESDTask, 0, cinput1 );
71 mgr->ConnectOutput(ESDTask, 0, coutput1);
72
73//Run analysis
74 if(mgr->InitAnalysis())
75 {
76 //mgr->PrintStatus();
77 mgr->StartAnalysis("Local", chain);
78 }
79}