]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/macros/AddTRDcheckPID.C
train ready for Pilot integration with all wagons
[u/mrichter/AliRoot.git] / PWG1 / TRD / macros / AddTRDcheckPID.C
1 #if ! defined (__CINT__) || defined (__MAKECINT__)
2 #include "TTree.h"
3 #include "AliLog.h"
4 #include "AliAnalysisManager.h"
5 #include "AliAnalysisDataContainer.h"
6 #include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
7 #include "PWG1/TRD/AliTRDcheckPID.h"
8 #include "PWG1/TRD/AliTRDpidRefMaker.h"
9 #include "PWG1/TRD/AliTRDpidRefMakerNN.h"
10 #include "PWG1/TRD/AliTRDpidRefMakerLQ.h"
11 #endif
12
13 #include "PWG1/TRD/macros/helper.C"
14 void AddTRDcheckPID(AliAnalysisManager *mgr, Char_t *trd, AliAnalysisDataContainer **ci/*, AliAnalysisDataContainer **co*/)
15 {
16   Int_t map = ParseOptions(trd);
17   if(!TSTBIT(map, kCheckPID)) return;
18   printf("AddTRDcheckPID <- [0]=\"%s\" [1]=\"%s\"\n", ci[0]->GetName(), ci[1]->GetName());
19
20   AliTRDcheckPID *pid(NULL);
21   mgr->AddTask(pid = new AliTRDcheckPID((char*)"checkPID"));
22   //AliLog::SetClassDebugLevel("AliTRDcheckPID", 5);  
23   pid->SetDebugLevel(0);
24   pid->SetMCdata(mgr->GetMCtruthEventHandler());
25
26   // define PID exchange container
27   AliAnalysisDataContainer *ce = mgr->CreateContainer("InfoPID", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
28   mgr->ConnectInput (pid, 0, mgr->GetCommonInputContainer());
29   mgr->ConnectInput (pid, 1, ci[0]);
30   mgr->ConnectInput (pid, 2, ci[1]);
31   mgr->ConnectOutput(pid, 1, mgr->CreateContainer(pid->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.Performance.root"));
32   mgr->ConnectOutput(pid, 2, ce);
33
34   if(!TSTBIT(map, kPIDRefMaker)) return;
35
36   // TRD pid reference maker NN
37   AliTRDpidRefMaker *ref(NULL);
38   mgr->AddTask(ref = new AliTRDpidRefMakerNN((char*)"refMakerNN"));
39   ref->SetDebugLevel(3);
40   //AliLog::SetClassDebugLevel("AliTRDpidRefMaker", 3);
41   ref->SetMCdata(mgr->GetMCtruthEventHandler());
42   ref->SetFriends(kTRUE);
43   mgr->ConnectInput( ref, 0, mgr->GetCommonInputContainer());
44   mgr->ConnectInput( ref, 1, ci[0]);
45   mgr->ConnectInput( ref, 2, ci[1]);
46   mgr->ConnectInput( ref, 3, ce);
47   mgr->ConnectOutput(ref, 1, mgr->CreateContainer("MonitorNN", TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibPIDrefMaker.root"));
48   mgr->ConnectOutput(ref, 2, mgr->CreateContainer(ref->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibPIDrefMaker.root"));
49
50   // TRD pid reference maker LQ 
51   mgr->AddTask(ref = new AliTRDpidRefMakerLQ((char*)"refMakerLQ"));
52   ref->SetDebugLevel(3);
53   //AliLog::SetClassDebugLevel("AliTRDpidRefMakerLQ", 3);
54   ref->SetMCdata(mgr->GetMCtruthEventHandler());
55   ref->SetFriends(kTRUE);
56   mgr->ConnectInput(ref, 0, mgr->GetCommonInputContainer());
57   mgr->ConnectInput(ref, 1, ci[0]);
58   mgr->ConnectInput(ref, 2, ci[1]);
59   mgr->ConnectInput(ref, 3, ce);
60   mgr->ConnectOutput(ref, 1, mgr->CreateContainer("MonitorLQ", TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibPIDrefMaker.root"));
61   mgr->ConnectOutput(ref, 2, mgr->CreateContainer(ref->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibPIDrefMaker.root"));
62   mgr->ConnectOutput(ref, 3, mgr->CreateContainer("PDF", TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibPIDrefMakerLQ.root"));
63 }
64