]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update macros
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 17:48:02 +0000 (17:48 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 17:48:02 +0000 (17:48 +0000)
25 files changed:
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C [deleted file]
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C [deleted file]
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNew.C [deleted file]
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnNew.C [deleted file]
PWG2/RESONANCES/macros/train/ConfigTaskRsn.C [deleted file]
PWG2/RESONANCES/macros/train/ConfigTaskRsn2D.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnEfficiency.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsITS.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsTPC.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipNoSA.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipSA.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigMC.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigNoSA.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigSA.C [deleted file]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisKStar.C [moved from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMC.C with 51% similarity]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisPhi.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisPhiRes.C [moved from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysis.C with 83% similarity]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/QualityCutsITS.C [moved from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsITS.C with 100% similarity]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/QualityCutsTPC.C [moved from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsTPC.C with 100% similarity]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigKStar.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhi.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhiRes.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/RsnConfig.C [deleted file]

diff --git a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C
deleted file mode 100644 (file)
index 165de01..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Macro to create the full analysis manager for Resonances
-//
-Bool_t AddAnalysisTaskRsn
-(
-  Bool_t sourceESD  = kTRUE // if true, the source of data is ESD, otherwise is AOD from filter task
-)
-{
-  AliLog::SetClassDebugLevel("AliMCEvent", AliLog::kWarning);
-  //AliLog::SetClassDebugLevel("AliRsnCutStd", AliLog::kDebug+3);
-  //AliLog::SetClassDebugLevel("AliRsnCutBetheBloch", AliLog::kDebug+3);
-
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-
-  // initialize task with 4 slots:
-  AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis", 2);
-  
-  // set prior probabilities for PID
-  task->SetPriorProbability(AliPID::kElectron, 0.02);
-  task->SetPriorProbability(AliPID::kMuon,     0.02);
-  task->SetPriorProbability(AliPID::kPion,     0.83);
-  task->SetPriorProbability(AliPID::kKaon,     0.07);
-  task->SetPriorProbability(AliPID::kProton,   0.06);
-  task->DumpPriors();
-
-  // load config macros
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/RsnConfig.C");
-
-  // initialize analysis manager with pairs from config
-  AliRsnAnalysisManager *anaMgr = 0x0;
-
-  // manager #0: phi
-  anaMgr = task->GetAnalysisManager(0);
-  anaMgr->Add(RsnConfig("PHI_NOPID", 333, 1.019455, AliPID::kKaon, AliPID::kKaon));
-  anaMgr->Add(RsnConfig("PHI_BB"   , 333, 1.019455, AliPID::kKaon, AliPID::kKaon));
-  anaMgr->Add(RsnConfig("PHI_PID"  , 333, 1.019455, AliPID::kKaon, AliPID::kKaon));
-  // manager #1: kstar
-  anaMgr = task->GetAnalysisManager(1);
-  anaMgr->Add(RsnConfig("KSTAR_NOPID", 313, 0.896, AliPID::kPion, AliPID::kKaon));
-  anaMgr->Add(RsnConfig("KSTAR_BB"   , 313, 0.896, AliPID::kPion, AliPID::kKaon));
-  anaMgr->Add(RsnConfig("KSTAR_PID"  , 313, 0.896, AliPID::kPion, AliPID::kKaon));
-
-  // setup cuts for events (good primary vertex)
-  AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 3);
-  AliRsnCutSet *cutSetEvent = new AliRsnCutSet("eventCuts");
-  cutSetEvent->AddCut(cutVertex);
-  cutSetEvent->SetCutScheme("cutVertex");
-  task->SetEventCuts(cutSetEvent);
-
-  // add the task to manager
-  mgr->AddTask(task);
-
-  // connect input container according to source choice
-  if (sourceESD) mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
-  else mgr->ConnectInput(task, 0, mgr->GetCommonOutputContainer());
-
-  // create paths for the output in the common file
-  Char_t infoPath[500], phiPath[500], kstarPath[500];
-  sprintf(infoPath , "%s:PWG2RSNINFO" , AliAnalysisManager::GetCommonFileName());
-  sprintf(phiPath  , "%s:PWG2RSNPHI"  , AliAnalysisManager::GetCommonFileName());
-  sprintf(kstarPath, "%s:PWG2RSNKSTAR", AliAnalysisManager::GetCommonFileName());
-
-  // create containers for output
-  AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, infoPath);
-  AliAnalysisDataContainer *outputRsn[2];
-  outputRsn[0] = mgr->CreateContainer("PHI"  , TList::Class(), AliAnalysisManager::kOutputContainer, phiPath);
-  outputRsn[1] = mgr->CreateContainer("KSTAR", TList::Class(), AliAnalysisManager::kOutputContainer, kstarPath);
-
-  mgr->ConnectOutput(task, 1, outputInfo);
-  mgr->ConnectOutput(task, 2, outputRsn[0]);
-  mgr->ConnectOutput(task, 3, outputRsn[1]);
-}
diff --git a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C
deleted file mode 100644 (file)
index c7e0bbc..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// This macro add an analysis task for computing efficiency.
-// It will have as output an AliCFContainer with several steps:
-//
-//  0) all resonances in MC which decay in the pair specified
-//  1) subset of (0) whose daughters are in acceptance
-//  2) subset of (1) whose daughters satisfy quality track cuts (covariance, chi square && nTPCclusters)
-//  3) subset of (2) whose daughters satisfy primary track cuts (nsigma to vertex, no kink daughters)
-//  4) subset of (3) whose daughters satisty the BB TPC compatibility cut at 3 sigma
-//
-Bool_t AddAnalysisTaskRsnEff
-(
-  Bool_t      useBB    = kFALSE,
-  Double_t    sigmaTPC = 0.065,
-  const char *outFile  = "eff"
-)
-{
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-
-  // common suffixes
-  TString suf[2];
-  suf[0] = "nopid";
-  suf[1] = "pid";
-
-  // create task
-  AliRsnAnalysisEffSE *task[2];
-  task[0] = new AliRsnAnalysisEffSE("EffNoPID");
-  task[1] = new AliRsnAnalysisEffSE("EffPID");
-
-  // set prior probabilities for PID
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->SetPriorProbability(AliPID::kElectron, 0.02);
-    task[i]->SetPriorProbability(AliPID::kMuon,     0.02);
-    task[i]->SetPriorProbability(AliPID::kPion,     0.83);
-    task[i]->SetPriorProbability(AliPID::kKaon,     0.07);
-    task[i]->SetPriorProbability(AliPID::kProton,   0.06);
-    task[i]->DumpPriors();
-  }
-
-  // pair definitions:
-  // phi   --> K+ K-
-  // kstar --> K+ pi- & K- pi+
-  AliRsnPairDef *pairPhi    = new AliRsnPairDef('+', AliPID::kKaon, '-', AliPID::kKaon, 333);
-  AliRsnPairDef *pairKStar1 = new AliRsnPairDef('-', AliPID::kKaon, '+', AliPID::kPion, 313);
-  AliRsnPairDef *pairKStar2 = new AliRsnPairDef('+', AliPID::kKaon, '-', AliPID::kPion, 313);
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddPairDef(pairPhi);
-    task[i]->AddPairDef(pairKStar1);
-    task[i]->AddPairDef(pairKStar2);
-  }
-
-  // axis definition
-  //  0) transverse momentum
-  //  1) pseudo-rapidity
-  //  2) multiplicity (estimated with SPD tracklets - uncorrected)
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,       50,  0.0,  10.0);
-  AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,      20, -1.5,   1.5);
-  AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,     8,  0.0, 200.0);
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddAxis(axisMult);
-    task[i]->AddAxis(axisPt);
-    task[i]->AddAxis(axisEta);
-  }
-
-  // define cuts for event selection:
-  // this will determine the filling of bins in the "info" histograms
-  // and should be computed as additional correction factor in efficiency
-  AliRsnCutPrimaryVertex *cutVertex   = new AliRsnCutPrimaryVertex("cutVertex", 3);
-  AliRsnCutSet           *cutSetEvent = new AliRsnCutSet("eventCuts");
-  cutSetEvent->AddCut(cutVertex);
-  cutSetEvent->SetCutScheme("cutVertex");
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->SetEventCuts(cutSetEvent);
-  }
-
-  //
-  // *** STEP 0 - All resonances which decay in the specified pairs
-  //
-  // This step does not need any kind of definition, since
-  // its requirement is automatically checked during execution,
-  // but to avoid segfaults, it is better to initialize a cut manager.
-  //
-  AliRsnCutMgr *cutMgrMC_step0 = new AliRsnCutMgr("mc_step0", "");
-
-  //
-  // *** STEP 1 - Acceptance
-  //
-  // Here we add a cut on the pseudorapidity for both tracks
-  //
-  AliRsnCutStd *cutEta = new AliRsnCutStd("cutEta", AliRsnCutStd::kEta, -0.9, 0.9);
-
-  AliRsnCutMgr *cutMgrMC_step1    = new AliRsnCutMgr("mc_step1", "");
-  AliRsnCutSet *cutSetTrack_step1 = new AliRsnCutSet("mc_step1_tracks");
-  
-  cutSetTrack_step1->AddCut(cutEta);
-  cutSetTrack_step1->SetCutScheme("cutEta");
-  cutMgrMC_step1   ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step1);
-
-  //
-  // *** STEP 2 - Reconstruction & track quality
-  //
-  // Use the interface to AliESDtrackCuts
-  // and set only the cuts we are interested in
-  AliRsnCutESDPrimary *cutQuality = new AliRsnCutESDPrimary("cutCov");
-  cutQuality->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutQuality->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutQuality->GetCuts()->SetMaxNsigmaToVertex(10000.0);
-  cutQuality->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutQuality->GetCuts()->SetAcceptKinkDaughters(kTRUE);
-  cutQuality->GetCuts()->SetMinNClustersTPC(50);
-  cutQuality->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-
-  AliRsnCutMgr *cutMgrESD_step2   = new AliRsnCutMgr("esd_step2", "");
-  AliRsnCutSet *cutSetTrack_step2 = new AliRsnCutSet("esd_step2_tracks");
-
-  cutSetTrack_step2->AddCut(cutQuality);
-  cutSetTrack_step2->SetCutScheme("cutQuality");
-  cutMgrESD_step2  ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step2);
-
-  //
-  // *** STEP 3 - Primary tracks
-  //
-  // Use the interface to AliESDtrackCuts
-  // and set only the cuts we are interested in
-  // we also disable the cuts we applied before, for clarity
-  AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
-  cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(100.0, 100.0, 100.0, 100.0, 100.0);
-  cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
-  cutESDPrimary->GetCuts()->SetRequireTPCRefit(kFALSE);
-  cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
-  cutESDPrimary->GetCuts()->SetMinNClustersTPC(0);
-  cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(100000000.0);
-
-  AliRsnCutMgr *cutMgrESD_step3   = new AliRsnCutMgr("esd_step3", "");
-  AliRsnCutSet *cutSetTrack_step3 = new AliRsnCutSet("esd_step3_tracks");
-
-  cutSetTrack_step3->AddCut(cutESDPrimary);
-  cutSetTrack_step3->SetCutScheme("cutESDPrimary");
-  cutMgrESD_step3  ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step3);
-
-  //
-  // *** STEP 4 - Two possibilities (depend on the first macro argument)
-  //
-  // option 1 = Bethe-Bloch cut in 3 sigma (the sigma is one argument)
-  // option 2 = realistic Bayesian PID with all detectors
-  //
-  AliRsnCutMgr *cutMgrESD_step4[2];
-  AliRsnCutSet *cutSetTrack_step4[2];
-  
-  cutMgrESD_step4[0] = new AliRsnCutMgr("esd_step4_nopid", "");
-  cutMgrESD_step4[1] = new AliRsnCutMgr("esd_step4_pid", "");
-  cutSetTrack_step4[0] = new AliRsnCutSet("esd_step4_tracks_nopid");
-  cutSetTrack_step4[1] = new AliRsnCutSet("esd_step4_tracks_pid");
-  
-  // Bethe-Bloch with kaon mass hypothesis
-  AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
-  cutKaonBB->SetCalibConstant(0, 0.76176e-1);
-  cutKaonBB->SetCalibConstant(1, 10.632);
-  cutKaonBB->SetCalibConstant(2, 0.13279e-4);
-  cutKaonBB->SetCalibConstant(3, 1.8631);
-  cutKaonBB->SetCalibConstant(4, 1.9479);
-
-  // cuts for realistic PID match
-  AliRsnCutStd *cutRealisticPID = new AliRsnCutStd("cutKaonPID", AliRsnCutStd::kRealisticPIDMatch, 0);
-
-  cutSetTrack_step4[0]->AddCut(cutKaonBB);
-  cutSetTrack_step4[0]->SetCutScheme("cutKaonBB");
-
-  cutSetTrack_step4[1]->AddCut(cutRealisticPID);
-  cutSetTrack_step4[1]->SetCutScheme("cutRealisticPID");
-
-  cutMgrESD_step4[0]->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step4[0]);
-  cutMgrESD_step4[1]->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step4[1]);
-
-  // add all steps to the task
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddStepMC (cutMgrMC_step0);
-    task[i]->AddStepMC (cutMgrMC_step1);
-    task[i]->AddStepESD(cutMgrESD_step2);
-    task[i]->AddStepESD(cutMgrESD_step3);
-    task[i]->AddStepESD(cutMgrESD_step4[i]);
-  }
-
-  // connect containers and finalize
-  for (Int_t i = 0; i < 2; i++)
-  {
-    mgr->AddTask(task[i]);
-    mgr->ConnectInput(task[i], 0, mgr->GetCommonInputContainer());
-
-    // create paths for the output in the common file
-    Char_t infoPath[500], effPath[500];
-    sprintf(infoPath , "%s:PWG2RSNINFO" , AliAnalysisManager::GetCommonFileName());
-    sprintf(effPath  , "%s:PWG2RSNEFF%s", AliAnalysisManager::GetCommonFileName(), suf[i].Data());
-
-    // initialize and connect container for the output
-    AliAnalysisDataContainer *info = 0x0, *out = 0x0;
-    info = mgr->CreateContainer(Form("EffInfo_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, infoPath);
-    out  = mgr->CreateContainer(Form("EFF_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, effPath);
-
-    mgr->ConnectOutput(task[i], 1, info);
-    mgr->ConnectOutput(task[i], 2, out);
-  }
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNew.C b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEffNew.C
deleted file mode 100644 (file)
index 345d925..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-//
-// This macro add an analysis task for computing efficiency.
-// It will have as output an AliCFContainer with several steps:
-//
-//  0) all resonances in MC which decay in the pair specified
-//  1) subset of (0) whose daughters are in acceptance
-//  2) subset of (1) whose daughters satisfy quality track cuts (covariance, chi square && nTPCclusters)
-//  3) subset of (2) whose daughters satisfy primary track cuts (nsigma to vertex, no kink daughters)
-//  4) subset of (3) whose daughters satisty the BB TPC compatibility cut at 3 sigma
-//
-Bool_t AddAnalysisTaskRsnEffNew
-(
-  Double_t    sigmaTPC = 0.065,
-  const char *outFile  = "eff"
-)
-{
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-
-  // common suffixes
-  TString suf[2];
-  suf[0] = "nopid";
-  suf[1] = "pid";
-
-  // create task
-  AliRsnAnalysisEffSE *task[2];
-  task[0] = new AliRsnAnalysisEffSE("EffNoPID");
-  task[1] = new AliRsnAnalysisEffSE("EffPID");
-
-  // set prior probabilities for PID
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->SetPriorProbability(AliPID::kElectron, 0.02);
-    task[i]->SetPriorProbability(AliPID::kMuon,     0.02);
-    task[i]->SetPriorProbability(AliPID::kPion,     0.83);
-    task[i]->SetPriorProbability(AliPID::kKaon,     0.07);
-    task[i]->SetPriorProbability(AliPID::kProton,   0.06);
-    task[i]->DumpPriors();
-  }
-
-  // pair definitions:
-  // phi   --> K+ K-
-  // kstar --> K+ pi- & K- pi+
-  AliRsnPairDef *pairPhi    = new AliRsnPairDef('+', AliPID::kKaon, '-', AliPID::kKaon, 333, 1.0193);
-  AliRsnPairDef *pairKStar1 = new AliRsnPairDef('-', AliPID::kKaon, '+', AliPID::kPion, 313, 0.896);
-  AliRsnPairDef *pairKStar2 = new AliRsnPairDef('+', AliPID::kKaon, '-', AliPID::kPion, 313, 0.896);
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddPairDef(pairPhi);
-    task[i]->AddPairDef(pairKStar1);
-    task[i]->AddPairDef(pairKStar2);
-  }
-
-  // axis definition
-  //  0) transverse momentum
-  //  1) pseudo-rapidity
-  //  2) multiplicity (estimated with SPD tracklets - uncorrected)
-  // define all binnings
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,           50,  0.0,  10.0);
-  AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,          20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisY    = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairY,            20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,         8,  0.0, 200.0);
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddAxis(axisMult);
-    task[i]->AddAxis(axisPt);
-    task[i]->AddAxis(axisY); 
-    task[i]->AddAxis(axisEta);
-  }
-
-  // define cuts for event selection:
-  // this will determine the filling of bins in the "info" histograms
-  // and should be computed as additional correction factor in efficiency
-  AliRsnCutPrimaryVertex *cutVertex   = new AliRsnCutPrimaryVertex("cutVertex", 3);
-  AliRsnCutSet           *cutSetEvent = new AliRsnCutSet("eventCuts");
-  cutSetEvent->AddCut(cutVertex);
-  cutSetEvent->SetCutScheme("cutVertex");
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->SetEventCuts(cutSetEvent);
-  }
-
-  //
-  // *** STEP 0 - All resonances which decay in the specified pairs
-  //
-  // This step does not need any kind of definition, since
-  // its requirement is automatically checked during execution,
-  // but to avoid segfaults, it is better to initialize a cut manager.
-  //
-  AliRsnCutMgr *cutMgrMC_step0 = new AliRsnCutMgr("mc_step0", "");
-
-  //
-  // *** STEP 1 - Acceptance
-  //
-  // Here we add a cut on the pseudorapidity for both tracks
-  //
-  AliRsnCutStd *cutEta = new AliRsnCutStd("cutEta", AliRsnCutStd::kEta, -0.9, 0.9);
-
-  AliRsnCutMgr *cutMgrMC_step1    = new AliRsnCutMgr("mc_step1", "");
-  AliRsnCutSet *cutSetTrack_step1 = new AliRsnCutSet("mc_step1_tracks");
-  
-  cutSetTrack_step1->AddCut(cutEta);
-  cutSetTrack_step1->SetCutScheme("cutEta");
-  cutMgrMC_step1   ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step1);
-
-  //
-  // *** STEP 2 - Reconstruction & track quality
-  //
-  // Use the interface to AliESDtrackCuts
-  // and set only the cuts we are interested in
-  AliRsnCutESDPrimary *cutQuality = new AliRsnCutESDPrimary("cutCov");
-  cutQuality->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutQuality->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutQuality->GetCuts()->SetMaxNsigmaToVertex(10000.0);
-  cutQuality->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutQuality->GetCuts()->SetAcceptKinkDaughters(kTRUE);
-  cutQuality->GetCuts()->SetMinNClustersTPC(50);
-  cutQuality->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-
-  AliRsnCutMgr *cutMgrESD_step2   = new AliRsnCutMgr("esd_step2", "");
-  AliRsnCutSet *cutSetTrack_step2 = new AliRsnCutSet("esd_step2_tracks");
-
-  cutSetTrack_step2->AddCut(cutQuality);
-  cutSetTrack_step2->SetCutScheme("cutQuality");
-  cutMgrESD_step2  ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step2);
-
-  //
-  // *** STEP 3 - Primary tracks
-  //
-  // Use the interface to AliESDtrackCuts
-  // and set only the cuts we are interested in
-  // we also disable the cuts we applied before, for clarity
-  AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
-  cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
-  cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
-  cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
-  cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-
-  AliRsnCutMgr *cutMgrESD_step3   = new AliRsnCutMgr("esd_step3", "");
-  AliRsnCutSet *cutSetTrack_step3 = new AliRsnCutSet("esd_step3_tracks");
-
-  cutSetTrack_step3->AddCut(cutESDPrimary);
-  cutSetTrack_step3->SetCutScheme("cutESDPrimary");
-  cutMgrESD_step3  ->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step3);
-
-  //
-  // *** STEP 4 - Two possibilities (depend on the first macro argument)
-  //
-  // option 1 = Bethe-Bloch cut in 3 sigma (the sigma is one argument)
-  // option 2 = realistic Bayesian PID with all detectors
-  //
-  AliRsnCutMgr *cutMgrESD_step4[2];
-  AliRsnCutSet *cutSetTrack_step4[2];
-  
-  cutMgrESD_step4[0] = new AliRsnCutMgr("esd_step4_nopid", "");
-  cutMgrESD_step4[1] = new AliRsnCutMgr("esd_step4_pid", "");
-  cutSetTrack_step4[0] = new AliRsnCutSet("esd_step4_tracks_nopid");
-  cutSetTrack_step4[1] = new AliRsnCutSet("esd_step4_tracks_pid");
-  
-  // Bethe-Bloch with kaon mass hypothesis
-  AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
-  cutKaonBB->SetCalibConstant(0, 0.76176e-1);
-  cutKaonBB->SetCalibConstant(1, 10.632);
-  cutKaonBB->SetCalibConstant(2, 0.13279e-4);
-  cutKaonBB->SetCalibConstant(3, 1.8631);
-  cutKaonBB->SetCalibConstant(4, 1.9479);
-
-  // cuts for realistic PID match
-  AliRsnCutStd *cutRealisticPID = new AliRsnCutStd("cutKaonPID", AliRsnCutStd::kRealisticPIDMatch, 0);
-
-  cutSetTrack_step4[0]->AddCut(cutKaonBB);
-  cutSetTrack_step4[0]->SetCutScheme("cutKaonBB");
-
-  cutSetTrack_step4[1]->AddCut(cutRealisticPID);
-  cutSetTrack_step4[1]->SetCutScheme("cutRealisticPID");
-
-  cutMgrESD_step4[0]->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step4[0]);
-  cutMgrESD_step4[1]->SetCutSet(AliRsnCut::kParticle, cutSetTrack_step4[1]);
-
-  // add all steps to the task
-  for (Int_t i = 0; i < 2; i++)
-  {
-    task[i]->AddStepMC (cutMgrMC_step0);
-    task[i]->AddStepMC (cutMgrMC_step1);
-    task[i]->AddStepESD(cutMgrESD_step2);
-    task[i]->AddStepESD(cutMgrESD_step3);
-    task[i]->AddStepESD(cutMgrESD_step4[i]);
-  }
-  
-  // create paths for the output in the common file
-  Char_t commonPath[500];
-  sprintf(commonPath, "%s:PWG2RSN", AliAnalysisManager::GetCommonFileName());
-
-  // connect containers and finalize
-  for (Int_t i = 0; i < 2; i++)
-  {
-    mgr->AddTask(task[i]);
-    mgr->ConnectInput(task[i], 0, mgr->GetCommonInputContainer());
-
-    // create paths for the output in the common file
-    Char_t infoPath[500], effPath[500];
-    sprintf(infoPath , "%s:PWG2RSN", AliAnalysisManager::GetCommonFileName());
-    sprintf(effPath  , "%s:PWG2RSN", AliAnalysisManager::GetCommonFileName(), suf[i].Data());
-
-    // initialize and connect container for the output
-    AliAnalysisDataContainer *info = 0x0, *out = 0x0;
-    info = mgr->CreateContainer(Form("RsnEffInfo_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, infoPath);
-    out  = mgr->CreateContainer(Form("RsnEffCorr_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, effPath);
-
-    mgr->ConnectOutput(task[i], 1, info);
-    mgr->ConnectOutput(task[i], 2, out);
-  }
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnNew.C b/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnNew.C
deleted file mode 100644 (file)
index 16d53f5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Macro to create the full analysis manager for Resonances
-//
-Bool_t AddAnalysisTaskRsnNew
-(
-  const char *configMacro = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/ConfigTaskRsn.C"
-)
-{
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-
-  // initialize task with all available slots, even if not all of them will be used:
-  AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis", 1);
-  task->SetZeroEventPercentWarning(100.0);
-
-  // load and execute configuration macro
-  // if we are in a PROOF environment, it must be loaded by gProof
-  // otherwise if will be loaded by gROOT
-  if (TProofMgr::GetListOfManagers()->GetEntries())
-  {
-    if (dynamic_cast<TProofLite *> gProof)
-      gProof->Exec(Form(".L %s", macro.Data()));
-    else
-      gProof->Load(configMacro);
-  }
-  else
-  {
-    //gROOT->ProcessLine(Form(".x %s", configMacro));
-    gROOT->LoadMacro(configMacro);
-  }
-
-  // configure the task
-  RsnConfigTask(task);
-
-  // add the task to manager
-  mgr->AddTask(task);
-
-  // connect input container according to source choice
-  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
-
-  // create paths for the output in the common file
-  Char_t commonPath[500];
-  sprintf(commonPath, "%s:PWG2RSN", AliAnalysisManager::GetCommonFileName());
-
-  // create containers for output
-  AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-  AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-  mgr->ConnectOutput(task, 1, outputInfo);
-  mgr->ConnectOutput(task, 2, outputHist);
-}
diff --git a/PWG2/RESONANCES/macros/train/ConfigTaskRsn.C b/PWG2/RESONANCES/macros/train/ConfigTaskRsn.C
deleted file mode 100644 (file)
index c49dfaf..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// CONFIGURATION SCRIPT FOR RESONANCES ANALYSIS TRAIN
-//
-// The configuration script made of two functions:
-//   1) RsnConfigPairManager
-//   2) RsnConfigTask
-//
-// Function 'RsnConfigPairManager' defines a common scheme used
-// for axis definition, cuts, and whatever is in common among
-// all the output histograms.
-// Function 'RsnConfigTask' calls the above function for all
-// specific resonance pairs one wants to create.
-// 
-
-//_________________________________________________________________________________________________
-AliRsnPairManager* RsnConfigPairManager
-(
-  const char            *pairMgrName,
-  Int_t                  resonancePDG,
-  Double_t               resonanceMass,
-  AliPID::EParticleType  type1,
-  AliPID::EParticleType  type2,
-  Bool_t                 addTruePairs
-)
-//
-// -- RsnConfigPairManager --
-//
-// This function defines:
-//  - what pairs one wants
-//  - what cuts have to be applied
-//  - what axes the output histogram will have
-//
-// Output:
-//  - an AliRsnPairManager containing all pairs related to one analysis
-//   (usually, all pairs in the same manager refer to the same resonance
-//    and this is assumed in the philosophy of the function itself)
-//
-// Arguments:
-//  - pairMgrName   = name assigned to output object
-//  - resonancePDG  = PDG code of resonance in study
-//  - resonanceMass = nominal (PDG) mass of resonance in study (required for mass-based axes, like Y and Mt)
-//  - type1         = first daughter type
-//  - type2         = second daughter type
-//  - addTruePairs  = flag to decide if true pairs histogram must be computed
-//                    (requires MC info, so it is not feasible with AOD only)
-//
-// == NOTE 1 ==
-// in this version of the configuration macro, the name given to PairManager must contain
-// some keywords which define a choice of cuts which will be added to the analysis:
-//  - "NOPID": completely no PID analysis (only primary track cuts are applied)
-//  - "BB"   : all tracks are used, but the TPC Bethe-Bloch cut is applied (cut value = 0.2)
-//  - "PID"  : realistic PID is used
-//
-// == NOTE 2 ==
-// in this version of the configuration macro, the output histograms have the following axes:
-//  0 = inv. mass
-//  1 = transverse mass
-//  2 = rapidity
-//
-{
-  // === NAME DEFINITIONS =========================================================================
-   
-  AliRsnPairManager  *pairMgr  = new AliRsnPairManager(pairMgrName);
-   
-  // examines the given name to define details about track selection and cuts
-  TString               str(pairMgrName);
-  AliRsnPair::EPairType pidType;
-  Bool_t                useBBCut;
-  if (str.Contains("NOPID"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: not used");
-  }
-  else if (str.Contains("BB"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kTRUE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: used");
-  }
-  else if (str.Contains("PID"))
-  {
-    pidType  = AliRsnPair::kRealisticPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = Realistic PID -- BB CUT: not used");
-  }
-  else
-  {
-    Error("RsnConfig", "Unrecognized keywords in the name. Can't continue");
-    return 0x0;
-  }
-   
-  // === PAIR DEFINITIONS =========================================================================
-   
-  // if particle #1 and #2 are different, two histograms must be built
-  // for each scheme (signal, true, mixed, like-sign) exchanging both particles and signs
-  Int_t i, j, nArray = 1;
-  if (type1 != type2) nArray = 2;
-   
-  AliRsnPairDef *defUnlike[2] = {0, 0};
-  AliRsnPairDef *defLikePP[2] = {0, 0};
-  AliRsnPairDef *defLikeMM[2] = {0, 0};
-   
-  defUnlike[0] = new AliRsnPairDef(type1, '+', type2, '-', resonancePDG, resonanceMass);
-  defLikePP[0] = new AliRsnPairDef(type1, '+', type2, '+', resonancePDG, resonanceMass);
-  defLikeMM[0] = new AliRsnPairDef(type1, '-', type2, '-', resonancePDG, resonanceMass);
-   
-  defUnlike[1] = new AliRsnPairDef(type2, '+', type1, '-', resonancePDG, resonanceMass);
-  defLikePP[1] = new AliRsnPairDef(type2, '+', type1, '+', resonancePDG, resonanceMass);
-  defLikeMM[1] = new AliRsnPairDef(type2, '-', type1, '-', resonancePDG, resonanceMass);
-   
-  // === PAIR ANALYSIS ENGINES ====================================================================
-   
-  // define null (dummy) objects and initialize only the ones which are needed,
-  // depending again on particle types;
-  // array is organized as follows:
-  // [0] - true pairs
-  // [1] - signal
-  // [2] - like PP
-  // [3] - like MM
-  AliRsnPair *pair[2][4];
-  for (i = 0; i < 2; i++) for (j = 0; j < 4; j++) pair[i][j] = 0x0;
-   
-  for (i = 0; i < nArray; i++) {
-    pair[i][0] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][1] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][2] = new AliRsnPair(pidType, defLikePP[i]);
-    pair[i][3] = new AliRsnPair(pidType, defLikeMM[i]);
-  }
-   
-  // === CUTS =====================================================================================
-   
-  // cuts for tracks:
-  // -- primary track quality
-  AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
-  cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
-  cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
-  cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
-  cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-  // -- Bethe-Bloch with kaon mass hypothesis
-  Double_t sigmaTPC = 0.065;
-  AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
-  cutKaonBB->SetCalibConstant(0, 0.76176e-1);
-  cutKaonBB->SetCalibConstant(1, 10.632);
-  cutKaonBB->SetCalibConstant(2, 0.13279e-4);
-  cutKaonBB->SetCalibConstant(3, 1.8631);
-  cutKaonBB->SetCalibConstant(4, 1.9479);
-   
-  // cuts on pairs:
-  // -- true daughters of a phi resonance (only for true pairs histogram)
-  AliRsnCutStd *cutTruePair = new AliRsnCutStd("cutTrue", AliRsnCutStd::kTruePair, resonancePDG);
-  // -- whole interval in Pt and Eta
-  //AliRsnCutStd *cutEtaPair = new AliRsnCutStd("cutEtaPair", AliRsnCutStd::kEta, -0.9,  0.9);
-  //AliRsnCutStd *cutPtPair  = new AliRsnCutStd("cutPtPair" , AliRsnCutStd::kPt ,  0.0, 10.0);
-  //AliRsnCutStd *cutYPair   = new AliRsnCutStd("cutYPair"  , AliRsnCutStd::kEta, -0.9,  0.9);
-  //cutYPair->SetMass(resonanceMass);
-   
-  // cuts on event (specific for this analysis):
-  // -- whole interval in multiplicity
-  AliRsnCutStd *cutMultiplicity = new AliRsnCutStd("cutMult", AliRsnCutStd::kMult, 0, 200);
-   
-  // cut set definition for all pairs
-  AliRsnCutSet *cutSetParticle = new AliRsnCutSet("trackCuts");
-  cutSetParticle->AddCut(cutESDPrimary);
-  if (useBBCut)
-  {
-    cutSetParticle->AddCut(cutKaonBB);
-    cutSetParticle->SetCutScheme("cutKaonBB&cutESDPrimary");
-  }
-  else 
-  {
-    cutSetParticle->SetCutScheme("cutESDPrimary");
-  }
-   
-  // cut set definition for true pairs
-  AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
-  //cutSetPairTrue->AddCut(cutPtPair);
-  //cutSetPairTrue->AddCut(cutEtaPair);
-  //cutSetPairTrue->AddCut(cutTruePair);
-  //cutSetPairTrue->SetCutScheme("cutPtPair&cutEtaPair&cutTrue");
-  cutSetPairTrue->SetCutScheme("cutTrue");
-   
-  // cut set definition for all pairs
-  //AliRsnCutSet *cutSetPairAll = new AliRsnCutSet("allPairs");
-  //cutSetPairAll->AddCut(cutPtPair);
-  //if (useY) 
-  //{
-  //  cutSetPairAll->AddCut(cutYPair); 
-  //  cutSetPairAll->SetCutScheme("cutPtPair&cutYPair");
-  //}
-  //else 
-  //{
-  //  cutSetPairAll->AddCut(cutEtaPair);
-  //  cutSetPairAll->SetCutScheme("cutPtPair&cutEtaPair");
-  //}
-   
-  // cut set definition for events
-  //AliRsnCutSet *cutSetEvent = new AliRsnCutSet("cutSetMult");
-  //cutSetEvent->AddCut(cutMultiplicity);
-  //cutSetEvent->SetCutScheme("cutMult");
-   
-  // cut manager for all pairs
-  // define a proper name for each mult bin, to avoid omonyme output histos
-  AliRsnCutMgr *cutMgrAll = new AliRsnCutMgr("std", "All");
-  cutMgrAll->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-  //cutMgrAll->SetCutSet(AliRsnCut::kPair, cutSetPairAll);
-  //cutMgrAll->SetCutSet(AliRsnCut::kEvent, cutSetEvent);
-  
-  // cut manager for true pairs
-  AliRsnCutMgr *cutMgrTrue = new AliRsnCutMgr("true", "True");
-  cutMgrTrue->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-  cutMgrTrue->SetCutSet(AliRsnCut::kPair, cutSetPairTrue);
-  //cutMgrAll->SetCutSet(AliRsnCut::kEvent, cutSetEvent);
-   
-  for (i = 0; i < nArray; i++) {
-    pair[i][0]->SetCutMgr(cutMgrTrue);
-    pair[i][0]->SetOnlyTrue();
-    for (j = 1; j < 4; j++) {
-      pair[i][j]->SetCutMgr(cutMgrAll);
-    }
-  }
-   
-  // === FUNCTIONS ================================================================================
-  
-  // resonance type defines IM binning
-  Double_t imMin, imMax, imBin;
-  Int_t    nbins;
-  if (str.Contains("PHI")) {
-    imMin = 0.9;
-    imMax = 1.6;
-    imBin = 1.0;
-  }
-  else
-  {
-    imMin = 0.6;
-    imMax = 2.1;
-    imBin = 10.0;
-  }
-  nbins = (Int_t)((imMax - imMin) / (imBin / 1000.0));
-  cout << "MIN  = " << imMin << endl;
-  cout << "MAX  = " << imMax << endl;
-  cout << "BIN  = " << imBin << endl;
-  cout << "NBIN = " << nbins << endl;
-   
-  // define all binnings
-  AliRsnFunctionAxis *axisIM   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass,   nbins,  imMin, imMax);
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,           50,  0.0,  10.0);
-  AliRsnFunctionAxis *axisY    = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairY,            20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,          20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,         8,  0.0, 200.0);
-   
-  AliRsnFunction *fcnPtY   = new AliRsnFunction();
-  AliRsnFunction *fcnPtEta = new AliRsnFunction();
-  AliRsnFunction *fcnMult  = new AliRsnFunction();
-  
-  fcnPtY  ->AddAxis(axisIM);
-  fcnPtEta->AddAxis(axisIM);
-  fcnMult ->AddAxis(axisIM);
-   
-  fcnPtY  ->AddAxis(axisPt);
-  fcnPtEta->AddAxis(axisPt);
-  fcnMult ->AddAxis(axisMult);
-  
-  fcnPtY  ->AddAxis(axisY);
-  fcnPtEta->AddAxis(axisEta);
-   
-  // add functions to pairs
-  for (i = 0; i < nArray; i++) {
-    for (j = 0; j < 4; j++) {
-      pair[i][j]->AddFunction(fcnPtY);
-      pair[i][j]->AddFunction(fcnPtEta);
-      pair[i][j]->AddFunction(fcnMult);
-    }
-  }
-   
-  // === ADD TO PAIR MANAGER ======================================================================
-  
-  //
-  // true pairs are array [0] element:
-  // if they must be excluded, this element is skipped everywhere
-  //
-   
-  for (i = 0; i < nArray; i++) {
-    Int_t start = (addTruePairs ? 0 : 1);
-    for (j = start; j < 4; j++) {
-      pairMgr->AddPair(pair[i][j]);
-    }
-  }
-   
-  return pairMgr;
-}
-
-//_________________________________________________________________________________________________
-void RsnConfigTask(AliRsnAnalysisSE* &task)
-//
-// -- RsnConfigTask --
-//
-// This function configures the entire task for all resonances the user is interested in.
-// It recalls the above function many times to configure all required pair managers.
-//
-// By default, this function has the used task as argument.
-//
-{
-  if (!task)
-  {
-    Error("ConfigTaskRsn", "Task not found");
-    return;
-  }
-
-  // set prior probabilities for PID
-  task->SetPriorProbability(AliPID::kElectron, 0.02);
-  task->SetPriorProbability(AliPID::kMuon,     0.02);
-  task->SetPriorProbability(AliPID::kPion,     0.83);
-  task->SetPriorProbability(AliPID::kKaon,     0.07);
-  task->SetPriorProbability(AliPID::kProton,   0.06);
-  task->DumpPriors();
-  
-  // initialize analysis manager with pairs from config
-  AliRsnAnalysisManager *anaMgr = task->GetAnalysisManager(0);
-    
-  // create pair managers for phi
-  anaMgr->Add(RsnConfigPairManager("PHI_NOPID", 333, 1.0193, AliPID::kKaon, AliPID::kKaon, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("PHI_BB"   , 333, 1.0193, AliPID::kKaon, AliPID::kKaon, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("PHI_PID"  , 333, 1.0193, AliPID::kKaon, AliPID::kKaon, kTRUE));
-  // create pair managers for kstar
-  anaMgr->Add(RsnConfigPairManager("KSTAR_NOPID", 313, 0.896, AliPID::kPion, AliPID::kKaon, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("KSTAR_BB"   , 313, 0.896, AliPID::kPion, AliPID::kKaon, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("KSTAR_PID"  , 313, 0.896, AliPID::kPion, AliPID::kKaon, kTRUE));
-  
-  // setup cuts for events (good primary vertex)
-  AliRsnCutPrimaryVertex *cutVertex   = new AliRsnCutPrimaryVertex("cutVertex", 3);
-  AliRsnCutSet           *cutSetEvent = new AliRsnCutSet("eventCuts");
-  cutSetEvent->AddCut(cutVertex);
-  cutSetEvent->SetCutScheme("cutVertex");
-  task->SetEventCuts(cutSetEvent);
-}
diff --git a/PWG2/RESONANCES/macros/train/ConfigTaskRsn2D.C b/PWG2/RESONANCES/macros/train/ConfigTaskRsn2D.C
deleted file mode 100644 (file)
index 7744356..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-//
-// CONFIGURATION SCRIPT FOR RESONANCES ANALYSIS TRAIN
-//
-// The configuration script made of two functions:
-//   1) RsnConfigPairManager
-//   2) RsnConfigTask
-//
-// Function 'RsnConfigPairManager' defines a common scheme used
-// for axis definition, cuts, and whatever is in common among
-// all the output histograms.
-// Function 'RsnConfigTask' calls the above function for all
-// specific resonance pairs one wants to create.
-// 
-
-//_________________________________________________________________________________________________
-AliRsnPairManager* RsnConfigPairManager
-(
-  const char            *pairMgrName,
-  Int_t                  resonancePDG,
-  Double_t               resonanceMass,
-  AliPID::EParticleType  type1,
-  AliPID::EParticleType  type2,
-  Bool_t                 useY,
-  Bool_t                 addTruePairs
-)
-//
-// -- RsnConfigPairManager --
-//
-// This function defines:
-//  - what pairs one wants
-//  - what cuts have to be applied
-//  - what axes the output histogram will have
-//
-// Output:
-//  - an AliRsnPairManager containing all pairs related to one analysis
-//   (usually, all pairs in the same manager refer to the same resonance
-//    and this is assumed in the philosophy of the function itself)
-//
-// Arguments:
-//  - pairMgrName   = name assigned to output object
-//  - resonancePDG  = PDG code of resonance in study
-//  - resonanceMass = nominal (PDG) mass of resonance in study (required for mass-based axes, like Y and Mt)
-//  - type1         = first daughter type
-//  - type2         = second daughter type
-//  - addTruePairs  = flag to decide if true pairs histogram must be computed
-//                    (requires MC info, so it is not feasible with AOD only)
-//
-// == NOTE 1 ==
-// in this version of the configuration macro, the name given to PairManager must contain
-// some keywords which define a choice of cuts which will be added to the analysis:
-//  - "NOPID": completely no PID analysis (only primary track cuts are applied)
-//  - "BB"   : all tracks are used, but the TPC Bethe-Bloch cut is applied (cut value = 0.2)
-//  - "PID"  : realistic PID is used
-//
-// == NOTE 2 ==
-// in this version of the configuration macro, the output histograms have the following axes:
-//  0 = inv. mass
-//  1 = transverse mass
-//  2 = rapidity
-//
-{
-  // === NAME DEFINITIONS =========================================================================
-   
-  AliRsnPairManager  *pairMgr  = new AliRsnPairManager(pairMgrName);
-   
-  // examines the given name to define details about track selection and cuts
-  TString               str(pairMgrName);
-  AliRsnPair::EPairType pidType;
-  Bool_t                useBBCut;
-  if (str.Contains("NOPID"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: not used");
-  }
-  else if (str.Contains("BB"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kTRUE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: used");
-  }
-  else if (str.Contains("PID"))
-  {
-    pidType  = AliRsnPair::kRealisticPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = Realistic PID -- BB CUT: not used");
-  }
-  else
-  {
-    Error("RsnConfig", "Unrecognized keywords in the name. Can't continue");
-    return 0x0;
-  }
-   
-  // === PAIR DEFINITIONS =========================================================================
-   
-  // if particle #1 and #2 are different, two histograms must be built
-  // for each scheme (signal, true, mixed, like-sign) exchanging both particles and signs
-  Int_t i, j, nArray = 1;
-  if (type1 != type2) nArray = 2;
-   
-  AliRsnPairDef *defUnlike[2] = {0, 0};
-  AliRsnPairDef *defLikePP[2] = {0, 0};
-  AliRsnPairDef *defLikeMM[2] = {0, 0};
-   
-  defUnlike[0] = new AliRsnPairDef(type1, '+', type2, '-', resonancePDG, resonanceMass);
-  defLikePP[0] = new AliRsnPairDef(type1, '+', type2, '+', resonancePDG, resonanceMass);
-  defLikeMM[0] = new AliRsnPairDef(type1, '-', type2, '-', resonancePDG, resonanceMass);
-   
-  defUnlike[1] = new AliRsnPairDef(type2, '+', type1, '-', resonancePDG, resonanceMass);
-  defLikePP[1] = new AliRsnPairDef(type2, '+', type1, '+', resonancePDG, resonanceMass);
-  defLikeMM[1] = new AliRsnPairDef(type2, '-', type1, '-', resonancePDG, resonanceMass);
-   
-  // === PAIR ANALYSIS ENGINES ====================================================================
-   
-  // define null (dummy) objects and initialize only the ones which are needed,
-  // depending again on particle types;
-  // array is organized as follows:
-  // [0] - true pairs
-  // [1] - signal
-  // [2] - like PP
-  // [3] - like MM
-  AliRsnPair *pair[2][4];
-  for (i = 0; i < 2; i++) for (j = 0; j < 4; j++) pair[i][j] = 0x0;
-   
-  for (i = 0; i < nArray; i++) {
-    pair[i][0] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][1] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][2] = new AliRsnPair(pidType, defLikePP[i]);
-    pair[i][3] = new AliRsnPair(pidType, defLikeMM[i]);
-  }
-   
-  // === CUTS =====================================================================================
-   
-  // cuts for tracks:
-  // -- primary track quality
-  AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
-  cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
-  cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
-  cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
-  cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-  // -- Bethe-Bloch with kaon mass hypothesis
-  Double_t sigmaTPC = 0.065;
-  AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
-  cutKaonBB->SetCalibConstant(0, 0.76176e-1);
-  cutKaonBB->SetCalibConstant(1, 10.632);
-  cutKaonBB->SetCalibConstant(2, 0.13279e-4);
-  cutKaonBB->SetCalibConstant(3, 1.8631);
-  cutKaonBB->SetCalibConstant(4, 1.9479);
-   
-  // cuts on pairs:
-  // -- true daughters of a phi resonance (only for true pairs histogram)
-  AliRsnCutStd *cutTruePair = new AliRsnCutStd("cutTrue", AliRsnCutStd::kTruePair, resonancePDG);
-  // -- whole interval in Pt and Eta
-  //AliRsnCutStd *cutEtaPair = new AliRsnCutStd("cutEtaPair", AliRsnCutStd::kEta, -0.9,  0.9);
-  //AliRsnCutStd *cutPtPair  = new AliRsnCutStd("cutPtPair" , AliRsnCutStd::kPt ,  0.0, 10.0);
-  //AliRsnCutStd *cutYPair   = new AliRsnCutStd("cutYPair"  , AliRsnCutStd::kEta, -0.9,  0.9);
-  //cutYPair->SetMass(resonanceMass);
-   
-  // cuts on event (specific for this analysis):
-  // -- whole interval in multiplicity
-  AliRsnCutStd *cutMultiplicity = new AliRsnCutStd("cutMult", AliRsnCutStd::kMult, 0, 200);
-   
-  // cut set definition for all pairs
-  AliRsnCutSet *cutSetParticle = new AliRsnCutSet("trackCuts");
-  cutSetParticle->AddCut(cutESDPrimary);
-  if (useBBCut)
-  {
-    cutSetParticle->AddCut(cutKaonBB);
-    cutSetParticle->SetCutScheme("cutKaonBB&cutESDPrimary");
-  }
-  else 
-  {
-    cutSetParticle->SetCutScheme("cutESDPrimary");
-  }
-   
-  // cut set definition for true pairs
-  AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
-  //cutSetPairTrue->AddCut(cutPtPair);
-  //cutSetPairTrue->AddCut(cutEtaPair);
-  //cutSetPairTrue->AddCut(cutTruePair);
-  //cutSetPairTrue->SetCutScheme("cutPtPair&cutEtaPair&cutTrue");
-  cutSetPairTrue->SetCutScheme("cutTrue");
-   
-  // cut set definition for all pairs
-  //AliRsnCutSet *cutSetPairAll = new AliRsnCutSet("allPairs");
-  //cutSetPairAll->AddCut(cutPtPair);
-  //if (useY) 
-  //{
-  //  cutSetPairAll->AddCut(cutYPair); 
-  //  cutSetPairAll->SetCutScheme("cutPtPair&cutYPair");
-  //}
-  //else 
-  //{
-  //  cutSetPairAll->AddCut(cutEtaPair);
-  //  cutSetPairAll->SetCutScheme("cutPtPair&cutEtaPair");
-  //}
-   
-  // cut set definition for events
-  //AliRsnCutSet *cutSetEvent = new AliRsnCutSet("cutSetMult");
-  //cutSetEvent->AddCut(cutMultiplicity);
-  //cutSetEvent->SetCutScheme("cutMult");
-   
-  // cut manager for all pairs
-  // define a proper name for each mult bin, to avoid omonyme output histos
-  AliRsnCutMgr *cutMgrAll = new AliRsnCutMgr("std", "All");
-  cutMgrAll->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-  //cutMgrAll->SetCutSet(AliRsnCut::kPair, cutSetPairAll);
-  //cutMgrAll->SetCutSet(AliRsnCut::kEvent, cutSetEvent);
-  
-  // cut manager for true pairs
-  AliRsnCutMgr *cutMgrTrue = new AliRsnCutMgr("true", "True");
-  cutMgrTrue->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-  cutMgrTrue->SetCutSet(AliRsnCut::kPair, cutSetPairTrue);
-  //cutMgrAll->SetCutSet(AliRsnCut::kEvent, cutSetEvent);
-   
-  for (i = 0; i < nArray; i++) {
-    pair[i][0]->SetCutMgr(cutMgrTrue);
-    pair[i][0]->SetOnlyTrue();
-    for (j = 1; j < 4; j++) {
-      pair[i][j]->SetCutMgr(cutMgrAll);
-    }
-  }
-   
-  // === FUNCTIONS ================================================================================
-   
-  // resonance type defines IM binning
-  Double_t imMin, imMax, imBin;
-  Int_t    nbins;
-  if (str.Contains("PHI")) {
-    imMin = 0.9;
-    imMax = 1.6;
-    imBin = 1.0;
-  }
-  else
-  {
-    imMin = 0.6;
-    imMax = 2.1;
-    imBin = 10.0;
-  }
-  nbins = (Int_t)((imMax - imMin) / (imBin / 1000.0));
-  cout << "MIN  = " << imMin << endl;
-  cout << "MAX  = " << imMax << endl;
-  cout << "BIN  = " << imBin << endl;
-  cout << "NBIN = " << nbins << endl;
-   
-  // define all binnings
-  AliRsnFunctionAxis *axisIM   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass,   nbins,  imMin, imMax);
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,           50,  0.0,  10.0);
-  AliRsnFunctionAxis *axisY    = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairY,            20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,          20, -1.0,   1.0);
-  AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,         8,  0.0, 200.0);
-   
-  AliRsnFunction *fcnPt   = new AliRsnFunction();
-  AliRsnFunction *fcnEta  = new AliRsnFunction();
-  AliRsnFunction *fcnY    = new AliRsnFunction();
-  AliRsnFunction *fcnMult = new AliRsnFunction();
-  
-  fcnPt  ->AddAxis(axisIM);
-  fcnEta ->AddAxis(axisIM);
-  fcnY   ->AddAxis(axisIM);
-  fcnMult->AddAxis(axisIM);
-   
-  fcnPt  ->AddAxis(axisPt);
-  fcnY   ->AddAxis(axisY); 
-  fcnEta ->AddAxis(axisEta);
-  fcnMult->AddAxis(axisMult);
-   
-  // add functions to pairs
-  for (i = 0; i < nArray; i++) {
-    for (j = 0; j < 4; j++) {
-      pair[i][j]->AddFunction(fcnPt);
-      pair[i][j]->AddFunction(fcnEta);
-      pair[i][j]->AddFunction(fcnY);
-      pair[i][j]->AddFunction(fcnMult);
-    }
-  }
-   
-  // === ADD TO PAIR MANAGER ======================================================================
-  
-  //
-  // true pairs are array [0] element:
-  // if they must be excluded, this element is skipped everywhere
-  //
-   
-  for (i = 0; i < nArray; i++) {
-    Int_t start = (addTruePairs ? 0 : 1);
-    for (j = start; j < 4; j++) {
-      pairMgr->AddPair(pair[i][j]);
-    }
-  }
-   
-  return pairMgr;
-}
-
-//_________________________________________________________________________________________________
-void RsnConfigTask(AliRsnAnalysisSE* &task, Bool_t useY = kTRUE)
-//
-// -- RsnConfigTask --
-//
-// This function configures the entire task for all resonances the user is interested in.
-// It recalls the above function many times to configure all required pair managers.
-//
-// By default, this function has the used task as argument.
-//
-{
-  if (!task)
-  {
-    Error("ConfigTaskRsn", "Task not found");
-    return;
-  }
-
-  // set prior probabilities for PID
-  task->SetPriorProbability(AliPID::kElectron, 0.02);
-  task->SetPriorProbability(AliPID::kMuon,     0.02);
-  task->SetPriorProbability(AliPID::kPion,     0.83);
-  task->SetPriorProbability(AliPID::kKaon,     0.07);
-  task->SetPriorProbability(AliPID::kProton,   0.06);
-  task->DumpPriors();
-  
-  // initialize analysis manager with pairs from config
-  AliRsnAnalysisManager *anaMgr = task->GetAnalysisManager(0);
-    
-  // create pair managers for phi
-  anaMgr->Add(RsnConfigPairManager("PHI_NOPID", 333, 1.0193, AliPID::kKaon, AliPID::kKaon, useY, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("PHI_BB"   , 333, 1.0193, AliPID::kKaon, AliPID::kKaon, useY, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("PHI_PID"  , 333, 1.0193, AliPID::kKaon, AliPID::kKaon, useY, kTRUE));
-  // create pair managers for kstar
-  anaMgr->Add(RsnConfigPairManager("KSTAR_NOPID", 313, 0.896, AliPID::kPion, AliPID::kKaon, useY, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("KSTAR_BB"   , 313, 0.896, AliPID::kPion, AliPID::kKaon, useY, kTRUE));
-  anaMgr->Add(RsnConfigPairManager("KSTAR_PID"  , 313, 0.896, AliPID::kPion, AliPID::kKaon, useY, kTRUE));
-  
-  // setup cuts for events (good primary vertex)
-  AliRsnCutPrimaryVertex *cutVertex   = new AliRsnCutPrimaryVertex("cutVertex", 3);
-  AliRsnCutSet           *cutSetEvent = new AliRsnCutSet("eventCuts");
-  cutSetEvent->AddCut(cutVertex);
-  cutSetEvent->SetCutScheme("cutVertex");
-  task->SetEventCuts(cutSetEvent);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C
deleted file mode 100644 (file)
index 90ae74d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// This macro serves to add the RSN analysis task to the steering macro.
-//
-// Inputs:
-//   - dataLabel   = a string with informations about the type of data
-//                   which could be needed to be ported to the config macro
-//                   to set up some cuts
-//   - configMacro = macro which configures the analysis; it has *ALWAYS*
-//                   defined inside a function named 'RsnConfigTask()',
-//                   whatever the name of the macro itself, whose first two
-//                   arguments must have to be the task and the 'dataLabel' argument.
-//
-Bool_t AddRsnAnalysisMult
-(
-  const char *options,
-  const char *configs = "RsnConfigNoSA.C RsnConfigSA.C RsnConfigDipNoSA.C RsnConfigDipSA.C",
-  const char *path    = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi"
-)
-{
-  cout << "Entering" << endl;
-  
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  
-  // initialize multiplicity bins
-  Int_t  multMin[6] = {0, 0, 6, 10, 15, 23       };
-  Int_t  multMax[6] = {0, 5, 9, 14, 22, 100000000};
-  
-  // initialize several tasks, each one with different multiplicity cut
-  // and all with the same primary vertex + pile-up cut
-  for (Int_t i = 0; i < 6; i++)
-  {
-    // create the task and connect with physics selection
-    AliRsnAnalysisSE *task = new AliRsnAnalysisSE(Form("RsnAnalysis_%d", i));
-    task->SetZeroEventPercentWarning(100.0);
-    task->SelectCollisionCandidates();
-
-    // add the task to manager
-    mgr->AddTask(task);
-
-    // load and execute all required configuration macroes in the string (arg #2)
-    TString    sList   = configs;
-    TObjArray *list    = sList.Tokenize(" ");
-    Int_t      nConfig = list->GetEntries();
-    Int_t      iConfig = 0;
-    for (iConfig = 0; iConfig < nConfig; iConfig++)
-    {
-      TObjString *ostr = (TObjString*)list->At(iConfig);
-      
-      // the config macro is assumed to be stored in the path in argument #3
-      // and to have three arguments: task name, a free string of options and the path where it is stored
-      // --> all of them is a string, and then it must be passed with the quote marks
-      const char *macro     = ostr->GetString().Data();
-      const char *argName   = Form("\"%s\"", task->GetName());
-      const char *argOption = Form("\"%s\"", options);
-      const char *argPath   = Form("\"%s\"", path);
-      const char *argMult   = Form("%d, %d", multMin[i], multMax[i]);
-      gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s, %s)", path, macro, argName, argOption, argPath, argMult));
-    }
-
-    // connect input container according to source choice
-    mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
-
-    // create paths for the output in the common file
-    Char_t commonPath[500];
-    sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
-
-    // create containers for output
-    AliAnalysisDataContainer *outputInfo = mgr->CreateContainer(Form("RsnInfo_%d", i), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    AliAnalysisDataContainer *outputHist = mgr->CreateContainer(Form("RsnHist_%d", i), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    mgr->ConnectOutput(task, 1, outputInfo);
-    mgr->ConnectOutput(task, 2, outputHist);
-    
-  } // end loop on tasks
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnEfficiency.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnEfficiency.C
deleted file mode 100644 (file)
index b41a2e2..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// This macro add an analysis task for computing efficiency.
-// It will have as output an AliCFContainer with several steps:
-//
-//  0) all resonances in MC which decay in the pair specified
-//  1) subset of (0) whose daughters are in acceptance
-//  2) subset of (1) whose daughters satisfy quality track cuts (covariance, chi square && nTPCclusters)
-//  3) subset of (2) whose daughters satisfy primary track cuts (nsigma to vertex, no kink daughters)
-//  4) subset of (3) whose daughters satisty the BB TPC compatibility cut at 3 sigma
-//
-Bool_t AddRsnEfficiency(const char *dataLabel, const char *path)
-{
-  // load useful macros
-  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
-  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
-  
-  // retrieve analysis manager
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  
-  // create task
-  AliRsnAnalysisEffSE *task1[2], *task2[2];
-  task1[0] = new AliRsnAnalysisEffSE("RsnTaskEffNoSA_1");
-  task1[1] = new AliRsnAnalysisEffSE("RsnTaskEffSA_1");
-  task2[0] = new AliRsnAnalysisEffSE("RsnTaskEffNoSA_2");
-  task2[1] = new AliRsnAnalysisEffSE("RsnTaskEffSA_2");
-  task1[0]->SelectCollisionCandidates();
-  task1[1]->SelectCollisionCandidates();
-  task2[0]->SelectCollisionCandidates();
-  task2[1]->SelectCollisionCandidates();
-
-  // pair definition: 
-  // kstar --> K+ pi- or vice versa
-  AliRsnPairDef *pairKstar1 = new AliRsnPairDef(AliPID::kPion, '+', AliPID::kKaon, '-', 313, 0.896);
-  AliRsnPairDef *pairKstar1 = new AliRsnPairDef(AliPID::kPion, '-', AliPID::kKaon, '+', 313, 0.896);
-  
-  // axis definition
-  // 0) invariant mass
-  // 1) transverse momentum
-  // 2) rapidity
-  // 3) multiplicity
-  Double_t     mult[]   = {0., 6., 10., 15., 23., 100000000.0};
-  Int_t        nmult    = sizeof(mult) / sizeof(mult[0]);
-  AliRsnValue *axisIM   = new AliRsnValue("IM"  , AliRsnValue::kPairInvMass     , 0.9,  1.4, 0.001);
-  AliRsnValue *axisPt   = new AliRsnValue("PT"  , AliRsnValue::kPairPt          , 0.0, 10.0, 0.100);
-  AliRsnValue *axisY    = new AliRsnValue("Y"   , AliRsnValue::kPairY           ,-1.2,  1.2, 0.100);
-  AliRsnValue *axisMult = new AliRsnValue("Mult", AliRsnValue::kEventMultESDCuts, nmult, mult);
-  
-  // initialize the support object: AliESDtrackCuts
-  // configured using the standard values
-  AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
-  axisMult->SetSupportObject(cuts);
-  
-  // define cuts for event selection:
-  // this will determine the filling of bins in the "info" histograms
-  // and should be computed as additional correction factor in efficiency
-  AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
-  cutVertex->SetCheckPileUp(kTRUE);
-  
-  // define standard 2010 track quality/PID cuts:
-  // - first  index: [0] = no PID, [1] = PID
-  // - second index: [0] = no ITS, [1] = ITS
-  AliRsnCutESD2010 *cuts2010[2][2];
-  cuts2010[0][0] = new AliRsnCutESD2010("cutESD2010nopidNoSA");
-  cuts2010[0][1] = new AliRsnCutESD2010("cutESD2010nopidSA");
-  cuts2010[1][0] = new AliRsnCutESD2010("cutESD2010pidNoSA");
-  cuts2010[1][1] = new AliRsnCutESD2010("cutESD2010pidSA");
-  // define Bethe-Bloch parameters (only for MC, since this computes efficiency)
-  Double_t bbPar[5] = {2.15898 / 50.0, 1.75295E1, 3.40030E-9, 1.96178, 3.91720};
-  // since both indexes are 0/1, the boolean settings are done according to them, for clarity
-  for (Int_t ipid = 0; ipid < 2; ipid++)
-  {
-    for (Int_t iits = 0; iits < 2; iits++)
-    {
-      // all work with MC here
-      cuts2010[ipid][iits]->SetMC(kTRUE);
-      
-      // PID reference is kaons
-      cuts2010[ipid][iits]->SetPID(AliPID::kKaon);
-      
-      // all use global tracks
-      cuts2010[ipid][iits]->SetUseITSTPC(kTRUE);
-      
-      // other flags, depend on indexes
-      cuts2010[ipid][iits]->SetUseITSSA((Bool_t)iits);
-      cuts2010[ipid][iits]->SetCheckITS((Bool_t)ipid);
-      cuts2010[ipid][iits]->SetCheckTPC((Bool_t)ipid);
-      cuts2010[ipid][iits]->SetCheckTOF((Bool_t)ipid);
-      
-      // basic quality settings
-      cuts2010[ipid][iits]->CopyCutsTPC(QualityCutsTPC());
-      cuts2010[ipid][iits]->CopyCutsITS(QualityCutsITS());
-      
-      // (unused for No PID) set the ITS PID-related variables
-      cuts2010[ipid][iits]->SetITSband(3.0);
-      
-      // (unused for No PID) set the TPC PID-related variables
-      cuts2010[ipid][iits]->SetTPCrange(3.0, 5.0);
-      cuts2010[ipid][iits]->SetTPCpLimit(0.35);
-      cuts2010[ipid][iits]->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
-      
-      // (unused for No PID) set the TOF PID-related variables
-      cuts2010[ipid][iits]->SetTOFrange(-3.0, 3.0);
-    }
-  }
-
-  // define cut on dip angle:
-  AliRsnCutValue *cutDip = new AliRsnCutValue("cutDip", AliRsnValue::kPairDipAngle, 0.02, 1.01);
-  
-  // define a common path for the output file
-  Char_t commonPath[500];
-  sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
-  
-  // add all the steps
-  // two-folded loop on the two tasks, where one contains the ITS-SA and the other doesn't
-  for (Int_t itask = 0; itask < 2; itask++)
-  {
-    // add pair definition, to choose the checked resonance
-    task1[itask]->AddPairDef(pairKstar1);
-    task2[itask]->AddPairDef(pairKstar2);
-
-    // add the output histogram axis
-    task1[itask]->AddAxis(axisIM);
-    task1[itask]->AddAxis(axisPt);
-    task1[itask]->AddAxis(axisY);
-    task1[itask]->AddAxis(axisMult);
-    task2[itask]->AddAxis(axisIM);
-    task2[itask]->AddAxis(axisPt);
-    task2[itask]->AddAxis(axisY);
-    task2[itask]->AddAxis(axisMult);
-    
-    // add the cut on primary vertex
-    task1[itask]->GetEventCuts()->AddCut(cutVertex);
-    task1[itask]->GetEventCuts()->SetCutScheme(cutVertex->GetName());
-    task2[itask]->GetEventCuts()->AddCut(cutVertex);
-    task2[itask]->GetEventCuts()->SetCutScheme(cutVertex->GetName());
-
-    //
-    // *** STEP 0 - All resonances which decay in the specified pair
-    //
-    // This step does not need any kind of definition, since
-    // its requirement is automatically checked during execution,
-    // but to avoid segfaults, it is better to initialize a cut manager.
-    //
-    AliRsnCutManager *mgr_step0 = new AliRsnCutManager("mc_step0", "");
-    
-    //
-    // *** STEP 1 - All resonances which decay into tracked particles
-    //
-    // This step does not need any kind of definition, since
-    // its requirement is automatically checked during execution,
-    // but to avoid segfaults, it is better to initialize a cut manager.
-    //
-    AliRsnCutManager *mgr_step1 = new AliRsnCutManager("esd_step0", "");
-
-    //
-    // *** STEP 2 - Reconstruction & track quality
-    //
-    // Define a cut on track quality, disabling the PID cuts (first index = [0])
-    //
-    AliRsnCutManager *mgr_step2 = new AliRsnCutManager("esd_step2", "");
-    AliRsnCutSet     *set_step2 = mgr_step2->GetCommonDaughterCuts();
-    
-    set_step2->AddCut(cuts2010[0][itask]);
-    set_step2->SetCutScheme(cuts2010[0][itask]->GetName());
-    
-    //
-    // *** STEP 3 - PID
-    //
-    // Define a cut on track quality, enabling the PID cuts (first index = [1])
-    //
-    AliRsnCutManager *mgr_step3 = new AliRsnCutManager("esd_step3", "");
-    AliRsnCutSet     *set_step3 = mgr_step3->GetCommonDaughterCuts();
-    
-    set_step3->AddCut(cuts2010[1][itask]);
-    set_step3->SetCutScheme(cuts2010[1][itask]->GetName());
-
-    //
-    // *** STEP 4 - Dip angle
-    //
-    // Add a cut on the pair dip angle
-    //
-    AliRsnCutManager *mgr_step4 = new AliRsnCutManager("esd_step4", "");
-    AliRsnCutSet     *set_step4 = mgr_step4->GetMotherCuts();
-    
-    set_step4->AddCut(cutDip);
-    set_step4->SetCutScheme(Form("%s", cutDip->GetName()));
-    
-    // add all steps to the task:
-    // - first step computed on MC
-    // - all other steps computed on reconstruction
-    task1[itask]->AddStepMC (mgr_step0);
-    task1[itask]->AddStepESD(mgr_step1);
-    task1[itask]->AddStepESD(mgr_step2);
-    task1[itask]->AddStepESD(mgr_step3);
-    task1[itask]->AddStepESD(mgr_step4);
-    task2[itask]->AddStepMC (mgr_step0);
-    task2[itask]->AddStepESD(mgr_step1);
-    task2[itask]->AddStepESD(mgr_step2);
-    task2[itask]->AddStepESD(mgr_step3);
-    task2[itask]->AddStepESD(mgr_step4);
-    
-    // add the task to the manager and connect to input
-    mgr->AddTask(task1[itask]);
-    mgr->AddTask(task2[itask]);
-    mgr->ConnectInput(task1[itask], 0, mgr->GetCommonInputContainer());
-    mgr->ConnectInput(task2[itask], 0, mgr->GetCommonInputContainer());
-    
-    // create paths for the output in the common file
-    TString infoname1(task1[itask]->GetName()), infoname2(task2[itask]->GetName());
-    TString histname1(task1[itask]->GetName()), histname2(task2[itask]->GetName());
-    infoname1.ReplaceAll("TaskEff", "Info");
-    histname1.ReplaceAll("TaskEff", "Hist");
-    infoname2.ReplaceAll("TaskEff", "Info");
-    histname2.ReplaceAll("TaskEff", "Hist");
-    AliAnalysisDataContainer *outputInfo1 = mgr->CreateContainer(infoname1.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    AliAnalysisDataContainer *outputHist1 = mgr->CreateContainer(histname1.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    AliAnalysisDataContainer *outputInfo2 = mgr->CreateContainer(infoname2.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    AliAnalysisDataContainer *outputHist2 = mgr->CreateContainer(histname2.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
-    mgr->ConnectOutput(task1[itask], 1, outputInfo1);
-    mgr->ConnectOutput(task1[itask], 2, outputHist1);
-    mgr->ConnectOutput(task2[itask], 1, outputInfo2);
-    mgr->ConnectOutput(task2[itask], 2, outputHist2);
-  }
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsITS.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsITS.C
deleted file mode 100644 (file)
index c67a23f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// This macro is defined in order to have a unique point
-// where the standard cuts are configured, in order to be sure
-// that all common parts of the cuts will be defined coherently
-//
-void ConfigESDCutsITS(AliESDtrackCuts * &cuts)
-{
-  // general acceptance/pt cuts
-  cuts->SetPtRange ( 0.15, 10.00);
-  cuts->SetEtaRange(-0.80,  0.80);
-  
-  // DCA cuts
-  // old cuts->SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.3");
-  cuts->SetMaxDCAToVertexXYPtDep("0.02289+0.03136/pt^1.3");
-  cuts->SetMaxDCAToVertexZ(2.0);
-  cuts->SetDCAToVertex2D(kFALSE);
-  cuts->SetRequireSigmaToVertex(kFALSE);
-  
-  // ITS related cuts for TPC+ITS tracks
-  cuts->SetRequireITSStandAlone(kTRUE);
-  cuts->SetRequireITSPureStandAlone(kFALSE);
-  cuts->SetRequireITSRefit(kTRUE); 
-  cuts->SetMinNClustersITS(4);
-  cuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
-  cuts->SetMaxChi2PerClusterITS(3.0);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsTPC.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsTPC.C
deleted file mode 100644 (file)
index f3ebefd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// This macro is defined in order to have a unique point
-// where the standard cuts are configured, in order to be sure
-// that all common parts of the cuts will be defined coherently
-//
-void ConfigESDCutsTPC(AliESDtrackCuts * &cuts)
-{
-  // general acceptance/pt cuts
-  cuts->SetPtRange ( 0.15, 1.0e+10);
-  cuts->SetEtaRange(-0.8 , 0.8);
-  
-  // DCA cuts
-  cuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
-  cuts->SetMaxDCAToVertexZ(2.0);
-  cuts->SetDCAToVertex2D(kFALSE);
-  cuts->SetRequireSigmaToVertex(kFALSE);
-  
-  // TPC related cuts for TPC+ITS tracks
-  cuts->SetMinNClustersTPC(70);
-  cuts->SetMaxChi2PerClusterTPC(4);
-  cuts->SetAcceptKinkDaughters(kFALSE);
-  cuts->SetRequireTPCRefit(kTRUE);
-  
-  // ITS related cuts for TPC+ITS tracks
-  cuts->SetRequireITSRefit(kTRUE);
-  cuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C
deleted file mode 100644 (file)
index b9161ad..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
-#include <TROOT.h>
-#include <TString.h>
-#include <AliAnalysisManager.h>
-#include <AliRsnAnalysisSE.h>
-#include <AliRsnCutESD2010.h>
-#include <AliRsnCutValue.h>
-#include <AliRsnPairFunctions.h>
-#include <AliRsnFunction.h>
-#include <AliRsnCutPrimaryVertex.h>
-
-#include "config/QualityCutsITS.C"
-#include "config/QualityCutsTPC.C"
-*/
-
-//
-// This function configures the entire task for all resonances the user is interested in.
-// This is done by creating all configuration objects which are defined in the package.
-//
-// Generally speaking, one has to define the following objects for each resonance:
-//
-//  1 - an AliRsnPairDef to define the resonance decay channel to be studied
-//  2 - an AliRsnPair{Ntuple|Functions} where the output is stored
-//  3 - one or more AliRsnCut objects to define track selections
-//      which will have then to be organized into AliRsnCutSet objects
-//  4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
-//  5 - definitions to build the TNtuple or histograms which are returned
-//
-// The return value is used to know if the configuration was successful
-//
-Bool_t RsnConfig
-(
-  const char *taskName, 
-  const char *options,
-  const char *config,
-  const char *path,
-  Int_t       multMin = 0,
-  Int_t       multMax = 0
-)
-{
-  // load useful macros
-  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
-  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
-  
-  // interpret the useful information from second argument
-  TString opt(options);
-  Bool_t isSim  = opt.Contains("sim");
-  Bool_t isData = opt.Contains("data");
-  if (!isSim && !isData)
-  {
-    Error("RsnConfig", "Required to know if working on data or MC");
-    return kFALSE;
-  }
-  
-  // interpret the specific info from third argument
-  // which should be fixed in the various calls to this function
-  TString conf(config);
-  Bool_t addPID    = conf.Contains("pid");
-  Bool_t addITSSA  = conf.Contains("its");
-  Bool_t addDipCut = conf.Contains("dip");
-      
-  // generate a common suffix depending on chosen options
-  TString suffix;
-  if (addPID)    suffix += "_pid";
-  if (addITSSA)  suffix += "_its";
-  if (addDipCut) suffix += "_dip";
-  Info("RsnConfig", "=== Specific configuration: %s ====================================================", config);
-  Info("RsnConfig", "=== suffix used           : %s ====================================================", suffix.Data());
-
-  // retrieve analysis manager & task
-  AliAnalysisManager *mgr  = AliAnalysisManager::GetAnalysisManager();
-  AliRsnAnalysisSE   *task = (AliRsnAnalysisSE*)mgr->GetTask(taskName);
-
-  // for safety, return if no task is passed
-  if (!task)
-  {
-    Error("RsnConfig2010PhiFcn", "Task not found");
-    return kFALSE;
-  }
-  
-  //
-  // -- Setup event cuts (added directly to task) ---------------------------------------------------
-  //
-  
-  // define a common cut on primary vertex, which also checks pile-up
-  AliRsnCutPrimaryVertex *cutVertex  = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
-  cutVertex->SetCheckPileUp(kTRUE);
-  task->GetEventCuts()->AddCut(cutVertex);
-  
-  // if at least one of last two arguments is not zero, 
-  // add a multiplicity cut using those arguments as range limits
-  if (multMin > 0 || multMax > 0)
-  {
-    ::Info("RsnConfig.C", "Adding multiplicity cut: %d --> %d", multMin, multMax);
-    AliRsnCutValue *cutMult = new AliRsnCutValue(Form("cutMult_%d-%d", multMin, multMax), AliRsnValue::kEventMultESDCuts, (Double_t)multMin, (Double_t)multMax);
-    
-    // initialize the support object: AliESDtrackCuts
-    // configured using the standard values
-    AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
-    cutMult->GetValueObj()->SetSupportObject(cuts);
-    
-    // add the cut and set the cut string
-    task->GetEventCuts()->AddCut(cutMult);
-    task->GetEventCuts()->SetCutScheme(Form("cutVertex&%s", cutMult->GetName()));
-  }
-  else
-  {
-    // if no mult cut is added, only primary vertex cut is used
-    task->GetEventCuts()->SetCutScheme("cutVertex");
-  }
-
-  //
-  // -- Setup pairs ---------------------------------------------------------------------------------
-  //
-
-  // decay channels
-  AliRsnPairDef *pairDefPM = new AliRsnPairDef(AliPID::kPion, '+', AliPID::kKaon, '-', 313, 0.896);
-  AliRsnPairDef *pairDefMP = new AliRsnPairDef(AliPID::kPion, '-', AliPID::kKaon, '+', 313, 0.896);
-  AliRsnPairDef *pairDefPP = new AliRsnPairDef(AliPID::kPion, '+', AliPID::kKaon, '+', 313, 0.896);
-  AliRsnPairDef *pairDefMM = new AliRsnPairDef(AliPID::kPion, '-', AliPID::kKaon, '-', 313, 0.896);
-
-  // computation objects
-  AliRsnPairFunctions *pairPM = new AliRsnPairFunctions(Form("PairPM%s", suffix.Data()), pairDefPM);
-  AliRsnPairFunctions *pairMP = new AliRsnPairFunctions(Form("PairMP%s", suffix.Data()), pairDefMP);
-  AliRsnPairFunctions *truePM = new AliRsnPairFunctions(Form("TruePM%s", suffix.Data()), pairDefPM);
-  AliRsnPairFunctions *trueMP = new AliRsnPairFunctions(Form("TrueMP%s", suffix.Data()), pairDefMP);
-  AliRsnPairFunctions *pairPP = new AliRsnPairFunctions(Form("PairPP%s", suffix.Data()), pairDefPP);
-  AliRsnPairFunctions *pairMM = new AliRsnPairFunctions(Form("PairMM%s", suffix.Data()), pairDefMM);
-
-  //
-  // -- Setup cuts ----------------------------------------------------------------------------------
-  //
-
-  // track cut -----------------------
-  // --> global cuts for 2010 analysis
-  // --> most options are set to right values by default
-  // --> second argument in constructor tells if we are working in simulation or not
-  AliRsnCutESD2010 *cuts2010_kaon = new AliRsnCutESD2010(Form("cuts2010%s_kaon", suffix.Data()), isSim);
-  AliRsnCutESD2010 *cuts2010_pion = new AliRsnCutESD2010(Form("cuts2010%s_pion", suffix.Data()), isSim);
-  // --> set the reference particle for PID
-  cuts2010_kaon->SetPID(AliPID::kKaon);
-  cuts2010_pion->SetPID(AliPID::kPion);
-  // --> include or not the ITS standalone (TPC is always in)
-  cuts2010_kaon->SetUseITSTPC(kTRUE);
-  cuts2010_pion->SetUseITSTPC(kTRUE);
-  cuts2010_kaon->SetUseITSSA (addITSSA);
-  cuts2010_pion->SetUseITSSA (addITSSA);
-  // --> set the quality cuts using the general macro and using the 'Copy()' method in AliESDtrackCuts
-  cuts2010_kaon->CopyCutsTPC(QualityCutsTPC());
-  cuts2010_pion->CopyCutsTPC(QualityCutsTPC());
-  cuts2010_kaon->CopyCutsITS(QualityCutsITS());
-  cuts2010_pion->CopyCutsITS(QualityCutsITS());
-  // --> set values for PID flags, depending on the choice expressed in the options
-  cuts2010_kaon->SetCheckITS(addPID);
-  cuts2010_kaon->SetCheckTPC(addPID);
-  cuts2010_kaon->SetCheckTOF(addPID);
-  cuts2010_pion->SetCheckITS(addPID);
-  cuts2010_pion->SetCheckTPC(addPID);
-  cuts2010_pion->SetCheckTOF(addPID);
-  // --> set the ITS PID-related variables
-  cuts2010_kaon->SetITSband(3.0);
-  cuts2010_pion->SetITSband(3.0);
-  // --> set the TPC PID-related variables
-  Double_t bbPar[5];
-  if (isSim)
-  {
-    bbPar[0] = 2.15898 / 50.0;
-    bbPar[1] = 1.75295E1;
-    bbPar[2] = 3.40030E-9;
-    bbPar[3] = 1.96178;
-    bbPar[4] = 3.91720;
-  }
-  else
-  {
-    bbPar[0] = 1.41543 / 50.0;
-    bbPar[1] = 2.63394E1;
-    bbPar[2] = 5.0411E-11;
-    bbPar[3] = 2.12543;
-    bbPar[4] = 4.88663;
-  }
-  cuts2010_kaon->SetTPCrange(3.0, 5.0);
-  cuts2010_kaon->SetTPCpLimit(0.35);
-  cuts2010_kaon->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
-  cuts2010_pion->SetTPCrange(3.0, 5.0);
-  cuts2010_pion->SetTPCpLimit(0.35);
-  cuts2010_pion->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
-  // --> set the TOF PID-related variables
-  cuts2010_kaon->SetTOFrange(-3.0, 3.0);
-  cuts2010_pion->SetTOFrange(-3.0, 3.0);
-  
-  // pair cut ----------------------------------------
-  // --> dip angle between daughters: (it is a cosine)
-  AliRsnCutValue *cutDip = new AliRsnCutValue("cutDip", AliRsnValue::kPairDipAngle, 0.02, 1.01);
-
-  // setup cut set for tracks------------------------------------------------------------
-  // --> apply pion cuts to daughter #1
-  pairPM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  pairMP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  truePM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  trueMP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  pairPP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  pairMM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010_pion);
-  pairPM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  pairMP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  truePM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  trueMP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  pairPP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  pairMM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010_pion->GetName());
-  // --> apply kaon cuts to daughter #2
-  pairPM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  pairMP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  truePM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  trueMP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  pairPP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  pairMM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010_kaon);
-  pairPM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  pairMP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  truePM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  trueMP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  pairPP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  pairMM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010_kaon->GetName());
-  
-  // cut set for pairs---------------------
-  // --> add dip angle cut only if required
-  if (addDipCut)
-  {
-    pairPM->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    truePM->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    pairMP->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    trueMP->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    pairPP->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    pairMM->GetCutManager()->GetMotherCuts()->AddCut(cutDip);
-    
-    pairPM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-    truePM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-    pairMP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-    trueMP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-    pairPP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-    pairMM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutDip->GetName());
-  }
-  
-  // set additional option for true pairs
-  truePM->SetOnlyTrue  (kTRUE);
-  trueMP->SetOnlyTrue  (kTRUE);
-  truePM->SetCheckDecay(kTRUE);
-  trueMP->SetCheckDecay(kTRUE);
-
-  //
-  // -- Setup functions -----------------------------------------------------------------------------
-  //
-
-  // axis definition
-  // 0) invariant mass
-  // 1) transverse momentum
-  // 2) rapidity
-  AliRsnValue *axisIM = new AliRsnValue("IM", AliRsnValue::kPairInvMass,  0.9,  1.3, 0.001);
-  AliRsnValue *axisPt = new AliRsnValue("PT", AliRsnValue::kPairPt     ,  0.0, 10.0, 0.100);
-  AliRsnValue *axisY  = new AliRsnValue("Y" , AliRsnValue::kPairY      , -1.1,  1.1, 0.100);
-
-  // create function and add axes
-  AliRsnFunction *fcn = new AliRsnFunction;
-  if ( !fcn->AddAxis(axisIM  ) ) return kFALSE;
-  if ( !fcn->AddAxis(axisPt  ) ) return kFALSE;
-  if ( !fcn->AddAxis(axisY   ) ) return kFALSE;
-
-  // add functions to pairs
-  pairPM->AddFunction(fcn);
-  truePM->AddFunction(fcn);
-  pairMP->AddFunction(fcn);
-  trueMP->AddFunction(fcn);
-  pairPP->AddFunction(fcn);
-  pairMM->AddFunction(fcn);
-
-  //
-  // -- Conclusion ----------------------------------------------------------------------------------
-  //
-
-  // add all created AliRsnPair objects to the AliRsnAnalysisManager in the task
-  task->GetAnalysisManager()->Add(pairPM);
-  task->GetAnalysisManager()->Add(pairMP);
-  task->GetAnalysisManager()->Add(pairPP);
-  task->GetAnalysisManager()->Add(pairMM);
-  if (isSim) 
-  {
-    task->GetAnalysisManager()->Add(truePM);
-    task->GetAnalysisManager()->Add(trueMP);
-  }
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipNoSA.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipNoSA.C
deleted file mode 100644 (file)
index 957e610..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Configuration: (see loaded macro for details)
-//
-// - PID: realistic (full)
-// - ITS: not included
-// - dip: included
-//
-Bool_t RsnConfigDipNoSA(const char *taskName, const char *options, const char *path, Int_t multMin = 0, Int_t multMax = 0)
-{
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfig.C");
-  return RsnConfig(taskName, options, "pid+dip", path, multMin, multMax);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipSA.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipSA.C
deleted file mode 100644 (file)
index 16c5cd2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Configuration: (see loaded macro for details)
-//
-// - PID: realistic (full)
-// - ITS: included
-// - dip: included
-//
-Bool_t RsnConfigDipSA(const char *taskName, const char *options, const char *path, Int_t multMin = 0, Int_t multMax = 0)
-{
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfig.C");
-  return RsnConfig(taskName, options, "pid+its+dip", path, multMin, multMax);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigMC.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigMC.C
deleted file mode 100644 (file)
index 7e8e9f9..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// This function configures the entire task for all resonances the user is interested in.
-// This is done by creating all configuration objects which are defined in the package.
-//
-// Generally speaking, one has to define the following objects for each resonance:
-//
-//  1 - an AliRsnPairDef to define the resonance decay channel to be studied
-//  2 - an AliRsnPair{Ntuple|Functions} where the output is stored
-//  3 - one or more AliRsnCut objects to define track selections
-//      which will have then to be organized into AliRsnCutSet objects
-//  4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
-//  5 - definitions to build the TNtuple or histograms which are returned
-//
-// The return value is used to know if the configuration was successful
-//
-Bool_t RsnConfigMC(const char *taskName, const char *options)
-{
-  // info
-  Info("RsnConfig2010PhiFcnMC", "Starting configuration");
-
-  // retrieve analysis manager & task
-  AliAnalysisManager *mgr  = AliAnalysisManager::GetAnalysisManager();
-  AliRsnAnalysisSE   *task = (AliRsnAnalysisSE*)mgr->GetTask(taskName);
-
-  // for safety, return if no task is passed
-  if (!task)
-  {
-    Error("ConfigTaskRsn", "Task not found");
-    return kFALSE;
-  }
-
-  // interpret the useful information from second argument
-  TString opt(options);
-  Bool_t isMC    = opt.Contains("MC");
-  Bool_t isSim   = opt.Contains("sim");
-  Bool_t isData  = opt.Contains("data");
-  Bool_t isPass1 = opt.Contains("pass1");
-  Bool_t isPass2 = opt.Contains("pass2");
-  if (!isMC)
-  {
-    Info("RsnConfig2010PhiFcnMC", "Config skipped for not pure MonteCarlo samples");
-    return kTRUE;
-  }
-
-  //
-  // -- Setup pairs ---------------------------------------------------------------------------------
-  //
-
-  // decay channels
-  AliRsnPairDef *pairDefPM = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '-', 333, 1.019455);
-  AliRsnPairDef *pairDefPP = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '+', 333, 1.019455);
-  AliRsnPairDef *pairDefMM = new AliRsnPairDef(AliPID::kKaon, '-', AliPID::kKaon, '-', 333, 1.019455);
-
-  // computation objects
-  AliRsnPairFunctions *pairPM = new AliRsnPairFunctions("PairPM_mc", pairDefPM);
-  AliRsnPairFunctions *truePM = new AliRsnPairFunctions("TruePM_mc", pairDefPM);
-  AliRsnPairFunctions *pairPP = new AliRsnPairFunctions("PairPP_mc", pairDefPP);
-  AliRsnPairFunctions *pairMM = new AliRsnPairFunctions("PairMM_mc", pairDefMM);
-
-  //
-  // -- Setup cuts ----------------------------------------------------------------------------------
-  //
-
-  // track cut -----------------------------
-  // --> perfect PID for check of PID issues
-  AliRsnCutPID *cutPID = new AliRsnCutPID("cutPID", AliPID::kKaon, 0.0, kTRUE);
-
-  // cut sets ---------------------------------
-  // --> only common cuts for tracks are needed
-  // --> standard 2010 cuts are applied only when working on ESD
-  AliRsnCutSet *cutSetDaughterCommon = new AliRsnCutSet("commonDaughterCuts", AliRsnCut::kDaughter);
-  cutSetDaughterCommon->AddCut(cutPID);
-  cutSetDaughterCommon->SetCutScheme("cutPID");
-  cout << "Cut scheme: " << cutSetDaughterCommon->GetCutScheme() << endl;
-
-  // configure cut managers -------------------
-  pairPM->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
-  truePM->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
-  pairPP->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
-  pairMM->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
-
-  // set additional option for true pairs when needed
-  truePM->SetOnlyTrue  (kTRUE);
-  truePM->SetCheckDecay(kTRUE);
-
-  //
-  // -- Setup functions -----------------------------------------------------------------------------
-  //
-
-  // function axes
-  Double_t y[] = {-0.8, -0.7, -0.6, -0.5, 0.5, 0.6, 0.7, 0.8};
-  Int_t    ny  = sizeof(y) / sizeof(y[0]);
-  AliRsnValue *axisIM = new AliRsnValue("IM", AliRsnValue::kPairInvMass, 2000, 0.9,  2.9);
-  AliRsnValue *axisPt = new AliRsnValue("PT", AliRsnValue::kPairPt,       100, 0.0, 10.0);
-  AliRsnValue *axisY  = new AliRsnValue("Y" , AliRsnValue::kPairY,         ny, y);
-
-  // create function and add axes
-  AliRsnFunction *fcnImPtY = new AliRsnFunction;
-  fcnImPtY->AddAxis(axisIM);
-  fcnImPtY->AddAxis(axisPt);
-  fcnImPtY->AddAxis(axisY);
-
-  // add functions to pairs
-  pairPM->AddFunction(fcnImPtY);
-  truePM->AddFunction(fcnImPtY);
-  pairPP->AddFunction(fcnImPtY);
-  pairMM->AddFunction(fcnImPtY);
-
-  //
-  // -- Conclusion ----------------------------------------------------------------------------------
-  //
-
-  // add all created AliRsnPair objects to the AliRsnAnalysisManager in the task
-  task->GetAnalysisManager()->Add(pairPM);
-  task->GetAnalysisManager()->Add(pairPP);
-  task->GetAnalysisManager()->Add(pairMM);
-  task->GetAnalysisManager()->Add(truePM);
-
-  return kTRUE;
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigNoSA.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigNoSA.C
deleted file mode 100644 (file)
index c2a0fcf..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Configuration: (see loaded macro for details)
-//
-// - PID: realistic (full)
-// - ITS: not included
-// - dip: not included
-//
-Bool_t RsnConfigNoSA(const char *taskName, const char *options, const char *path, Int_t multMin = 0, Int_t multMax = 0)
-{
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfig.C");
-  return RsnConfig(taskName, options, "pid", path, multMin, multMax);
-}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigSA.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigSA.C
deleted file mode 100644 (file)
index 6897d5e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Configuration: (see loaded macro for details)
-//
-// - PID: realistic (full)
-// - ITS: included
-// - dip: not included
-//
-Bool_t RsnConfigSA(const char *taskName, const char *options, const char *path, Int_t multMin = 0, Int_t multMax = 0)
-{
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfig.C");
-  return RsnConfig(taskName, options, "pid+its", path, multMin, multMax);
-}
similarity index 51%
rename from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMC.C
rename to PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisKStar.C
index 571214d1bf29f4c16dc2efdfffa809dfda6accdc..d45f4b2df3743ea1866d62a9246f72c3c15e24f8 100644 (file)
 //                   whatever the name of the macro itself, whose first two
 //                   arguments must have to be the task and the 'dataLabel' argument.
 //
 //                   whatever the name of the macro itself, whose first two
 //                   arguments must have to be the task and the 'dataLabel' argument.
 //
-Bool_t AddAnalysisTaskRsn
+Bool_t AddRsnAnalysisKStar
 (
 (
-  const char *options,
-  const char *configs = "RsnConfig2010PhiFcnRealisticNoSA.C \
-                         RsnConfig2010PhiFcnRealisticWithSA.C \
-                         RsnConfig2010PhiFcnRealisticDipNoSA.C \
-                         RsnConfig2010PhiFcnRealisticDipWithSA.C"
+  const char *options     = "", 
+  const char *taskName    = "RsnAnalysis",
+  const char *configMacro = "RsnConfigKStar",
+  const char *configPath  = "$(ALICE_INSTALL)/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV"
 )
 {
   // retrieve analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
 )
 {
   // retrieve analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-
-  // interpret config string
-  TString strDataLabel(options);
-  Bool_t isSim = strDataLabel.Contains("sim");
-  Bool_t isMC  = strDataLabel.Contains("MC");
-
-  // initialize task with all available slots, even if not all of them will be used:
-  AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
+    
+  // create the task and connect with physics selection
+  AliRsnAnalysisSE *task = new AliRsnAnalysisSE(taskName);
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
-  if (isMC) task->SetMCOnly(kTRUE);
-
-  // if not MC kinematics, set cuts for events : primary vertex range and type
-  if (!isMC)
-  {
-    AliRsnCutPrimaryVertex *cutVertex   = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
-    task->GetEventCuts()->AddCut(cutVertex);
-    task->GetEventCuts()->SetCutScheme("cutVertex");
-  }
 
   // add the task to manager
   mgr->AddTask(task);
 
   // add the task to manager
   mgr->AddTask(task);
-
-  // load and execute configuration macroes
-  TString    sList(configs);
-  TObjArray *list = sList.Tokenize(" ");
-  Int_t nConfig = list->GetEntries();
-  Int_t iConfig = 0;
-  for (iConfig = 0; iConfig < nConfig; iConfig++)
-  {
-    TObjString *ostr = (TObjString*)list->At(iConfig);
-    cout << "***** Processing config macro '" << ostr->GetString().Data() << endl;
-    gROOT->ProcessLine(Form(".x %s(\"%s\",\"%s\")", ostr->GetString().Data(), task->GetName(), options));
-  }
-
+  
+  // execute the related config with settings for adding and not adding ITS-SA
+  gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, options                , configPath));
+  gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, Form("its+%s", options), configPath));
+  
   // connect input container according to source choice
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
 
   // connect input container according to source choice
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
 
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisPhi.C b/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisPhi.C
new file mode 100644 (file)
index 0000000..be2749d
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// This macro serves to add the RSN analysis task to the steering macro.
+//
+// Inputs:
+//   - dataLabel   = a string with informations about the type of data
+//                   which could be needed to be ported to the config macro
+//                   to set up some cuts
+//   - configMacro = macro which configures the analysis; it has *ALWAYS*
+//                   defined inside a function named 'RsnConfigTask()',
+//                   whatever the name of the macro itself, whose first two
+//                   arguments must have to be the task and the 'dataLabel' argument.
+//
+Bool_t AddRsnAnalysisPhi
+(
+  const char *options     = "", 
+  const char *taskName    = "RsnAnalysis",
+  const char *configMacro = "RsnConfigPhi",
+  const char *configPath  = "$(ALICE_INSTALL)/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV"
+)
+{
+  // retrieve analysis manager
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+    
+  // create the task and connect with physics selection
+  AliRsnAnalysisSE *task = new AliRsnAnalysisSE(taskName);
+  task->SetZeroEventPercentWarning(100.0);
+  task->SelectCollisionCandidates();
+
+  // add the task to manager
+  mgr->AddTask(task);
+  
+  // execute the related config with settings for adding and not adding ITS-SA
+  gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, options                , configPath));
+  gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, Form("its+%s", options), configPath));
+  
+  // connect input container according to source choice
+  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
+
+  // create paths for the output in the common file
+  Char_t commonPath[500];
+  sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
+
+  // create containers for output
+  AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
+  AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
+  mgr->ConnectOutput(task, 1, outputInfo);
+  mgr->ConnectOutput(task, 2, outputHist);
+
+  return kTRUE;
+}
similarity index 83%
rename from PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysis.C
rename to PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisPhiRes.C
index 38c0493d92cecba7a31fb066d1d486ba3f9867da..126bbaf58f85e414eb9d442cff6e04eba141907b 100644 (file)
 //                   whatever the name of the macro itself, whose first two
 //                   arguments must have to be the task and the 'dataLabel' argument.
 //
 //                   whatever the name of the macro itself, whose first two
 //                   arguments must have to be the task and the 'dataLabel' argument.
 //
-Bool_t AddRsnAnalysis
+Bool_t AddRsnAnalysisRes
 (
   const char *options,
 (
   const char *options,
-  const char *configs = "RsnConfigNoSA.C RsnConfigSA.C RsnConfigDipNoSA.C RsnConfigDipSA.C",
-  const char *path    = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi"
+  const char *configs = "RsnConfigResNoSA.C RsnConfigResSA.C",
+  const char *path    = "$(ALICE_INSTALL)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/fixed_rapidity"
 )
 )
-{  
+{
+  // retrieve analysis manager
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+    
   // create the task and connect with physics selection
   // create the task and connect with physics selection
-  AliRsnAnalysisSE *task = new AliRsnAnalysisSE(Form("RsnAnalysis_%d", i));
+  AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
 
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
 
@@ -41,7 +44,7 @@ Bool_t AddRsnAnalysis
     const char *argName   = Form("\"%s\"", task->GetName());
     const char *argOption = Form("\"%s\"", options);
     const char *argPath   = Form("\"%s\"", path);
     const char *argName   = Form("\"%s\"", task->GetName());
     const char *argOption = Form("\"%s\"", options);
     const char *argPath   = Form("\"%s\"", path);
-    gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s,0,0)", path, macro, argName, argOption, argPath));
+    gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", path, macro, argName, argOption, argPath));
   }
 
   // connect input container according to source choice
   }
 
   // connect input container according to source choice
@@ -56,6 +59,6 @@ Bool_t AddRsnAnalysis
   AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
   mgr->ConnectOutput(task, 1, outputInfo);
   mgr->ConnectOutput(task, 2, outputHist);
   AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
   mgr->ConnectOutput(task, 1, outputInfo);
   mgr->ConnectOutput(task, 2, outputHist);
-    
+
   return kTRUE;
 }
   return kTRUE;
 }
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigKStar.C b/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigKStar.C
new file mode 100644 (file)
index 0000000..be95877
--- /dev/null
@@ -0,0 +1,282 @@
+//
+// This function configures the entire task for all resonances the user is interested in.
+// This is done by creating all configuration objects which are defined in the package.
+//
+// Generally speaking, one has to define the following objects for each resonance:
+//
+//  1 - an AliRsnPairDef to define the resonance decay channel to be studied
+//  2 - an AliRsnPair{Ntuple|Functions} where the output is stored
+//  3 - one or more AliRsnCut objects to define track selections
+//      which will have then to be organized into AliRsnCutSet objects
+//  4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
+//  5 - definitions to build the TNtuple or histograms which are returned
+//
+// The return value is used to know if the configuration was successful
+//
+Bool_t RsnConfigKStar
+(
+  const char *taskName, 
+  const char *options,
+  const char *path
+)
+{
+  // retrieve analysis manager & task and exit in case of failure
+  AliAnalysisManager *mgr  = AliAnalysisManager::GetAnalysisManager();
+  AliRsnAnalysisSE   *task = (AliRsnAnalysisSE*)mgr->GetTask(taskName);
+  if (!task)
+  {
+    Error("RsnConfigPhi", "Task not found");
+    return kFALSE;
+  }
+  
+  // load useful macros
+  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
+  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
+  
+  // interpret the useful information from second argument
+  TString opt(options);
+  TString suffix("_pid");
+  Bool_t isSim    = opt.Contains("sim");
+  Bool_t isData   = opt.Contains("data");
+  Bool_t addITSSA = opt.Contains("its");
+  if (!isSim && !isData)
+  {
+    Error("RsnConfigPhi", "Required to know if working on data or MC");
+    return kFALSE;
+  }
+  if (addITSSA) suffix += "_its";
+  
+  // define some names using a standard part plus the above suffix
+  TString pairPMname(suffix);
+  TString pairMPname(suffix);
+  TString truePMname(suffix);
+  TString trueMPname(suffix);
+  TString pairPPname(suffix);
+  TString pairMMname(suffix);
+  TString esdCutName(suffix);
+  pairPMname.Prepend("PairPM");
+  pairMPname.Prepend("PairMP");
+  truePMname.Prepend("TruePM");
+  trueMPname.Prepend("TrueMP");
+  pairPPname.Prepend("PairPP");
+  pairMMname.Prepend("PairMM");
+  esdCutName.Prepend("cutESD2010");
+  
+  //
+  // -- Setup pair definition (phi decay trees)  and pairs ------------------------------------------
+  //
+
+  // decay channels
+  AliRsnPairDef *pairDefPM = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kPion, '-', 313, 0.896);
+  AliRsnPairDef *pairDefMP = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kPion, '-', 313, 0.896);
+  AliRsnPairDef *pairDefPP = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kPion, '+', 313, 0.896);
+  AliRsnPairDef *pairDefMM = new AliRsnPairDef(AliPID::kKaon, '-', AliPID::kPion, '-', 313, 0.896);
+
+  // computation objects
+  AliRsnPairFunctions *pairPM = new AliRsnPairFunctions(pairPMname.Data(), pairDefPM);
+  AliRsnPairFunctions *pairMP = new AliRsnPairFunctions(pairMPname.Data(), pairDefMP);
+  AliRsnPairFunctions *truePM = new AliRsnPairFunctions(truePMname.Data(), pairDefPM);
+  AliRsnPairFunctions *trueMP = new AliRsnPairFunctions(trueMPname.Data(), pairDefMP);
+  AliRsnPairFunctions *pairPP = new AliRsnPairFunctions(pairPPname.Data(), pairDefPP);
+  AliRsnPairFunctions *pairMM = new AliRsnPairFunctions(pairMMname.Data(), pairDefMM);
+  
+  // set additional option for true pairs
+  truePM->SetOnlyTrue  (kTRUE);
+  truePM->SetCheckDecay(kTRUE);
+  trueMP->SetOnlyTrue  (kTRUE);
+  trueMP->SetCheckDecay(kTRUE);
+  
+  //
+  // -- Setup event cuts ----------------------------------------------------------------------------
+  //
+  
+  // cut on primary vertex:
+  // - 2nd argument = 10.0     --> require |Vz| <= 10 cm
+  // - 3rd argument = 0        --> disable check on number of contributors
+  // - 4th argument = 'kFALSE' --> reject TPC stand-alone primary vertex
+  AliRsnCutPrimaryVertex *cutVertex  = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
+  
+  // check pile-up with SPD
+  cutVertex->SetCheckPileUp(kTRUE);
+
+  //
+  // -- Setup single track cuts ---------------------------------------------------------------------
+  //
+  
+  // set Bethe-Bloch parameterizations
+  // that depend on the sample
+  Double_t bbPar[5];
+  if (isSim)
+  {
+    bbPar[0] = 2.15898 / 50.0;
+    bbPar[1] = 1.75295E1;
+    bbPar[2] = 3.40030E-9;
+    bbPar[3] = 1.96178;
+    bbPar[4] = 3.91720;
+  }
+  else
+  {
+    bbPar[0] = 1.41543 / 50.0;
+    bbPar[1] = 2.63394E1;
+    bbPar[2] = 5.0411E-11;
+    bbPar[3] = 2.12543;
+    bbPar[4] = 4.88663;
+  }
+
+  // cut on track quality/PID:
+  // 2nd argument (variable) --> 'kTRUE' for MonteCarlo, 'kFALSE' for data
+  AliRsnCutESD2010 *cuts2010[2];
+  cuts2010[0] = new AliRsnCutESD2010(esdCutName.Data(), isSim);
+  cuts2010[1] = new AliRsnCutESD2010(esdCutName.Data(), isSim);
+  
+  // specify that PID is for kaons or pions
+  cuts2010[0]->SetPID(AliPID::kKaon);
+  cuts2010[1]->SetPID(AliPID::kPion);
+  
+  // other specifications are common
+  for (Int_t i = 0; i < 2; i++)
+  {
+    // TPC+ITS tracks are always added, ITS-SA depends on options
+    cuts2010[i]->SetUseITSTPC(kTRUE);
+    cuts2010[i]->SetUseITSSA (addITSSA);
+    
+    // set quality cuts according to standard macro (defined outside)
+    cuts2010[i]->CopyCutsTPC(QualityCutsTPC());
+    cuts2010[i]->CopyCutsITS(QualityCutsITS());
+    
+    // add always the PID check
+    cuts2010[i]->SetCheckITS(kTRUE);
+    cuts2010[i]->SetCheckTPC(kTRUE);
+    cuts2010[i]->SetCheckTOF(kTRUE);
+    
+    // set the ITS PID-related variables
+    cuts2010[i]->SetITSband(3.0);
+    
+    // set the TPC PID-related variables
+    cuts2010[i]->SetTPCrange(3.0, 5.0);
+    cuts2010[i]->SetTPCpLimit(0.35);
+    cuts2010[i]->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
+    
+    // set the TOF PID-related variables
+    cuts2010[i]->SetTOFrange(-3.0, 3.0);
+  }
+  
+  //
+  // -- Setup track pair cuts -----------------------------------------------------------------------
+  //
+  
+  // rapidity window
+  AliRsnCutValue *cutY = new AliRsnCutValue("cutY", AliRsnValue::kPairY, -0.5, 0.5);
+  
+  // this cut requires a support object to retrieve default mass
+  cutY->GetValueObj()->SetSupportObject(pairDefPM);
+  
+  //
+  // -- Add cuts to cut collections -----------------------------------------------------------------
+  //
+  
+  // event cuts are added directly to task, and only the first time
+  if (task->GetEventCuts()->GetCuts()->FindObject("cutVertex") == 0x0)
+  {
+    task->GetEventCuts()->AddCut(cutVertex);
+    task->GetEventCuts()->SetCutScheme("cutVertex");
+  }
+  
+  // single track cuts are added to separate sets, in this case
+  
+  // first candidate is always the kaon
+  pairPM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  truePM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  pairMP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  trueMP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  pairPP->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  pairMM->GetCutManager()->GetDaughter1Cuts()->AddCut(cuts2010[0]);
+  
+  pairPM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+  truePM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+  pairMP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+  trueMP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+  pairPP->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+  pairMM->GetCutManager()->GetDaughter1Cuts()->SetCutScheme(cuts2010[0]->GetName());
+                                       
+  // second candidate is always the pion
+  pairPM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  truePM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  pairMP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  trueMP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  pairPP->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  pairMM->GetCutManager()->GetDaughter2Cuts()->AddCut(cuts2010[1]);
+  
+  pairPM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  truePM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  pairMP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  trueMP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  pairPP->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  pairMM->GetCutManager()->GetDaughter2Cuts()->SetCutScheme(cuts2010[1]->GetName());
+  
+  // pair cuts are added to each pair
+  TString scheme(cutY->GetName());
+  pairPM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  truePM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  pairMP->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  trueMP->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  pairPP->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  pairMM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  
+  pairPM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  truePM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  pairMP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  trueMP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  pairPP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  pairMM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+
+  //
+  // -- Setup functions -----------------------------------------------------------------------------
+  //
+
+  // axis definition
+  // 0) invariant mass
+  // 1) transverse momentum
+  // 2) multiplicity (variable binning)
+  Double_t     mult[]   = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 30., 35., 40., 50., 60., 70., 80., 90., 100., 120., 140., 160., 180., 200., 1E+8};
+  Int_t        nmult    = sizeof(mult) / sizeof(mult[0]);
+  AliRsnValue *axisIM   = new AliRsnValue("IM", AliRsnValue::kPairInvMass     , 0.9,   1.4, 0.001);
+  AliRsnValue *axisPt   = new AliRsnValue("PT", AliRsnValue::kPairPt          , 0.0,   5.0, 0.100);
+  AliRsnValue *axisMult = new AliRsnValue("M" , AliRsnValue::kEventMultESDCuts, nmult, mult);
+
+  // multiplicity axis needs a support object
+  // of type AliESDtrackCuts, correctly configured
+  AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
+  axisMult->SetSupportObject(cuts);
+
+  // create function and add axes
+  AliRsnFunction *fcn = new AliRsnFunction;
+  if ( !fcn->AddAxis(axisIM  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisPt  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisMult) ) return kFALSE;
+
+  // add functions to pairs
+  pairPM->AddFunction(fcn);
+  truePM->AddFunction(fcn);
+  pairMP->AddFunction(fcn);
+  trueMP->AddFunction(fcn);
+  pairPP->AddFunction(fcn);
+  pairMM->AddFunction(fcn);
+
+  //
+  // -- Conclusion ----------------------------------------------------------------------------------
+  //
+
+  // add all created AliRsnPair objects to the AliRsnAnalysisManager in the task
+  task->GetAnalysisManager()->Add(pairPM);
+  task->GetAnalysisManager()->Add(pairMP);
+  task->GetAnalysisManager()->Add(pairPP);
+  task->GetAnalysisManager()->Add(pairMM);
+  if (isSim) 
+  {
+    task->GetAnalysisManager()->Add(truePM);
+    task->GetAnalysisManager()->Add(trueMP);
+  }
+
+  return kTRUE;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhi.C b/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhi.C
new file mode 100644 (file)
index 0000000..e1ad7e5
--- /dev/null
@@ -0,0 +1,231 @@
+//
+// This function configures the entire task for all resonances the user is interested in.
+// This is done by creating all configuration objects which are defined in the package.
+//
+// Generally speaking, one has to define the following objects for each resonance:
+//
+//  1 - an AliRsnPairDef to define the resonance decay channel to be studied
+//  2 - an AliRsnPair{Ntuple|Functions} where the output is stored
+//  3 - one or more AliRsnCut objects to define track selections
+//      which will have then to be organized into AliRsnCutSet objects
+//  4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
+//  5 - definitions to build the TNtuple or histograms which are returned
+//
+// The return value is used to know if the configuration was successful
+//
+Bool_t RsnConfigPhi
+(
+  const char *taskName, 
+  const char *options,
+  const char *path
+)
+{
+  // retrieve analysis manager & task and exit in case of failure
+  AliAnalysisManager *mgr  = AliAnalysisManager::GetAnalysisManager();
+  AliRsnAnalysisSE   *task = (AliRsnAnalysisSE*)mgr->GetTask(taskName);
+  if (!task)
+  {
+    Error("RsnConfigPhi", "Task not found");
+    return kFALSE;
+  }
+  
+  // load useful macros
+  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
+  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
+  
+  // interpret the useful information from second argument
+  TString opt(options);
+  TString suffix("_pid");
+  Bool_t isSim    = opt.Contains("sim");
+  Bool_t isData   = opt.Contains("data");
+  Bool_t addITSSA = opt.Contains("its");
+  if (!isSim && !isData)
+  {
+    Error("RsnConfigPhi", "Required to know if working on data or MC");
+    return kFALSE;
+  }
+  if (addITSSA) suffix += "_its";
+  
+  // define some names using a standard part plus the above suffix
+  TString pairPMname(suffix);
+  TString truePMname(suffix);
+  TString pairPPname(suffix);
+  TString pairMMname(suffix);
+  TString esdCutName(suffix);
+  pairPMname.Prepend("PairPM");
+  truePMname.Prepend("TruePM");
+  pairPPname.Prepend("PairPP");
+  pairMMname.Prepend("PairMM");
+  esdCutName.Prepend("cutESD2010");
+  
+  //
+  // -- Setup pair definition (phi decay trees)  and pairs ------------------------------------------
+  //
+
+  // decay channels
+  AliRsnPairDef *pairDefPM = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '-', 333, 1.019455);
+  AliRsnPairDef *pairDefPP = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '+', 333, 1.019455);
+  AliRsnPairDef *pairDefMM = new AliRsnPairDef(AliPID::kKaon, '-', AliPID::kKaon, '-', 333, 1.019455);
+
+  // computation objects
+  AliRsnPairFunctions *pairPM = new AliRsnPairFunctions(pairPMname.Data(), pairDefPM);
+  AliRsnPairFunctions *truePM = new AliRsnPairFunctions(truePMname.Data(), pairDefPM);
+  AliRsnPairFunctions *pairPP = new AliRsnPairFunctions(pairPPname.Data(), pairDefPP);
+  AliRsnPairFunctions *pairMM = new AliRsnPairFunctions(pairMMname.Data(), pairDefMM);
+  
+  // set additional option for true pairs
+  truePM->SetOnlyTrue  (kTRUE);
+  truePM->SetCheckDecay(kTRUE);
+  
+  //
+  // -- Setup event cuts ----------------------------------------------------------------------------
+  //
+  
+  // cut on primary vertex:
+  // - 2nd argument = 10.0     --> require |Vz| <= 10 cm
+  // - 3rd argument = 0        --> disable check on number of contributors
+  // - 4th argument = 'kFALSE' --> reject TPC stand-alone primary vertex
+  AliRsnCutPrimaryVertex *cutVertex  = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
+  
+  // check pile-up with SPD
+  cutVertex->SetCheckPileUp(kTRUE);
+
+  //
+  // -- Setup single track cuts ---------------------------------------------------------------------
+  //
+
+  // cut on track quality/PID:
+  // 2nd argument (variable) --> 'kTRUE' for MonteCarlo, 'kFALSE' for data
+  AliRsnCutESD2010 *cuts2010 = new AliRsnCutESD2010(esdCutName.Data(), isSim);
+  
+  // specify that PID is for kaons
+  cuts2010->SetPID(AliPID::kKaon);
+  
+  // TPC+ITS tracks are always added, ITS-SA depends on options
+  cuts2010->SetUseITSTPC(kTRUE);
+  cuts2010->SetUseITSSA (addITSSA);
+  
+  // set quality cuts according to standard macro (defined outside)
+  cuts2010->CopyCutsTPC(QualityCutsTPC());
+  cuts2010->CopyCutsITS(QualityCutsITS());
+  
+  // add always the PID check
+  cuts2010->SetCheckITS(kTRUE);
+  cuts2010->SetCheckTPC(kTRUE);
+  cuts2010->SetCheckTOF(kTRUE);
+  
+  // set the ITS PID-related variables
+  cuts2010->SetITSband(3.0);
+  
+  // set the TPC PID-related variables
+  Double_t bbPar[5];
+  if (isSim)
+  {
+    bbPar[0] = 2.15898 / 50.0;
+    bbPar[1] = 1.75295E1;
+    bbPar[2] = 3.40030E-9;
+    bbPar[3] = 1.96178;
+    bbPar[4] = 3.91720;
+  }
+  else
+  {
+    bbPar[0] = 1.41543 / 50.0;
+    bbPar[1] = 2.63394E1;
+    bbPar[2] = 5.0411E-11;
+    bbPar[3] = 2.12543;
+    bbPar[4] = 4.88663;
+  }
+  cuts2010->SetTPCrange(3.0, 5.0);
+  cuts2010->SetTPCpLimit(0.35);
+  cuts2010->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
+  
+  // set the TOF PID-related variables
+  cuts2010->SetTOFrange(-3.0, 3.0);
+  
+  //
+  // -- Setup track pair cuts -----------------------------------------------------------------------
+  //
+  
+  // rapidity window
+  AliRsnCutValue *cutY = new AliRsnCutValue("cutY", AliRsnValue::kPairY, -0.5, 0.5);
+  
+  // this cut requires a support object to retrieve default mass
+  cutY->GetValueObj()->SetSupportObject(pairDefPM);
+  
+  //
+  // -- Add cuts to cut collections -----------------------------------------------------------------
+  //
+  
+  // event cuts are added directly to task, and only the first time
+  if (task->GetEventCuts()->GetCuts()->FindObject("cutVertex") == 0x0)
+  {
+    task->GetEventCuts()->AddCut(cutVertex);
+    task->GetEventCuts()->SetCutScheme("cutVertex");
+  }
+  
+  // single track cuts are added to each pair as common ones for both daughters
+  pairPM->GetCutManager()->GetCommonDaughterCuts()->AddCut(cuts2010);
+  truePM->GetCutManager()->GetCommonDaughterCuts()->AddCut(cuts2010);
+  pairPP->GetCutManager()->GetCommonDaughterCuts()->AddCut(cuts2010);
+  pairMM->GetCutManager()->GetCommonDaughterCuts()->AddCut(cuts2010);
+  
+  pairPM->GetCutManager()->GetCommonDaughterCuts()->SetCutScheme(cuts2010->GetName());
+  truePM->GetCutManager()->GetCommonDaughterCuts()->SetCutScheme(cuts2010->GetName());
+  pairPP->GetCutManager()->GetCommonDaughterCuts()->SetCutScheme(cuts2010->GetName());
+  pairMM->GetCutManager()->GetCommonDaughterCuts()->SetCutScheme(cuts2010->GetName());
+  
+  // pair cuts are added to each pair
+  TString scheme(cutY->GetName());
+  pairPM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  truePM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  pairPP->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  pairMM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  
+  pairPM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  truePM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  pairPP->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  pairMM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+
+  //
+  // -- Setup functions -----------------------------------------------------------------------------
+  //
+
+  // axis definition
+  // 0) invariant mass
+  // 1) transverse momentum
+  // 2) multiplicity (variable binning)
+  Double_t     mult[]   = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 30., 35., 40., 50., 60., 70., 80., 90., 100., 120., 140., 160., 180., 200., 1E+8};
+  Int_t        nmult    = sizeof(mult) / sizeof(mult[0]);
+  AliRsnValue *axisIM   = new AliRsnValue("IM", AliRsnValue::kPairInvMass     , 0.9,   1.4, 0.001);
+  AliRsnValue *axisPt   = new AliRsnValue("PT", AliRsnValue::kPairPt          , 0.0,   5.0, 0.100);
+  AliRsnValue *axisMult = new AliRsnValue("M" , AliRsnValue::kEventMultESDCuts, nmult, mult);
+
+  // multiplicity axis needs a support object
+  // of type AliESDtrackCuts, correctly configured
+  AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
+  axisMult->SetSupportObject(cuts);
+
+  // create function and add axes
+  AliRsnFunction *fcn = new AliRsnFunction;
+  if ( !fcn->AddAxis(axisIM  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisPt  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisMult) ) return kFALSE;
+
+  // add functions to pairs
+  pairPM->AddFunction(fcn);
+  truePM->AddFunction(fcn);
+  pairPP->AddFunction(fcn);
+  pairMM->AddFunction(fcn);
+
+  //
+  // -- Conclusion ----------------------------------------------------------------------------------
+  //
+
+  // add all created AliRsnPair objects to the AliRsnAnalysisManager in the task
+  task->GetAnalysisManager()->Add(pairPM);
+  task->GetAnalysisManager()->Add(pairPP);
+  task->GetAnalysisManager()->Add(pairMM);
+  if (isSim) task->GetAnalysisManager()->Add(truePM);
+
+  return kTRUE;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhiRes.C b/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/RsnConfigPhiRes.C
new file mode 100644 (file)
index 0000000..45f7ec9
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+#include <TROOT.h>
+#include <TString.h>
+#include <AliAnalysisManager.h>
+#include <AliRsnAnalysisSE.h>
+#include <AliRsnCutESD2010.h>
+#include <AliRsnCutValue.h>
+#include <AliRsnPairFunctions.h>
+#include <AliRsnFunction.h>
+#include <AliRsnCutPrimaryVertex.h>
+
+#include "config/QualityCutsITS.C"
+#include "config/QualityCutsTPC.C"
+*/
+
+//
+// This function configures the entire task for all resonances the user is interested in.
+// This is done by creating all configuration objects which are defined in the package.
+//
+// Generally speaking, one has to define the following objects for each resonance:
+//
+//  1 - an AliRsnPairDef to define the resonance decay channel to be studied
+//  2 - an AliRsnPair{Ntuple|Functions} where the output is stored
+//  3 - one or more AliRsnCut objects to define track selections
+//      which will have then to be organized into AliRsnCutSet objects
+//  4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
+//  5 - definitions to build the TNtuple or histograms which are returned
+//
+// The return value is used to know if the configuration was successful
+//
+Bool_t RsnConfigRes
+(
+  const char *taskName, 
+  const char *options,
+  const char *config,
+  const char *path
+)
+{
+  // load useful macros
+  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
+  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
+  
+  // interpret the useful information from second argument
+  TString opt(options);
+  Bool_t  isSim = kTRUE;
+  
+  // interpret the specific info from third argument
+  // which should be fixed in the various calls to this function
+  TString conf(config);
+  Bool_t addPID    = conf.Contains("pid");
+  Bool_t addITSSA  = conf.Contains("its");
+  Bool_t addDipCut = conf.Contains("dip");
+      
+  // generate a common suffix depending on chosen options
+  TString suffix;
+  if (addPID)    suffix += "_pid";
+  if (addITSSA)  suffix += "_its";
+  Info("RsnConfig", "=== Specific configuration: %s ====================================================", config);
+  Info("RsnConfig", "=== suffix used           : %s ====================================================", suffix.Data());
+
+  // retrieve analysis manager & task
+  AliAnalysisManager *mgr  = AliAnalysisManager::GetAnalysisManager();
+  AliRsnAnalysisSE   *task = (AliRsnAnalysisSE*)mgr->GetTask(taskName);
+
+  // for safety, return if no task is passed
+  if (!task)
+  {
+    Error("RsnConfig2010PhiFcn", "Task not found");
+    return kFALSE;
+  }
+  
+  //
+  // -- Setup event cuts (added directly to task) ---------------------------------------------------
+  //
+  
+  // define a common cut on primary vertex, which also checks pile-up
+  AliRsnCutPrimaryVertex *cutVertex  = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
+  cutVertex->SetCheckPileUp(kTRUE);
+  task->GetEventCuts()->AddCut(cutVertex);
+  task->GetEventCuts()->SetCutScheme("cutVertex");
+
+  //
+  // -- Setup pairs ---------------------------------------------------------------------------------
+  //
+
+  // decay channels
+  AliRsnPairDef *pairDefPM = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '-', 333, 1.019455);
+
+  // computation objects
+  AliRsnPairFunctions *truePM = new AliRsnPairFunctions(Form("TrueResPM%s", suffix.Data()), pairDefPM);
+
+  //
+  // -- Setup cuts ----------------------------------------------------------------------------------
+  //
+
+  // track cut -----------------------
+  // --> global cuts for 2010 analysis
+  // --> most options are set to right values by default
+  // --> second argument in constructor tells if we are working in simulation or not
+  AliRsnCutESD2010 *cuts2010 = new AliRsnCutESD2010(Form("cuts2010%s", suffix.Data()), isSim);
+  // --> set the reference particle for PID
+  cuts2010->SetPID(AliPID::kKaon);
+  // --> include or not the ITS standalone (TPC is always in)
+  cuts2010->SetUseITSTPC(kTRUE);
+  cuts2010->SetUseITSSA (addITSSA);
+  // --> set the quality cuts using the general macro and using the 'Copy()' method in AliESDtrackCuts
+  cuts2010->CopyCutsTPC(QualityCutsTPC());
+  cuts2010->CopyCutsITS(QualityCutsITS());
+  // --> set values for PID flags, depending on the choice expressed in the options
+  cuts2010->SetCheckITS (addPID);
+  cuts2010->SetCheckTPC (addPID);
+  cuts2010->SetCheckTOF (addPID);
+  // --> set the ITS PID-related variables
+  cuts2010->SetITSband(3.0);
+  // --> set the TPC PID-related variables
+  Double_t bbPar[5];
+  bbPar[0] = 2.15898 / 50.0;
+  bbPar[1] = 1.75295E1;
+  bbPar[2] = 3.40030E-9;
+  bbPar[3] = 1.96178;
+  bbPar[4] = 3.91720;
+  cuts2010->SetTPCrange(3.0, 5.0);
+  cuts2010->SetTPCpLimit(0.35);
+  cuts2010->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(bbPar[0], bbPar[1], bbPar[2], bbPar[3], bbPar[4]);
+  // --> set the TOF PID-related variables
+  cuts2010->SetTOFrange(-3.0, 3.0);
+  
+  // pair cut ----------------------------------------
+  // --> dip angle between daughters: (it is a cosine)
+  AliRsnCutValue *cutY   = new AliRsnCutValue("cutY"  , AliRsnValue::kPairY       , -0.5 , 0.5 );
+  cutY->GetValueObj()->SetSupportObject(pairDefPM);
+
+  // setup cut set for tracks------------------------------------------------------------
+  // --> in this case, only common cuts are applied, depending if working with ESD or AOD
+  // --> these cuts are added always
+  truePM->GetCutManager()->GetCommonDaughterCuts()->AddCut(cuts2010);
+  truePM->GetCutManager()->GetCommonDaughterCuts()->SetCutScheme(cuts2010->GetName());
+  
+  // setup cut set for pairs---------------
+  // --> add rapidity range cut
+  TString scheme(cutY->GetName());
+  truePM->GetCutManager()->GetMotherCuts()->AddCut(cutY);
+  truePM->GetCutManager()->GetMotherCuts()->SetCutScheme(cutY->GetName());
+  
+  // set additional option for true pairs
+  truePM->SetOnlyTrue  (kTRUE);
+  truePM->SetCheckDecay(kTRUE);
+
+  //
+  // -- Setup functions -----------------------------------------------------------------------------
+  //
+
+  // axis definition
+  // 0) invariant mass
+  // 1) transverse momentum
+  // 2) multiplicity
+  Double_t mult[] = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 30., 35., 40., 50., 60., 70., 80., 90., 100., 120., 140., 160., 180., 200., 1E+8};
+  Int_t    nmult  = sizeof(mult) / sizeof(mult[0]);
+  AliRsnValue *axisIM   = new AliRsnValue("IM", AliRsnValue::kPairInvMassRes  , 0.9,   1.4, 0.001);
+  AliRsnValue *axisPt   = new AliRsnValue("PT", AliRsnValue::kPairPt          , 0.0,   5.0, 0.100);
+  AliRsnValue *axisMult = new AliRsnValue("M" , AliRsnValue::kEventMultESDCuts, nmult, mult);
+
+  // initialize the support object: AliESDtrackCuts
+  // configured using the standard values
+  AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
+  axisMult->SetSupportObject(cuts);
+
+  // create function and add axes
+  AliRsnFunction *fcn = new AliRsnFunction;
+  if ( !fcn->AddAxis(axisIM  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisPt  ) ) return kFALSE;
+  if ( !fcn->AddAxis(axisMult) ) return kFALSE;
+
+  // add functions to pairs
+  truePM->AddFunction(fcn);
+
+  //
+  // -- Conclusion ----------------------------------------------------------------------------------
+  //
+
+  // add all created AliRsnPair objects to the AliRsnAnalysisManager in the task
+  task->GetAnalysisManager()->Add(truePM);
+
+  return kTRUE;
+}
diff --git a/PWG2/RESONANCES/macros/train/RsnConfig.C b/PWG2/RESONANCES/macros/train/RsnConfig.C
deleted file mode 100644 (file)
index e2e1ef1..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// This is an example macro for creation of a pair manager
-// for a resonance analysis with the PWG2/RESONANCES package.
-// Its output is an AliRsnPairManager which will be added to the task.
-// It will contain:
-// - signal (inv. mass)
-// - true pairs (inv. mass)
-// - like-sign (inv. mass)
-// - true pairs (inv. mass, resolution)
-// All histogram are done w.r. to Pt or Eta and w.r. to multiplicity.
-// The binnings are hard-coded. Change them according to your preferences.
-//
-// Arguments:
-// -- pairMgrName : a name for the pair manager which must contain
-//                  some keywords to choose amond the available cuts
-//                  and PID selection available here (this is a personal customization)
-// -- resonancePDG: PDG code of resonance (for true pairs)
-// -- type1, type2: particle species for track 1 and 2 in the pair (using AliPID enumeration)
-//
-// NOTE:
-// the keyword available here are the following:
-// -- "NOPID": completely no PID analysis (only primary track cuts are applied)
-// -- "BB"   : all tracks are used, but the TPC Bethe-Bloch cut is applied (cut value = 0.2)
-// -- "PID"  : realistic PID is used
-//
-AliRsnPairManager* RsnConfig
-(
-  const char            *pairMgrName,    // name for the pair manager
-  Int_t                  resonancePDG,   // PDG code of resonance (for true pairs)
-  Double_t               resonanceMass,  // mass of resonance
-  AliPID::EParticleType  type1,          // PID of one member of decay (+)
-  AliPID::EParticleType  type2           // PID of other member of decay (-)
-)
-{
-  // === NAME DEFINITIONS =========================================================================
-
-  AliRsnPairManager  *pairMgr  = new AliRsnPairManager(pairMgrName);
-
-  // examines the given name to define details about track selection and cuts
-  TString               str(pairMgrName);
-  AliRsnPair::EPairType pidType;
-  Bool_t                useBBCut;
-  if (str.Contains("NOPID"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: not used");
-  }
-  else if (str.Contains("BB"))
-  {
-    pidType  = AliRsnPair::kNoPID;
-    useBBCut = kTRUE;
-    Info("RsnConfig", "PID TYPE = No PID        -- BB CUT: used");
-  }
-  else if (str.Contains("PID"))
-  {
-    pidType  = AliRsnPair::kRealisticPID;
-    useBBCut = kFALSE;
-    Info("RsnConfig", "PID TYPE = Realistic PID -- BB CUT: not used");
-  }
-  else
-  {
-    Error("RsnConfig", "Unrecognized keywords in the name. Can't continue");
-    return 0x0;
-  }
-
-  // === PAIR DEFINITIONS =========================================================================
-
-  // if particle #1 and #2 are different, two histograms must be built
-  // for each scheme (signal, true, mixed, like-sign) exchanging both particles and signs
-  Int_t i, j, nArray = 1;
-  if (type1 != type2) nArray = 2;
-
-  AliRsnPairDef *defUnlike[2] = {0, 0};
-  AliRsnPairDef *defLikePP[2] = {0, 0};
-  AliRsnPairDef *defLikeMM[2] = {0, 0};
-
-  defUnlike[0] = new AliRsnPairDef(type1, '+', type2, '-', resonancePDG, resonanceMass);
-  defLikePP[0] = new AliRsnPairDef(type1, '+', type2, '+', resonancePDG, resonanceMass);
-  defLikeMM[0] = new AliRsnPairDef(type1, '-', type2, '-', resonancePDG, resonanceMass);
-
-  defUnlike[1] = new AliRsnPairDef(type2, '+', type1, '-', resonancePDG, resonanceMass);
-  defLikePP[1] = new AliRsnPairDef(type2, '+', type1, '+', resonancePDG, resonanceMass);
-  defLikeMM[1] = new AliRsnPairDef(type2, '-', type1, '-', resonancePDG, resonanceMass);
-
-  // === PAIR ANALYSIS ENGINES ====================================================================
-
-  // define null (dummy) objects and initialize only the ones which are needed,
-  // depending again on particle types;
-  // array is organized as follows:
-  // [0] - true pairs
-  // [1] - signal
-  // [2] - like PP
-  // [3] - like MM
-  AliRsnPair *pair[2][4] = {0,0,0,0,0,0,0,0};
-
-  for (i = 0; i < nArray; i++) {
-    pair[i][0] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][1] = new AliRsnPair(pidType, defUnlike[i]);
-    pair[i][2] = new AliRsnPair(pidType, defLikePP[i]);
-    pair[i][3] = new AliRsnPair(pidType, defLikeMM[i]);
-  }
-
-  // === CUTS =====================================================================================
-
-  // cuts for tracks:
-  // -- primary track quality
-  AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
-  cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
-  cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
-  cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
-  cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
-  cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
-  cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
-  cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
-  // -- Bethe-Bloch with kaon mass hypothesis
-  Double_t sigmaTPC = 0.065;
-  AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
-  cutKaonBB->SetCalibConstant(0, 0.76176e-1);
-  cutKaonBB->SetCalibConstant(1, 10.632);
-  cutKaonBB->SetCalibConstant(2, 0.13279e-4);
-  cutKaonBB->SetCalibConstant(3, 1.8631);
-  cutKaonBB->SetCalibConstant(4, 1.9479);
-
-  // cuts on pairs:
-  // -- true daughters of a phi resonance (only for true pairs histogram)cutSetPairTrue->AddCut(cutTrue);
-  AliRsnCutStd *cutTruePair = new AliRsnCutStd("cutTrue", AliRsnCutStd::kTruePair, resonancePDG);
-
-  // cuts on event:
-  // -- none (specified for whole task)
-
-  // cut set definition for all pairs
-  AliRsnCutSet *cutSetParticle = new AliRsnCutSet("trackCuts");
-  cutSetParticle->AddCut(cutESDPrimary);
-  if (useBBCut)
-  {
-    cutSetParticle->AddCut(cutKaonBB);
-    cutSetParticle->SetCutScheme("cutKaonBB&cutESDPrimary");
-  }
-  else {
-    cutSetParticle->SetCutScheme("cutESDPrimary");
-  }
-
-  // cut set definition for true pairs
-  AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
-  cutSetPairTrue->AddCut(cutTruePair);
-  cutSetPairTrue->SetCutScheme("cutTrue");
-
-  // cut manager for all pairs
-  AliRsnCutMgr *cutMgrAll = new AliRsnCutMgr("std", "All");
-  cutMgrAll->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-
-  // cut manager for all pairs
-  AliRsnCutMgr *cutMgrTrue = new AliRsnCutMgr("true", "True");
-  cutMgrTrue->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
-  cutMgrTrue->SetCutSet(AliRsnCut::kPair, cutSetPairTrue);
-
-  for (i = 0; i < nArray; i++) {
-    pair[i][0]->SetCutMgr(cutMgrTrue);
-    pair[i][0]->SetOnlyTrue();
-    for (j = 1; j < 4; j++) {
-      pair[i][j]->SetCutMgr(cutMgrAll);
-    }
-  }
-
-  // === FUNCTIONS ================================================================================
-
-  // define all binnings
-  AliRsnFunctionAxis *axisIM   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass,    4000,  0.0,   2.0);
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,           50,  0.0,  10.0);
-  AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,          15, -1.5,   1.5);
-  //AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairY,          15, -1.5,   1.5);
-  AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,         8,  0.0, 200.0);
-
-  AliRsnFunction *fcn = new AliRsnFunction;
-  fcn->AddAxis(axisIM);
-  fcn->AddAxis(axisPt);
-  fcn->AddAxis(axisEta);
-  fcn->AddAxis(axisMult);
-
-  // add functions to pairs
-  for (i = 0; i < nArray; i++) {
-    for (j = 0; j < 4; j++) {
-      pair[i][j]->AddFunction(fcn);
-    }
-  }
-
-  // === ADD TO PAIR MANAGER ======================================================================
-
-  for (i = 0; i < nArray; i++) {
-    for (j = 0; j < 4; j++) {
-      pairMgr->AddPair(pair[i][j]);
-    }
-  }
-
-  return pairMgr;
-}