Skip to content

Commit 96ffdba

Browse files
jokonigjokonig
andauthored
[PWGEM] Add configurable for minimum Minv a photon pair has to have i… (#18581)
Co-authored-by: jokonig <jokonig@cern.ch>
1 parent 8178754 commit 96ffdba

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

‎PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ struct PhotonConversionBuilder {
283283
struct : ConfigurableGroup {
284284
std::string prefix = "skim_group";
285285
Configurable<int> minNv0PerCollision{"minNv0PerCollision", -1, "store V0 photons only for collisions with at least this many surviving candidates (event-level skim for derived data). negative = store all"};
286-
Configurable<float> maxMinvPairPerCollision{"maxMinvPairPerCollision", -1.f, "store a collision's photons only if at least one photon pair has qinv below this (GeV/c^2). negative = disabled"};
286+
Configurable<float> minMinvPairPerCollision{"minMinvPairPerCollision", -1.f, "store a collision's photons only if at least one photon pair has qinv (minv) above this (GeV/c^2). negative = disabled"};
287+
Configurable<float> maxMinvPairPerCollision{"maxMinvPairPerCollision", -1.f, "store a collision's photons only if at least one photon pair has qinv (minv) below this (GeV/c^2). negative = disabled"};
287288
} skim;
288289

289290
// single track cuts
@@ -420,8 +421,8 @@ struct PhotonConversionBuilder {
420421
}
421422
LOGF(info, "photon-conversion-builder: deduplicationMode = %d (%s), score weight = %.2f",
422423
dedup.deduplicationMode.value, DedupNames[dedup.deduplicationMode.value], dedup.deduplicationScoreWeight.value);
423-
LOGF(info, "photon-conversion-builder: minNv0PerCollision = %d, maxMinvPairPerCollision = %f",
424-
skim.minNv0PerCollision.value, skim.maxMinvPairPerCollision.value);
424+
LOGF(info, "photon-conversion-builder: minNv0PerCollision = %d, minMinvPairPerCollision = %f, maxMinvPairPerCollision = %f",
425+
skim.minNv0PerCollision.value, skim.minMinvPairPerCollision.value, skim.maxMinvPairPerCollision.value);
425426

426427
ccdb->setURL(ccdburl);
427428
ccdb->setCaching(true);
@@ -1991,7 +1992,7 @@ struct PhotonConversionBuilder {
19911992
}
19921993

19931994
std::set<int64_t> skimRejected;
1994-
if (skim.minNv0PerCollision > 0 || skim.maxMinvPairPerCollision > 0.f) {
1995+
if (skim.minNv0PerCollision > 0 || skim.maxMinvPairPerCollision > 0.f || skim.minMinvPairPerCollision > 0.f) { // o2-linter: disable=magic-number (check if configurable is enabled)
19951996
const std::set<CandKey> storedSetSkim(stored_fullv0Ids.begin(), stored_fullv0Ids.end());
19961997
std::unordered_map<int64_t, std::vector<const V0CandidateHelper*>> candsPerColl;
19971998
for (const auto& c : vecV0Dedup) {
@@ -2004,19 +2005,22 @@ struct PhotonConversionBuilder {
20042005
skimRejected.insert(colId);
20052006
continue;
20062007
}
2007-
if (skim.maxMinvPairPerCollision > 0.f) {
2008-
bool hasLowMPair = false;
2009-
for (size_t i = 0; i < cands.size() && !hasLowMPair; ++i) {
2008+
if (skim.maxMinvPairPerCollision > 0.f || skim.minMinvPairPerCollision > 0.f) { // o2-linter: disable=magic-number (check if configurable is enabled)
2009+
bool hasPairOfInterest = false;
2010+
const float minMinv = skim.minMinvPairPerCollision > 0.f ? skim.minMinvPairPerCollision.value : 0.f;
2011+
const float maxMinv = skim.maxMinvPairPerCollision > 0.f ? skim.maxMinvPairPerCollision.value : std::numeric_limits<float>::max();
2012+
for (size_t i = 0; i < cands.size() && !hasPairOfInterest; ++i) {
20102013
for (size_t j = i + 1; j < cands.size(); ++j) {
20112014
ROOT::Math::PxPyPzMVector v1(cands[i]->pxAtPV, cands[i]->pyAtPV, cands[i]->pzAtPV, 0.f);
20122015
ROOT::Math::PxPyPzMVector v2(cands[j]->pxAtPV, cands[j]->pyAtPV, cands[j]->pzAtPV, 0.f);
2013-
if ((v1 + v2).M() < skim.maxMinvPairPerCollision) {
2014-
hasLowMPair = true;
2016+
const double massPair = (v1 + v2).M();
2017+
if (massPair > minMinv && massPair < maxMinv) {
2018+
hasPairOfInterest = true;
20152019
break;
20162020
}
20172021
}
20182022
}
2019-
if (!hasLowMPair) {
2023+
if (!hasPairOfInterest) {
20202024
skimRejected.insert(colId);
20212025
}
20222026
}

0 commit comments

Comments
 (0)