<commit_before>const Int_t numberOfCentralityBins = 10;
TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-1","1-2"};

void drawBalanceFunctionPsi(const char* filename = "AnalysisResultsPsi.root", 
			    Int_t gCentrality = 1,
			    Int_t gDeltaEtaDeltaPhi = 2,
			    Double_t psiMin = -0.5, Double_t psiMax = 0.5,
			    Double_t ptTriggerMin = -1.,
			    Double_t ptTriggerMax = -1.,
			    Double_t ptAssociatedMin = -1.,
			    Double_t ptAssociatedMax = -1.) {
  //Macro that draws the BF distributions for each centrality bin
  //for reaction plane dependent analysis
  //Author: <EMAIL>
  //Load the PWG2ebye library
  gSystem->Load("libANALYSIS.so");
  gSystem->Load("libANALYSISalice.so");
  gSystem->Load("libEventMixing.so");
  gSystem->Load("libCORRFW.so");
  gSystem->Load("libPWGTools.so");
  gSystem->Load("libPWGCFebye.so");

  //Prepare the objects and return them
  TList *listBF = GetListOfObjects(filename,gCentrality,0);
  TList *listBFShuffled = GetListOfObjects(filename,gCentrality,1);
  TList *listBFMixed = GetListOfObjects(filename,gCentrality,2);
  if(!listBF) {
    Printf("The TList object was not created");
    return;
  }
  else 
    draw(listBF,listBFShuffled,listBFMixed,
	 gCentrality,gDeltaEtaDeltaPhi,
	 psiMin,psiMax,
	 ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);  
}

//______________________________________________________//
TList *GetListOfObjects(const char* filename, 
			Int_t gCentrality, Int_t kData = 1) {
  //Get the TList objects (QA, bf, bf shuffled)
  //kData == 0: data
  //kData == 1: shuffling
  //kData == 2: mixing
  TList *listQA = 0x0;
  TList *listBF = 0x0;
  
  //Open the file
  TFile *f = TFile::Open(filename);
  if((!f)||(!f->IsOpen())) {
    Printf("The file %s is not found. Aborting...",filename);
    return listBF;
  }
  //f->ls();
  
  TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis"));
  if(!dir) {   
    Printf("The TDirectoryFile is not found. Aborting...",filename);
    return listBF;
  }
  //dir->ls();
  
  TString listBFName;
  if(kData == 0) {
    //cout<<"no shuffling - no mixing"<<endl;
    listBFName = "listBFPsi_";
  }
  else if(kData == 1) {
    //cout<<"shuffling - no mixing"<<endl;
    listBFName = "listBFPsiShuffled_";
  }
  else if(kData == 2) {
    //cout<<"no shuffling - mixing"<<endl;
    listBFName = "listBFPsiMixed_";
  }
  listBFName += centralityArray[gCentrality-1];
  listBF = dynamic_cast<TList *>(dir->Get(listBFName.Data()));
  cout<<"======================================================="<<endl;
  cout<<"List name: "<<listBF->GetName()<<endl;
  //listBF->ls();

  //Get the histograms
  TString histoName;
  if(kData == 0)
    histoName = "fHistPV0M";
  else if(kData == 1)
    histoName = "fHistP_shuffleV0M";
  else if(kData == 2)
    histoName = "fHistPV0M";
  AliTHn *fHistP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));  
  if(!fHistP) {
    Printf("fHistP %s not found!!!",histoName.Data());
    break;
  }
  fHistP->FillParent(); fHistP->DeleteContainers();

  if(kData == 0)
    histoName = "fHistNV0M";
  if(kData == 1)<commit_msg>correct efficiency/acceptance histograms (centrality dependence)<commit_after>const Int_t numberOfCentralityBins = 10;
TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-1","1-2"};

void drawBalanceFunctionPsi(const char* filename = "AnalysisResultsPsi.root", 
			    Int_t gCentrality = 1,
			    Int_t gDeltaEtaDeltaPhi = 2,
			    Double_t psiMin = -0.5, Double_t psiMax = 0.5,
			    Double_t ptTriggerMin = -1.,
			    Double_t ptTriggerMax = -1.,
			    Double_t ptAssociatedMin = -1.,
			    Double_t ptAssociatedMax = -1.) {
  //Macro that draws the BF distributions for each centrality bin
  //for reaction plane dependent analysis
  //Author: Pan<EMAIL>
  //Load the PWG2ebye library
  gSystem->Load("libANALYSIS.so");
  gSystem->Load("libANALYSISalice.so");
  gSystem->Load("libEventMixing.so");
  gSystem->Load("libCORRFW.so");
  gSystem->Load("libPWGTools.so");
  gSystem->Load("libPWGCFebye.so");

  //Prepare the objects and return them
  TList *listBF = GetListOfObjects(filename,gCentrality,0);
  TList *listBFShuffled = GetListOfObjects(filename,gCentrality,1);
  TList *listBFMixed = GetListOfObjects(filename,gCentrality,2);
  if(!listBF) {
    Printf("The TList object was not created");
    return;
  }
  else 
    draw(listBF,listBFShuffled,listBFMixed,
	 gCentrality,gDeltaEtaDeltaPhi,
	 psiMin,psiMax,
	 ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);  
}

//______________________________________________________//
TList *GetListOfObjects(const char* filename, 
			Int_t gCentrality, Int_t kData = 1) {
  //Get the TList objects (QA, bf, bf shuffled)
  //kData == 0: data
  //kData == 1: shuffling
  //kData == 2: mixing
  TList *listQA = 0x0;
  TList *listBF = 0x0;
  
  //Open the file
  TFile *f = TFile::Open(filename);
  if((!f)||(!f->IsOpen())) {
    Printf("The file %s is not found. Aborting...",filename);
    return listBF;
  }
  f->ls();
  
  TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis"));
  if(!dir) {   
    Printf("The TDirectoryFile is not found. Aborting...",filename);
    return listBF;
  }
  dir->ls();
  
  TString listBFName;
  if(kData == 0) {
    //cout<<"no shuffling - no mixing"<<endl;
    listBFName = "listBFPsi_";
  }
  else if(kData == 1) {
    //cout<<"shuffling - no mixing"<<endl;
    listBFName = "listBFPsiShuffled_";
  }
  else if(kData == 2) {
    //cout<<"no shuffling - mixing"<<endl;
    listBFName = "listBFPsiMixed_";
  }
  listBFName += centralityArray[gCentrality-1];
  listBFName += "_Bit128_V0M";
  listBF = dynamic_cast<TList *>(dir->Get(listBFName.Data()));
  cout<<"======================================================="<<endl;
  cout<<"List name: "<<listBF->GetName()<<endl;
  listBF->ls();

  //Get the histograms
  TString histoName;
  if(kData == 0)
    histoName = "fHistPV0M";
  else if(kData == 1)
    histoName = "fHistP_shuffleV0M";
  else if(kData == 2)
    histoName = "fHistPV0M";
  AliTHn *fHistP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));  
  if(!fHistP) {
    Printf("fHistP %s not found!!!",histoName.Data());
    break;
  }
  fHistP->FillParent(); fHistP->DeleteContainers();

  if(kData == 0)
    histoName = "fHistNV0M";
  if(kData == 1)
{'fraction_non_alphanumeric': 0.17242969110189027, 'fraction_numerical': 0.022744736437682496, 'mean_word_length': 3.964149504195271, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 43, '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': '7379887', 'n_tokens_mistral': 2576, 'n_tokens_neox': 2389, 'n_words': 459}