<commit_before>//
// Macro designed for use with the AliAnalysisTaskDptDptCorrelations task.
//
// Author: <NAME> & <NAME>, Wayne State
// 
//           system:  0: PbPb                 1: pp
//      singlesOnly:  0: full correlations    1: singles only
//       useWeights:  0: no                   1: yes
// centralityMethod:  3: track count  4: V0 centrality
//        chargeSet:  0: ++    1: +-    2: -+    3: --
/////////////////////////////////////////////////////////////////////////////////
AliAnalysisTaskDptDptCorrelations *AddTaskDptDptCorrelations2010(int    system                 = 0,
                                                                 int    singlesOnly            = 0,
                                                                 int    useWeights             = 1,
                                                                 int    centralityMethod       = 4,
                                                                 int    chargeSet              = 1)

{
  // Set Default Configuration of this analysis
  // ==========================================
  int    debugLevel             = 0;
  int    rejectPileup           = 1;
  int    rejectPairConversion   = 1;
  int    sameFilter             = 1;

  
  int    nCentrality;
  double minCentrality[10];
  double maxCentrality[10];

  if (system==0) // PbPb
    {
    if (centralityMethod == 4)
      {

	/*nCentrality = 6;
        minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
        minCentrality[1] = 5.0; maxCentrality[1] = 10.;
	minCentrality[2] = 30.; maxCentrality[2] = 40.;
        minCentrality[3] = 40.; maxCentrality[3] = 50.;
        minCentrality[4] = 70.; maxCentrality[4] = 80.;
        minCentrality[5] = 80.; maxCentrality[5] = 90.;*/
	
	nCentrality = 10;
	minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
	minCentrality[1] = 5.0; maxCentrality[1] = 10.;
	minCentrality[2] = 10.; maxCentrality[2] = 20.;
	minCentrality[3] = 20.; maxCentrality[3] = 30.;
	minCentrality[4] = 30.; maxCentrality[4] = 40.;
	minCentrality[5] = 40.; maxCentrality[5] = 50.;
	minCentrality[6] = 50.; maxCentrality[6] = 60.;
	minCentrality[7] = 60.; maxCentrality[7] = 70.;
	minCentrality[8] = 70.; maxCentrality[8] = 80.;
	minCentrality[9] = 80.; maxCentrality[9] = 90.;
	
      }
    else
      {
	//cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
      return 0;
      }
    }
  else if (system==1) // pp
    {
    if (centralityMethod == 3)
      {
      nCentrality = 4;
      minCentrality[0] = 2;   maxCentrality[0] = 100.0;
      minCentrality[1] = 2;   maxCentrality[1] = 20.;
      minCentrality[2] = 20.; maxCentrality[2] = 50.;
      minCentrality[3] = 50.; maxCentrality[3] = 100.;
      }
    else
      {
	//cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
      return 0;
      }
    }
  else
    {
      //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". Option NOT CURRENTLY AVAILABLE. ABORT."
    return 0;
    }

  double zMin                   = -10.;
  double zMax                   =  10.;
  double ptMin                  =  0.2;
  double ptMax                  =  2.0;
  double etaMin                 = -0.9;
  double etaMax                 =  0.9;
  double dcaZMin                = -3.0;
  double dcaZMax                =  3.0;
  double dcaXYMin               = -2.4;
  double dcaXYMax               =  2.4;
  double dedxMin                =  0.0;
  double dedxMax                =  20000.0;
  int    nClusterMin            =   80;
  int    trackFilterBit         =  128;//TPC only
  //int    trackFilterBit         =  272; //Hybrid
  
  int    requestedCharge1       =  1; //default
  int    requestedCharge2       = -1; //default
  
  
  // Get the pointer to the existing analysis manager via the static access method.
  // ==============================================================================
  AliAnalysisManager *analysisManager = AliAnalysisManager::GetAnalysisManager();
  
  if (!analysisManager) 
    {
    ::Error("AddTaskDptDptCorrelations", "No analysis manager to connect to.");
    return NULL;
    }  
  
  TString part1Name;
  TString part2Name;
  TString eventName;
  TString prefixName        = "Corr_";
  TString pileupRejecSuffix = "_PileupRejec";
  TString pairRejecSuffix   = "_PairRejec";
  TString calibSuffix       = "_calib";
  TString singlesOnlySuffix = "_SO";
  TString suffix;
  
  TString inputPath         = ".";
  TString outputPath        = ".";
  TString baseName;
  TString listName;
  TString taskName;
  TString inputHistogramFileName;
  TString outputHistogramFileName;
  
  // Create the task and add subtask.
  // ===========================================================================
  int iTask = 0; // task counter
  AliAnalysisDataContainer *taskInputContainer;
  AliAnalysisDataContainer *taskOutputContainer;
  AliAnalysisTaskDptDptCorrelations* task;
  
  for (int iCentrality=0; iCentrality < nCentrality; ++iCentrality)
    {
      switch (chargeSet)
        {
          case 0: part1Name = "P_"; part2Name = "P_"; requestedCharge1 =  1; requestedCharge2 =  1; sameFilter = 1; break;
          case 1: part1Name = "P_"; part2Name = "M_"; requestedCharge1 =  1; requestedCharge2 = -1; sameFilter = 0;   break;
          case 2: part1Name = "M_"; part2Name = "P_"; requestedCharge1 = -1; requestedCharge2 =  1; sameFilter = 0;   break;
          case 3: part1Name = "M_"; part2Name = "M_"; requestedCharge1 = -1; requestedCharge2 = -1; sameFilter = 1;   break;
        }
      //part1Name += int(1000*etaMin);
      part1Name += "eta";
      part1Name += int(1000*etaMax);
      part1Name += "_";
      part1Name += int(1000*ptMin);
      part1Name += "pt";
      part1Name += int(1000*ptMax);
      part1Name += "_";
      //part2Name += int(1000*etaMin);
      part2Name += "eta";
      part2Name += int(1000*etaMax);
      part2Name += "_";
      part2Name += int(1000*ptMin);
      part2Name += "pt";
      part2Name += int(1000*ptMax);
      part2Name += "_";
      eventName =  "";
      eventName += int(10.*minCentrality[iCentrality] );
      eventName += "Vo";
      eventName += int(10.*maxCentrality[iCentrality] );
      //eventName += "_";
      //eventName += int(10*zMin ); 
      //eventName += "Z";
      //eventName += int(10*zMax ); 
      //if (rejectPileup)         eventName += pileupRejecSuffix;
      //if (rejectPairConversion) eventName += pairRejecSuffix;
      baseName     =   prefixName;
      baseName     +=  part1Name;
      baseName     +=  part2Name;
      baseName     +=  eventName;
      listName     =   baseName;
      taskName     =   baseName;

      inputHistogramFileName =  "/Users/prabhat/MyTestforEta/PbPb276Calibration_2010.root";
      //inputHistogramFileName =  "alien:///alice/cern.ch/user/p/prabhat/CalibFiles/PbPb276Calibration_2010.root";

      outputHistogramFileName = baseName;
      if (singlesOnly) outputHistogramFileName += singlesOnlySuffix;
      outputHistogramFileName += ".root";
      
      /*cout << "============================================================" << endl;
    cout << "                   iTask: " << iTask << endl;
      cout << "               Task Name: " << taskName << endl;
      cout << "               List Name: " << listName << endl;
      cout << "  inputHistogramFileName: " << inputHistogramFileName  << endl;
      cout << " outputHistogramFileName: " << outputHistogramFileName << endl;
      cout << "                  system: " << system << endl;
      cout << "             singlesOnly: " << singlesOnly << endl;<commit_msg>change in AddTask macro for alien directory (<NAME> <<EMAIL>>)<commit_after>//
// Macro designed for use with the AliAnalysisTaskDptDptCorrelations task.
//
// Author: <NAME> & <NAME>, Wayne State
// 
//           system:  0: PbPb                 1: pp
//      singlesOnly:  0: full correlations    1: singles only
//       useWeights:  0: no                   1: yes
// centralityMethod:  3: track count  4: V0 centrality
//        chargeSet:  0: ++    1: +-    2: -+    3: --
/////////////////////////////////////////////////////////////////////////////////
AliAnalysisTaskDptDptCorrelations *AddTaskDptDptCorrelations2010(int    system                 = 0,
                                                                 int    singlesOnly            = 0,
                                                                 int    useWeights             = 1,
                                                                 int    centralityMethod       = 4,
                                                                 int    chargeSet              = 1)

{
  // Set Default Configuration of this analysis
  // ==========================================
  int    debugLevel             = 0;
  int    rejectPileup           = 1;
  int    rejectPairConversion   = 1;
  int    sameFilter             = 1;

  
  int    nCentrality;
  double minCentrality[10];
  double maxCentrality[10];

  if (system==0) // PbPb
    {
    if (centralityMethod == 4)
      {

	/*nCentrality = 6;
        minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
        minCentrality[1] = 5.0; maxCentrality[1] = 10.;
	minCentrality[2] = 30.; maxCentrality[2] = 40.;
        minCentrality[3] = 40.; maxCentrality[3] = 50.;
        minCentrality[4] = 70.; maxCentrality[4] = 80.;
        minCentrality[5] = 80.; maxCentrality[5] = 90.;*/
	
	nCentrality = 10;
	minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
	minCentrality[1] = 5.0; maxCentrality[1] = 10.;
	minCentrality[2] = 10.; maxCentrality[2] = 20.;
	minCentrality[3] = 20.; maxCentrality[3] = 30.;
	minCentrality[4] = 30.; maxCentrality[4] = 40.;
	minCentrality[5] = 40.; maxCentrality[5] = 50.;
	minCentrality[6] = 50.; maxCentrality[6] = 60.;
	minCentrality[7] = 60.; maxCentrality[7] = 70.;
	minCentrality[8] = 70.; maxCentrality[8] = 80.;
	minCentrality[9] = 80.; maxCentrality[9] = 90.;
	
      }
    else
      {
	//cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
      return 0;
      }
    }
  else if (system==1) // pp
    {
    if (centralityMethod == 3)
      {
      nCentrality = 4;
      minCentrality[0] = 2;   maxCentrality[0] = 100.0;
      minCentrality[1] = 2;   maxCentrality[1] = 20.;
      minCentrality[2] = 20.; maxCentrality[2] = 50.;
      minCentrality[3] = 50.; maxCentrality[3] = 100.;
      }
    else
      {
	//cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
      return 0;
      }
    }
  else
    {
      //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". Option NOT CURRENTLY AVAILABLE. ABORT."
    return 0;
    }

  double zMin                   = -10.;
  double zMax                   =  10.;
  double ptMin                  =  0.2;
  double ptMax                  =  2.0;
  double etaMin                 = -0.9;
  double etaMax                 =  0.9;
  double dcaZMin                = -3.0;
  double dcaZMax                =  3.0;
  double dcaXYMin               = -2.4;
  double dcaXYMax               =  2.4;
  double dedxMin                =  0.0;
  double dedxMax                =  20000.0;
  int    nClusterMin            =   80;
  int    trackFilterBit         =  128;//TPC only
  //int    trackFilterBit         =  272; //Hybrid
  
  int    requestedCharge1       =  1; //default
  int    requestedCharge2       = -1; //default
  
  
  // Get the pointer to the existing analysis manager via the static access method.
  // ==============================================================================
  AliAnalysisManager *analysisManager = AliAnalysisManager::GetAnalysisManager();
  
  if (!analysisManager) 
    {
    ::Error("AddTaskDptDptCorrelations", "No analysis manager to connect to.");
    return NULL;
    }  
  
  TString part1Name;
  TString part2Name;
  TString eventName;
  TString prefixName        = "Corr_";
  TString pileupRejecSuffix = "_PileupRejec";
  TString pairRejecSuffix   = "_PairRejec";
  TString calibSuffix       = "_calib";
  TString singlesOnlySuffix = "_SO";
  TString suffix;
  
  TString inputPath         = ".";
  TString outputPath        = ".";
  TString baseName;
  TString listName;
  TString taskName;
  TString inputHistogramFileName;
  TString outputHistogramFileName;
  
  // Create the task and add subtask.
  // ===========================================================================
  int iTask = 0; // task counter
  AliAnalysisDataContainer *taskInputContainer;
  AliAnalysisDataContainer *taskOutputContainer;
  AliAnalysisTaskDptDptCorrelations* task;
  
  for (int iCentrality=0; iCentrality < nCentrality; ++iCentrality)
    {
      switch (chargeSet)
        {
          case 0: part1Name = "P_"; part2Name = "P_"; requestedCharge1 =  1; requestedCharge2 =  1; sameFilter = 1; break;
          case 1: part1Name = "P_"; part2Name = "M_"; requestedCharge1 =  1; requestedCharge2 = -1; sameFilter = 0;   break;
          case 2: part1Name = "M_"; part2Name = "P_"; requestedCharge1 = -1; requestedCharge2 =  1; sameFilter = 0;   break;
          case 3: part1Name = "M_"; part2Name = "M_"; requestedCharge1 = -1; requestedCharge2 = -1; sameFilter = 1;   break;
        }
      //part1Name += int(1000*etaMin);
      part1Name += "eta";
      part1Name += int(1000*etaMax);
      part1Name += "_";
      part1Name += int(1000*ptMin);
      part1Name += "pt";
      part1Name += int(1000*ptMax);
      part1Name += "_";
      //part2Name += int(1000*etaMin);
      part2Name += "eta";
      part2Name += int(1000*etaMax);
      part2Name += "_";
      part2Name += int(1000*ptMin);
      part2Name += "pt";
      part2Name += int(1000*ptMax);
      part2Name += "_";
      eventName =  "";
      eventName += int(10.*minCentrality[iCentrality] );
      eventName += "Vo";
      eventName += int(10.*maxCentrality[iCentrality] );
      //eventName += "_";
      //eventName += int(10*zMin ); 
      //eventName += "Z";
      //eventName += int(10*zMax ); 
      //if (rejectPileup)         eventName += pileupRejecSuffix;
      //if (rejectPairConversion) eventName += pairRejecSuffix;
      baseName     =   prefixName;
      baseName     +=  part1Name;
      baseName     +=  part2Name;
      baseName     +=  eventName;
      listName     =   baseName;
      taskName     =   baseName;

      
      inputHistogramFileName =  "alien:///alice/cern.ch/user/p/prabhat/CalibFiles/PbPb276Calibration_2010.root";

      outputHistogramFileName = baseName;
      if (singlesOnly) outputHistogramFileName += singlesOnlySuffix;
      outputHistogramFileName += ".root";
      
      /*cout << "============================================================" << endl;
    cout << "                   iTask: " << iTask << endl;
      cout << "               Task Name: " << taskName << endl;
      cout << "               List Name: " << listName << endl;
      cout << "  inputHistogramFileName: " << inputHistogramFileName  << endl;
      cout << " outputHistogramFileName: " << outputHistogramFileName << endl;
      cout << "                  system: " << system << endl;
      cout << "             singlesOnly: " << singlesOnly << endl;
{'fraction_non_alphanumeric': 0.164368414205802, 'fraction_numerical': 0.03987251203330298, 'mean_word_length': 1.9235596120935539, 'pattern_counts': {'":': 0, '<': 156, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '421216', 'n_tokens_mistral': 5210, 'n_tokens_neox': 4803, 'n_words': 1055}