Updated macros for lego train (mvala) + added scripts folder
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Oct 2012 11:37:26 +0000 (11:37 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Oct 2012 11:37:26 +0000 (11:37 +0000)
PWGLF/RESONANCES/AliRsnTrainManager.cxx
PWGLF/RESONANCES/macros/lego_train/AddAMRsn.C
PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsRho.C [new file with mode: 0644]
PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsRhoNsigma.C
PWGLF/RESONANCES/macros/lego_train/AddRsnPairsRho.C
PWGLF/RESONANCES/macros/lego_train/AddRsnTask.C
PWGLF/RESONANCES/macros/lego_train/AddRsnTaskTrain.C
PWGLF/RESONANCES/scripts/alirsn-create-wk-dir.sh [new file with mode: 0755]

index 28e203a..936c35f 100644 (file)
@@ -148,7 +148,7 @@ void AliRsnTrainManager::SetGlobalDbl(const char *key, Double_t value)
                ::Error("AliRsnTrainManager::SetGlobalInt", "Global %s = %g already defined.", key, existing);
                return;
        }
-       mgr->GetGlobals()->Add(new TObjString(key), new TObjString(TString::Format("%f.16",value)));
+       mgr->GetGlobals()->Add(new TObjString(key), new TObjString(TString::Format("%f",value)));
 }
 
 //______________________________________________________________________________
@@ -219,7 +219,9 @@ void AliRsnTrainManager::Print(Option_t */*option*/) const {
                }
        }
        Printf("\n=========================================================");
-       Printf("            Rsn Particles and Cuts \n");
+
+/*     Printf("            Rsn Particles and Cuts \n");
+
 
        next.Reset();
 //     AliRsnCut
@@ -236,5 +238,6 @@ void AliRsnTrainManager::Print(Option_t */*option*/) const {
        }
 
        Printf("\n=========================================================");
-
+       
+*/
 }
index 0245c9f..4adeba1 100644 (file)
@@ -12,6 +12,13 @@ Bool_t AddAMRsn(TString analysisSource = "proof", TString analysisMode = "test",
    AliAnalysisManager::SetGlobalStr("RsnLegoTrainPath",legoTrainPath.Data());
 
 
+   // RSN Setting (same as old AddRsnToManager<Rsn>.C)
+   // Rsn Particle
+   TString rsnStr="Phi";
+   // Rsn Cut
+   TString rsnCutStr="PhiNsigma:KTPCnsig30";
+   
+   
    input.ToLower();
    inputMC.ToLower();
    Bool_t useMC = !inputMC.CompareTo("mc");
@@ -142,8 +149,8 @@ Bool_t AddAMRsn(TString analysisSource = "proof", TString analysisMode = "test",
    // use mini
    rsnBaseSettings.Append("_MINI");
 
-   gROOT->LoadMacro("AddRsnTaskTrain.C");
-   AddRsnTaskTrain(rsnBaseSettings,"Phi","PhiNsigma:KTPCnsig30");
+   if (!RsnLoadMacro("AddRsnTaskTrain.C")) return kFALSE;
+   AddRsnTaskTrain(rsnBaseSettings,rsnStr.Data(),rsnCutStr.Data());
 
    return kTRUE;
 }
diff --git a/PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsRho.C b/PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsRho.C
new file mode 100644 (file)
index 0000000..ee1c8b2
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef __CINT__\r
+#include <AliRsnCutPIDNSigma.h>\r
+#include <PWGLF/RESONANCES/AliRsnCutTrackQuality.h>\r
+#endif\r
+Int_t AddRsnDaughterCutsRho(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,Bool_t isRsnMini=kFALSE,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)\r
+{\r
+\r
+   if (!rsnIH) return 0;\r
+\r
+   Bool_t valid = kTRUE;\r
+   Int_t isPP = AliAnalysisManager::GetGlobalInt("rsnIsPP",valid);\r
+\r
+   Bool_t usePPCut = kFALSE;\r
+\r
+   if (isPP && (opt.Contains("usePP"))) usePPCut = kTRUE;\r
+\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 etaRange=0.8;\r
+\r
+   if (opt.Contains("TPCsigma1")) nSigmaTPC = 1.0;\r
+   if (opt.Contains("TPCsigma2")) nSigmaTPC = 2.0;\r
+   if (opt.Contains("TPCsigma3")) nSigmaTPC = 3.0;\r
+\r
+   if (opt.Contains("TOFsigma1")) nSigmaTOF = 1.0;\r
+   if (opt.Contains("TOFsigma2")) nSigmaTOF = 2.0;\r
+   if (opt.Contains("TOFsigma3")) nSigmaTOF = 3.0;\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
+      Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange);\r
+      useEta = kTRUE;\r
+   }\r
+\r
+   Bool_t usetof = kFALSE;\r
+   if(opt.Contains("tof")) {\r
+     Printf("Using tof PID range (%.2f,%.2f)",0.0,1E+20);\r
+     usetof = kTRUE;\r
+   }\r
+\r
+   Bool_t usetpc = kFALSE;\r
+   if(opt.Contains("tpc")) {\r
+     Printf("Using tpc PID range (%.2f,%.2f)",0.0,1E+20);\r
+     usetpc = kTRUE;\r
+     }\r
+\r
+//---------------------------------------------\r
+//  Combine cuts\r
+//---------------------------------------------\r
+\r
+   TString cutname = "pionRho";\r
+   if (!opt.IsNull()) cutname += Form("_%s",opt.Data());\r
+   AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);\r
+\r
+   TString scheme="";\r
+\r
+   AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQuatity");\r
+   //qualityCut->SetDefaults2010();\r
+   //qualityCut->SetDCAZmax(0.3);\r
+   //qualityCut->SetDCARmax(0.05);\r
+\r
+   qualityCut->SetDCAZmax(0.2);\r
+   qualityCut->SetDCARmax(0.02);\r
+   qualityCut->AddStatusFlag(AliESDtrack::kTPCin   , kTRUE);\r
+   qualityCut->AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);\r
+   qualityCut->AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);\r
+\r
+\r
+   qualityCut->SetPtRange(0.15, 1E+20);\r
+   qualityCut->SetEtaRange(-0.8, 0.8);\r
+   qualityCut->SetSPDminNClusters(0);\r
+   qualityCut->SetITSminNClusters(0);\r
+   qualityCut->SetITSmaxChi2(1E+20);\r
+   qualityCut->SetTPCminNClusters(80);\r
+   qualityCut->SetTPCmaxChi2(4.0);\r
+   qualityCut->SetRejectKinkDaughters();\r
+   cuts->AddCut(qualityCut);\r
+   if (!scheme.IsNull()) scheme += "&";\r
+   scheme += qualityCut->GetName();\r
+   \r
+   if (usetpc) {\r
+     AliRsnCutPIDNSigma *cutPiTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPC",AliPID::kPion,AliRsnCutPIDNSigma::kTPC);\r
+     cutPiTPC->SinglePIDRange(nSigmaTPC);\r
+     //cutPiTPC->AddPIDRange(nSigmaTPC,0.0,0.7);\r
+     cuts->AddCut(cutPiTPC);\r
+     if (!scheme.IsNull()) scheme += "&";\r
+     scheme += cutPiTPC->GetName();\r
+  }\r
+\r
+   if(usetof) {\r
+       AliRsnCutPIDNSigma *cutPiTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOF",AliPID::kPion,AliRsnCutPIDNSigma::kTOF);\r
+       cutPiTOF->SinglePIDRange(nSigmaTOF);\r
+       //cutPiTOF->AddPIDRange(nSigmaTOF,0.7,1e20);\r
+       cuts->AddCut(cutPiTOF);\r
+       if (!scheme.IsNull()) scheme += "&";\r
+       scheme += cutPiTOF->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()),-etaRange,etaRange);\r
+      cutEta->SetTargetType(AliRsnTarget::kDaughter);\r
+      cutEta->SetValueObj(valEta);\r
+      cuts->AddCut(cutEta);\r
+      if (!scheme.IsNull()) scheme += "&";\r
+      scheme += cutEta->GetName();\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 = dynamic_cast<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
+   }\r
+   return numberOfCuts;\r
+\r
+}\r
+\r
index 3941148..cef8049 100644 (file)
-#ifndef __CINT__
-#include <AliRsnCutPIDNSigma.h>
-#include <PWGLF/RESONANCES/AliRsnCutTrackQuality.h>
-#endif
-Int_t AddRsnDaughterCutsRhoNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)
-{
-
-   if (!rsnIH) return 0;
-
-   Bool_t valid;
-   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
-
-   // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====
-   Int_t numberOfCuts = 1;
-
-   //---------------------------------------------
-   //  Define single cuts
-   //---------------------------------------------
-
-   Printf("AddRsnDaughterCutsRho Option : %s",opt.Data());
-
-   Double_t nSigmaTPC=3.0;
-   Double_t nSigmaTOF=3.0;
-   Double_t etaRange=0.8;
-   Bool_t useTPC_Pi=kFALSE;
-   Bool_t useTOF_Pi=kFALSE;
-
-   if (opt.Contains("qualityonly")) {
-      useTPC_Pi=kFALSE;
-      useTOF_Pi=kFALSE;
-   } else if (!opt.Contains("nsig")) {
-      useTPC_Pi=kTRUE;
-      useTOF_Pi=kTRUE;
-   }
-
-   if (opt.Contains("PiTPCnsig"))  useTPC_Pi=kTRUE;
-   if (opt.Contains("PiTOFnsig"))  useTOF_Pi=kTRUE;
-
-   if (opt.Contains("PiTPCnsig10")) nSigmaTPC = 1.0;
-   if (opt.Contains("PiTPCnsig15")) nSigmaTPC = 1.5;
-   if (opt.Contains("PiTPCnsig20")) nSigmaTPC = 2.0;
-   if (opt.Contains("PiTPCnsig25")) nSigmaTPC = 2.5;
-   if (opt.Contains("PiTPCnsig30")) nSigmaTPC = 3.0;
-
-   if (opt.Contains("PiTOFnsig10")) nSigmaTOF = 1.0;
-   if (opt.Contains("PiTOFnsig15")) nSigmaTOF = 1.5;
-   if (opt.Contains("PiTOFnsig20")) nSigmaTOF = 2.0;
-   if (opt.Contains("PiTOFnsig25")) nSigmaTOF = 2.5;
-   if (opt.Contains("PiTOFnsig30")) nSigmaTOF = 3.0;
-
-   Bool_t usePDG=kFALSE;
-   if (opt.Contains("pdg")) {
-      Printf("Using PDG");
-      usePDG = kTRUE;
-   }
-
-   Bool_t useEta = kFALSE;
-   if (opt.Contains("eta")) {
-      Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange);
-      useEta = kTRUE;
-   }
-
-//---------------------------------------------
-//  Combine cuts
-//---------------------------------------------
-
-   TString cutname = "Pi_Rho";
-   if (!opt.IsNull()) cutname += Form("_%s",opt.Data());
-   AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);
-
-   TString scheme="";
-
-   AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQuatityPi");
-   qualityCut->SetDefaults2010();
-   cuts->AddCut(qualityCut);
-   if (!scheme.IsNull()) scheme += "&";
-   scheme += qualityCut->GetName();
-
-   if (useTPC_Pi) {
-      AliRsnCutPIDNSigma *cutPiTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCPi",AliPID::kPion,AliRsnCutPIDNSigma::kTPC);
-      cutPiTPC->SinglePIDRange(nSigmaTPC);
-      cuts->AddCut(cutPiTPC);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutPiTPC->GetName();
-   }
-   if (useTOF_Pi) {
-      AliRsnCutPIDNSigma *cutPiTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFPi",AliPID::kPion,AliRsnCutPIDNSigma::kTOF);
-      cutPiTOF->SinglePIDRange(nSigmaTOF);
-      cuts->AddCut(cutPiTOF);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutPiTOF->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()),-etaRange,etaRange);
-      cutEta->SetTargetType(AliRsnTarget::kDaughter);
-      cutEta->SetValueObj(valEta);
-      cuts->AddCut(cutEta);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutEta->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 = dynamic_cast<AliRsnMiniAnalysisTask *>(task);
-      if (taskRsnMini) {
-         taskRsnMini->AddTrackCuts(cuts);
-      }
-   } else {
-      AliRsnDaughterSelector *sel = rsnIH->GetSelector();
-//       sel->SetLabelCheck(kFALSE);
-      sel->Add(cuts, kTRUE);
-   }
-   return numberOfCuts;
-
-}
-
+#ifndef __CINT__\r
+#include <AliRsnCutPIDNSigma.h>\r
+#include <PWGLF/RESONANCES/AliRsnCutTrackQuality.h>\r
+#endif\r
+Int_t AddRsnDaughterCutsRhoNsigma(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;\r
+   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",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("AddRsnDaughterCutsRho Option : %s",opt.Data());\r
+\r
+   Double_t nSigmaTPC=3.0;\r
+   Double_t nSigmaTOF=3.0;\r
+   Double_t etaRange=0.8;\r
+   Bool_t useTPC_Pi=kFALSE;\r
+   Bool_t useTOF_Pi=kFALSE;\r
+\r
+   if (opt.Contains("qualityonly")) {\r
+      useTPC_Pi=kFALSE;\r
+      useTOF_Pi=kFALSE;\r
+   } else if (!opt.Contains("nsig")) {\r
+      useTPC_Pi=kTRUE;\r
+      useTOF_Pi=kTRUE;\r
+   }\r
+\r
+   if (opt.Contains("PiTPCnsig"))  useTPC_Pi=kTRUE;\r
+   if (opt.Contains("PiTOFnsig"))  useTOF_Pi=kTRUE;\r
+\r
+   if (opt.Contains("PiTPCnsig10")) nSigmaTPC = 1.0;\r
+   if (opt.Contains("PiTPCnsig15")) nSigmaTPC = 1.5;\r
+   if (opt.Contains("PiTPCnsig20")) nSigmaTPC = 2.0;\r
+   if (opt.Contains("PiTPCnsig25")) nSigmaTPC = 2.5;\r
+   if (opt.Contains("PiTPCnsig30")) nSigmaTPC = 3.0;\r
+\r
+   if (opt.Contains("PiTOFnsig10")) nSigmaTOF = 1.0;\r
+   if (opt.Contains("PiTOFnsig15")) nSigmaTOF = 1.5;\r
+   if (opt.Contains("PiTOFnsig20")) nSigmaTOF = 2.0;\r
+   if (opt.Contains("PiTOFnsig25")) nSigmaTOF = 2.5;\r
+   if (opt.Contains("PiTOFnsig30")) nSigmaTOF = 3.0;\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
+      Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange);\r
+      useEta = kTRUE;\r
+   }\r
+\r
+//---------------------------------------------\r
+//  Combine cuts\r
+//---------------------------------------------\r
+\r
+   TString cutname = "Pi_Rho";\r
+   if (!opt.IsNull()) cutname += Form("_%s",opt.Data());\r
+   AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);\r
+\r
+   TString scheme="";\r
+\r
+   AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQuatityPi");\r
+   //qualityCut->SetDefaults2010();\r
+               \r
+       qualityCut->SetDCAZmax(0.2);\r
+       qualityCut->SetDCARmax(0.02);\r
+       qualityCut->AddStatusFlag(AliESDtrack::kTPCin   , kTRUE);\r
+       qualityCut->AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);\r
+       qualityCut->AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);\r
+       \r
+       qualityCut->SetPtRange(0.2, 1E+20);\r
+       qualityCut->SetEtaRange(-0.8, 0.8);\r
+       qualityCut->SetSPDminNClusters(0);\r
+       qualityCut->SetITSminNClusters(0);\r
+       qualityCut->SetITSmaxChi2(1E+20);\r
+       qualityCut->SetTPCminNClusters(70);\r
+       qualityCut->SetTPCmaxChi2(4.0);\r
+       qualityCut->SetRejectKinkDaughters();\r
+\r
+   cuts->AddCut(qualityCut);\r
+   if (!scheme.IsNull()) scheme += "&";\r
+   scheme += qualityCut->GetName();\r
+\r
+   if (useTPC_Pi) {\r
+      AliRsnCutPIDNSigma *cutPiTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCPi",AliPID::kPion,AliRsnCutPIDNSigma::kTPC);\r
+      cutPiTPC->SinglePIDRange(nSigmaTPC);\r
+      cuts->AddCut(cutPiTPC);\r
+      if (!scheme.IsNull()) scheme += "&";\r
+      scheme += cutPiTPC->GetName();\r
+   }\r
+   if (useTOF_Pi) {\r
+      AliRsnCutPIDNSigma *cutPiTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFPi",AliPID::kPion,AliRsnCutPIDNSigma::kTOF);\r
+      cutPiTOF->SinglePIDRange(nSigmaTOF);\r
+      cuts->AddCut(cutPiTOF);\r
+      if (!scheme.IsNull()) scheme += "&";\r
+      scheme += cutPiTOF->GetName();\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()),-etaRange,etaRange);\r
+      cutEta->SetTargetType(AliRsnTarget::kDaughter);\r
+      cutEta->SetValueObj(valEta);\r
+      cuts->AddCut(cutEta);\r
+      if (!scheme.IsNull()) scheme += "&";\r
+      scheme += cutEta->GetName();\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 = dynamic_cast<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
+   }\r
+   return numberOfCuts;\r
+\r
+}\r
+\r
index ddc4c85..c58e9cc 100644 (file)
-#ifndef __CINT__
-#include <AliRsnValuePair.h>
-#endif
-
-void AddRsnPairsRho(AliAnalysisTaskSE *task,
-                    Bool_t isMC,
-                    Bool_t isMixing,
-                    AliPID::EParticleType pType1,
-                    Int_t listID1,
-                    AliPID::EParticleType pType2,
-                    Int_t listID2,
-                    AliRsnCutSet *cutsEvent=0,
-                    AliRsnCutSet *cutsPair=0,
-                    TString suffix = "") {
-
-   Printf("id1=%d id2=%d",listID1,listID2);
-
-   // retrieve mass from PDG database
-   Int_t         pdg  = 113;
-   TDatabasePDG *db   = TDatabasePDG::Instance();
-   TParticlePDG *part = db->GetParticle(pdg);
-   Double_t mass = part->Mass();
-   Bool_t valid;
-   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
-
-   if (isRsnMini) {
-      AddPairOutputMiniRho(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsPair,suffix);
-   } else {
-      // this function is common and it is located in RsnConfig.C
-      // as ouptup AddPairOutputPhi from this macro will be taken
-      AddPair(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsEvent,cutsPair,suffix);
-   }
-}
-void AddPairOutputRho(AliRsnLoopPair *pair)
-{
-   Bool_t valid;
-   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
-
-   // axes
-   AliRsnValuePair *axisIM = new AliRsnValuePair("IM", AliRsnValuePair::kInvMass);
-   AliRsnValuePair *axisPt = new AliRsnValuePair("PT", AliRsnValuePair::kPt);
-   AliRsnValuePair *axisEta = new AliRsnValuePair("ETA", AliRsnValuePair::kEta);
-   axisIM     ->SetBins(1000, 0.2, 1.2);
-//   axisIM     ->SetBins(1000, 0.9, 1.9);
-   axisPt     ->SetBins(120, 0.0, 12.0);
-   axisEta    ->SetBins(400, -2.0, 2.0);
-
-   // output: 2D histogram of inv. mass vs. pt
-   AliRsnListOutput *outPair = 0;
-   if (!isFullOutput) {
-      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoDefault);
-      outPair->AddValue(axisIM);
-   } else {
-      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoSparse);
-      outPair->AddValue(axisIM);
-      outPair->AddValue(axisPt);
-      outPair->AddValue(axisEta);
-   }
-   // add outputs to loop
-   pair->AddOutput(outPair);
-}
-
-void AddPairOutputMiniRho(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing, AliPID::EParticleType pType1,Int_t listID1, AliPID::EParticleType pType2,Int_t listID2, Int_t pdgMother,Double_t massMother, AliRsnCutSet *cutsPair=0,TString suffix = "") {
-
-   Bool_t valid;
-   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
-   Int_t useMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
-   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
-
-   AliRsnMiniAnalysisTask *taskRsnMini =  (AliRsnMiniAnalysisTask *)task;
-
-   /* invariant mass   */ Int_t imID   = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
-   /* IM resolution    */ Int_t resID  = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMassDiff, kTRUE);
-   /* transv. momentum */ Int_t ptID   = taskRsnMini->CreateValue(AliRsnMiniValue::kPt, kFALSE);
-   /* centrality       */ Int_t centID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);
-   /* eta              */ Int_t etaID = taskRsnMini->CreateValue(AliRsnMiniValue::kEta, kFALSE);
-
-
-   // use an array for more compact writing, which are different on mixing and charges
-   // [0] = unlike
-   // [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] = {'-'     , '-'     , '+'     , '-'     , '-'    };
-
-   // common definitions
-   TString outputType = "HIST";
-   if (isFullOutput) outputType = "SPARSE";
-
-   Int_t nIM   = 1000; Double_t minIM   = 0.2, maxIM =  1.2;
-   Int_t nEta   = 400; Double_t minEta   = -2.0, maxEta =  2.0;
-//   Int_t nIM   = 1000; Double_t minIM   = 0.9, maxIM =  1.9;
-   Int_t nPt   = 120; Double_t minPt   = 0.0, maxPt = 12.0;
-   Int_t nCent = 100; Double_t minCent = 0.0, maxCent = 100.0;
-   Int_t nRes  = 200; Double_t maxRes  = 0.01;
-
-   // retrieve mass from PDG database
-   Int_t         pdg  = 113;
-   TDatabasePDG *db   = TDatabasePDG::Instance();
-   TParticlePDG *part = db->GetParticle(pdg);
-
-
-   Printf(suffix.Data());
-   // create standard outputs
-   for (Int_t i = 0; i < 5; i++) {
-      if (!use[i]) continue;
-      // create output
-      AliRsnMiniOutput *out = taskRsnMini->CreateOutput(Form("%s_%s", suffix.Data(),name[i].Data() ), outputType.Data(), comp[i].Data());
-      // selection settings
-      out->SetCutID(0, listID1);
-      out->SetCutID(1, listID1);
-      out->SetDaughter(0, AliRsnDaughter::kPion);
-      out->SetDaughter(1, AliRsnDaughter::kPion);
-      out->SetCharge(0, charge1[i]);
-      out->SetCharge(1, charge2[i]);
-      out->SetMotherPDG(pdg);
-      out->SetMotherMass(part->Mass());
-      // pair cuts
-      if (cutsPair) out->SetPairCuts(cutsPair);
-      // axis X: invmass
-      out->AddAxis(imID, nIM, minIM, maxIM);
-
-      if (isFullOutput) {
-         // axis Y: transverse momentum
-         out->AddAxis(ptID, nPt, minPt, maxPt);
-
-         out->AddAxis(etaID, nEta, minEta, maxEta);
-         // axis Z: centrality
-         if (collisionType==1) out->AddAxis(centID, nCent, minCent, maxCent);
-      }
-   }
-
-   // add output for resolution
-   if (isMC) {
-      AliRsnMiniOutput *outRes = taskRsnMini->CreateOutput(Form("rho_Res%s", suffix.Data()), outputType.Data(), "TRUE");
-      // selection settings
-      outRes->SetCutID(0, listID1);
-      outRes->SetCutID(1, listID1);
-      outRes->SetDaughter(0, AliRsnDaughter::kPion);
-      outRes->SetDaughter(1, AliRsnDaughter::kPion);
-      outRes->SetCharge(0, '+');
-      outRes->SetCharge(1, '-');
-      outRes->SetMotherPDG(pdg);
-      outRes->SetMotherMass(part->Mass());
-      // pair cuts
-      if (cutsPair) outRes->SetPairCuts(cutsPair);
-      // axis X: resolution
-      outRes->AddAxis(resID, nRes, -maxRes, maxRes);
-
-      if (isFullOutput) {
-         // axis Y: transverse momentum
-         outRes->AddAxis(ptID, nPt, minPt, maxPt);
-         outRes->AddAxis(etaID, nEta, minEta, maxEta);
-         // axis Z: centrality
-         if (collisionType==1) outRes->AddAxis(centID, nCent, minCent, maxCent);
-      }
-   }
-
-   //
-   // -- Create output for MC generated ------------------------------------------------------------
-   //
-
-   if (isMC) {
-      // create ouput
-      AliRsnMiniOutput *outMC = taskRsnMini->CreateOutput(Form("rho_MCGen%s", suffix.Data()), outputType.Data(), "MOTHER");
-      // selection settings
-      outMC->SetDaughter(0, AliRsnDaughter::kPion);
-      outMC->SetDaughter(1, AliRsnDaughter::kPion);
-      outMC->SetMotherPDG(pdg);
-      outMC->SetMotherMass(part->Mass());
-      // pair cuts
-      if (cutsPair) outMC->SetPairCuts(cutsPair);
-      // axis X: invmass
-      outMC->AddAxis(imID, nIM, minIM, maxIM);
-      if (isFullOutput) {
-         // axis Y: transverse momentum
-         outMC->AddAxis(ptID, nPt, minPt, maxPt);
-         outMC->AddAxis(etaID, nEta, minEta, maxEta);
-         // axis Z: centrality
-         if (collisionType==1) outMC->AddAxis(centID, nCent, minCent, maxCent);
-      }
-   }
-
-
-}
+#ifndef __CINT__\r
+#include <AliRsnValuePair.h>\r
+#endif\r
+\r
+void AddRsnPairsRho(AliAnalysisTaskSE *task,\r
+                    Bool_t isMC,\r
+                    Bool_t isMixing,\r
+                    AliPID::EParticleType pType1,\r
+                    Int_t listID1,\r
+                    AliPID::EParticleType pType2,\r
+                    Int_t listID2,\r
+                    AliRsnCutSet *cutsEvent=0,\r
+                    AliRsnCutSet *cutsPair=0,\r
+                    TString suffix = "") {\r
+\r
+   Printf("id1=%d id2=%d",listID1,listID2);\r
+\r
+   // retrieve mass from PDG database\r
+       \r
+       // pdg rho = 133\r
+       // pdg omega = 223\r
+       // pdg eta = 221\r
+       // pdg eta' = 331\r
+       // pdg kshort = 310\r
+       \r
+   Int_t         pdg  = 113;\r
+   TDatabasePDG *db   = TDatabasePDG::Instance();\r
+   TParticlePDG *part = db->GetParticle(pdg);\r
+   Double_t mass = part->Mass();\r
+   Bool_t valid;\r
+   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);\r
+\r
+   if (isRsnMini) {\r
+      AddPairOutputMiniRho(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsPair,suffix);\r
+   } else {\r
+      // this function is common and it is located in RsnConfig.C\r
+      // as ouptup AddPairOutputPhi from this macro will be taken\r
+      AddPair(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsEvent,cutsPair,suffix);\r
+   }\r
+}\r
+void AddPairOutputRho(AliRsnLoopPair *pair)\r
+{\r
+   Bool_t valid;\r
+   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);\r
+\r
+   // axes\r
+   AliRsnValuePair *axisIM = new AliRsnValuePair("IM", AliRsnValuePair::kInvMass);\r
+   AliRsnValuePair *axisPt = new AliRsnValuePair("PT", AliRsnValuePair::kPt);\r
+   AliRsnValuePair *axisEta = new AliRsnValuePair("ETA", AliRsnValuePair::kEta);\r
+   axisIM     ->SetBins(180, 0.2, 2.0);\r
+//   axisIM     ->SetBins(1000, 0.9, 1.9);\r
+   axisPt     ->SetBins(100, 0.0, 12.0);\r
+   axisEta    ->SetBins(100, -2.0, 2.0);\r
+   axisY      ->SetBins(100,-2.0, 2.0);\r
+\r
+   // output: 2D histogram of inv. mass vs. pt\r
+   AliRsnListOutput *outPair = 0;\r
+   if (!isFullOutput) {\r
+      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoDefault);\r
+      outPair->AddValue(axisIM);\r
+   } else {\r
+      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoSparse);\r
+      outPair->AddValue(axisIM);\r
+      outPair->AddValue(axisPt);\r
+      outPair->AddValue(axisEta);\r
+         outPair->AddValue(axisY);\r
+   }\r
+   // add outputs to loop\r
+   pair->AddOutput(outPair);\r
+}\r
+\r
+void AddPairOutputMiniRho(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing, AliPID::EParticleType pType1,Int_t listID1, AliPID::EParticleType pType2,Int_t listID2, Int_t pdgMother,Double_t massMother, AliRsnCutSet *cutsPair=0,TString suffix = "") {\r
+\r
+   Bool_t valid;\r
+   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);\r
+   Int_t useMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);\r
+   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);\r
+\r
+   AliRsnMiniAnalysisTask *taskRsnMini =  (AliRsnMiniAnalysisTask *)task;\r
+\r
+   /* invariant mass   */ Int_t imID   = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);\r
+   /* IM resolution    */ Int_t resID  = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMassDiff, kTRUE);\r
+   /* transv. momentum */ Int_t ptID   = taskRsnMini->CreateValue(AliRsnMiniValue::kPt, kFALSE);\r
+   /* centrality       */ Int_t centID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);\r
+   /* eta              */ Int_t etaID = taskRsnMini->CreateValue(AliRsnMiniValue::kEta, kFALSE);\r
+   /* y                */ Int_t yID    = taskRsnMini->CreateValue(AliRsnMiniValue::kY, kFALSE);\r
+\r
+\r
+   // use an array for more compact writing, which are different on mixing and charges\r
+   // [0] = unlike\r
+   // [1] = mixing\r
+   // [2] = like ++\r
+   // [3] = like --\r
+   Bool_t  use     [5] = { 1      ,  useMixing      ,  1      ,  1      ,  isMC  };\r
+   TString name    [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues"};\r
+   TString comp    [5] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE" };\r
+   Char_t  charge1 [5] = {'+'     , '+'     , '+'     , '-'     , '+'    };\r
+   Char_t  charge2 [5] = {'-'     , '-'     , '+'     , '-'     , '-'    };\r
+\r
+   // common definitions\r
+   TString outputType = "HIST";\r
+   if (isFullOutput) outputType = "SPARSE";\r
+\r
+   Int_t nIM   = 1000; Double_t minIM   = 0.2, maxIM =  1.2;\r
+   Int_t nEta   = 100; Double_t minEta   = -2.0, maxEta =  2.0;\r
+   Int_t nY    = 100;  Double_t minY    = -2.0,maxY =  2.0;\r
+//   Int_t nIM   = 1000; Double_t minIM   = 0.9, maxIM =  1.9;\r
+   Int_t nPt   = 100; Double_t minPt   = 0.0, maxPt = 12.0;\r
+   Int_t nCent = 100; Double_t minCent = 0.0, maxCent = 100.0;\r
+   Int_t nRes  = 200; Double_t maxRes  = 0.01;\r
+\r
+   // retrieve mass from PDG database\r
+   Int_t         pdg  = 113;\r
+   TDatabasePDG *db   = TDatabasePDG::Instance();\r
+   TParticlePDG *part = db->GetParticle(pdg);\r
+\r
+\r
+   Printf(suffix.Data());\r
+   // create standard outputs\r
+   for (Int_t i = 0; i < 5; i++) {\r
+      if (!use[i]) continue;\r
+      // create output\r
+      AliRsnMiniOutput *out = taskRsnMini->CreateOutput(Form("%s_%s", suffix.Data(),name[i].Data() ), outputType.Data(), comp[i].Data());\r
+      // selection settings\r
+      out->SetCutID(0, listID1);\r
+      out->SetCutID(1, listID1);\r
+      out->SetDaughter(0, AliRsnDaughter::kPion);\r
+      out->SetDaughter(1, AliRsnDaughter::kPion);\r
+      out->SetCharge(0, charge1[i]);\r
+      out->SetCharge(1, charge2[i]);\r
+      out->SetMotherPDG(pdg);\r
+      out->SetMotherMass(part->Mass());\r
+      // pair cuts\r
+      if (cutsPair) out->SetPairCuts(cutsPair);\r
+      // axis X: invmass\r
+      out->AddAxis(imID, nIM, minIM, maxIM);\r
+\r
+      if (isFullOutput) {\r
+         // axis Y: transverse momentum\r
+         out->AddAxis(ptID, nPt, minPt, maxPt);\r
+         out->AddAxis(etaID, nEta, minEta, maxEta);\r
+                out->AddAxis(yID, nY, minY, maxY);\r
+                 \r
+         // axis Z: centrality\r
+         if (collisionType==1) out->AddAxis(centID, nCent, minCent, maxCent);\r
+      }\r
+   }\r
+\r
+   // add output for resolution\r
+   if (isMC) {\r
+      AliRsnMiniOutput *outRes = taskRsnMini->CreateOutput(Form("rho_Res%s", suffix.Data()), outputType.Data(), "TRUE");\r
+      // selection settings\r
+      outRes->SetCutID(0, listID1);\r
+      outRes->SetCutID(1, listID1);\r
+      outRes->SetDaughter(0, AliRsnDaughter::kPion);\r
+      outRes->SetDaughter(1, AliRsnDaughter::kPion);\r
+      outRes->SetCharge(0, '+');\r
+      outRes->SetCharge(1, '-');\r
+      outRes->SetMotherPDG(pdg);\r
+      outRes->SetMotherMass(part->Mass());\r
+      // pair cuts\r
+      if (cutsPair) outRes->SetPairCuts(cutsPair);\r
+      // axis X: resolution\r
+      outRes->AddAxis(resID, nRes, -maxRes, maxRes);\r
+\r
+      if (isFullOutput) {\r
+         // axis Y: transverse momentum\r
+         outRes->AddAxis(ptID, nPt, minPt, maxPt);\r
+         outRes->AddAxis(etaID, nEta, minEta, maxEta);\r
+         // axis Z: centrality\r
+         if (collisionType==1) outRes->AddAxis(centID, nCent, minCent, maxCent);\r
+      }\r
+   }\r
+\r
+   //\r
+   // -- Create output for MC generated ------------------------------------------------------------\r
+   //\r
+\r
+   if (isMC) {\r
+      // create ouput\r
+      AliRsnMiniOutput *outMC = taskRsnMini->CreateOutput(Form("rho_MCGen%s", suffix.Data()), outputType.Data(), "MOTHER");\r
+      // selection settings\r
+      outMC->SetDaughter(0, AliRsnDaughter::kPion);\r
+      outMC->SetDaughter(1, AliRsnDaughter::kPion);\r
+      outMC->SetMotherPDG(pdg);\r
+      outMC->SetMotherMass(part->Mass());\r
+      // pair cuts\r
+      if (cutsPair) outMC->SetPairCuts(cutsPair);\r
+      // axis X: invmass\r
+      outMC->AddAxis(imID, nIM, minIM, maxIM);\r
+      if (isFullOutput) {\r
+         // axis Y: transverse momentum\r
+         outMC->AddAxis(ptID, nPt, minPt, maxPt);\r
+         outMC->AddAxis(etaID, nEta, minEta, maxEta);\r
+                outRes->AddAxis(yID, nY, minY, maxY);\r
+         // axis Z: centrality\r
+         if (collisionType==1) outMC->AddAxis(centID, nCent, minCent, maxCent);\r
+      }\r
+   }\r
+\r
+\r
+}\r
index bedd3ac..05be91b 100644 (file)
@@ -41,7 +41,7 @@ AliAnalysisTaskSE *AddRsnTask(TString rsnPart,TString rsnCut,TString postfix="")
    TList *listRsn = new TList();
    listRsn->Add(new TNamed(rsnPart.Data(),rsnCut.Data()));
 
-   gROOT->LoadMacro("RsnConfig.C");
+   if (!RsnLoadMacro("RsnConfig.C")) return kFALSE;
    if (!RsnConfig(task,rsnIH,listRsn)) {
       Printf("Error in RsnConfig.C");
       return 0;
index 66e9fa1..8f0ebc5 100644 (file)
@@ -12,10 +12,10 @@ AliAnalysisTask *AddRsnTaskTrain(const char *commonStr,const char *rsnStr,const
    //    return AddRsnTask(rsnStr,rsnCutStr,"");
 
    Bool_t valid;
-   AliRsnTrainManager::GetGlobalStr("LegoTrainPath",valid);
+   AliAnalysisManager::GetGlobalStr("LegoTrainPath",valid);
    if (!valid) {
       TString legoTrainPath = "$ALICE_ROOT/PWGLF/RESONANCES/macros/lego_train";
-      AliRsnTrainManager::SetGlobalStr("LegoTrainPath",legoTrainPath.Data());
+      AliAnalysisManager::SetGlobalStr("LegoTrainPath",legoTrainPath.Data());
    }
 
    // Creating Rsn Train Manager
@@ -51,4 +51,4 @@ Bool_t RsnLoadMacroTrain(TString macro,TString path="") {
    Printf("Error loading %s",macro.Data());
 
    return kFALSE;
-}
\ No newline at end of file
+}
diff --git a/PWGLF/RESONANCES/scripts/alirsn-create-wk-dir.sh b/PWGLF/RESONANCES/scripts/alirsn-create-wk-dir.sh
new file mode 100755 (executable)
index 0000000..fe61ebd
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+MY_ALIRSN_DIR="$0"
+MY_ALIRSN_DIR=`dirname $MY_ALIRSN_DIR`
+MY_ALIRSN_DIR=`dirname $MY_ALIRSN_DIR`
+
+FILES="AddAMRsn.C RunALICE.C SetupAnalysisPlugin.C"
+
+for FILE in $FILES;do
+  cp $MY_ALIRSN_DIR/PWGLF/RESONANCES/macros/lego_train/$FILE .
+done
\ No newline at end of file