2 // *** Configuration script for phi->KK analysis with 2010 runs ***
4 // A configuration script for RSN package needs to define the followings:
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
11 Bool_t RsnConfigMonitorTPC
13 AliRsnAnalysisTask *task,
16 AliRsnCutSet *eventCuts
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);}
23 if (!task) myError("NULL task");
25 const char *suffix = "tpcstd";
27 // ==================================================================================================================
28 // == DEFINITIONS ===================================================================================================
29 // ==================================================================================================================
31 // daughter definitions
32 AliRsnDaughterDef *tracks = new AliRsnDaughterDef(AliRsnDaughter::kTrack, 0);
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);
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());
48 myError("Needed a multi input handler!");
51 TObjArray *array = multi->InputEventHandlers();
52 AliRsnInputHandler *rsn = (AliRsnInputHandler*)array->FindObject("rsnInputHandler");
54 myError("Needed an RSN event handler");
57 AliRsnDaughterSelector *sel = rsn->GetSelector();
59 id[0] = sel->GetID("qualityTPC", kTRUE);
60 id[1] = sel->GetID("pionTPC", kTRUE);
61 id[2] = sel->GetID("kaonTPC", kTRUE);
63 // ==================================================================================================================
64 // == COMPUTED VALUES & OUTPUTS =====================================================================================
65 // ==================================================================================================================
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);
74 AliRsnListOutput *outTPC = new AliRsnListOutput("outTPC", AliRsnListOutput::kHistoDefault);
75 AliRsnListOutput *outTOF = new AliRsnListOutput("outTOF", AliRsnListOutput::kHistoDefault);
77 // add values to outputs
78 outTPC->AddValue(axisMomTPC);
79 outTPC->AddValue(axisSigTPC);
80 outTOF->AddValue(axisMomTOF);
81 outTOF->AddValue(axisSigTOF);
83 // ==================================================================================================================
84 // == CONCLUSION ====================================================================================================
85 // ==================================================================================================================
87 for (Int_t i = 0; i < 3; i++) {
90 myError(Form("Required entry list for loop #%d is not added in the selector", i));
93 myInfo(Form("Required entry list for loop #%d [%s] is %d", i, loop[i]->GetName(), id[i]));
94 loop[i]->SetListID(id[i]);
97 loop[i]->SetEventCuts(eventCuts);
100 loop[i]->AddOutput(outTPC);
101 loop[i]->AddOutput(outTOF);