<commit_before>#ifndef __CINT__
#include <AliRsnListOutput.h>
#include <AliRsnValuePair.h>
#include <AliRsnValueEvent.h>
#include <AliRsnMiniAnalysisTask.h>
#endif

void AddRsnPairsPhi(AliAnalysisTaskSE *task,
                    Bool_t isMC,
                    Bool_t isMixing,
                    AliPID::EParticleType pType1,
                    Int_t listID1,
                    AliPID::EParticleType pType2,
                    Int_t listID2,
                    AliRsnCutSet *cutsEvent=0,
                    AliRsnCutSet *cutsPair=0,
                    TString suffix = "") {

   Printf("id1=%d id2=%d",listID1,listID2);

   // retrieve mass from PDG database
   Int_t         pdg  = 333;
   TDatabasePDG *db   = TDatabasePDG::Instance();
   TParticlePDG *part = db->GetParticle(pdg);
   Double_t mass = part->Mass();
   Bool_t valid;

   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);

   if (isRsnMini) {
      AddPairOutputMiniPhi(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsPair,suffix);
   } else {
      // this function is common and it is located in RsnConfig.C
      // as ouptup AddPairOutputPhi from this macro will be taken
      AddPair(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsEvent,cutsPair,suffix);
   }
}
void AddPairOutputPhi(AliRsnLoopPair *pair)
{
   Bool_t valid;
   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
   Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);
   
   // axes
   AliRsnValuePair *axisIM = new AliRsnValuePair("IM", AliRsnValuePair::kInvMass);
   AliRsnValuePair *axisPt = new AliRsnValuePair("PT", AliRsnValuePair::kPt);
   AliRsnValuePair *axisEta = new AliRsnValuePair("ETA", AliRsnValuePair::kEta);
   AliRsnValuePair *axisRapidity = new AliRsnValuePair("Y", AliRsnValuePair::kY);

   AliRsnValueEvent *axisCentrality = 0;
   if (collisionType == 1) axisCentrality = new AliRsnValueEvent("MULTI",AliRsnValueEvent::kCentralityV0);


   axisIM     ->SetBins(300, 0.9, 1.2);
//   axisIM     ->SetBins(600, 0.9, 1.2);
//   axisIM     ->SetBins(1000, 0.9, 1.9);
   axisPt     ->SetBins(120, 0.0, 12.0);
//    axisEta    ->SetBins(400, -2.0, 2.0);
   axisEta    ->SetBins(400, -0.5, 0.5);
   axisRapidity    ->SetBins(10, -0.5, 0.5);

   if (axisCentrality) axisCentrality->SetBins(20,0,100);

   // output: 2D histogram of inv. mass vs. pt
   AliRsnListOutput *outPair = 0;
   if (!isFullOutput) {
      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoDefault);
      outPair->AddValue(axisIM);
   } else {
      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoSparse);
      outPair->AddValue(axisIM);
      outPair->AddValue(axisPt);
      if (useRapidity) outPair->AddValue(axisRapidity);
      else outPair->AddValue(axisEta);
      if (axisCentrality) outPair->AddValue(axisCentrality);
   }
   // add outputs to loop
   pair->AddOutput(outPair);
}

void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing, AliPID::EParticleType pType1,Int_t listID1, AliPID::EParticleType pType2,Int_t listID2, Int_t pdgMother,Double_t massMother, AliRsnCutSet *cutsPair=0,TString suffix = "") {

   Bool_t valid;
   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
   Int_t useMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);

   Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);

   AliRsnMiniAnalysisTask *taskRsnMini =  (AliRsnMiniAnalysisTask *)task;

   if (collisionType==0) taskRsnMini->UseMultiplicity("QUALITY");
   else {
      taskRsnMini->UseCentrality("V0M");
      Int_t multID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);
      AliRsnMiniOutput *outMult = taskRsnMini->CreateOutput("eventMult", "HIST", "EVENT");
      outMult->AddAxis(multID, 100, 0.0, 100.0);
      Int_t paID = taskRsnMini->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE);
      AliRsnMiniOutput *outPa = taskRsnMini->CreateOutput("planeAngle", "HIST", "EVENT");
      outPa->AddAxis(paID, 100, 0, TMath::Pi());
   }


   /* invariant mass   */ Int_t imID   = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
   /* IM resolution    */ Int_t resID  = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMassDiff, kTRUE);
   /* transv. momentum */ Int_t ptID   = taskRsnMini->CreateValue(AliRsnMiniValue::kPt, kFALSE);
   /* centrality       */ Int_t centID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);
   /* eta              */ Int_t etaID = taskRsnMini->CreateValue(AliRsnMiniValue::kEta, kFALSE);
   /* rapidity         */ Int_t yID = taskRsnMini->CreateValue(AliRsnMiniValue::kY, kFALSE);


   // use an array for more compact writing, which are different on mixing and charges
   // [0] = unlike
   // [1] = mixing
   // [2] = like ++
   // [3] = like --
   Bool_t  use     [5] = { 1      ,  useMixing      ,  1      ,  1      ,  isMC  };
   TString name    [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues"};
   TString comp    [5] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE" };
   Char_t  charge1 [5] = {'+'     , '+'     , '+'     , '-'     , '+'    };
   Char_t  charge2 [5] = {'-'     , '-'     , '+'     , '-'     , '-'    };

   // common definitions
   TString outputType = "HIST";
   if (isFullOutput) outputType = "SPARSE";

   Int_t nIM   = 215; Double_t minIM   = 0.985, maxIM =  1.2;
//    Int_t nEta   = 400; Double_t minEta   = -2.0, maxEta =  2.0;
   Int_t nEta   = 400; Double_t minEta   = -0.5, maxEta =  0.5;
   Int_t nY   = 1; Double_t minY   = -0.5, maxY =  0.5;
//   Int_t nIM   = 1000; Double_t minIM   = 0.9, maxIM =  1.9;
   Int_t nPt   = 120; Double_t minPt   = 0.0, maxPt = 12.0;
   if (collisionType==0) nPt = 240;minPt=0.0;maxPt=24.0;
   Int_t nCent = 20; Double_t minCent = 0.0, maxCent = 100.0;
   Int_t nRes  = 200; Double_t maxRes  = 0.01;

   // retrieve mass from PDG database
   Int_t         pdg  = 333;
   TDatabasePDG *db   = TDatabasePDG::Instance();
   TParticlePDG *part = db->GetParticle(pdg);


   Printf(suffix.Data());
   // create standard outputs
   for (Int_t i = 0; i < 5; i++) {<commit_msg>Minor change to histo range<commit_after>#ifndef __CINT__
#include <AliRsnListOutput.h>
#include <AliRsnValuePair.h>
#include <AliRsnValueEvent.h>
#include <AliRsnMiniAnalysisTask.h>
#endif

void AddRsnPairsPhi(AliAnalysisTaskSE *task,
                    Bool_t isMC,
                    Bool_t isMixing,
                    AliPID::EParticleType pType1,
                    Int_t listID1,
                    AliPID::EParticleType pType2,
                    Int_t listID2,
                    AliRsnCutSet *cutsEvent=0,
                    AliRsnCutSet *cutsPair=0,
                    TString suffix = "") {

   Printf("id1=%d id2=%d",listID1,listID2);

   // retrieve mass from PDG database
   Int_t         pdg  = 333;
   TDatabasePDG *db   = TDatabasePDG::Instance();
   TParticlePDG *part = db->GetParticle(pdg);
   Double_t mass = part->Mass();
   Bool_t valid;

   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);

   if (isRsnMini) {
      AddPairOutputMiniPhi(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsPair,suffix);
   } else {
      // this function is common and it is located in RsnConfig.C
      // as ouptup AddPairOutputPhi from this macro will be taken
      AddPair(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsEvent,cutsPair,suffix);
   }
}
void AddPairOutputPhi(AliRsnLoopPair *pair)
{
   Bool_t valid;
   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
   Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);
   
   // axes
   AliRsnValuePair *axisIM = new AliRsnValuePair("IM", AliRsnValuePair::kInvMass);
   AliRsnValuePair *axisPt = new AliRsnValuePair("PT", AliRsnValuePair::kPt);
   AliRsnValuePair *axisEta = new AliRsnValuePair("ETA", AliRsnValuePair::kEta);
   AliRsnValuePair *axisRapidity = new AliRsnValuePair("Y", AliRsnValuePair::kY);

   AliRsnValueEvent *axisCentrality = 0;
   if (collisionType == 1) axisCentrality = new AliRsnValueEvent("MULTI",AliRsnValueEvent::kCentralityV0);


   axisIM     ->SetBins(300, 0.9, 1.2);
//   axisIM     ->SetBins(600, 0.9, 1.2);
//   axisIM     ->SetBins(1000, 0.9, 1.9);
   axisPt     ->SetBins(120, 0.0, 12.0);
//    axisEta    ->SetBins(400, -2.0, 2.0);
   axisEta    ->SetBins(400, -0.5, 0.5);
   axisRapidity    ->SetBins(10, -0.5, 0.5);

   if (axisCentrality) axisCentrality->SetBins(20,0,100);

   // output: 2D histogram of inv. mass vs. pt
   AliRsnListOutput *outPair = 0;
   if (!isFullOutput) {
      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoDefault);
      outPair->AddValue(axisIM);
   } else {
      outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoSparse);
      outPair->AddValue(axisIM);
      outPair->AddValue(axisPt);
      if (useRapidity) outPair->AddValue(axisRapidity);
      else outPair->AddValue(axisEta);
      if (axisCentrality) outPair->AddValue(axisCentrality);
   }
   // add outputs to loop
   pair->AddOutput(outPair);
}

void AddPairOutputMiniPhi(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing, AliPID::EParticleType pType1,Int_t listID1, AliPID::EParticleType pType2,Int_t listID2, Int_t pdgMother,Double_t massMother, AliRsnCutSet *cutsPair=0,TString suffix = "") {

   Bool_t valid;
   Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
   Int_t useMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);

   Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);

   AliRsnMiniAnalysisTask *taskRsnMini =  (AliRsnMiniAnalysisTask *)task;

   if (collisionType==0) taskRsnMini->UseMultiplicity("QUALITY");
   else {
      taskRsnMini->UseCentrality("V0M");
      Int_t multID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);
      AliRsnMiniOutput *outMult = taskRsnMini->CreateOutput("eventMult", "HIST", "EVENT");
      outMult->AddAxis(multID, 100, 0.0, 100.0);
      Int_t paID = taskRsnMini->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE);
      AliRsnMiniOutput *outPa = taskRsnMini->CreateOutput("planeAngle", "HIST", "EVENT");
      outPa->AddAxis(paID, 100, 0, TMath::Pi());
   }


   /* invariant mass   */ Int_t imID   = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
   /* IM resolution    */ Int_t resID  = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMassDiff, kTRUE);
   /* transv. momentum */ Int_t ptID   = taskRsnMini->CreateValue(AliRsnMiniValue::kPt, kFALSE);
   /* centrality       */ Int_t centID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE);
   /* eta              */ Int_t etaID = taskRsnMini->CreateValue(AliRsnMiniValue::kEta, kFALSE);
   /* rapidity         */ Int_t yID = taskRsnMini->CreateValue(AliRsnMiniValue::kY, kFALSE);


   // use an array for more compact writing, which are different on mixing and charges
   // [0] = unlike
   // [1] = mixing
   // [2] = like ++
   // [3] = like --
   Bool_t  use     [5] = { 1      ,  useMixing      ,  1      ,  1      ,  isMC  };
   TString name    [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues"};
   TString comp    [5] = {"PAIR"  , "MIX"   , "PAIR"  , "PAIR"  , "TRUE" };
   Char_t  charge1 [5] = {'+'     , '+'     , '+'     , '-'     , '+'    };
   Char_t  charge2 [5] = {'-'     , '-'     , '+'     , '-'     , '-'    };

   // common definitions
   TString outputType = "HIST";
   if (isFullOutput) outputType = "SPARSE";

   Int_t nIM   = 215; Double_t minIM   = 0.985, maxIM =  1.2;
//    Int_t nEta   = 400; Double_t minEta   = -2.0, maxEta =  2.0;
   Int_t nEta   = 400; Double_t minEta   = -0.5, maxEta =  0.5;
   Int_t nY   = 1; Double_t minY   = -0.5, maxY =  0.5;
//   Int_t nIM   = 1000; Double_t minIM   = 0.9, maxIM =  1.9;
   Int_t nPt   = 240; Double_t minPt   = 0.0, maxPt = 24.0;
   Int_t nCent = 20; Double_t minCent = 0.0, maxCent = 100.0;
   Int_t nRes  = 200; Double_t maxRes  = 0.01;

   // retrieve mass from PDG database
   Int_t         pdg  = 333;
   TDatabasePDG *db   = TDatabasePDG::Instance();
   TParticlePDG *part = db->GetParticle(pdg);


   Printf(suffix.Data());
   // create standard outputs
   for (Int_t i = 0; i < 5; i++) {
{'fraction_non_alphanumeric': 0.1359854188129012, 'fraction_numerical': 0.02908312861557968, 'mean_word_length': 3.22214787554366, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3012769', 'n_tokens_mistral': 5062, 'n_tokens_neox': 4751, 'n_words': 890}