<commit_before>/*
 * 
 * Last modified:  12/02/2016
 * By: <NAME> <<EMAIL>>, GSI-Darmstadt
 * By: <NAME> <<EMAIL>>, GSI-Darmstadt
 * 
 */




void AddTask_dNdPtpp_TPCITS(const int cutMode=223, const char *partMode = "", const char *suffix="")
{

 /*
CheckLoadLibrary("libPWG0base");
CheckLoadLibrary("libPWG0dep");
CheckLoadLibrary("libPWG0selectors");
*/

  TString stParticleSelection(partMode);
  cout<<"String: "<<stParticleSelection<<endl;
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

  if (!mgr) {
    Error("AddTask_dNdPtAnalysis_TPCITS", "No analysis manager found.");
    return 0;
  }

  // Switch off all AliInfo (too much output!!!)
  AliLog::SetGlobalLogLevel(AliLog::kError);
  mgr->SetDebugLevel(0);

  //
  // Create physics trigger selection class
  //
  //AliPhysicsSelection *physTrigSel =  new AliPhysicsSelection();
  //physTrigSel->AddBackgroundIdentification(new AliBackgroundSelection());

  //
  // Create event cuts
  //
  Float_t zvWindow =30. ;

  AlidNdPtEventCuts *evtCuts = new AlidNdPtEventCuts("AlidNdPtEventCuts","Event cuts");
  evtCuts->SetZvRange(-zvWindow,zvWindow);
  evtCuts->SetMeanXYZv(0.0,0.0,0.0);
  evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0);
  evtCuts->SetTriggerRequired(kTRUE);

  //
  // Create geom. acceptance cuts
  //
  Float_t etaWindow = 1.0 ;
  Float_t ptMin = 0.10;

  AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts");
  accCuts->SetEtaRange(-etaWindow,etaWindow);
  accCuts->SetPtRange(ptMin,1.e10);

  //
  // Create standard esd track cuts
  //
  
  gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/CreatedNdPtTrackCuts.C");
  AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode);
  if (!esdTrackCuts) {
    printf("ERROR: esdTrackCuts could not be created\n");
    return;
  } else {
    esdTrackCuts->SetHistogramsOn(kTRUE);
  }

  Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);

  
  TString stContainerName = Form("dNdPtpp_%d",cutMode);
  stContainerName += stParticleSelection;
  TString stCombinedName(suffix);
  stContainerName += stCombinedName;
  //
  // Create task
  //
  AlidNdPtTask *task = new AlidNdPtTask(stContainerName);  
  task->SetUseMCInfo(hasMC);

  // trigger  
  task->SelectCollisionCandidates(AliVEvent::kINT7); 



  


  
  //
  // Create analysis object
  //

  AlidNdPtAnalysis *fdNdPtAnalysis = new AlidNdPtAnalysis("dNdPtAnalysis","dN/dPt Analysis with TPC-ITS tracking");
  fdNdPtAnalysis->SetEventCuts(evtCuts);
  fdNdPtAnalysis->SetAcceptanceCuts(accCuts);
  fdNdPtAnalysis->SetTrackCuts(esdTrackCuts);
  fdNdPtAnalysis->SetAnalysisMode(AlidNdPtHelper::kTPCITS); 
  fdNdPtAnalysis->SetTriggerMask(AliVEvent::kINT7);

  //Particle Mode
  if(stParticleSelection.Contains("Pion")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCPion);}
  else if(stParticleSelection.Contains("Proton")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCProton);}
  else if(stParticleSelection.Contains("Kaon")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCKaon);}
  else if(stParticleSelection.Contains("Rest")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCRest);}
  else if(stParticleSelection.Contains("Plus")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kPlus);}
  else if(stParticleSelection.Contains("Minus")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMinus);}
  else{ fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kAllPart);}
  

  fdNdPtAnalysis->SetUseMCInfo(hasMC);
  fdNdPtAnalysis->SetHistogramsOn(hasMC);

    // change binning
    Int_t multNbins = 252;  
    Double_t binsMult[253];
    for (int i=0; i<=multNbins; i++) { binsMult[i] = -0.5 + i; }
    binsMult[252] = 1000.;
    // change binning
    const Int_t ptNbins = 81;<commit_msg>AddTask updated<commit_after>/*
 * 
 * Last modified:  12/02/2016
 * By: <NAME> <<EMAIL>>, GSI-Darmstadt
 * By: <NAME> <<EMAIL>>, GSI-Darmstadt
 * 
 */




void AddTask_dNdPtpp_TPCITS(const int cutMode=223, const char *partMode = "", const char *suffix="")
{

 /*
CheckLoadLibrary("libPWG0base");
CheckLoadLibrary("libPWG0dep");
CheckLoadLibrary("libPWG0selectors");
*/

  TString stParticleSelection(partMode);
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

  if (!mgr) {
    Error("AddTask_dNdPtAnalysis_TPCITS", "No analysis manager found.");
    return 0;
  }

  // Switch off all AliInfo (too much output!!!)
  AliLog::SetGlobalLogLevel(AliLog::kError);
  mgr->SetDebugLevel(0);

  //
  // Create physics trigger selection class
  //
  //AliPhysicsSelection *physTrigSel =  new AliPhysicsSelection();
  //physTrigSel->AddBackgroundIdentification(new AliBackgroundSelection());

  //
  // Create event cuts
  //
  Float_t zvWindow =30. ;

  AlidNdPtEventCuts *evtCuts = new AlidNdPtEventCuts("AlidNdPtEventCuts","Event cuts");
  evtCuts->SetZvRange(-zvWindow,zvWindow);
  evtCuts->SetMeanXYZv(0.0,0.0,0.0);
  evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0);
  evtCuts->SetTriggerRequired(kTRUE);

  //
  // Create geom. acceptance cuts
  //
  Float_t etaWindow = 1.0 ;
  Float_t ptMin = 0.10;

  AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts");
  accCuts->SetEtaRange(-etaWindow,etaWindow);
  accCuts->SetPtRange(ptMin,1.e10);

  //
  // Create standard esd track cuts
  //
  
  gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/CreatedNdPtTrackCuts.C");
  AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode,hasMC,1.0);
  if (!esdTrackCuts) {
    printf("ERROR: esdTrackCuts could not be created\n");
    return;
  } else {
    esdTrackCuts->SetHistogramsOn(kTRUE);
  }

  Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);

  
  TString stContainerName = Form("dNdPtpp_%d",cutMode);
  stContainerName += stParticleSelection;
  TString stCombinedName(suffix);
  stContainerName += stCombinedName;
  //
  // Create task
  //
  AlidNdPtTask *task = new AlidNdPtTask(stContainerName);  
  task->SetUseMCInfo(hasMC);

  // trigger  
  task->SelectCollisionCandidates(AliVEvent::kINT7); 



  


  
  //
  // Create analysis object
  //

  AlidNdPtAnalysis *fdNdPtAnalysis = new AlidNdPtAnalysis("dNdPtAnalysis","dN/dPt Analysis with TPC-ITS tracking");
  fdNdPtAnalysis->SetEventCuts(evtCuts);
  fdNdPtAnalysis->SetAcceptanceCuts(accCuts);
  fdNdPtAnalysis->SetTrackCuts(esdTrackCuts);
  fdNdPtAnalysis->SetAnalysisMode(AlidNdPtHelper::kTPCITS); 
  fdNdPtAnalysis->SetTriggerMask(AliVEvent::kINT7);
  fdNdPtAnalysis->SetUsePileUpRejection(kTRUE);
  fdNdPtAnalysis->SetUseSPDClusterVsTrackletRejection(kTRUE);
  fdNdPtAnalysis->SetRequireCompleteDAQ(kTRUE);
  fdNdPtAnalysis->SetUseTOFBunchCrossing(kFALSE);
  fdNdPtAnalysis->SetTriggerClass("");
  
  
  //Particle Mode
  if(stParticleSelection.Contains("Pion")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCPion);}
  else if(stParticleSelection.Contains("Proton")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCProton);}
  else if(stParticleSelection.Contains("Kaon")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCKaon);}
  else if(stParticleSelection.Contains("Rest")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMCRest);}
  else if(stParticleSelection.Contains("Plus")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kPlus);}
  else if(stParticleSelection.Contains("Minus")){fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kMinus);}
  else{ fdNdPtAnalysis->SetParticleMode(AlidNdPtHelper::kAllPart);}
  

  fdNdPtAnalysis->SetUseMCInfo(hasMC);
  fdNdPtAnalysis->SetHistogramsOn(hasMC);

    // change binning
    Int_t multNbins = 252;  
    Double_t binsMult[253];
    for (int i=0; i<=multNbins; i++) { binsMult[i] = -0.5 + i; }
    binsMult[252] = 1000.;
    // change binning
    const Int_t ptNbins = 81;
{'fraction_non_alphanumeric': 0.1377466581795035, 'fraction_numerical': 0.01578612348822406, 'mean_word_length': 5.274760383386582, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 74, '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': '5396021', 'n_tokens_mistral': 3002, 'n_tokens_neox': 2861, 'n_words': 383}