<commit_before>/*********************************************
<EMAIL> - created on 20 Nov 2017
Macro to add task for phi analysis in XeXe
*********************************************/

#if !defined (__CINT__) || defined (__CLING__)
#include "ConfigPhiXeXe.C"
#endif

AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Int_t selectTaskConfig = 0, Bool_t isMC = kFALSE, Int_t nmix = 5, TString multEstimator = "AliMultSelection_V0M");
AliRsnMiniAnalysisTask * AddTaskPhiXeXe( Bool_t isMC = kFALSE,
					 AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s,
					 Float_t     nsigmaTPC = 2.0,
					 Float_t     nsigmaTOF = 2.0,
					 Int_t       aodFilterBit = 5,
           Int_t       customQualityCutsID = -1,
					 TString     multEstimator = "AliMultSelection_V0M",  
					 Int_t       nmix = 5,
					 Bool_t      enableMonitor = kTRUE,
					 TString     outNameSuffix = "default");

AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Int_t selectTaskConfig, Bool_t isMC, Int_t nmix, TString multEstimator)
{
  //Select cuts configuration and returns the corresponding add task
  AliRsnMiniAnalysisTask * task = 0x0;
  switch (selectTaskConfig){
  case 1:
    //2011 std cuts - DCA cut as for nominal field - preliminary setting
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, -1, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3sveto5smism");    
    break;
  case 2:
    //2011 std cuts - DCA cut as for nominal field with custom cuts
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 3.0, 3.0, 5, 100, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3sveto5smism");    
    break;
  case 101 :
    //2011 std cuts - DCA cut for low B field -- tpc2sPtDep_tof3sveto5smism PID
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 5, kTRUE, "default_LowBdca");    
    break;
  case 102 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 3.0, 3.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc3sPtDep_tof3sveto5smism");    
    break;  
  case 103 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 4.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof4sveto5smism");    
    break;  
  case 104 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, 3.0, 10.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc3s");    
    break;  
  case 7001:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 7, kTRUE, "default_7mix");    
    break;
  case 1001:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 10, kTRUE, "default_10mix");    
    break;
  default:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 100, multEstimator.Data(), 5, kTRUE, "default");    
//  task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFPhiXeXe, 2.0, 3.0, 5, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3s");    
  }

  return task;
}


AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Bool_t isMC, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate, Float_t nsigmaTPC, Float_t nsigmaTOF,
					                              Int_t aodFilterBit, Int_t customQualityCutsID, TString multEstimator, Int_t nmix, Bool_t enableMonitor, TString outNameSuffix)
{  
  //-------------------------------------------
  // event cuts
  //-------------------------------------------
  Bool_t   rejectPileUp = kTRUE;
  Double_t vtxZcut = 10.0;

  //-------------------------------------------
  // event mixing settings
  //-------------------------------------------
  Float_t     maxDiffVzMix = 1.0;
  Float_t     maxDiffMultMix = 5.0;
  
  //-------------------------------------------
  // pair cuts
  //-------------------------------------------
  Double_t    minYlab = -0.5;
  Double_t    maxYlab = 0.5;

  // -- INITIALIZATION ----------------------------------------------------------------------------
  // retrieve analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
      ::Error("AddTaskPhiXeXe", "No analysis manager to connect to.");
      return NULL;
   } 

   // create the task and configure 
   TString taskName = Form("PhiXeXe%s", (isMC ? "MC" : "Data"));
   
   AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC);
   //task->SelectCollisionCandidates(triggerMask);//AOD
   task->UseESDTriggerMask(AliVEvent::kINT7);//ESD
   task->UseMultiplicity("AliMultSelection_V0M");
   // set event mixing options
   task->UseContinuousMix();
   task->SetNMix(nmix);
   task->SetMaxDiffVz(maxDiffVzMix);
   task->SetMaxDiffMult(maxDiffMultMix);
   TString message = Form("\nevents to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n", nmix, maxDiffVzMix, maxDiffMultMix);
   Printf("AddTaskPhiXeXe :::: Event mixing configuration: %s", message.Data());
   
   mgr->AddTask(task);

   //
   // -- EVENT CUTS (same for all configs) ---------------------------------------------------------
   //   
   //AliRsnCutEventUtils* cutEventUtils = new AliRsnCutEventUtils("cutEventUtils", kTRUE, rejectPileUp);
   //cutEventUtils->SetCheckAcceptedMultSelection();
   //Printf("AddTaskPhiXeXe :::: Centrality estimator: %s", multEstimator.Data());
   //TList * lEvtQA = new TList();
   AliRsnEventCuts * evtCuts = new AliRsnEventCuts("defaultAliEventCuts");
   //evtCuts->AddQAplotsToList(lEvtQA);

   AliRsnCutSet * evtCutSet = new AliRsnCutSet("evtCutSet", AliRsnTarget::kEvent);
   evtCutSet->AddCut(evtCuts);
   evtCutSet->SetCutScheme(Form("%s", evtCuts->GetName()));
   task->SetEventCuts(evtCutSet); 

   //
   // -- EVENT-ONLY COMPUTATIONS -------------------------------------------------------------------
   //   
   //vertex
   //Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE);
   //multiplicity or centrality
   //Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
   // AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT");
   // outVtx->AddAxis(vtxID, 240, -12.0, 12.0);
   // outVtx->AddAxis(multID, 20, 0.0, 100.0);
   // AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT");
   // outMult->AddAxis(multID, 100, 0.0, 100.0);
   
   // ------------------------------------------------------
   // PAIR CUTS (common to all resonances) 
   // ------------------------------------------------------
   AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
   cutY->SetRangeD(minYlab, maxYlab);
   
   AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
   cutsPair->AddCut(cutY);<commit_msg>Switch to built-in event cuts<commit_after>/*********************************************
<EMAIL> - created on 20 Nov 2017
Macro to add task for phi analysis in XeXe
*********************************************/

#if !defined (__CINT__) || defined (__CLING__)
#include "ConfigPhiXeXe.C"
#endif

AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Int_t selectTaskConfig = 0, Bool_t isMC = kFALSE, Int_t nmix = 5, TString multEstimator = "AliMultSelection_V0M");
AliRsnMiniAnalysisTask * AddTaskPhiXeXe( Bool_t isMC = kFALSE,
					 AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s,
					 Float_t     nsigmaTPC = 2.0,
					 Float_t     nsigmaTOF = 2.0,
					 Int_t       aodFilterBit = 5,
           Int_t       customQualityCutsID = -1,
					 TString     multEstimator = "AliMultSelection_V0M",  
					 Int_t       nmix = 5,
					 Bool_t      enableMonitor = kTRUE,
					 TString     outNameSuffix = "default");

AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Int_t selectTaskConfig, Bool_t isMC, Int_t nmix, TString multEstimator)
{
  //Select cuts configuration and returns the corresponding add task
  AliRsnMiniAnalysisTask * task = 0x0;
  switch (selectTaskConfig){
  case 1:
    //2011 std cuts - DCA cut as for nominal field - preliminary setting
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, -1, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3sveto5smism");    
    break;
  case 2:
    //2011 std cuts - DCA cut as for nominal field with custom cuts
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 3.0, 3.0, 5, 100, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3sveto5smism");    
    break;
  case 101 :
    //2011 std cuts - DCA cut for low B field -- tpc2sPtDep_tof3sveto5smism PID
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 5, kTRUE, "default_LowBdca");    
    break;
  case 102 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 3.0, 3.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc3sPtDep_tof3sveto5smism");    
    break;  
  case 103 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 4.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof4sveto5smism");    
    break;  
  case 104 :
    //2011 std cuts - DCA cut for low B field -- PID systematics
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, 3.0, 10.0, 5, 101, multEstimator.Data(), 5, kTRUE, "tpc3s");    
    break;  
  case 7001:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 7, kTRUE, "default_7mix");    
    break;
  case 1001:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 101, multEstimator.Data(), 10, kTRUE, "default_10mix");    
    break;
  default:
    task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFvetoPhiXeXe, 2.0, 3.0, 5, 100, multEstimator.Data(), 5, kTRUE, "default");    
//  task = (AliRsnMiniAnalysisTask *) AddTaskPhiXeXe(isMC, AliRsnCutSetDaughterParticle::kTPCTOFPhiXeXe, 2.0, 3.0, 5, multEstimator.Data(), 5, kTRUE, "tpc2sPtDep_tof3s");    
  }

  return task;
}


AliRsnMiniAnalysisTask * AddTaskPhiXeXe(Bool_t isMC, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate, Float_t nsigmaTPC, Float_t nsigmaTOF,
					                              Int_t aodFilterBit, Int_t customQualityCutsID, TString multEstimator, Int_t nmix, Bool_t enableMonitor, TString outNameSuffix)
{  
  //-------------------------------------------
  // event cuts
  //-------------------------------------------
  Bool_t   rejectPileUp = kTRUE;
  Double_t vtxZcut = 10.0;

  //-------------------------------------------
  // event mixing settings
  //-------------------------------------------
  Float_t     maxDiffVzMix = 1.0;
  Float_t     maxDiffMultMix = 5.0;
  
  //-------------------------------------------
  // pair cuts
  //-------------------------------------------
  Double_t    minYlab = -0.5;
  Double_t    maxYlab = 0.5;

  // -- INITIALIZATION ----------------------------------------------------------------------------
  // retrieve analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
      ::Error("AddTaskPhiXeXe", "No analysis manager to connect to.");
      return NULL;
   } 

   // create the task and configure 
   TString taskName = Form("PhiXeXe%s", (isMC ? "MC" : "Data"));
   
   AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC);
   //task->SelectCollisionCandidates(triggerMask);//AOD
   task->UseESDTriggerMask(AliVEvent::kINT7);//ESD
   task->UseMultiplicity("AliMultSelection_V0M");
   task->SetUseBuiltinEventCuts();
   // set event mixing options
   task->UseContinuousMix();
   task->SetNMix(nmix);
   task->SetMaxDiffVz(maxDiffVzMix);
   task->SetMaxDiffMult(maxDiffMultMix);
   TString message = Form("\nevents to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n", nmix, maxDiffVzMix, maxDiffMultMix);
   Printf("AddTaskPhiXeXe :::: Event mixing configuration: %s", message.Data());
   
   mgr->AddTask(task);

   // ------------------------------------------------------
   // PAIR CUTS (common to all resonances) 
   // ------------------------------------------------------
   AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
   cutY->SetRangeD(minYlab, maxYlab);
   
   AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
   cutsPair->AddCut(cutY);
{'fraction_non_alphanumeric': 0.19582652606564682, 'fraction_numerical': 0.03029852963017971, 'mean_word_length': 2.7807411566535656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4431585', 'n_tokens_mistral': 5146, 'n_tokens_neox': 4690, 'n_words': 962}