]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update of analysis macros
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Dec 2010 13:01:37 +0000 (13:01 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Dec 2010 13:01:37 +0000 (13:01 +0000)
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/AddRsnAnalysis.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/AddRsnAnalysisMult.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/AddRsnEfficiency.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfig.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfigDipNoSA.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfigDipSA.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfigNoSA.C
PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/RsnConfigSA.C

index 13dd0fa07c010cca873a261790555dc673041fa0..38c0493d92cecba7a31fb066d1d486ba3f9867da 100644 (file)
 Bool_t AddRsnAnalysis
 (
   const char *options,
-  //const char *configs = "RsnConfigNoSA.C RsnConfigSA.C RsnConfigDipNoSA.C RsnConfigDipSA.C",
-  const char *configs = "RsnConfigTest.C",
+  const char *configs = "RsnConfigNoSA.C RsnConfigSA.C RsnConfigDipNoSA.C RsnConfigDipSA.C",
   const char *path    = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi"
 )
-{
-  // 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");
+{  
+  // create the task and connect with physics selection
+  AliRsnAnalysisSE *task = new AliRsnAnalysisSE(Form("RsnAnalysis_%d", i));
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
 
-  // set cuts for events : primary vertex range and type
-  gROOT->LoadMacro(Form("%s/ConfigESDCutsTPC.C", path));
-  AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
-  cutVertex->SetCheckPileUp(kTRUE);
-  task->GetEventCuts()->AddCut(cutVertex);
-  task->GetEventCuts()->SetCutScheme(cutVertex->GetName());
-
   // 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;
+  // 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);
-    cout << "***** Processing config macro '" << ostr->GetString().Data() << endl;
-    gROOT->ProcessLine(Form(".x %s/%s(\"%s\",\"%s\",\"%s\")", path, ostr->GetString().Data(), task->GetName(), options, path));
+    
+    // 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
@@ -60,6 +56,6 @@ Bool_t AddRsnAnalysis
   AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
   mgr->ConnectOutput(task, 1, outputInfo);
   mgr->ConnectOutput(task, 2, outputHist);
-
+    
   return kTRUE;
 }
index c17e0efa7ce588e86a8be5077bb3c3be6d3eb85b..90ae74d49994312f750b226e2b1c4738c955aeb9 100644 (file)
 Bool_t AddRsnAnalysisMult
 (
   const char *options,
-  //const char *configs = "RsnConfigNoSA.C RsnConfigSA.C RsnConfigDipNoSA.C RsnConfigDipSA.C",
-  const char *configs = "RsnConfigDipSA.C",
+  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();
   
-  // define a common cut on primary vertex, 
-  // which also checks pile-up
-  AliRsnCutPrimaryVertex *cutVertex  = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
-  cutVertex->SetCheckPileUp(kTRUE);
+  // initialize multiplicity bins
+  Int_t  multMin[6] = {0, 0, 6, 10, 15, 23       };
+  Int_t  multMax[6] = {0, 5, 9, 14, 22, 100000000};
   
-  // initialize multiplicity cuts, and loads a standard macro for 
-  // initializing the required support object
-  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
-  Double_t         multMin[5] = {0, 6, 10, 15, 23   };
-  Double_t         multMax[5] = {5, 9, 14, 22, 1E+10};
-  AliRsnCutValue  *cutMult[5] = {0, 0,  0,  0, 0    };
-  for (Int_t i = 0; i < 5; i++)
-  {
-    cutMult[i] = new AliRsnCutValue(Form("cutMult_%d", i), AliRsnValue::kEventMultESDCuts, multMin[i], multMax[i]);
-    
-    // initialize the support object: AliESDtrackCuts
-    // configured using the standard values
-    AliESDtrackCuts *cuts = new AliESDtrackCuts(QualityCutsTPC());
-    cutMult[i]->GetValueObj()->SetSupportObject(cuts);
-  }
-
   // 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 < 1; i++)
+  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();
-    
-    // setup the cuts (first loop is for all multiplicities)
-    if (i == 0)
-    {
-      task->GetEventCuts()->AddCut(cutVertex);
-      task->GetEventCuts()->SetCutScheme("cutVertex");
-    }
-    else
-    {
-      task->GetEventCuts()->AddCut(cutVertex);
-      task->GetEventCuts()->AddCut(cutMult[i - 1]);
-      task->GetEventCuts()->SetCutScheme(Form("cutVertex&%s", cutMult[i - 1]->GetName()));
-    }
 
     // add the task to manager
     mgr->AddTask(task);
@@ -84,7 +54,8 @@ Bool_t AddRsnAnalysisMult
       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)", path, macro, argName, argOption, argPath));
+      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
index 81542a47bc1176c4c1521469b2873da8fa60ea56..88aa4b2c5f472df0fbe79982ddb3dc5bd0709ee7 100644 (file)
@@ -8,11 +8,11 @@
 //  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)
+Bool_t AddRsnEfficiency(const char *dataLabel, const char *path)
 {
   // load useful macros
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/ConfigESDCutsITS.C");
-  gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/ConfigESDCutsTPC.C");
+  gROOT->LoadMacro(Form("%s/QualityCutsITS.C", path));
+  gROOT->LoadMacro(Form("%s/QualityCutsTPC.C", path));
   
   // retrieve analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -33,22 +33,23 @@ Bool_t AddRsnEfficiency(const char *dataLabel)
   // 1) transverse momentum
   // 2) rapidity
   // 3) multiplicity
-  Double_t mult[] = {0., 6., 10., 15., 23., 10000};
-  Int_t    nmult  = sizeof(mult) / sizeof(mult[0]);
+  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);
   
-  // add the support cut to the value which computes the multiplicity
-  AliESDtrackCuts *cuts = new AliESDtrackCuts;
-  ConfigESDCutsTPC(cuts);
+  // 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, 1, kFALSE);
+  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
@@ -58,8 +59,9 @@ Bool_t AddRsnEfficiency(const char *dataLabel)
   cuts2010[0][1] = new AliRsnCutESD2010("cutESD2010nopidSA");
   cuts2010[1][0] = new AliRsnCutESD2010("cutESD2010pidNoSA");
   cuts2010[1][1] = new AliRsnCutESD2010("cutESD2010pidSA");
-  // since both indexes are 0/1, the boolean settings
-  // are done according to them, for clarity
+  // 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++)
@@ -67,6 +69,9 @@ Bool_t AddRsnEfficiency(const char *dataLabel)
       // 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);
       
@@ -77,8 +82,19 @@ Bool_t AddRsnEfficiency(const char *dataLabel)
       cuts2010[ipid][iits]->SetCheckTOF((Bool_t)ipid);
       
       // basic quality settings
-      ConfigESDCutsITS(cuts2010[ipid][iits]->GetCutsITS());
-      ConfigESDCutsTPC(cuts2010[ipid][iits]->GetCutsTPC());
+      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);
     }
   }
 
@@ -102,7 +118,7 @@ Bool_t AddRsnEfficiency(const char *dataLabel)
     task[itask]->AddAxis(axisY);
     task[itask]->AddAxis(axisMult);
     
-    // add the cut only when working on ESD, not on MC only
+    // add the cut on primary vertex
     task[itask]->GetEventCuts()->AddCut(cutVertex);
     task[itask]->GetEventCuts()->SetCutScheme(cutVertex->GetName());
 
index eb9e6fc4fb11a72a296b68a9fe73d115463d6445..25e03ba47f2dad778d7cff150e44f326738d29db 100644 (file)
@@ -7,6 +7,8 @@
 #include <AliRsnCutValue.h>
 #include <AliRsnPairFunctions.h>
 #include <AliRsnFunction.h>
+#include <AliRsnCutPrimaryVertex.h>
+
 #include "config/QualityCutsITS.C"
 #include "config/QualityCutsTPC.C"
 */
@@ -31,7 +33,9 @@ Bool_t RsnConfig
   const char *taskName, 
   const char *options,
   const char *config,
-  const char *path
+  const char *path,
+  Int_t       multMin = 0,
+  Int_t       multMax = 0
 )
 {
   // load useful macros
@@ -73,6 +77,37 @@ Bool_t RsnConfig
     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 ---------------------------------------------------------------------------------
@@ -202,9 +237,9 @@ Bool_t RsnConfig
 
   // 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);
+  task->GetAnalysisManager()->Add(pairPP);
+  task->GetAnalysisManager()->Add(pairMM);
+  if (isSim) task->GetAnalysisManager()->Add(truePM);
 
   return kTRUE;
 }
index d99d4d98e0faab5018cb7a70803cb3936581c72f..957e61017258e448e7fa20be62c1e51169950c60 100644 (file)
@@ -5,8 +5,8 @@
 // - ITS: not included
 // - dip: included
 //
-Bool_t RsnConfigDipNoSA(const char *taskName, const char *options, const char *path)
+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);
+  return RsnConfig(taskName, options, "pid+dip", path, multMin, multMax);
 }
index 27c48739fd8b07235648a7eab53db232bcd71210..16c5cd2cd24be9f92da987b600e984b2c456f563 100644 (file)
@@ -5,8 +5,8 @@
 // - ITS: included
 // - dip: included
 //
-Bool_t RsnConfigDipSA(const char *taskName, const char *options, const char *path)
+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);
+  return RsnConfig(taskName, options, "pid+its+dip", path, multMin, multMax);
 }
index e7229e7295a1868b4505f8b610324468e9ca0774..c2a0fcf760a4591fe37b61b810b6c5dbe7dea122 100644 (file)
@@ -5,8 +5,8 @@
 // - ITS: not included
 // - dip: not included
 //
-Bool_t RsnConfigNoSA(const char *taskName, const char *options, const char *path)
+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);
+  return RsnConfig(taskName, options, "pid", path, multMin, multMax);
 }
index 40d60c6ffc0074f4bdab18fd4a136ba3ec025715..6897d5eafba8ca3fc0c673666a91d5d8a546e201 100644 (file)
@@ -5,8 +5,8 @@
 // - ITS: included
 // - dip: not included
 //
-Bool_t RsnConfigSA(const char *taskName, const char *options, const char *path)
+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);
+  return RsnConfig(taskName, options, "pid+its", path, multMin, multMax);
 }