<commit_before>void MakeITSRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult, const char* cdbURI="local://") {
//========================================================================
//
// Steering macro for ITSU reconstruction parameters
//
// Contact: <EMAIL>
//
//========================================================================
  const char* macroname = "MakeITSRecoParam.C";
  //
  enum {kBit0=0x1<<0,kBit1=0x1<<1,kBit2=0x1<<2,kBit3=0x1<<3,kBit4=0x1<<4,kBit5=0x1<<5,kBit6=0x1<<6,kBit7=0x7<<2,kBit8=0x1<<8};
  //
  //
  gSystem->Load("libITSUpgradeBase.so");
  gSystem->Load("libITSUpgradeSim.so");
  gSystem->Load("libITSUpgradeRec.so");
  //
  // Activate CDB storage and load geometry from CDB
  AliCDBManager* cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage(cdbURI);
  AliITSUTrackCond* trcond = 0;
  int nLr = 7;
  //  
  TObjArray *recoParamArray = new TObjArray();
  //
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetCosmicTestParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
    itsRecoParam->SetTitle("Cosmic");
    recoParamArray->AddLast(itsRecoParam);
  }
  //
  const Bool_t kAllowDiagCl = kFALSE;
  const Bool_t kUseLUT[3] = {kTRUE,kTRUE,kFALSE}; // use TGeo mat.queries only for RefitInward
  //
  // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5%
  // long tracks
  int   c0nBranch[7]   = {5,10,15,4,6,6,10}; // max branching for the seed on layer
  int   c0nCands[7]    = {10,20,45,20,45,15,10}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {6, 10,20,40,70,70,70}; // cut on seed global norm chi2
  float c0missPen[7]   = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,2.,3.,8., 10.,10.,10.,10.,10.,10.,10.};   // chi2SA vs Nclus
  float c0maxChi2Match = 10.;
  //
  // short tracks from decays
  int   c1nBranch[7]   = {0,0,0,4,6,6,10}; // max branching for the seed on layer
  int   c1nCands[7]    = {0,0,0,20,45,15,10}; // max candidates for the TPC seed
  float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2 
  float c1gloChi2[7]   = {0,0,0,16,40,30,30}; // cut on seed global norm chi2
  float c1missPen[7]   = {0.,0.,0.,2.,2.,2.,2.};    // missing cluster penalty
  float c1maxChi2SA[14] = {0.,0.,0.,7.,8.,8.,8., 10.,10.,10.,10.,10.,10.,10.};  // chi2SA vs Nclus
  float c1maxChi2Match = 8.;

  //
  /*
    // tuned for 20x33 pixels
  int   c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
  int   c0nCands[7]  = {10,20,25,20,30,15,20}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {20,20,25,25,25,30,40}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {9, 10,15,20,30,30,30}; // cut on seed global norm chi2
  float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
  float c0maxChi2Match = 10.;
  */

  /*
  // this is for tuning only
  int   c0nBranch[7] = {30,20,20,20,20,20,20}; // max branching for the seed on layer
  int   c0nCands[7]  = {20,100,100,100,100,55,20}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {40,50,60,80,80,80,80}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {20, 30,40,60,80,80,80}; // cut on seed global norm chi2
  float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
  float c0maxChi2Match = 20.;
  */
  //
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
    itsRecoParam->SetTitle("LowMult");
    recoParamArray->AddLast(itsRecoParam);
    //******************************************************************
    for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
    for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
    //  
    // Add tracking conditions >>>
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
    //
    // to exclude some layer use trCon->ExcludeLayer(lrID);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(5); // min hits
    trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
    trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
    trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
    //-----------------------------------------------------------
    // short tracks
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    //
    trCond->ExcludeLayer(0);
    trCond->ExcludeLayer(1);
    trCond->ExcludeLayer(2);
    //
    trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
    //
    // to exclude some layer use trCon->ExcludeLayer(lrID);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c1nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c1nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c1missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(4); // min hits
    trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
   
    // Add tracking conditions <<<
  }
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
    itsRecoParam->SetTitle("HighMult");
    recoParamArray->AddLast(itsRecoParam);
    //******************************************************************
    for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
    for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
    //  
    // Add tracking conditions >>>
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]);   // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(5); // min hits
    trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
    trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
    trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
    //-----------------------------------------------------------
    // short tracks
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    //
    trCond->ExcludeLayer(0);<commit_msg>recoparam tuned for tdr5 setup<commit_after>void MakeITSRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult, const char* cdbURI="local://") {
//========================================================================
//
// Steering macro for ITSU reconstruction parameters
//
// Contact: <EMAIL>
//
//========================================================================
  const char* macroname = "MakeITSRecoParam.C";
  //
  enum {kBit0=0x1<<0,kBit1=0x1<<1,kBit2=0x1<<2,kBit3=0x1<<3,kBit4=0x1<<4,kBit5=0x1<<5,kBit6=0x1<<6,kBit7=0x7<<2,kBit8=0x1<<8};
  //
  //
  gSystem->Load("libITSUpgradeBase.so");
  gSystem->Load("libITSUpgradeSim.so");
  gSystem->Load("libITSUpgradeRec.so");
  //
  // Activate CDB storage and load geometry from CDB
  AliCDBManager* cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage(cdbURI);
  AliITSUTrackCond* trcond = 0;
  int nLr = 7;
  
  TObjArray *recoParamArray = new TObjArray();
  //
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetCosmicTestParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
    itsRecoParam->SetTitle("Cosmic");
    recoParamArray->AddLast(itsRecoParam);
  }
  //
  const Bool_t kAllowDiagCl = kFALSE;
  //
  // long tracks
  /*
  // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
  //
  int   c0nBranch[7]   = {5,10,15,4,6,6,10}; // max branching for the seed on layer
  int   c0nCands[7]    = {10,20,45,20,45,15,10}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {6, 10,20,40,70,70,70}; // cut on seed global norm chi2
  float c0missPen[7]   = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,2.,3.,8., 10.,10.,10.,10.,10.,10.,10.};   // chi2SA vs Nclus
  float c0maxChi2Match = 10.;
  */
  //
  //  /*
  // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% TDR5 setup
  int   c0nBranch[7] = {3,9,15,4,5,7,10}; // max branching for the seed on layer
  int   c0nCands[7]  = {10,15,45,20,60,20,10}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {6,10,20,30,60,60,70}; // cut on seed global norm chi2
  float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,2.5,5.,10., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
  float c0maxChi2Match = 10.;
  //  */


  // short tracks from decays
  /*
  // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
  int   c1nBranch[7]   = {0,0,0,4,6,6,10}; // max branching for the seed on layer
  int   c1nCands[7]    = {0,0,0,20,45,15,10}; // max candidates for the TPC seed
  float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2 
  float c1gloChi2[7]   = {0,0,0,16,40,30,30}; // cut on seed global norm chi2
  float c1missPen[7]   = {0.,0.,0.,2.,2.,2.,2.};    // missing cluster penalty
  float c1maxChi2SA[14] = {0.,0.,0.,7.,8.,8.,8., 10.,10.,10.,10.,10.,10.,10.};  // chi2SA vs Nclus
  float c1maxChi2Match = 8.;
  */

  // short tracks from decays
  int   c1nBranch[7]   = {0,0,0,4,6,6,10}; // max branching for the seed on layer
  int   c1nCands[7]    = {0,0,0,5,5,5,8}; // max candidates for the TPC seed
  float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2 
  float c1gloChi2[7]   = {0,0,0,16,40,35,30}; // cut on seed global norm chi2
  float c1missPen[7]   = {0.,0.,0.,2.,2.,2.,2.};    // missing cluster penalty
  float c1maxChi2SA[14] = {0.,0.,0.,5.,13.,13.,18., 10.,10.,10.,10.,10.,10.,10.};  // chi2SA vs Nclus
  float c1maxChi2Match = 10.;

  //
  /*
    // tuned for 20x33 pixels
  int   c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
  int   c0nCands[7]  = {10,20,25,20,30,15,20}; // max candidates for the TPC seed
  float c0tr2clChi2[7] = {20,20,25,25,25,30,40}; // cut on cluster to track chi2 
  float c0gloChi2[7]   = {9, 10,15,20,30,30,30}; // cut on seed global norm chi2
  float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
  float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
  float c0maxChi2Match = 10.;
  */

  //
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
    itsRecoParam->SetTitle("LowMult");
    recoParamArray->AddLast(itsRecoParam);
    //******************************************************************
    for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
    //  
    // Add tracking conditions >>>
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
    //
    // to exclude some layer use trCon->ExcludeLayer(lrID);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(5); // min hits
    trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
    trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
    trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
    //-----------------------------------------------------------
    // short tracks
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    //
    trCond->ExcludeLayer(0);
    trCond->ExcludeLayer(1);
    trCond->ExcludeLayer(2);
    //
    trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
    //
    // to exclude some layer use trCon->ExcludeLayer(lrID);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c1nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c1nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c1missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(4); // min hits
    trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
   
    // Add tracking conditions <<<
  }
  {
    AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
    //
    itsRecoParam->SetNLayers(nLr);
    //
    //******************************************************************
    itsRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
    itsRecoParam->SetTitle("HighMult");
    recoParamArray->AddLast(itsRecoParam);
    //******************************************************************
    for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
    //  
    // Add tracking conditions >>>
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
    //
    for (int i=0;i<nLr;i++) {
      trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
      trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
      trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]);   // cut on cluster to track chi2
      trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
      trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
    }
    for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
    //
    trCond->AddNewCondition(5); // min hits
    trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
    trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
    trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
    //
    trCond->Init();
    //
    itsRecoParam->AddTrackingCondition(trCond);
    //-----------------------------------------------------------
    // short tracks
    trCond = new AliITSUTrackCond();
    trCond->SetNLayers(nLr); 
    //
    trCond->ExcludeLayer(0);
{'fraction_non_alphanumeric': 0.22118535799588956, 'fraction_numerical': 0.0727656501694162, 'mean_word_length': 3.1850302185030217, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 149, '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': '353269', 'n_tokens_mistral': 7407, 'n_tokens_neox': 6843, 'n_words': 1290}