Updated macros for lego_train phi analysis (mvala)
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Apr 2013 17:01:49 +0000 (17:01 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Apr 2013 17:01:49 +0000 (17:01 +0000)
PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsPhiNsigma.C
PWGLF/RESONANCES/macros/lego_train/AddRsnPairsPhi.C
PWGLF/RESONANCES/macros/lego_train/AddRsnTaskTrain.C
PWGLF/RESONANCES/macros/lego_train/RsnQualityCut.C
PWGLF/RESONANCES/macros/lego_train/RsnTrainSettingsExtra.C

index 0064221..2f4a893 100644 (file)
-#ifndef __CINT__\r
-#include <AliRsnCutTrackQuality.h>\r
-#endif\r
-Int_t AddRsnDaughterCutsPhiNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)\r
-{\r
-\r
-  if (!rsnIH) return 0;\r
-  \r
-  Bool_t valid = kTRUE;\r
-  //   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);\r
-  Int_t useCommonQualityCut = AliRsnTrainManager::GetGlobalInt("RsnCommonQualityCut",valid);\r
-  TString rsnQualityCut = AliRsnTrainManager::GetGlobalStr("RsnQualityCut",valid);\r
-  Int_t isMC = AliRsnTrainManager::GetGlobalInt("IsMC",valid);\r
-  Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);\r
-  Int_t isMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);\r
-\r
-  // experts only (don't touch)\r
-  Int_t isRsnDev = AliAnalysisManager::GetGlobalInt("rsnUseRSNParDev",valid);\r
-\r
-  // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====\r
-  Int_t numberOfCuts = 1;\r
-\r
-  //---------------------------------------------\r
-  //  Define single cuts\r
-  //---------------------------------------------\r
-\r
-  Printf("AliRsnCutPIDNSigma Option : %s",opt.Data());\r
-\r
-  Double_t nSigmaTPC=3.0;\r
-  Double_t nSigmaTOF=3.0;\r
-  Double_t etaMin=-0.8;\r
-  Double_t etaMax=0.8;\r
-  Double_t trackPtMin=0.;\r
-  Double_t trackPtMax=1.e10;\r
-  Int_t NclTPC=70;\r
-  Char_t DCAxyFormula[100]="0.0182+0.035/pt^1.01";\r
-\r
-  Bool_t useTPC_K=kFALSE;\r
-  Bool_t useTOF_K=kFALSE;\r
-  Bool_t useTrackPtCut=kFALSE;\r
-\r
-  if (opt.Contains("qualityonly")) {\r
-    useTPC_K=kFALSE;\r
-    useTOF_K=kFALSE;\r
-  } else if (!opt.Contains("nsig")) {\r
-    useTPC_K=kTRUE;\r
-    useTOF_K=kTRUE;\r
-  }\r
-\r
-  if (opt.Contains("KTPCnsig"))  useTPC_K=kTRUE;\r
-  if (opt.Contains("KTOFnsig"))  useTOF_K=kTRUE;\r
-\r
-  if (opt.Contains("KTPCnsig05")) nSigmaTPC = 0.5;\r
-  if (opt.Contains("KTPCnsig08")) nSigmaTPC = 0.8;\r
-  if (opt.Contains("KTPCnsig10")) nSigmaTPC = 1.0;\r
-  if (opt.Contains("KTPCnsig15")) nSigmaTPC = 1.5;\r
-  if (opt.Contains("KTPCnsig20")) nSigmaTPC = 2.0;\r
-  if (opt.Contains("KTPCnsig25")) nSigmaTPC = 2.5;\r
-  if (opt.Contains("KTPCnsig30")) nSigmaTPC = 3.0;\r
-  if (opt.Contains("KTPCnsig40")) nSigmaTPC = 4.0;\r
-  if (opt.Contains("KTPCnsig50")) nSigmaTPC = 5.0;\r
-  if (opt.Contains("KTPCnsig1000")) nSigmaTPC = 100.0;\r
-\r
-  if (opt.Contains("KTOFnsig10")) nSigmaTOF = 1.0;\r
-  if (opt.Contains("KTOFnsig15")) nSigmaTOF = 1.5;\r
-  if (opt.Contains("KTOFnsig20")) nSigmaTOF = 2.0;\r
-  if (opt.Contains("KTOFnsig25")) nSigmaTOF = 2.5;\r
-  if (opt.Contains("KTOFnsig30")) nSigmaTOF = 3.0;\r
-  if (opt.Contains("KTOFnsig1000")) nSigmaTOF = 100.0;\r
-\r
-  if (opt.Contains("trackPt")) {\r
-    useTrackPtCut = kTRUE;\r
-    if (opt.Contains("trackPtMin015")) trackPtMin = 0.15;\r
-    if (opt.Contains("trackPtMin02")) trackPtMin = 0.2;\r
-    if (opt.Contains("trackPtMin05")) trackPtMin = 0.5;\r
-    if (opt.Contains("trackPtMin06")) trackPtMin = 0.6;\r
-\r
-    if (opt.Contains("trackPtMax18")) trackPtMax = 1.8;\r
-    if (opt.Contains("trackPtMax20")) trackPtMax = 2.0;\r
-    if (opt.Contains("trackPtMax25")) trackPtMax = 2.5;\r
-  }\r
-\r
-  Bool_t usePDG=kFALSE;\r
-  if (opt.Contains("pdg")) {\r
-    Printf("Using PDG");\r
-    usePDG = kTRUE;\r
-  }\r
-\r
-  Bool_t useEta = kFALSE;\r
-  if (opt.Contains("eta")) {\r
-    for(int j=1;j<=9;j++) if(opt.Contains(Form("eta0%i",j))){etaMin=-0.1*j; etaMax=0.1*j;}\r
-\r
-    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinMinus0%i",j))) etaMin=-0.1*j;\r
-    if(opt.Contains("etaMin00")) etaMin=0.;\r
-    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinPlus0%i",j))) etaMin=0.1*j;\r
-\r
-    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxMinus0%i",j))) etaMax=-0.1*j;\r
-    if(opt.Contains("etaMax00")) etaMax=0.;\r
-    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxPlus0%i",j))) etaMax=0.1*j;\r
-\r
-    Printf("Using ETA range (%.2f,%.2f)",etaMin,etaMax);\r
-    useEta = kTRUE;\r
-  }\r
-\r
-  Bool_t useNclTPC = kFALSE;\r
-  if (opt.Contains("NclTPC")) {\r
-    if (opt.Contains("NclTPC70")) NclTPC=70;\r
-    if (opt.Contains("NclTPC75")) NclTPC=75;\r
-    if (opt.Contains("NclTPC80")) NclTPC=80;\r
-    if (opt.Contains("NclTPC85")) NclTPC=85;\r
-    if (opt.Contains("NclTPC90")) NclTPC=90;\r
-    useNclTPC = kTRUE;\r
-  }\r
-\r
-  Bool_t useDCAxy = kFALSE;\r
-  if (opt.Contains("DCAxy")) {\r
-    if (opt.Contains("DCAxyFormula7s")) sprintf(DCAxyFormula,"0.0182+0.035/pt^1.01");\r
-    if (opt.Contains("DCAxyFormula6s")) sprintf(DCAxyFormula,"0.0156+0.03/pt^1.01");\r
-    if (opt.Contains("DCAxyFormula5s")) sprintf(DCAxyFormula,"0.013+0.025/pt^1.01");\r
-    useDCAxy = kTRUE;\r
-  }\r
-\r
-  //---------------------------------------------\r
-  //  Combine cuts\r
-  //---------------------------------------------\r
-\r
-  TString cutname = "K_Phi";\r
-  if (!opt.IsNull()) cutname += Form("_%s",opt.Data());\r
-  AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);\r
-\r
-  TString scheme="";\r
-  AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQualityK");\r
-  if (!rsnQualityCut.IsNull()) {\r
-    AliESDtrackCuts *esdTK = RsnQualityCut(rsnQualityCut.Data());\r
-    if(useDCAxy) esdTK->SetMaxDCAToVertexXYPtDep(DCAxyFormula);\r
-    qualityCut->SetESDtrackCuts(esdTK);\r
-  } else {\r
-    if (useCommonQualityCut>=0) {\r
-      qualityCut->SetAODTestFilterBit(useCommonQualityCut);\r
-      if(useDCAxy) {qualityCut->SetCheckOnlyFilterBit(kFALSE); qualityCut->SetDCARPtFormula(DCAxyFormula);}\r
-    } else {\r
-      qualityCut->SetDefaults2010();\r
-      if(useDCAxy) qualityCut->SetDCARPtFormula(DCAxyFormula);\r
-    }\r
-  }\r
-\r
-  cuts->AddCut(qualityCut);\r
-  if (!scheme.IsNull()) scheme += "&";\r
-  scheme += qualityCut->GetName();\r
-\r
-\r
-  if (useTPC_K) {\r
-    AliRsnCutPIDNSigma *cutKTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCK",AliPID::kKaon,AliRsnCutPIDNSigma::kTPC);\r
-    cutKTPC->SinglePIDRange(nSigmaTPC);\r
-    cuts->AddCut(cutKTPC);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutKTPC->GetName();\r
-  }\r
-\r
-  if (useTOF_K) {\r
-    AliRsnCutPIDNSigma *cutKTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFK",AliPID::kKaon,AliRsnCutPIDNSigma::kTOF);\r
-    cutKTOF->SinglePIDRange(nSigmaTOF);\r
-    cuts->AddCut(cutKTOF);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutKTOF->GetName();\r
-  }\r
-\r
-  if (useEta) {\r
-    Printf("Adding ETA ...");\r
-    AliRsnValueDaughter *valEta = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta);\r
-    AliRsnCutValue *cutEta = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),etaMin,etaMax);\r
-    cutEta->SetTargetType(AliRsnTarget::kDaughter);\r
-    cutEta->SetValueObj(valEta);\r
-    cuts->AddCut(cutEta);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutEta->GetName();\r
-  }\r
-\r
-  if (useTrackPtCut) {\r
-    Printf("Adding Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);\r
-    AliRsnValueDaughter *valTrackPt = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt);\r
-\r
-    AliRsnCutValue *cutTrackPt = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax);\r
-    cutTrackPt->SetTargetType(AliRsnTarget::kDaughter);\r
-    cutTrackPt->SetValueObj(valTrackPt);\r
-    cuts->AddCut(cutTrackPt);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutTrackPt->GetName();\r
-  }\r
-\r
-  if (useNclTPC) {\r
-    Printf("Adding NclTPC >= %i",NclTPC);\r
-    AliRsnValueDaughter *valNclTPC = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kNTPCclusters);\r
-    AliRsnCutValue *cutNclTPC = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),NclTPC-0.1,1000.);\r
-    cutNclTPC->SetTargetType(AliRsnTarget::kDaughter);\r
-    cutNclTPC->SetValueObj(valNclTPC);\r
-    cuts->AddCut(cutNclTPC);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutNclTPC->GetName();\r
-  }\r
-\r
-  if (usePDG) {\r
-    Printf("Adding PDG ...");\r
-    AliRsnCutPID *cutPDG = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE);\r
-    cuts->AddCut(cutPDG);\r
-    if (!scheme.IsNull()) scheme += "&";\r
-    scheme += cutPDG->GetName();\r
-  }\r
-\r
-  Printf ("CUT Scheme is '%s'",scheme.Data());\r
-  cuts->SetCutScheme(scheme.Data());\r
-\r
-  if (opt.Contains("mon")) {\r
-    AddMonitorOutput(cuts->GetMonitorOutput(),opt);\r
-  }\r
-  if (isRsnMini) {\r
-    AliRsnMiniAnalysisTask *taskRsnMini = (AliRsnMiniAnalysisTask *)task;\r
-    if (taskRsnMini) {\r
-      taskRsnMini->AddTrackCuts(cuts);\r
-    }\r
-  } else {\r
-    AliRsnDaughterSelector *sel = rsnIH->GetSelector();\r
-    //       sel->SetLabelCheck(kFALSE);\r
-    sel->Add(cuts, kTRUE);\r
-    if (isRsnDev>=0 && opt.Contains("pairPID")) {\r
-      AliRsnActPostDaughterSelection *pairPID = new AliRsnActPostDaughterSelection();\r
-      pairPID->SetID(0);\r
-\r
-      const char *fn="rsnRange.txt";\r
-      if (!gSystem->AccessPathName(fn)) {\r
-       TString minStr = gSystem->GetFromPipe(TString::Format("head -n 1 %s").Data());\r
-       TString maxStr = gSystem->GetFromPipe(TString::Format("tail -n 1 %s").Data());\r
-       pairPID->SetMass(minStr.Atof(),maxStr.Atof());\r
-      } else {\r
-       //       pairPID->SetMass(1.01,1.03);\r
-       pairPID->SetMass(1.015,1.025);\r
-       pairPID->SetMass(1.019,1.021);\r
-       pairPID->SetMass(1.0195,1.0205);\r
-       pairPID->SetMass(1.1000,1.1005);\r
-       //       pairPID->SetMass(1.1005,1.1010);\r
-      }\r
-      sel->AddAction(pairPID);\r
-    }\r
-\r
-  }\r
-  return numberOfCuts;\r
-\r
-}\r
+#ifndef __CINT__
+#include <AliRsnCutTrackQuality.h>
+#endif
+Int_t AddRsnDaughterCutsPhiNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)
+{
+
+  if (!rsnIH) return 0;
+  
+  Bool_t valid = kTRUE;
+  //   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
+  Int_t useCommonQualityCut = AliRsnTrainManager::GetGlobalInt("RsnCommonQualityCut",valid);
+  TString rsnQualityCut = AliRsnTrainManager::GetGlobalStr("RsnQualityCut",valid);
+  Int_t isMC = AliRsnTrainManager::GetGlobalInt("IsMC",valid);
+  Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
+  Int_t isMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
+
+  // experts only (don't touch)
+  Int_t isRsnDev = AliAnalysisManager::GetGlobalInt("rsnUseRSNParDev",valid);
+
+  // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====
+  Int_t numberOfCuts = 1;
+
+  //---------------------------------------------
+  //  Define single cuts
+  //---------------------------------------------
+
+  Printf("AliRsnCutPIDNSigma Option : %s",opt.Data());
+
+  Double_t nSigmaTPC=3.0;
+  Double_t nSigmaTOF=3.0;
+  Double_t etaMin=-0.8;
+  Double_t etaMax=0.8;
+  Double_t trackPtMin=0.;
+  Double_t trackPtMax=1.e10;
+  Int_t NclTPC=70;
+  Char_t DCAxyFormula[100]="0.0182+0.035/pt^1.01";
+
+  Bool_t useTPC_K=kFALSE;
+  Bool_t useTOF_K=kFALSE;
+  Bool_t useTrackPtCut=kFALSE;
+
+  if (opt.Contains("qualityonly")) {
+    useTPC_K=kFALSE;
+    useTOF_K=kFALSE;
+  } else if (!opt.Contains("nsig")) {
+    useTPC_K=kTRUE;
+    useTOF_K=kTRUE;
+  }
+
+  if (opt.Contains("KTPCnsig"))  useTPC_K=kTRUE;
+  if (opt.Contains("KTOFnsig"))  useTOF_K=kTRUE;
+
+  if (opt.Contains("KTPCnsig05")) nSigmaTPC = 0.5;
+  if (opt.Contains("KTPCnsig08")) nSigmaTPC = 0.8;
+  if (opt.Contains("KTPCnsig10")) nSigmaTPC = 1.0;
+  if (opt.Contains("KTPCnsig15")) nSigmaTPC = 1.5;
+  if (opt.Contains("KTPCnsig20")) nSigmaTPC = 2.0;
+  if (opt.Contains("KTPCnsig25")) nSigmaTPC = 2.5;
+  if (opt.Contains("KTPCnsig30")) nSigmaTPC = 3.0;
+  if (opt.Contains("KTPCnsig40")) nSigmaTPC = 4.0;
+  if (opt.Contains("KTPCnsig50")) nSigmaTPC = 5.0;
+  if (opt.Contains("KTPCnsig1000")) nSigmaTPC = 100.0;
+
+  if (opt.Contains("KTOFnsig10")) nSigmaTOF = 1.0;
+  if (opt.Contains("KTOFnsig15")) nSigmaTOF = 1.5;
+  if (opt.Contains("KTOFnsig20")) nSigmaTOF = 2.0;
+  if (opt.Contains("KTOFnsig25")) nSigmaTOF = 2.5;
+  if (opt.Contains("KTOFnsig30")) nSigmaTOF = 3.0;
+  if (opt.Contains("KTOFnsig1000")) nSigmaTOF = 100.0;
+
+  if (opt.Contains("trackPt")) {
+    useTrackPtCut = kTRUE;
+    if (opt.Contains("trackPtMin015")) trackPtMin = 0.15;
+    if (opt.Contains("trackPtMin02")) trackPtMin = 0.2;
+    if (opt.Contains("trackPtMin05")) trackPtMin = 0.5;
+    if (opt.Contains("trackPtMin06")) trackPtMin = 0.6;
+
+    if (opt.Contains("trackPtMax18")) trackPtMax = 1.8;
+    if (opt.Contains("trackPtMax20")) trackPtMax = 2.0;
+    if (opt.Contains("trackPtMax25")) trackPtMax = 2.5;
+  }
+
+  Bool_t usePDG=kFALSE;
+  if (opt.Contains("pdg")) {
+    Printf("Using PDG");
+    usePDG = kTRUE;
+  }
+
+  Bool_t useEta = kFALSE;
+  if (opt.Contains("eta")) {
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("eta0%i",j))){etaMin=-0.1*j; etaMax=0.1*j;}
+
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinMinus0%i",j))) etaMin=-0.1*j;
+    if(opt.Contains("etaMin00")) etaMin=0.;
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinPlus0%i",j))) etaMin=0.1*j;
+
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxMinus0%i",j))) etaMax=-0.1*j;
+    if(opt.Contains("etaMax00")) etaMax=0.;
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxPlus0%i",j))) etaMax=0.1*j;
+
+    Printf("Using ETA range (%.2f,%.2f)",etaMin,etaMax);
+    useEta = kTRUE;
+  }
+
+  Bool_t useNclTPC = kFALSE;
+  if (opt.Contains("NclTPC")) {
+    if (opt.Contains("NclTPC70")) NclTPC=70;
+    if (opt.Contains("NclTPC75")) NclTPC=75;
+    if (opt.Contains("NclTPC80")) NclTPC=80;
+    if (opt.Contains("NclTPC85")) NclTPC=85;
+    if (opt.Contains("NclTPC90")) NclTPC=90;
+    useNclTPC = kTRUE;
+  }
+
+  Bool_t useDCAxy = kFALSE;
+  if (opt.Contains("DCAxy")) {
+    if (opt.Contains("DCAxyFormula7s")) sprintf(DCAxyFormula,"0.0182+0.035/pt^1.01");
+    if (opt.Contains("DCAxyFormula6s")) sprintf(DCAxyFormula,"0.0156+0.03/pt^1.01");
+    if (opt.Contains("DCAxyFormula5s")) sprintf(DCAxyFormula,"0.013+0.025/pt^1.01");
+    useDCAxy = kTRUE;
+  }
+
+  //---------------------------------------------
+  //  Combine cuts
+  //---------------------------------------------
+
+  TString cutname = "K_Phi";
+  if (!opt.IsNull()) cutname += Form("_%s",opt.Data());
+  AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);
+
+  TString scheme="";
+  AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQualityK");
+  if (!rsnQualityCut.IsNull()) {
+    AliESDtrackCuts *esdTK = RsnQualityCut(rsnQualityCut.Data());
+    if(useDCAxy) esdTK->SetMaxDCAToVertexXYPtDep(DCAxyFormula);
+    qualityCut->SetESDtrackCuts(esdTK);
+  } else {
+    if (useCommonQualityCut>=0) {
+      qualityCut->SetAODTestFilterBit(useCommonQualityCut);
+      if(useDCAxy) {qualityCut->SetCheckOnlyFilterBit(kFALSE); qualityCut->SetDCARPtFormula(DCAxyFormula);}
+    } else {
+      qualityCut->SetDefaults2010();
+      if(useDCAxy) qualityCut->SetDCARPtFormula(DCAxyFormula);
+    }
+  }
+
+  cuts->AddCut(qualityCut);
+  if (!scheme.IsNull()) scheme += "&";
+  scheme += qualityCut->GetName();
+
+
+  if (useTPC_K) {
+    AliRsnCutPIDNSigma *cutKTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCK",AliPID::kKaon,AliRsnCutPIDNSigma::kTPC);
+    cutKTPC->SinglePIDRange(nSigmaTPC);
+    cuts->AddCut(cutKTPC);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutKTPC->GetName();
+  }
+
+  if (useTOF_K) {
+    AliRsnCutPIDNSigma *cutKTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFK",AliPID::kKaon,AliRsnCutPIDNSigma::kTOF);
+    cutKTOF->SinglePIDRange(nSigmaTOF);
+    cuts->AddCut(cutKTOF);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutKTOF->GetName();
+  }
+
+  if (useEta) {
+    Printf("Adding ETA ...");
+    AliRsnValueDaughter *valEta = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta);
+    AliRsnCutValue *cutEta = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),etaMin,etaMax);
+    cutEta->SetTargetType(AliRsnTarget::kDaughter);
+    cutEta->SetValueObj(valEta);
+    cuts->AddCut(cutEta);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutEta->GetName();
+  }
+
+  if (useTrackPtCut) {
+    Printf("Adding Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);
+    AliRsnValueDaughter *valTrackPt = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt);
+
+    AliRsnCutValue *cutTrackPt = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax);
+    cutTrackPt->SetTargetType(AliRsnTarget::kDaughter);
+    cutTrackPt->SetValueObj(valTrackPt);
+    cuts->AddCut(cutTrackPt);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutTrackPt->GetName();
+  }
+
+  if (useNclTPC) {
+    Printf("Adding NclTPC >= %i",NclTPC);
+    AliRsnValueDaughter *valNclTPC = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kNTPCclusters);
+    AliRsnCutValue *cutNclTPC = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),NclTPC-0.1,1000.);
+    cutNclTPC->SetTargetType(AliRsnTarget::kDaughter);
+    cutNclTPC->SetValueObj(valNclTPC);
+    cuts->AddCut(cutNclTPC);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutNclTPC->GetName();
+  }
+
+  if (usePDG) {
+    Printf("Adding PDG ...");
+    AliRsnCutPID *cutPDG = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE);
+    cuts->AddCut(cutPDG);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutPDG->GetName();
+  }
+
+  Printf ("CUT Scheme is '%s'",scheme.Data());
+  cuts->SetCutScheme(scheme.Data());
+
+  if (opt.Contains("mon")) {
+    AddMonitorOutput(cuts->GetMonitorOutput(),opt);
+  }
+  if (isRsnMini) {
+    AliRsnMiniAnalysisTask *taskRsnMini = (AliRsnMiniAnalysisTask *)task;
+    if (taskRsnMini) {
+      taskRsnMini->AddTrackCuts(cuts);
+    }
+  } else {
+    AliRsnDaughterSelector *sel = rsnIH->GetSelector();
+    //       sel->SetLabelCheck(kFALSE);
+    sel->Add(cuts, kTRUE);
+    if (isRsnDev>=0 && opt.Contains("pairPID")) {
+      AliRsnActPostDaughterSelection *pairPID = new AliRsnActPostDaughterSelection();
+      pairPID->SetID(0);
+
+      const char *fn="rsnRange.txt";
+      if (!gSystem->AccessPathName(fn)) {
+       TString minStr = gSystem->GetFromPipe(TString::Format("head -n 1 %s").Data());
+       TString maxStr = gSystem->GetFromPipe(TString::Format("tail -n 1 %s").Data());
+       pairPID->SetMass(minStr.Atof(),maxStr.Atof());
+      } else {
+       //       pairPID->SetMass(1.01,1.03);
+       pairPID->SetMass(1.015,1.025);
+       pairPID->SetMass(1.019,1.021);
+       pairPID->SetMass(1.0195,1.0205);
+       pairPID->SetMass(1.1000,1.1005);
+       //       pairPID->SetMass(1.1005,1.1010);
+      }
+      sel->AddAction(pairPID);
+    }
+
+  }
+  return numberOfCuts;
+
+}
index 289204e..5c70143 100644 (file)
@@ -86,6 +86,7 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
    Int_t useMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
    Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
 
+   Int_t useMixLike = AliRsnTrainManager::GetGlobalInt("RsnMixLike",valid);
    Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);
 
    AliRsnMiniAnalysisTask *taskRsnMini =  (AliRsnMiniAnalysisTask *)task;
@@ -115,11 +116,16 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
    // [1] = mixing
    // [2] = like ++
    // [3] = like --
-   Bool_t  use     [5] = { 1      ,  useMixing      ,  1      ,  1      ,  isMC  };
-   TString name    [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues"};
-   TString comp    [5] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE" };
-   Char_t  charge1 [5] = {'+'     , '+'     , '+'     , '-'     , '+'    };
-   Char_t  charge2 [5] = {'-'     , '-'     , '+'     , '-'     , '-'    };
+
+//   Bool_t useMixLike = kFALSE;
+//   useMixLike = kTRUE;
+
+   const Int_t numAxis = 7;
+   Bool_t  use     [numAxis] = { 1      ,  useMixing      ,  1      ,  1      ,  isMC  ,  useMixLike,  useMixLike};
+   TString name    [numAxis] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues", "MixingPP", "MixingMM"};
+   TString comp    [numAxis] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE" , "MIX"   , "MIX"   };
+   Char_t  charge1 [numAxis] = {'+'     , '+'     , '+'     , '-'     , '+'    , '+'     , '-'     };
+   Char_t  charge2 [numAxis] = {'-'     , '-'     , '+'     , '-'     , '-'    , '+'     , '-'     };
 
    // common definitions
    TString outputType = "HIST";
@@ -134,6 +140,15 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
    Int_t nCent = 20; Double_t minCent = 0.0, maxCent = 100.0;
    Int_t nRes  = 200; Double_t maxRes  = 0.01;
 
+   // in case pp
+   if (collisionType==0) {
+      nIM   = 150; minIM  = 0.975; maxIM  =  1.125;
+      nPt   = 160; minPt  = 0.0,   maxPt  = 8.0;
+      nEta  = 30;  minEta = -1.5;  maxEta =  1.5;
+      nY    = 3;   minY   = -1.5;  maxY   =  1.5;
+   }
+
+
    // retrieve mass from PDG database
    Int_t         pdg  = 333;
    TDatabasePDG *db   = TDatabasePDG::Instance();
@@ -142,7 +157,7 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
 
    Printf(suffix.Data());
    // create standard outputs
-   for (Int_t i = 0; i < 5; i++) {
+   for (Int_t i = 0; i < numAxis; i++) {
       if (!use[i]) continue;
       // create output
       AliRsnMiniOutput *out = taskRsnMini->CreateOutput(Form("%s_%s", suffix.Data(),name[i].Data() ), outputType.Data(), comp[i].Data());
@@ -165,7 +180,7 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
          out->AddAxis(ptID, nPt, minPt, maxPt);
 
          if (useRapidity) out->AddAxis(yID, nY, minY, maxY);
-         else  out->AddAxis(etaID, nEta, minEta, maxEta);
+         if (collisionType==0) out->AddAxis(etaID, nEta, minEta, maxEta);
          // axis Z: centrality
          if (collisionType==1) out->AddAxis(centID, nCent, minCent, maxCent);
       }
@@ -192,7 +207,8 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
          // axis Y: transverse momentum
          outRes->AddAxis(ptID, nPt, minPt, maxPt);
          if (useRapidity) outRes->AddAxis(yID, nY, minY, maxY);
-         else  outRes->AddAxis(etaID, nEta, minEta, maxEta);
+         if (collisionType==0) outRes->AddAxis(etaID, nEta, minEta, maxEta);
+
          // axis Z: centrality
          if (collisionType==1) outRes->AddAxis(centID, nCent, minCent, maxCent);
       }
@@ -218,7 +234,7 @@ void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing,
          // axis Y: transverse momentum
          outMC->AddAxis(ptID, nPt, minPt, maxPt);
          if (useRapidity) outMC->AddAxis(yID, nY, minY, maxY);
-         else  outMC->AddAxis(etaID, nEta, minEta, maxEta);
+         if (collisionType==0) outMC->AddAxis(etaID, nEta, minEta, maxEta);
          // axis Z: centrality
          if (collisionType==1) outMC->AddAxis(centID, nCent, minCent, maxCent);
       }
index 9ecfd57..903f54b 100644 (file)
@@ -11,6 +11,7 @@ AliAnalysisTask *AddRsnTaskTrain(const char *commonStr,const char *rsnStr,const
    // or like we are using it now
    //    return AddRsnTask(rsnStr,rsnCutStr,"");
 
+   Printf ("Running AddRsnTaskTrain(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")",commonStr,rsnStr,rsnCutStr,rsnQualityCutStr.Data(),extraMacro.Data(),extraMacroArgs.Data());
    Bool_t valid;
    AliAnalysisManager::GetGlobalStr("LegoTrainPath",valid);
    if (!valid) {
index f18c6ed..24dd86b 100644 (file)
@@ -6,32 +6,11 @@ AliESDtrackCuts *RsnQualityCut(TString cut="pp_LHC11_p4_120") {
 
    Printf("RsnQualityCut : %s",cut.Data());
    AliESDtrackCuts *esdTrackCuts = 0;
-   if (cut.Contains("pp_LHC11a_p4")) {
+   if (cut.Contains("pp_LHC11a_p4_AOD113")) {
       //esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(Bool_t selPrimaries=kTRUE, Int_t clusterCut=1);
       esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,1);
-
-      // std AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,1)
-      esdTrackCuts->SetMaxChi2PerClusterTPC(4);
-      esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
-      esdTrackCuts->SetRequireTPCRefit(kTRUE);
-      // ITS
-
-      esdTrackCuts->SetRequireITSRefit(kTRUE);
-      esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                             AliESDtrackCuts::kAny);
-      if(selPrimaries) {
-         // 7*(0.0015+0.0050/pt^1.1)
-         esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
-         esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
-      }
-      esdTrackCuts->SetMaxDCAToVertexZ(2);
-      esdTrackCuts->SetDCAToVertex2D(kFALSE);
-      esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-
-      // additional cuts by FilterBit 10
-
-      if (!cut.CompareTo("pp_LHC11a_p4_120")) esdTrackCuts->SetMinNCrossedRowsTPC(120);
-      if (!cut.CompareTo("pp_LHC11a_p4_70")) esdTrackCuts->SetMinNCrossedRowsTPC(70);
+      if (!cut.CompareTo("pp_LHC11a_p4_AOD113_120")) esdTrackCuts->SetMinNCrossedRowsTPC(120);
+      if (!cut.CompareTo("pp_LHC11a_p4_AOD113_70")) esdTrackCuts->SetMinNCrossedRowsTPC(70);
 
       esdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
       esdTrackCuts->SetMaxChi2PerClusterITS(36);
@@ -39,57 +18,51 @@ AliESDtrackCuts *RsnQualityCut(TString cut="pp_LHC11_p4_120") {
       esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
       esdTrackCuts->SetEtaRange(-0.9,0.9);
       esdTrackCuts->SetPtRange(0.15, 1e10);
-   } else if (cut.Contains("pp_LHC11a_p3_bit4")) {
+
+   } else if (cut.Contains("pp_LHC11a_p3_AOD067_bit4")) {
       //AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(Bool_t selPrimaries=kTRUE, Int_t clusterCut=0);
       esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE,0);
-
-      // std AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,0);
-      esdTrackCuts->SetMinNClustersTPC(70);
-      esdTrackCuts->SetMaxChi2PerClusterTPC(4);
-      esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
-      esdTrackCuts->SetRequireTPCRefit(kTRUE);
-      // ITS
-      esdTrackCuts->SetRequireITSRefit(kTRUE);
-      esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                             AliESDtrackCuts::kAny);
-      if(selPrimaries) {
-         // 7*(0.0026+0.0050/pt^1.01)
-         esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
-         esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
-      }
-      esdTrackCuts->SetMaxDCAToVertexZ(2);
-      esdTrackCuts->SetDCAToVertex2D(kFALSE);
-      esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-      esdTrackCuts->SetMaxChi2PerClusterITS(36);
-
       // additional to std cuts
       esdTrackCuts->SetMaxDCAToVertexXY(2.4);
       esdTrackCuts->SetMaxDCAToVertexZ(3.2);
       esdTrackCuts->SetDCAToVertex2D(kTRUE);
 
-   } else if (cut.Contains("pp_LHC11a_p3_bit5")) {
+   } else if (cut.Contains("pp_LHC11a_p3_AOD067_bit5")) {
       //AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(Bool_t selPrimaries=kTRUE, Int_t clusterCut=0);
       esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,0);
+   } else if (cut.Contains("STD2010_PRIMARY")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,0);
+   } else if (cut.Contains("STD2010_SECONDARY")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE,0);
+   } else if (cut.Contains("STD2011_PRIMARY")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,1);
+   } else if (cut.Contains("STD2011_SECONDARY")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE,1);
+   } else if (cut.Contains("STD2011_PRIMARY_NCLSTTPC")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,0);
+   } else if (cut.Contains("STD2011_SECONDARY_NCLSTTPC")) {
+      esdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE,0);
+   }
 
-      // std AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,0);
-      esdTrackCuts->SetMinNClustersTPC(70);
-      esdTrackCuts->SetMaxChi2PerClusterTPC(4);
-      esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
-      esdTrackCuts->SetRequireTPCRefit(kTRUE);
-      // ITS
-      esdTrackCuts->SetRequireITSRefit(kTRUE);
-      esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-                                             AliESDtrackCuts::kAny);
-      if(selPrimaries) {
-         // 7*(0.0026+0.0050/pt^1.01)
-         esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
-         esdTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
-      }
-      esdTrackCuts->SetMaxDCAToVertexZ(2);
-      esdTrackCuts->SetDCAToVertex2D(kFALSE);
-      esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-      esdTrackCuts->SetMaxChi2PerClusterITS(36);
+   if (cut.BeginsWith("STD")) {
+      // DCAXY: 3.5 - 14 sigma
+      if (cut.Contains("DCAXY7S")) esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.035/pt^1.01");
+      else if (cut.Contains("DCAXY6S")) esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0156+0.03/pt^1.01");
+      else if (cut.Contains("DCAXY5S")) esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.013+0.025/pt^1.01");
 
+      // DCAZ: 0.1 - 2 cm
+      if (cut.Contains("DCAZ20")) esdTrackCuts->SetMaxDCAToVertexZ(2);
+      else if (cut.Contains("DCAZ01")) esdTrackCuts->SetMaxDCAToVertexZ(0.1);
+      // MinNClustersTPC: 50-70
+      if (cut.Contains("NCLSTTPC50")) esdTrackCuts->SetMinNClustersTPC(50);
+      else if (cut.Contains("NCLSTTPC70")) esdTrackCuts->SetMinNClustersTPC(70);
+      else if (cut.Contains("NCLSTTPC80")) esdTrackCuts->SetMinNClustersTPC(80);
+      // Chi2 in TPC: 4-6
+      if (cut.Contains("CHI2TPC04")) esdTrackCuts->SetMaxChi2PerClusterITS(4);
+      else if (cut.Contains("CHI2TPC6")) esdTrackCuts->SetMaxChi2PerClusterITS(6);
+      // Chi2 in ITS: 36-100
+      if (cut.Contains("CHI2ITS036")) esdTrackCuts->SetMaxChi2PerClusterITS(36);
+      else if (cut.Contains("CHI2ITS100")) esdTrackCuts->SetMaxChi2PerClusterITS(100);
    }
 
    return esdTrackCuts;
index 5324a28..fc0e071 100644 (file)
@@ -7,7 +7,8 @@ void RsnTrainSettingsExtra(Double_t primaryVertex,
                            Double_t useMixDiffMult,
                            Double_t useMixDiffVz,
                            Double_t useMixDiffAngle,
-                           Int_t printRefresh=-1) {
+                           Int_t printRefresh=-1,
+                           Int_t useMixLike=0) {
 
    AliRsnTrainManager::SetGlobalDbl("RsnEventCutPrimaryVertex",primaryVertex);
    AliRsnTrainManager::SetGlobalInt("RsnCommonQualityCut",useCommonQualityCut);
@@ -22,6 +23,7 @@ void RsnTrainSettingsExtra(Double_t primaryVertex,
    AliRsnTrainManager::SetGlobalDbl("RsnMixDiffAngle",useMixDiffAngle);
 
    AliRsnTrainManager::SetGlobalInt("RsnMixPrintRefresh",printRefresh);
+   AliRsnTrainManager::SetGlobalInt("RsnMixLike",useMixLike);
 
    return;
 }