Added macros for K* analysis
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Dec 2010 13:22:29 +0000 (13:22 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Dec 2010 13:22:29 +0000 (13:22 +0000)
14 files changed:
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysis.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMC.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnEfficiency.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsITS.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/ConfigESDCutsTPC.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsITS.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsTPC.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipNoSA.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigDipSA.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigMC.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigNoSA.C [new file with mode: 0644]
PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfigSA.C [new file with mode: 0644]

diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysis.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysis.C
new file mode 100644 (file)
index 0000000..38c0493
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// 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 AddRsnAnalysis
+(
+  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"
+)
+{  
+  // 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);
+    gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s,0,0)", path, macro, argName, argOption, argPath));
+  }
+
+  // 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;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMC.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMC.C
new file mode 100644 (file)
index 0000000..571214d
--- /dev/null
@@ -0,0 +1,73 @@
+//
+// 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 AddAnalysisTaskRsn
+(
+  const char *options,
+  const char *configs = "RsnConfig2010PhiFcnRealisticNoSA.C \
+                         RsnConfig2010PhiFcnRealisticWithSA.C \
+                         RsnConfig2010PhiFcnRealisticDipNoSA.C \
+                         RsnConfig2010PhiFcnRealisticDipWithSA.C"
+)
+{
+  // 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");
+  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);
+
+  // 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));
+  }
+
+  // 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;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/AddRsnAnalysisMult.C
new file mode 100644 (file)
index 0000000..90ae74d
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..b41a2e2
--- /dev/null
@@ -0,0 +1,226 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..c67a23f
--- /dev/null
@@ -0,0 +1,26 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..f3ebefd
--- /dev/null
@@ -0,0 +1,27 @@
+//
+// 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/QualityCutsITS.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsITS.C
new file mode 100644 (file)
index 0000000..e1682fa
--- /dev/null
@@ -0,0 +1,31 @@
+//
+// 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
+//
+AliESDtrackCuts QualityCutsITS()
+{
+  // create output variable
+  AliESDtrackCuts cuts;
+  
+  // general acceptance/pt cuts
+  cuts.SetPtRange ( 0.15, 1.0e+10);
+  cuts.SetEtaRange(-0.8 , 0.8);
+  
+  // DCA cuts
+  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);
+  
+  // finished
+  return cuts;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsTPC.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/QualityCutsTPC.C
new file mode 100644 (file)
index 0000000..ecdf9f0
--- /dev/null
@@ -0,0 +1,33 @@
+//
+// 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
+//
+AliESDtrackCuts QualityCutsTPC()
+{
+  // create output variable
+  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);
+  
+  // finished
+  return cuts;
+}
diff --git a/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C b/PWG2/RESONANCES/macros/train/LHC2010-7TeV-kstar/RsnConfig.C
new file mode 100644 (file)
index 0000000..b9161ad
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+#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
new file mode 100644 (file)
index 0000000..957e610
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..16c5cd2
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..7e8e9f9
--- /dev/null
@@ -0,0 +1,120 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..c2a0fcf
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// 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
new file mode 100644 (file)
index 0000000..6897d5e
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// 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);
+}