]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/macros/train/RsnConfigMonitorTPC.C
Migration of PWG2/RESONANCES -> PWGLF/RESONANCES
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / train / RsnConfigMonitorTPC.C
CommitLineData
00163883 1//
2// *** Configuration script for phi->KK analysis with 2010 runs ***
3//
4// A configuration script for RSN package needs to define the followings:
5//
6// (1) decay tree of each resonance to be studied, which is needed to select
7// true pairs and to assign the right mass to all candidate daughters
8// (2) cuts at all levels: single daughters, tracks, events
9// (3) output objects: histograms or trees
10//
11Bool_t RsnConfigMonitorTPC
12(
13 AliRsnAnalysisTask *task,
14 Bool_t isMC,
15 Bool_t useCentrality,
16 AliRsnCutSet *eventCuts
17)
18{
19 void myError (const char *msg) {::Error ("RsnConfigPhi", msg);}
20 void myWarning(const char *msg) {::Warning("RsnConfigPhi", msg);}
21 void myInfo (const char *msg) {::Info ("RsnConfigPhi", msg);}
22
23 if (!task) myError("NULL task");
24
25 const char *suffix = "tpcstd";
26
27 // ==================================================================================================================
28 // == DEFINITIONS ===================================================================================================
29 // ==================================================================================================================
30
31 // daughter definitions
32 AliRsnDaughterDef *tracks = new AliRsnDaughterDef(AliRsnDaughter::kTrack, 0);
33
34 // computation objects:
35 // these are the objects which drive the computations, whatever it is (histos or tree filling)
36 // and all tracks passed to them will be given the mass according to the reference pair definition
37 // we create two unlike-sign pair computators, one for all pairs and another for true pairs (useful in MC)
38 AliRsnLoopDaughter *loop[3];
39 loop[0] = new AliRsnLoopDaughter(Form("%s_quality", suffix), 0, tracks);
40 loop[1] = new AliRsnLoopDaughter(Form("%s_pion" , suffix), 0, tracks);
41 loop[2] = new AliRsnLoopDaughter(Form("%s_kaon" , suffix), 0, tracks);
42
43 // assign the ID of the entry lists to be used by each pair to get selected daughters
44 // in our case, the AliRsnInputHandler contains only one list for selecting kaons
45 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
46 AliMultiInputEventHandler *multi = dynamic_cast<AliMultiInputEventHandler*>(mgr->GetInputEventHandler());
47 if (!multi) {
48 myError("Needed a multi input handler!");
49 return kFALSE;
50 }
51 TObjArray *array = multi->InputEventHandlers();
52 AliRsnInputHandler *rsn = (AliRsnInputHandler*)array->FindObject("rsnInputHandler");
53 if (!rsn) {
54 myError("Needed an RSN event handler");
55 return kFALSE;
56 }
57 AliRsnDaughterSelector *sel = rsn->GetSelector();
58 Int_t id[3];
59 id[0] = sel->GetID("qualityTPC", kTRUE);
60 id[1] = sel->GetID("pionTPC", kTRUE);
61 id[2] = sel->GetID("kaonTPC", kTRUE);
62
63 // ==================================================================================================================
64 // == COMPUTED VALUES & OUTPUTS =====================================================================================
65 // ==================================================================================================================
66
67 // axes
68 AliRsnValueStd *axisMomTPC = new AliRsnValueStd("pTPC", AliRsnValueStd::kTrackPtpc , 0.0, 5.0, 0.01 );
69 AliRsnValueStd *axisSigTPC = new AliRsnValueStd("sTPC", AliRsnValueStd::kTrackTPCsignal, 0.0, 500.0, 2.0 );
70 AliRsnValueStd *axisMomTOF = new AliRsnValueStd("pTOF", AliRsnValueStd::kTrackP , 0.0, 5.0, 0.01 );
71 AliRsnValuePID *axisSigTOF = new AliRsnValuePID("sTOF", AliRsnValuePID::kTOFnsigma , AliPID::kKaon, -200.0, 200.0, 10.0);
72
73 // create outputs
74 AliRsnListOutput *outTPC = new AliRsnListOutput("outTPC", AliRsnListOutput::kHistoDefault);
75 AliRsnListOutput *outTOF = new AliRsnListOutput("outTOF", AliRsnListOutput::kHistoDefault);
76
77 // add values to outputs
78 outTPC->AddValue(axisMomTPC);
79 outTPC->AddValue(axisSigTPC);
80 outTOF->AddValue(axisMomTOF);
81 outTOF->AddValue(axisSigTOF);
82
83 // ==================================================================================================================
84 // == CONCLUSION ====================================================================================================
85 // ==================================================================================================================
86
87 for (Int_t i = 0; i < 3; i++) {
88 // list ID
89 if (id[i] < 0) {
90 myError(Form("Required entry list for loop #%d is not added in the selector", i));
91 return kFALSE;
92 }
93 myInfo(Form("Required entry list for loop #%d [%s] is %d", i, loop[i]->GetName(), id[i]));
94 loop[i]->SetListID(id[i]);
95
96 // event cuts
97 loop[i]->SetEventCuts(eventCuts);
98
99 // outputs
100 loop[i]->AddOutput(outTPC);
101 loop[i]->AddOutput(outTOF);
102
103 // add to task
104 task->Add(loop[i]);
105 }
106
107 return kTRUE;
108}