Updated cut classes and macro for Sigma* analysis (M. Venaruzzo)
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / lego_train / AddRsnDaughterCutsKStar.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 AddRsnDaughterCutsKStar(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("AddRsnDaughterCutsKStar Option : %s",opt.Data());
15
16    AliRsnCutPion *cutPi = 0;
17    AliRsnCutKaon *cutK = 0;
18    if (opt.Contains("TPCTOFpidDefaultKstarPP2010")) {
19       cutPi = new AliRsnCutPion("cutPionTPCTOFpidDefaultKstarPP2010", AliRsnCutPion::kTPCTOFpidDefaultKstarPP2010);
20       cutK = new AliRsnCutKaon("cutKaonTPCTOFpidDefaultKstarPP2010", AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010);
21    } else if (opt.Contains("FastTPCpid1point5sigma")) {
22       cutPi = new AliRsnCutPion("cutPionForKStarFastTPCpid1point5sigma", AliRsnCutPion::kFastTPCpid1point5sigma);
23       cutK = new AliRsnCutKaon("cutKaonForKStarFastTPCpid1point5sigma", AliRsnCutKaon::kFastTPCpid1point5sigma);
24    } else if (opt.Contains("FastTPCpid2sigma")) {
25       cutPi = new AliRsnCutPion("cutPionForKStarFastTPCpid2sigma", AliRsnCutPion::kFastTPCpid2sigma);
26       cutK = new AliRsnCutKaon("cutKaonForKStarFastTPCpid2sigma", AliRsnCutKaon::kFastTPCpid2sigma);
27    } else {
28       cutPi = new AliRsnCutPion("cutPionDefault");
29       cutK = new AliRsnCutKaon("cutKaonDefault")
30    }
31    AliRsnCutSet *cutSetPi = new AliRsnCutSet(Form("set%s",cutPi->GetName()), AliRsnTarget::kDaughter);
32    cutSetPi->AddCut(cutPi);
33    cutSetPi->SetCutScheme(cutPi->GetName());
34
35    // cut set
36    AliRsnCutSet *cutSetK = new AliRsnCutSet(Form("set%s",cutK->GetName()), AliRsnTarget::kDaughter);
37    cutSetK->AddCut(cutK);
38    cutSetK->SetCutScheme(cutK->GetName());
39
40
41    if (opt.Contains("mon")) {
42       Printf("Monitoring cut AddRsnDaughterCutsKStar Option : %s",opt.Data());
43       AddMonitorOutput(cutSetPi->GetMonitorOutput());
44       AddMonitorOutput(cutSetK->GetMonitorOutput());
45    }
46    if (isRsnMini) {
47       AliRsnMiniAnalysisTask *taskRsnMini = dynamic_cast<AliRsnMiniAnalysisTask *>(task);
48       if (taskRsnMini) {
49          taskRsnMini->AddTrackCuts(cutSetPi);
50          taskRsnMini->AddTrackCuts(cutSetK);
51       }
52    } else {
53       AliRsnDaughterSelector *sel = rsnIH->GetSelector();
54       sel->Add(cutSetPi, kTRUE);
55       sel->Add(cutSetK, kTRUE);
56    }
57
58
59    return numberOfCuts;
60 }