]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/macros/AddTRDcheckPID.C
use folders TRD_Performance, TRD_Calibration and TRD_Alignment to store
[u/mrichter/AliRoot.git] / PWG1 / TRD / macros / AddTRDcheckPID.C
1 #if ! defined (__CINT__) || defined (__MAKECINT__)
2 #include "TTree.h"
3 #include "TError.h"
4 #include "AliLog.h"
5 #include "AliAnalysisManager.h"
6 #include "AliAnalysisDataContainer.h"
7 #include "PWG1/TRD/AliTRDpwg1Helper.h"
8 #include "PWG1/TRD/AliTRDcheckPID.h"
9 #include "PWG1/TRD/AliTRDpidRefMaker.h"
10 #include "PWG1/TRD/AliTRDpidRefMakerNN.h"
11 #include "PWG1/TRD/AliTRDpidRefMakerLQ.h"
12 #endif
13
14 void AddTRDcheckPID(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer **ci, AliAnalysisDataContainer **co)
15 {
16   Info("AddTRDcheckPID", Form("[0]=\"%s\" [1]=\"%s\"", ci[0]->GetName(), ci[1]->GetName()));
17
18   AliTRDcheckPID *pid(NULL);
19   mgr->AddTask(pid = new AliTRDcheckPID((char*)"TRDcheckPID"));
20   //AliLog::SetClassDebugLevel("AliTRDcheckPID", 5);  
21   pid->SetDebugLevel(0);
22   pid->SetMCdata(mgr->GetMCtruthEventHandler());
23
24   // define PID exchange container
25   co[0] = mgr->CreateContainer("InfoPID", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
26   mgr->ConnectInput (pid, 0, mgr->GetCommonInputContainer());
27   mgr->ConnectInput (pid, 1, ci[0]);
28   mgr->ConnectInput (pid, 2, ci[1]);
29   mgr->ConnectOutput(pid, 1, mgr->CreateContainer(pid->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName())));
30   mgr->ConnectOutput(pid, 2, co[0]);
31
32   if(TESTBIT(map, AliTRDpwg1Helper::kPIDRefMaker)){
33
34     //AliLog::SetClassDebugLevel("AliTRDpidRefMaker", 3);
35     //AliLog::SetClassDebugLevel("AliTRDpidRefMakerNN", 3);
36     //AliLog::SetClassDebugLevel("AliTRDpidRefMakerLQ", 3);
37   
38     // TRD pid reference maker NN
39     AliTRDpidRefMaker *ref(NULL);
40     mgr->AddTask(ref = new AliTRDpidRefMakerNN((char*)"TRDrefMakerNN"));
41     ref->SetDebugLevel(3);
42     ref->SetMCdata(mgr->GetMCtruthEventHandler());
43     ref->SetFriends(kTRUE);
44     mgr->ConnectInput( ref, 0, mgr->GetCommonInputContainer());
45     mgr->ConnectInput( ref, 1, ci[0]);
46     mgr->ConnectInput( ref, 2, ci[1]);
47     mgr->ConnectInput( ref, 3, co[0]);
48     mgr->ConnectOutput(ref, 1, mgr->CreateContainer("MonitorNN", TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration",mgr->GetCommonFileName())));
49     mgr->ConnectOutput(ref, 2, mgr->CreateContainer(ref->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
50   
51     // TRD pid reference maker LQ 
52     mgr->AddTask(ref = new AliTRDpidRefMakerLQ((char*)"TRDrefMakerLQ"));
53     ref->SetDebugLevel(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, co[0]);
60     mgr->ConnectOutput(ref, 1, mgr->CreateContainer("MonitorLQ", TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
61     mgr->ConnectOutput(ref, 2, mgr->CreateContainer(ref->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
62     mgr->ConnectOutput(ref, 3, mgr->CreateContainer("PDF", TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
63   }
64 }
65