<commit_before>AliAnalysisTaskEmcalJetBtagSV* AddTaskEmcalJetBtagSV(const char* trkcontname   = "tracks",
                                                     const char* jetcontname   = "Jets",
                                                     const char* mctrkcontname = "mcparticles",
                                                     const char* mcjetcontname = "MCJets",
                                                     Double_t jetRadius = 0.2,
                                                     const char* type  = "TPC",
                                                     TString fileout   = "standard",
                                                     Bool_t corrMode   =  kFALSE,
                                                     Bool_t doBkgRej   =  kTRUE,
                                                     Bool_t doRndmCone =  kFALSE,
                                                     Bool_t doQAvtx    =  kFALSE,
                                                     Bool_t doFillV0   =  kFALSE,
                                                     Bool_t doDetRespMtx = kFALSE,
                                                     Bool_t doOnlyMtxAna = kFALSE,
                                                     Bool_t checkXsec  =  kFALSE,
                                                     Bool_t useWeight  =  kFALSE,
                                                     const char* ptHname  =  "",
                                                     const char* ptHpatt  =  "",
                                                     Int_t gbLogLevel  = AliLog::kInfo,  //=2
                                                     Int_t lcDebLevel  = AliLog::kFatal, //=0
                                                     Double_t tagRadius = 0.4,
                                                     TString cutflname = "",
                                                     Float_t minPt = 0., Float_t maxPt = 100.,
                                                     Float_t minC  = 0., Float_t maxC  = 100.,
                                                     UInt_t  fTrigger = AliVEvent::kAny,
                                                     const char* taskname = "HFjetsContainer")
{ // Mailto: <EMAIL>
  // Get the AnalysisManager
  AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskEmcalJetBtagSV", "No analysis manager to connect to.");
    return NULL;
  }
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskEmcalJetBtagSV", "This task requires an input event handler");
    return NULL;
  }

  TString name(taskname);
  TString strType(type);

  AliAnalysisTaskEmcalJetBtagSV* hfTask = new AliAnalysisTaskEmcalJetBtagSV(name); // Configure analysis task

  AliParticleContainer* trkCont = hfTask->AddTrackContainer(trkcontname);//for data, and reco MC
  AliJetContainer*      jetCont = hfTask->AddJetContainer(jetcontname, strType, jetRadius);
  jetCont->ConnectParticleContainer(trkCont);
  if (corrMode) {
    AliParticleContainer* mctrkCont  = hfTask->AddMCParticleContainer(mctrkcontname);//for MC particle level
    AliJetContainer*      mcjetCont = hfTask->AddJetContainer(mcjetcontname, strType, jetRadius);
  }

  hfTask->SetCorrectionMode(corrMode); // kFALSE for real data
  hfTask->SetDoBkgRejection(doBkgRej);
  hfTask->SetDoRandomCone(doRndmCone);
  hfTask->SetDoFillSecVtxQA(doQAvtx);
  hfTask->SetDoFillV0Trks(doFillV0);
  hfTask->SetDoDetRespMtx(doDetRespMtx);
  hfTask->SetDoOnlyMtxAna(doOnlyMtxAna);
  hfTask->SetPtHardName(ptHname);
  hfTask->SetGenNamePattern(ptHpatt);
  hfTask->SetJetContName(jetcontname);
  hfTask->SetTrkContName(trkcontname);

  hfTask->SetCheckMCCrossSection(checkXsec);  
  if (useWeight) hfTask->SetUseWeightOn();

  hfTask->SetGlLogLevel(gbLogLevel);
  hfTask->SetLcDebLevel(lcDebLevel);

  // choose the method to select on the flavor of the jet and, if needed, select the pt-hard bin via the minimum pt-hard
  // also set mc jet and particle container
  if (corrMode) {
    hfTask->SetMCJetContName(mcjetcontname);
    hfTask->SetMCTrkContName(mctrkcontname);
    hfTask->SetJetTaggingRadius(tagRadius);
  }

  // Define the tagger
  AliHFJetsTaggingVertex* tagger = new AliHFJetsTaggingVertex();

  // Set analysis cuts
  TString strCutFlName(cutflname);
  if (!strCutFlName.IsNull() && !gSystem->AccessPathName(strCutFlName.Data(), kFileExists)) {
    // read cuts from file
    ::Info(Form("Reading cuts from file: %s", strCutFlName.Data()));

    TFile* f = TFile::Open(strCutFlName.Data());
    AliRDHFJetsCuts* cuts = (AliRDHFCutsD0toKpi*)f->Get("HFJetsCutsVertex");

    cuts->SetMinPtJet(minPt);
    cuts->SetMaxPtJet(maxPt);
    // Set centrality
    cuts->SetMinCentrality(minC);
    cuts->SetMaxCentrality(maxC);
    cuts->SetTriggerMask(fTrigger);
//    cuts->SetTriggerClass(trigClass);
    cuts->PrintAll();
    hfTask->SetCuts(cuts);
  } else {
    // define your cuts here
    DefineCutsTask(hfTask, minPt, maxPt, minC, maxC, corrMode, fTrigger);
    DefineCutsTagger(tagger);
  }

  // // Add task to manager
  hfTask->SetTagger(tagger);
  mgr->AddTask(hfTask);

  // Create containers for input/output
  AliAnalysisDataContainer* cInput =   mgr->GetCommonInputContainer();
  mgr->ConnectInput(hfTask, 0, cInput);

  //All containers in a list
  AliAnalysisDataContainer* cOutput = mgr->CreateContainer(name.Data(), TList::Class(), AliAnalysisManager::kOutputContainer,        AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(hfTask, 1, cOutput);

  delete tagger;
  return hfTask;
}

//------------------------------------------------------
Bool_t DefineCutsTask(AliAnalysisTaskEmcalJetBtagSV* task,
                      Float_t minPt, Float_t maxPt,
                      Float_t minC, Float_t maxC, 
                      Bool_t corrMode, UInt_t fTrigger)
{

  // define cuts for task
  AliRDHFJetsCuts* cuts = new AliRDHFJetsCuts();
  // jets
  cuts->SetJetRadius(0.4); // this cut does nothing
  cuts->SetMaxEtaJet(0.5);//0.9-R
  cuts->SetMinPtJet(minPt);
  cuts->SetMaxPtJet(maxPt);
  // Set centrality
  cuts->SetMinCentrality(minC);
  cuts->SetMaxCentrality(maxC);
  cuts->SetTriggerMask(fTrigger);
  if (!corrMode){
    cuts->SetOptPileup(1);
    cuts->ConfigurePileupCuts(5, 0.8);
    cuts->SetTriggerClass("CINT7");
   } // pPb minbias only
 
  task->SetCuts(cuts);
  delete cuts;
  <commit_msg>Fix compilation on root6<commit_after>
Bool_t DefineCutsTagger(AliHFJetsTaggingVertex* tg);

Bool_t DefineCutsTask(AliAnalysisTaskEmcalJetBtagSV* task,
                      Float_t minPt, Float_t maxPt,
                      Float_t minC, Float_t maxC,
                      Bool_t corrMode, UInt_t fTrigger);

AliAnalysisTaskEmcalJetBtagSV* AddTaskEmcalJetBtagSV(const char* trkcontname   = "tracks",
                                                     const char* jetcontname   = "Jets",
                                                     const char* mctrkcontname = "mcparticles",
                                                     const char* mcjetcontname = "MCJets",
                                                     Double_t jetRadius = 0.2,
                                                     const char* type  = "TPC",
                                                     TString fileout   = "standard",
                                                     Bool_t corrMode   =  kFALSE,
                                                     Bool_t doBkgRej   =  kTRUE,
                                                     Bool_t doRndmCone =  kFALSE,
                                                     Bool_t doQAvtx    =  kFALSE,
                                                     Bool_t doFillV0   =  kFALSE,
                                                     Bool_t doDetRespMtx = kFALSE,
                                                     Bool_t doOnlyMtxAna = kFALSE,
                                                     Bool_t checkXsec  =  kFALSE,
                                                     Bool_t useWeight  =  kFALSE,
                                                     const char* ptHname  =  "",
                                                     const char* ptHpatt  =  "",
                                                     Int_t gbLogLevel  = AliLog::kInfo,  //=2
                                                     Int_t lcDebLevel  = AliLog::kFatal, //=0
                                                     Double_t tagRadius = 0.4,
                                                     TString cutflname = "",
                                                     Float_t minPt = 0., Float_t maxPt = 100.,
                                                     Float_t minC  = 0., Float_t maxC  = 100.,
                                                     UInt_t  fTrigger = AliVEvent::kAny,
                                                     const char* taskname = "HFjetsContainer")
{ // Mailto: <EMAIL>
  // Get the AnalysisManager
  AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskEmcalJetBtagSV", "No analysis manager to connect to.");
    return NULL;
  }
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskEmcalJetBtagSV", "This task requires an input event handler");
    return NULL;
  }

  TString name(taskname);
  TString strType(type);

  AliAnalysisTaskEmcalJetBtagSV* hfTask = new AliAnalysisTaskEmcalJetBtagSV(name); // Configure analysis task

  AliParticleContainer* trkCont = hfTask->AddTrackContainer(trkcontname);//for data, and reco MC
  AliJetContainer*      jetCont = hfTask->AddJetContainer(jetcontname, strType, jetRadius);
  jetCont->ConnectParticleContainer(trkCont);
  if (corrMode) {
    AliParticleContainer* mctrkCont  = hfTask->AddMCParticleContainer(mctrkcontname);//for MC particle level
    AliJetContainer*      mcjetCont = hfTask->AddJetContainer(mcjetcontname, strType, jetRadius);
  }

  hfTask->SetCorrectionMode(corrMode); // kFALSE for real data
  hfTask->SetDoBkgRejection(doBkgRej);
  hfTask->SetDoRandomCone(doRndmCone);
  hfTask->SetDoFillSecVtxQA(doQAvtx);
  hfTask->SetDoFillV0Trks(doFillV0);
  hfTask->SetDoDetRespMtx(doDetRespMtx);
  hfTask->SetDoOnlyMtxAna(doOnlyMtxAna);
  hfTask->SetPtHardName(ptHname);
  hfTask->SetGenNamePattern(ptHpatt);
  hfTask->SetJetContName(jetcontname);
  hfTask->SetTrkContName(trkcontname);

  hfTask->SetCheckMCCrossSection(checkXsec);
  if (useWeight) hfTask->SetUseWeightOn();

  hfTask->SetGlLogLevel(gbLogLevel);
  hfTask->SetLcDebLevel(lcDebLevel);

  // choose the method to select on the flavor of the jet and, if needed, select the pt-hard bin via the minimum pt-hard
  // also set mc jet and particle container
  if (corrMode) {
    hfTask->SetMCJetContName(mcjetcontname);
    hfTask->SetMCTrkContName(mctrkcontname);
    hfTask->SetJetTaggingRadius(tagRadius);
  }

  // Define the tagger
  AliHFJetsTaggingVertex* tagger = new AliHFJetsTaggingVertex();

  // Set analysis cuts
  TString strCutFlName(cutflname);
  if (!strCutFlName.IsNull() && !gSystem->AccessPathName(strCutFlName.Data(), kFileExists)) {
    // read cuts from file
    ::Info("AddTaskEmcalJetBtagSV","Reading cuts from file: %s", strCutFlName.Data());

    TFile* f = TFile::Open(strCutFlName.Data());
    AliRDHFJetsCuts* cuts = (AliRDHFJetsCuts *)f->Get("HFJetsCutsVertex");

    cuts->SetMinPtJet(minPt);
    cuts->SetMaxPtJet(maxPt);
    // Set centrality
    cuts->SetMinCentrality(minC);
    cuts->SetMaxCentrality(maxC);
    cuts->SetTriggerMask(fTrigger);
//    cuts->SetTriggerClass(trigClass);
    cuts->PrintAll();
    hfTask->SetCuts(cuts);
  } else {
    // define your cuts here
    DefineCutsTask(hfTask, minPt, maxPt, minC, maxC, corrMode, fTrigger);
    DefineCutsTagger(tagger);
  }

  // // Add task to manager
  hfTask->SetTagger(tagger);
  mgr->AddTask(hfTask);

  // Create containers for input/output
  AliAnalysisDataContainer* cInput =   mgr->GetCommonInputContainer();
  mgr->ConnectInput(hfTask, 0, cInput);

  //All containers in a list
  AliAnalysisDataContainer* cOutput = mgr->CreateContainer(name.Data(), TList::Class(), AliAnalysisManager::kOutputContainer,        AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(hfTask, 1, cOutput);

  delete tagger;
  return hfTask;
}

//------------------------------------------------------
Bool_t DefineCutsTask(AliAnalysisTaskEmcalJetBtagSV* task,
                      Float_t minPt, Float_t maxPt,
                      Float_t minC, Float_t maxC,
                      Bool_t corrMode, UInt_t fTrigger)
{

  // define cuts for task
  AliRDHFJetsCuts* cuts = new AliRDHFJetsCuts();
  // jets
  cuts->SetJetRadius(0.4); // this cut does nothing
  cuts->SetMaxEtaJet(0.5);//0.9-R
  cuts->SetMinPtJet(minPt);
  cuts->SetMaxPtJet(maxPt);
  // Set centrality
  cuts->SetMinCentrality(minC);
  cuts->SetMaxCentrality(maxC);
  cuts->SetTriggerMask(fTrigger);
  if (!corrMode){
    cuts->SetOptPileup(1);
    cuts->ConfigurePileupCuts(5, 0.8);
    cuts->SetTriggerClass("CINT7");
   } // pPb minbias only

  task->SetCuts(cuts);
  delete cuts;

{'fraction_non_alphanumeric': 0.10357442268119808, 'fraction_numerical': 0.004725249599878058, 'mean_word_length': 1.768354430379747, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 100, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3422677', 'n_tokens_mistral': 3876, 'n_tokens_neox': 3714, 'n_words': 729}