Skip to content

Commit d7cd423

Browse files
committed
reduced number of configurables
1 parent 9a020d7 commit d7cd423

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,6 @@ struct AntinucleiInJets {
206206
Configurable<bool> applyReweighting{"applyReweighting", true, "enable reweighting for efficiency"};
207207
Configurable<std::string> urlToCcdb{"urlToCcdb", "http://alice-ccdb.cern.ch/", "url of the personal ccdb"};
208208
Configurable<std::string> pathToFile{"pathToFile", "Users/a/alcaliva/reweightingHistogramsAntinucleiInJets/", "path to file"};
209-
Configurable<std::string> weightsProton{"weightsProton", "weightsProton", "weightsProton"};
210-
Configurable<std::string> weightsLambda{"weightsLambda", "weightsLambda", "weightsLambda"};
211-
Configurable<std::string> weightsSigma{"weightsSigma", "weightsSigma", "weightsSigma"};
212-
Configurable<std::string> weightsXi{"weightsXi", "weightsXi", "weightsXi"};
213-
Configurable<std::string> weightsOmega{"weightsOmega", "weightsOmega", "weightsOmega"};
214-
Configurable<std::string> weightsJet{"weightsJet", "weightsJet", "weightsJet"};
215-
Configurable<std::string> weightsUe{"weightsUe", "weightsUe", "weightsUe"};
216-
Configurable<std::string> weightsAntidJet{"weightsAntidJet", "weightsAntidJet", "weightsAntidJet"};
217-
Configurable<std::string> weightsAntidUe{"weightsAntidUe", "weightsAntidUe", "weightsAntidUe"};
218209

219210
// Number of events
220211
Configurable<int> shrinkInterval{"shrinkInterval", 1000, "variable that controls how often shrinking happens"};
@@ -288,7 +279,7 @@ struct AntinucleiInJets {
288279
ccdb->setLocalObjectValidityChecking();
289280
ccdb->setCreatedNotAfter(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
290281
ccdb->setFatalWhenNull(false);
291-
getReweightingHistograms(ccdb, TString(pathToFile), TString(weightsProton), TString(weightsLambda), TString(weightsSigma), TString(weightsXi), TString(weightsOmega), TString(weightsJet), TString(weightsUe), TString(weightsAntidJet), TString(weightsAntidUe));
282+
getReweightingHistograms(ccdb, TString(pathToFile));
292283
}
293284

294285
// Binning
@@ -692,7 +683,7 @@ struct AntinucleiInJets {
692683
}
693684
}
694685

695-
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString filepath, TString antip, TString antilambda, TString antisigma, TString antixi, TString antiomega, TString jet, TString ue, TString antidJet, TString antidUe)
686+
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString filepath)
696687
{
697688
TList* list = ccdbObj->get<TList>(filepath.Data());
698689
if (!list) {
@@ -701,26 +692,26 @@ struct AntinucleiInJets {
701692
}
702693

703694
// Get reweighting histograms for primary fraction
704-
primaryAntiprotons = static_cast<TH1F*>(list->FindObject(antip));
705-
primaryAntiLambda = static_cast<TH1F*>(list->FindObject(antilambda));
706-
primaryAntiSigma = static_cast<TH1F*>(list->FindObject(antisigma));
707-
primaryAntiXi = static_cast<TH1F*>(list->FindObject(antixi));
708-
primaryAntiOmega = static_cast<TH1F*>(list->FindObject(antiomega));
695+
primaryAntiprotons = static_cast<TH1F*>(list->FindObject("weightsProton"));
696+
primaryAntiLambda = static_cast<TH1F*>(list->FindObject("weightsLambda"));
697+
primaryAntiSigma = static_cast<TH1F*>(list->FindObject("weightsSigma"));
698+
primaryAntiXi = static_cast<TH1F*>(list->FindObject("weightsXi"));
699+
primaryAntiOmega = static_cast<TH1F*>(list->FindObject("weightsOmega"));
709700

710701
if (!primaryAntiprotons || !primaryAntiSigma || !primaryAntiLambda || !primaryAntiXi || !primaryAntiOmega) {
711702
LOGP(error, "Missing one or more reweighting histograms for primary fraction in CCDB list");
712703
}
713704

714705
// Get reweighting histograms for antiproton efficiency
715-
antiprotonsInsideJets = static_cast<TH1F*>(list->FindObject(jet));
716-
antiprotonsPerpCone = static_cast<TH1F*>(list->FindObject(ue));
706+
antiprotonsInsideJets = static_cast<TH1F*>(list->FindObject("weightsJet"));
707+
antiprotonsPerpCone = static_cast<TH1F*>(list->FindObject("weightsUe"));
717708
if (!antiprotonsInsideJets || !antiprotonsPerpCone) {
718709
LOGP(error, "Missing one or more reweighting histograms for antiproton efficiency in CCDB list");
719710
}
720711

721712
// Get reweighting histograms for antideuteron efficiency
722-
antideuteronsInsideJets = static_cast<TH1F*>(list->FindObject(antidJet));
723-
antideuteronsPerpCone = static_cast<TH1F*>(list->FindObject(antidUe));
713+
antideuteronsInsideJets = static_cast<TH1F*>(list->FindObject("weightsAntidJet"));
714+
antideuteronsPerpCone = static_cast<TH1F*>(list->FindObject("weightsAntidUe"));
724715
if (!antideuteronsInsideJets || !antideuteronsPerpCone) {
725716
LOGP(error, "Missing one or more reweighting histograms for antideuteron efficiency in CCDB list");
726717
}

0 commit comments

Comments
 (0)