Moved old macros for lego_train into lego_train/old folder
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / lego_train / old / AddRsnDaughterCutsKStar2010.C
1 #ifndef __CINT__
2 #include <PWG2/RESONANCES/AliRsnInputHandler.h>
3 #include <PWG2/RESONANCES/AliRsnCutSet.h>
4 #include <PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h>
5 #endif
6 Int_t AddRsnDaughterCutsKStar2010(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,Bool_t isRsnMini=kFALSE,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)
7 {
8
9    if (!rsnIH) return 0;
10
11    // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====
12    Int_t numberOfCuts = 2;
13
14    Printf("AddRsnDaughterCutsKStar2010 Option : %s",opt.Data());
15
16    // integrated kaon cut
17    AliRsnCutDaughterKStar2010PP *cutK = new AliRsnCutDaughterKStar2010PP("cutKaonForKStar", type1);
18    // cut set
19    AliRsnCutSet *cutSetK = new AliRsnCutSet("KaonForKStar", AliRsnTarget::kDaughter);
20    cutSetK->AddCut(cutK);
21    cutSetK->SetCutScheme(cutK->GetName());
22
23    // integrated proton cut
24    AliRsnCutDaughterKStar2010PP *cutP = new AliRsnCutDaughterKStar2010PP("cutPionForKStar", type2);
25    // cut set
26    AliRsnCutSet *cutSetP = new AliRsnCutSet("PionForKStar", AliRsnTarget::kDaughter);
27    cutSetP->AddCut(cutP);
28    cutSetP->SetCutScheme(cutP->GetName());
29
30    if (opt.Contains("mon")) {
31       AddMonitorOutput(cutSetK->GetMonitorOutput());
32       AddMonitorOutput(cutSetP->GetMonitorOutput());
33    }
34    if (isRsnMini) {
35       AliRsnMiniAnalysisTask *taskRsnMini = dynamic_cast<AliRsnMiniAnalysisTask *>(task);
36       if (taskRsnMini) {
37          taskRsnMini->AddTrackCuts(cutSetK);
38          taskRsnMini->AddTrackCuts(cutSetP);
39       }
40    } else {
41       AliRsnDaughterSelector *sel = rsnIH->GetSelector();
42       sel->Add(cutSetK, kTRUE);
43       sel->Add(cutSetP, kTRUE);
44    }
45
46
47    return numberOfCuts;
48 }