Skip to content

Commit db5b950

Browse files
author
Victor
committed
[PWGCF] DptDpt - Fine tune on the fly second pass
1 parent c25bcdf commit db5b950

File tree

2 files changed

+70
-29
lines changed

2 files changed

+70
-29
lines changed

PWGCF/TableProducer/dptDptFilter.cxx

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static constexpr float MultiplicityUpperLimitBase[11][8] = {
128128
};
129129

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

144144
/* helpers for the system type assignment */
145-
static const std::string periodsOnSystemType[11][1] = {
145+
static const std::string periodsOnSystemType[11][1] = { // NOLINT
146146
/* no system */ {""},
147147
/* pp Run2 */ {""},
148148
/* pPb Run2 */ {""},
@@ -316,8 +316,8 @@ struct Multiplicity {
316316

317317
MultEst classestimator = kV0M;
318318

319-
static constexpr float kForMultiplicityPtLowLimit = 0.001f;
320-
static constexpr float kForMultiplicityPtHighLimit = 50.0f;
319+
static constexpr float KForMultiplicityPtLowLimit = 0.001f;
320+
static constexpr float KForMultiplicityPtHighLimit = 50.0f;
321321
float multiplicityClass = -1.0;
322322
float multiplicity = 0.0;
323323
bool inelgth0 = false;
@@ -353,7 +353,7 @@ struct Multiplicity {
353353

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

597599
Multiplicity multiplicity;
600+
std::string otfGenerator;
601+
Service<o2::ccdb::BasicCCDBManager> ccdb;
602+
bool storedCcdbInfo = false;
598603
Preslice<DptDptFullTracksDetLevel> perCollision = aod::track::collisionId;
599604

600-
void init(InitContext const&)
605+
void init(InitContext& initContext)
601606
{
602607
using namespace dptdptfilter;
603608

@@ -645,8 +650,18 @@ struct DptDptFilter {
645650

646651
/* get the data type and the system type */
647652
fDataType = getDataType(cfgDataType);
648-
fSystem = getSystemType(cfgSystemForPeriod.value);
649-
fLhcRun = multRunForSystemMap.at(fSystem);
653+
if (fDataType != kOnTheFly) {
654+
fSystem = getSystemType(cfgSystemForPeriod.value);
655+
fLhcRun = multRunForSystemMap.at(fSystem);
656+
} else {
657+
std::string tmpstr;
658+
getTaskOptionValue(initContext, "generator-task", "configFile", tmpstr, false);
659+
TString fullPath = tmpstr;
660+
auto tokens = fullPath.Tokenize("/");
661+
otfGenerator = TString(tokens->At(tokens->GetEntries() - 1)->GetName()).ReplaceAll(".ini", "");
662+
delete tokens;
663+
LOGF(info, "The generator configuration file: %s", otfGenerator.c_str());
664+
}
650665

651666
/* the multiplicities outliers exclusion */
652667
multiplicityCentralityCorrelationsExclusion = getExclusionFormula(cfgEventSelection.multiplicitiesExclusionFormula->getData()[fSystem][0].c_str());
@@ -766,6 +781,23 @@ struct DptDptFilter {
766781
fOutputList->Add(fhTrueVertexZAA);
767782
}
768783
}
784+
/* initialize access to the CCDB */
785+
ccdb->setURL(cfginputfile.url);
786+
ccdb->setCaching(true);
787+
ccdb->setLocalObjectValidityChecking();
788+
}
789+
790+
void getCCDBInformation()
791+
{
792+
/* let's get a potential OTF configuration */
793+
if ((cfginputfile.dateOTF.value.length() > 0) && (cfginputfile.pathNameOTF.value.length() > 0) && !storedCcdbInfo) {
794+
LOGF(info, "Getting information for OTF configuration from %s, at %s", cfginputfile.pathNameOTF.value.c_str(), cfginputfile.dateOTF.value.c_str());
795+
TList* otfinfo = getCCDBInput(ccdb, cfginputfile.pathNameOTF.value.c_str(), cfginputfile.dateOTF.value.c_str(), true, otfGenerator);
796+
if (otfinfo != nullptr) {
797+
multiplicity.setMultiplicityPercentiles(otfinfo);
798+
}
799+
storedCcdbInfo = true;
800+
}
769801
}
770802

771803
template <typename CollisionObject, typename TracksObject>
@@ -1056,6 +1088,8 @@ void DptDptFilter::processOnTheFlyGeneratorLevel(aod::McCollision const& mccolli
10561088
fhTrueVertexZB->Fill(mccollision.posZ());
10571089
/* we assign a default value for the time being */
10581090
float centormult = 50.0f;
1091+
/* ask for configuration */
1092+
getCCDBInformation();
10591093
if (isEventSelected(mccollision, centormult)) {
10601094
acceptedEvent = true;
10611095
multiplicity.extractMultiplicity(mcparticles);

PWGCF/TableProducer/dptDptFilter.h

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,23 @@ struct DptDptTrackSelection {
809809
bool requirePvContributor = false;
810810
};
811811

812+
SystemType fSystem = SystemNoSystem;
813+
MultRunType fLhcRun = MultRunRUN1RUN2;
814+
DataType fDataType = kData;
815+
CentMultEstimatorType fCentMultEstimator = CentMultV0M;
816+
OccupancyEstimationType fOccupancyEstimation = OccupancyNOOCC; /* the occupancy estimator to use */
817+
818+
float fMinOccupancy = 0.0f; /* the minimum allowed occupancy */
819+
float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */
820+
821+
/* adaptations for the pp nightly checks */
822+
analysis::CheckRangeCfg traceDCAOutliers;
823+
bool traceOutOfSpeciesParticles = false;
824+
int recoIdMethod = 0;
825+
float particleMaxDCAxy = 999.9f;
826+
float particleMaxDCAZ = 999.9f;
827+
bool traceCollId0 = false;
828+
812829
inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdate, bool periodInPath = false, const std::string& suffix = "")
813830
{
814831
std::tm cfgtm = {};
@@ -826,13 +843,20 @@ inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdat
826843
return tmpStr;
827844
};
828845

829-
std::string actualPeriod = cleanPeriod(metadataInfo.get("LPMProductionTag"));
846+
std::string actualPeriod;
847+
if (fDataType != kOnTheFly) {
848+
actualPeriod = cleanPeriod(metadataInfo.get("LPMProductionTag"));
849+
} else {
850+
actualPeriod = suffix;
851+
}
830852
std::string actualPath = ccdbpath;
831853
if (periodInPath) {
832854
actualPath = actualPath + "/" + actualPeriod;
833855
}
834-
if (suffix.length() > 0) {
835-
actualPeriod = actualPeriod + "_" + suffix;
856+
if (fDataType != kOnTheFly) {
857+
if (suffix.length() > 0) {
858+
actualPeriod = actualPeriod + "_" + suffix;
859+
}
836860
}
837861

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

849-
SystemType fSystem = SystemNoSystem;
850-
MultRunType fLhcRun = MultRunRUN1RUN2;
851-
DataType fDataType = kData;
852-
CentMultEstimatorType fCentMultEstimator = CentMultV0M;
853-
OccupancyEstimationType fOccupancyEstimation = OccupancyNOOCC; /* the occupancy estimator to use */
854-
855-
float fMinOccupancy = 0.0f; /* the minimum allowed occupancy */
856-
float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */
857-
858-
/* adaptations for the pp nightly checks */
859-
analysis::CheckRangeCfg traceDCAOutliers;
860-
bool traceOutOfSpeciesParticles = false;
861-
int recoIdMethod = 0;
862-
float particleMaxDCAxy = 999.9f;
863-
float particleMaxDCAZ = 999.9f;
864-
bool traceCollId0 = false;
865-
866873
inline std::bitset<32> getTriggerSelection(std::string_view const& triggstr)
867874
{
868875
std::bitset<32> flags;

0 commit comments

Comments
 (0)