]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/macros/mini/ConfigKStar.C
Migration of PWG2/RESONANCES -> PWGLF/RESONANCES
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / mini / ConfigKStar.C
CommitLineData
caef2e3c 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 ConfigKStar
12(
13 AliRsnMiniAnalysisTask *task,
14 Bool_t isMC,
15 const char *suffix,
16 AliRsnCutSet *cutsPair
17)
18{
19 // manage suffix
20 if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
21
22 //
23 // -- Define track cuts -------------------------------------------------------------------------
24 //
25
26 // integrated pion cut
27 AliRsnCutDaughterKStar2010PP *cutPi = new AliRsnCutDaughterKStar2010PP("cutPionForKStar", AliPID::kPion);
28 // cut set
29 AliRsnCutSet *cutSetPi = new AliRsnCutSet("setPionForKStar", AliRsnTarget::kDaughter);
30 cutSetPi->AddCut(cutPi);
31 cutSetPi->SetCutScheme(cutPi->GetName());
32 // add to task
33 Int_t iCutPi = task->AddTrackCuts(cutSetPi);
34
35 // integrated kaon cut
36 AliRsnCutDaughterKStar2010PP *cutK = new AliRsnCutDaughterKStar2010PP("cutKaonForKStar", AliPID::kKaon);
37 // cut set
38 AliRsnCutSet *cutSetK = new AliRsnCutSet("setKaonForKStar", AliRsnTarget::kDaughter);
39 cutSetK->AddCut(cutK);
40 cutSetK->SetCutScheme(cutK->GetName());
41 // add to task
42 Int_t iCutK = task->AddTrackCuts(cutSetK);
43
44 //
45 // -- Values ------------------------------------------------------------------------------------
46 //
47
48 /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
49 /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
50 /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
51 /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
52
53 //
54 // -- Create all needed outputs -----------------------------------------------------------------
55 //
56
57 // use an array for more compact writing, which are different on mixing and charges
58 // [0] = unlike
59 // [1] = mixing
60 // [2] = like ++
61 // [3] = like --
62 Bool_t use [10] = { 1 , 1 , 1 , 1 , 1 , 1 , isMC , isMC , isMC , isMC };
63 Bool_t useIM [10] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 };
64 TString name [10] = {"Unlike1", "Unlike2", "Mixing1", "Mixing2", "LikePP", "LikeMM", "Trues1", "Trues2", "Res1" , "Res2" };
65 TString comp [10] = {"PAIR" , "PAIR" , "MIX" , "MIX" , "PAIR" , "PAIR" , "TRUE" , "TRUE" , "TRUE" , "TRUE" };
66 TString output [10] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" };
67 Char_t charge1 [10] = {'+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' };
68 Char_t charge2 [10] = {'-' , '+' , '-' , '+' , '+' , '-' , '-' , '+' , '-' , '+' };
69 Int_t cutID1 [10] = { iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK };
70 Int_t cutID2 [10] = { iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi };
71
72 for (Int_t i = 0; i < 10; i++) {
73 if (!use[i]) continue;
74 // create output
75 AliRsnMiniOutput *out = task->CreateOutput(Form("kstar_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
76 // selection settings
77 out->SetCutID(0, cutID1[i]);
78 out->SetCutID(1, cutID2[i]);
79 out->SetDaughter(0, AliRsnDaughter::kKaon);
80 out->SetDaughter(1, AliRsnDaughter::kPion);
81 out->SetCharge(0, charge1[i]);
82 out->SetCharge(1, charge2[i]);
83 out->SetMotherPDG(313);
84 out->SetMotherMass(0.896);
85 // pair cuts
86 out->SetPairCuts(cutsPair);
87 // axis X: invmass (or resolution)
88 if (useIM[i])
89 out->AddAxis(imID, 90, 0.6, 1.5);
90 else
91 out->AddAxis(resID, 200, -0.02, 0.02);
92 // axis Y: transverse momentum
93 out->AddAxis(ptID, 100, 0.0, 10.0);
94 }
95
96 return kTRUE;
97}