]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/macros/mini/ConfigPhi.C
PWG2/SPECTRA -> PWGLF/SPECTRA migration
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / mini / ConfigPhi.C
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 //
11 Bool_t ConfigPhi
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 kaon cut
27    AliRsnCutKaonForPhi2010PP *cutStd = new AliRsnCutKaonForPhi2010PP("cutStdPP");
28    // cut set
29    AliRsnCutSet *cutSetStd = new AliRsnCutSet("kaonForPhi", AliRsnTarget::kDaughter);
30    cutSetStd->AddCut(cutStd);
31    cutSetStd->SetCutScheme(cutStd->GetName());
32    // add to task
33    Int_t icut = task->AddTrackCuts(cutSetStd);
34    
35    //
36    // -- Values ------------------------------------------------------------------------------------
37    //
38    
39    /* invariant mass   */ Int_t imID   = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
40    /* IM resolution    */ Int_t resID  = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
41    /* transv. momentum */ Int_t ptID   = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
42    /* centrality       */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
43    
44    //
45    // -- Create all needed outputs -----------------------------------------------------------------
46    //
47    
48    // use an array for more compact writing, which are different on mixing and charges
49    // [0] = unlike
50    // [1] = mixing
51    // [2] = like ++
52    // [3] = like --
53    Bool_t  use     [6] = { 1      ,  1      ,  1      ,  1      ,  isMC   ,  isMC     };
54    Bool_t  useIM   [6] = { 1      ,  1      ,  1      ,  1      ,  1      ,  0        };
55    TString name    [6] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues" , "Res"     };
56    TString comp    [6] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE"  , "TRUE"    };
57    TString output  [6] = {"HIST"  , "HIST"  , "HIST"  , "HIST"  , "HIST"  , "HIST"    };
58    Char_t  charge1 [6] = {'+'     , '+'     , '+'     , '-'     , '+'     , '+'       };
59    Char_t  charge2 [6] = {'-'     , '-'     , '+'     , '-'     , '-'     , '-'       };
60    Int_t   cutID   [6] = { icut   ,  icut   ,  icut   ,  icut   ,  icut   ,  icut     };
61    
62    for (Int_t i = 0; i < 6; i++) {
63       if (!use[i]) continue;
64       // create output
65       AliRsnMiniOutput *out = task->CreateOutput(Form("phi_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
66       // selection settings
67       out->SetCutID(0, cutID[i]);
68       out->SetCutID(1, cutID[i]);
69       out->SetDaughter(0, AliRsnDaughter::kKaon);
70       out->SetDaughter(1, AliRsnDaughter::kKaon);
71       out->SetCharge(0, charge1[i]);
72       out->SetCharge(1, charge2[i]);
73       out->SetMotherPDG(333);
74       out->SetMotherMass(1.019455);
75       // pair cuts
76       out->SetPairCuts(cutsPair);
77       // axis X: invmass (or resolution)
78       if (useIM[i]) 
79          out->AddAxis(imID, 500, 0.9,  1.4);
80       else
81          out->AddAxis(resID, 200, -0.02, 0.02);
82       // axis Y: transverse momentum
83       out->AddAxis(ptID, 100, 0.0, 10.0);
84    }
85    
86    return kTRUE;
87 }