small fix to remove TF1Helper which sneaked in again, inadvertently...
[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
0246246b 28void MuonTrackingEffAnalysis(const Bool_t alien = false, const Int_t run = 100, const char * fileName = "AliESDs.root", const char * geometryFileName = "geometry.root", Bool_t isCosmicData = kFALSE)
128a8042 29{
30//Chain construction
31 TChain *chain = new TChain("esdTree");
32 chain->Add(fileName);
33
6db6876c 34
35 // Name of the output file
36 const Char_t* outputName = "MuonTrackingChamberEffHistos.root";
37
128a8042 38//Load OCD
39 AliCDBManager* man = AliCDBManager::Instance();
40 TString ocdbPath;
41 if(alien)
42 {
43 ocdbPath = "alien://folder=/alice/data/2008/LHC08a/OCDB";
44 }
45 else
46 {
162637e4 47 ocdbPath = "local://$ALICE_ROOT/OCDB";
128a8042 48 }
49
50 man->SetDefaultStorage(ocdbPath.Data());
51 man->SetSpecificStorage("MUON/Calib/Mapping",ocdbPath);
52 man->SetRun(run);
53
54//Load Geometry
55 AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer();
56 transformer->LoadGeometryData(geometryFileName);
57
58
59//Make analysis manager:
60 AliAnalysisManager* mgr = new AliAnalysisManager("Manager", "Manager");
6db6876c 61 AliAnalysisTaskMuonTrackingEffComplete* ESDTask = new AliAnalysisTaskMuonTrackingEffComplete("ESDTask", transformer, isCosmicData);
128a8042 62 AliESDInputHandler* inHandler = new AliESDInputHandler();
63
64 mgr->SetInputEventHandler (inHandler );
65// mgr->SetDebugLevel(10);
66 mgr->AddTask(ESDTask);
67
68//Create containers for input/output
0246246b 69 AliAnalysisDataContainer* cinput0 = mgr->GetCommonInputContainer();
70 AliAnalysisDataContainer *coutput0 =
6db6876c 71 mgr->CreateContainer("TracksDetectedPerDE", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
128a8042 72 AliAnalysisDataContainer *coutput1 =
6db6876c 73 mgr->CreateContainer("TotalTracksPerDE", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
0246246b 74 AliAnalysisDataContainer *coutput2 =
6db6876c 75 mgr->CreateContainer("EfficiencyPerDE", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
0246246b 76 AliAnalysisDataContainer *coutput3 =
6db6876c 77 mgr->CreateContainer("TracksDetectedPerChamber", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
0246246b 78 AliAnalysisDataContainer *coutput4 =
6db6876c 79 mgr->CreateContainer("TotalTracksPerChamber", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
0246246b 80 AliAnalysisDataContainer *coutput5 =
6db6876c 81 mgr->CreateContainer("EfficiencyPerChamber", TClonesArray::Class(),AliAnalysisManager::kOutputContainer, outputName);
128a8042 82
83//Connection
0246246b 84 mgr->ConnectInput (ESDTask, 0, cinput0 );
6db6876c 85
0246246b 86 mgr->ConnectOutput(ESDTask, 0, coutput0);
87 mgr->ConnectOutput(ESDTask, 1, coutput1);
88 mgr->ConnectOutput(ESDTask, 2, coutput2);
89 mgr->ConnectOutput(ESDTask, 3, coutput3);
90 mgr->ConnectOutput(ESDTask, 4, coutput4);
91 mgr->ConnectOutput(ESDTask, 5, coutput5);
92
128a8042 93//Run analysis
94 if(mgr->InitAnalysis())
95 {
96 //mgr->PrintStatus();
97 mgr->StartAnalysis("Local", chain);
98 }
99}