Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions PWGCF/TableProducer/dptDptFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static constexpr float MultiplicityUpperLimitBase[11][8] = {
};

/* helpers for the multiplicity/centrality correlations exclusion formulae */
static const std::string multiplicityCentralityCorrelationsFormulaBase[11][1] = {
static const std::string multiplicityCentralityCorrelationsFormulaBase[11][1] = { // NOLINT
/* no system */ {""},
/* pp Run2 */ {""},
/* pPb Run2 */ {""},
Expand All @@ -142,7 +142,7 @@ static const std::string multiplicityCentralityCorrelationsFormulaBase[11][1] =
/* pO Run3 */ {""}};

/* helpers for the system type assignment */
static const std::string periodsOnSystemType[11][1] = {
static const std::string periodsOnSystemType[11][1] = { // NOLINT
/* no system */ {""},
/* pp Run2 */ {""},
/* pPb Run2 */ {""},
Expand Down Expand Up @@ -316,8 +316,8 @@ struct Multiplicity {

MultEst classestimator = kV0M;

static constexpr float kForMultiplicityPtLowLimit = 0.001f;
static constexpr float kForMultiplicityPtHighLimit = 50.0f;
static constexpr float KForMultiplicityPtLowLimit = 0.001f;
static constexpr float KForMultiplicityPtHighLimit = 50.0f;
float multiplicityClass = -1.0;
float multiplicity = 0.0;
bool inelgth0 = false;
Expand Down Expand Up @@ -353,7 +353,7 @@ struct Multiplicity {

void setMultiplicityPercentiles(TList* list)
{
LOGF(info, "setMultiplicityPercentiles()", "From list %s", list->GetName());
LOGF(info, "setMultiplicityPercentiles(). From list %s", list->GetName());
fhV0MMultPercentile = reinterpret_cast<TH1*>(list->FindObject("V0MCentMult"));
fhCL1MultPercentile = reinterpret_cast<TH1*>(list->FindObject("CL1MCentMult"));
fhCL1EtaGapMultPercentile = reinterpret_cast<TH1*>(list->FindObject("CL1EtaGapMCentMult"));
Expand Down Expand Up @@ -385,7 +385,7 @@ struct Multiplicity {
case kProton:
/* not clear if we should use IsPhysicalPrimary here */
/* TODO: adapt to FT0M Run 3 and other estimators */
if (kForMultiplicityPtLowLimit < p.pt() && p.pt() < kForMultiplicityPtHighLimit) {
if (KForMultiplicityPtLowLimit < p.pt() && p.pt() < KForMultiplicityPtHighLimit) {
if (p.eta() < 1.0f && -1.0f < p.eta()) {
inelgth0 = true;
}
Expand Down Expand Up @@ -545,8 +545,10 @@ struct DptDptFilter {
Configurable<std::string> url{"url", "http://ccdb-test.cern.ch:8080", "The CCDB url for the input file"};
Configurable<std::string> pathNameCorrections{"pathNameCorrections", "", "The CCDB path for the corrections file. Default \"\", i.e. don't load from CCDB"};
Configurable<std::string> pathNamePID{"pathNamePID", "", "The CCDB path for the PID adjusts file. Default \"\", i.e. don't load from CCDB"};
Configurable<std::string> pathNameOTF{"pathNameOTF", "", "The CCDB path for the OTF configuration file. Default \"\", i.e. don't load from CCDB"};
Configurable<std::string> dateCorrections{"dateCorrections", "20220307", "The CCDB date for the corrections input file"};
Configurable<std::string> datePID{"datePID", "20220307", "The CCDB date for the PID adjustments input file"};
Configurable<std::string> dateOTF{"dateOTF", "20260306", "The CCDB date for the OTF configuration file"};
Configurable<std::string> suffix{"suffix", "", "Dataset period suffix for metadata discrimination"};
} cfginputfile;
Configurable<bool> cfgFullDerivedData{"cfgFullDerivedData", false, "Produce the full derived data for external storage. Default false"};
Expand Down Expand Up @@ -595,9 +597,12 @@ struct DptDptFilter {
Produces<aod::DptDptCFGenCollisionsInfo> gencollisionsinfo;

Multiplicity multiplicity;
std::string otfGenerator;
Service<o2::ccdb::BasicCCDBManager> ccdb;
bool storedCcdbInfo = false;
Preslice<DptDptFullTracksDetLevel> perCollision = aod::track::collisionId;

void init(InitContext const&)
void init(InitContext& initContext)
{
using namespace dptdptfilter;

Expand Down Expand Up @@ -645,8 +650,18 @@ struct DptDptFilter {

/* get the data type and the system type */
fDataType = getDataType(cfgDataType);
fSystem = getSystemType(cfgSystemForPeriod.value);
fLhcRun = multRunForSystemMap.at(fSystem);
if (fDataType != kOnTheFly) {
fSystem = getSystemType(cfgSystemForPeriod.value);
fLhcRun = multRunForSystemMap.at(fSystem);
} else {
std::string tmpstr;
getTaskOptionValue(initContext, "generator-task", "configFile", tmpstr, false);
TString fullPath = tmpstr;
auto tokens = fullPath.Tokenize("/");
otfGenerator = TString(tokens->At(tokens->GetEntries() - 1)->GetName()).ReplaceAll(".ini", "");
delete tokens;
LOGF(info, "The generator configuration file: %s", otfGenerator.c_str());
}

/* the multiplicities outliers exclusion */
multiplicityCentralityCorrelationsExclusion = getExclusionFormula(cfgEventSelection.multiplicitiesExclusionFormula->getData()[fSystem][0].c_str());
Expand Down Expand Up @@ -766,6 +781,23 @@ struct DptDptFilter {
fOutputList->Add(fhTrueVertexZAA);
}
}
/* initialize access to the CCDB */
ccdb->setURL(cfginputfile.url);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
}

void getCCDBInformation()
{
/* let's get a potential OTF configuration */
if ((cfginputfile.dateOTF.value.length() > 0) && (cfginputfile.pathNameOTF.value.length() > 0) && !storedCcdbInfo) {
LOGF(info, "Getting information for OTF configuration from %s, at %s", cfginputfile.pathNameOTF.value.c_str(), cfginputfile.dateOTF.value.c_str());
TList* otfinfo = getCCDBInput(ccdb, cfginputfile.pathNameOTF.value.c_str(), cfginputfile.dateOTF.value.c_str(), true, otfGenerator);
if (otfinfo != nullptr) {
multiplicity.setMultiplicityPercentiles(otfinfo);
}
storedCcdbInfo = true;
}
}

template <typename CollisionObject, typename TracksObject>
Expand Down Expand Up @@ -1056,6 +1088,8 @@ void DptDptFilter::processOnTheFlyGeneratorLevel(aod::McCollision const& mccolli
fhTrueVertexZB->Fill(mccollision.posZ());
/* we assign a default value for the time being */
float centormult = 50.0f;
/* ask for configuration */
getCCDBInformation();
if (isEventSelected(mccollision, centormult)) {
acceptedEvent = true;
multiplicity.extractMultiplicity(mcparticles);
Expand Down
47 changes: 27 additions & 20 deletions PWGCF/TableProducer/dptDptFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,23 @@ struct DptDptTrackSelection {
bool requirePvContributor = false;
};

SystemType fSystem = SystemNoSystem;
MultRunType fLhcRun = MultRunRUN1RUN2;
DataType fDataType = kData;
CentMultEstimatorType fCentMultEstimator = CentMultV0M;
OccupancyEstimationType fOccupancyEstimation = OccupancyNOOCC; /* the occupancy estimator to use */

float fMinOccupancy = 0.0f; /* the minimum allowed occupancy */
float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */

/* adaptations for the pp nightly checks */
analysis::CheckRangeCfg traceDCAOutliers;
bool traceOutOfSpeciesParticles = false;
int recoIdMethod = 0;
float particleMaxDCAxy = 999.9f;
float particleMaxDCAZ = 999.9f;
bool traceCollId0 = false;

inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdate, bool periodInPath = false, const std::string& suffix = "")
{
std::tm cfgtm = {};
Expand All @@ -826,13 +843,20 @@ inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdat
return tmpStr;
};

std::string actualPeriod = cleanPeriod(metadataInfo.get("LPMProductionTag"));
std::string actualPeriod;
if (fDataType != kOnTheFly) {
actualPeriod = cleanPeriod(metadataInfo.get("LPMProductionTag"));
} else {
actualPeriod = suffix;
}
std::string actualPath = ccdbpath;
if (periodInPath) {
actualPath = actualPath + "/" + actualPeriod;
}
if (suffix.length() > 0) {
actualPeriod = actualPeriod + "_" + suffix;
if (fDataType != kOnTheFly) {
if (suffix.length() > 0) {
actualPeriod = actualPeriod + "_" + suffix;
}
}

TList* lst = nullptr;
Expand All @@ -846,23 +870,6 @@ inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdat
return lst;
}

SystemType fSystem = SystemNoSystem;
MultRunType fLhcRun = MultRunRUN1RUN2;
DataType fDataType = kData;
CentMultEstimatorType fCentMultEstimator = CentMultV0M;
OccupancyEstimationType fOccupancyEstimation = OccupancyNOOCC; /* the occupancy estimator to use */

float fMinOccupancy = 0.0f; /* the minimum allowed occupancy */
float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */

/* adaptations for the pp nightly checks */
analysis::CheckRangeCfg traceDCAOutliers;
bool traceOutOfSpeciesParticles = false;
int recoIdMethod = 0;
float particleMaxDCAxy = 999.9f;
float particleMaxDCAZ = 999.9f;
bool traceCollId0 = false;

inline std::bitset<32> getTriggerSelection(std::string_view const& triggstr)
{
std::bitset<32> flags;
Expand Down
Loading