Moving PWG1 to PWGPP
[u/mrichter/AliRoot.git] / PWGPP / TRD / macros / AddTRDcheckESD.C
... / ...
CommitLineData
1#if ! defined (__CINT__) || defined (__MAKECINT__)
2#include "AliLog.h"
3#include "AliAnalysisManager.h"
4#include "AliAnalysisDataContainer.h"
5#include "AliAnalysisCuts.h"
6#include "AliESDtrackCuts.h"
7#include "PWGPP/TRD/AliTRDcheckESD.h"
8#endif
9
10AliESDtrackCuts* SetupESDcuts();
11
12void AddTRDcheckESD(AliAnalysisManager *mgr)
13{
14 //AliLog::SetClassDebugLevel("AliTRDcheckESD", 5);
15 AliTRDcheckESD *checkESD = new AliTRDcheckESD((char*)"TRDcheckESD");
16 checkESD->SetRefTrackFilter(SetupESDcuts());
17 mgr->AddTask(checkESD);
18 Bool_t mc = mgr->GetMCtruthEventHandler();
19 checkESD->SetMC(mc);
20 checkESD->SetCollision(/*kFALSE*/);
21 checkESD->SetDebugLevel(0);
22
23 mgr->ConnectInput(checkESD, 0, mgr->GetCommonInputContainer());
24 mgr->ConnectOutput(checkESD, 1, mgr->CreateContainer(checkESD->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName())));
25}
26
27AliESDtrackCuts* SetupESDcuts() {
28 // Setup ESD cuts for the TPC reference tracks
29 AliESDtrackCuts* esdCuts = new AliESDtrackCuts;
30 esdCuts->SetPtRange(0.5, 100.0);
31 esdCuts->SetEtaRange(-0.9, +0.9);
32 esdCuts->SetRequireTPCRefit(kTRUE);
33 esdCuts->SetAcceptKinkDaughters(kFALSE);
34 esdCuts->SetMaxDCAToVertexXY(1.);
35 esdCuts->SetMaxDCAToVertexZ(3.);
36 esdCuts->SetMinNClustersTPC(70);
37 return esdCuts;
38}
39