Skip to content

Commit 796a022

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 1d44885 + d0de9d7 commit 796a022

File tree

19 files changed

+793
-781
lines changed

19 files changed

+793
-781
lines changed

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 147 additions & 110 deletions
Large diffs are not rendered by default.

Common/TableProducer/propagationServiceRun2.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct propagationServiceRun2 {
9191
ccdb->setCaching(true);
9292
ccdb->setLocalObjectValidityChecking();
9393
ccdb->setURL(ccdburl.value);
94+
ccdb->setFatalWhenNull(false);
9495

9596
// task-specific
9697
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);

Common/Tools/Multiplicity/MultModule.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -772,29 +772,35 @@ class MultModule
772772
//_______________________________________________________________________
773773
// vertex-Z equalized signals
774774
if (internalOpts.mEnabledTables[kFV0MultZeqs]) {
775-
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
775+
if (mults.multFV0A > -1.0f && std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
776776
mults.multFV0AZeq = hVtxZFV0A->Interpolate(0.0) * mults.multFV0A / hVtxZFV0A->Interpolate(collision.posZ());
777777
} else {
778778
mults.multFV0AZeq = 0.0f;
779779
}
780780
cursors.tableFV0Zeqs(mults.multFV0AZeq);
781781
}
782782
if (internalOpts.mEnabledTables[kFT0MultZeqs]) {
783-
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
783+
if (mults.multFT0A > -1.0f && std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
784784
mults.multFT0AZeq = hVtxZFT0A->Interpolate(0.0) * mults.multFT0A / hVtxZFT0A->Interpolate(collision.posZ());
785-
mults.multFT0CZeq = hVtxZFT0C->Interpolate(0.0) * mults.multFT0C / hVtxZFT0C->Interpolate(collision.posZ());
786785
} else {
787786
mults.multFT0AZeq = 0.0f;
787+
}
788+
if (mults.multFT0C > -1.0f && std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
789+
mults.multFT0CZeq = hVtxZFT0C->Interpolate(0.0) * mults.multFT0C / hVtxZFT0C->Interpolate(collision.posZ());
790+
} else {
788791
mults.multFT0CZeq = 0.0f;
789792
}
790793
cursors.tableFT0Zeqs(mults.multFT0AZeq, mults.multFT0CZeq);
791794
}
792795
if (internalOpts.mEnabledTables[kFDDMultZeqs]) {
793-
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
796+
if (mults.multFDDA > -1.0f && std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
794797
mults.multFDDAZeq = hVtxZFDDA->Interpolate(0.0) * mults.multFDDA / hVtxZFDDA->Interpolate(collision.posZ());
795-
mults.multFDDCZeq = hVtxZFDDC->Interpolate(0.0) * mults.multFDDC / hVtxZFDDC->Interpolate(collision.posZ());
796798
} else {
797799
mults.multFDDAZeq = 0.0f;
800+
}
801+
if (mults.multFDDC > -1.0f && std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {
802+
mults.multFDDCZeq = hVtxZFDDC->Interpolate(0.0) * mults.multFDDC / hVtxZFDDC->Interpolate(collision.posZ());
803+
} else {
798804
mults.multFDDCZeq = 0.0f;
799805
}
800806
cursors.tableFDDZeqs(mults.multFDDAZeq, mults.multFDDCZeq);

Common/Tools/StandardCCDBLoader.h

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <DataFormatsCalibration/MeanVertexObject.h>
2020
#include <DataFormatsParameters/GRPMagField.h>
21+
#include <DataFormatsParameters/GRPObject.h>
2122
#include <DetectorsBase/MatLayerCylSet.h>
2223
#include <DetectorsBase/Propagator.h>
2324
#include <Framework/Configurable.h>
@@ -43,6 +44,7 @@ struct StandardCCDBLoaderConfigurables : o2::framework::ConfigurableGroup {
4344
o2::framework::Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
4445
o2::framework::Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
4546
o2::framework::Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
47+
o2::framework::Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
4648
o2::framework::Configurable<std::string> mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"};
4749
};
4850

@@ -81,25 +83,36 @@ class StandardCCDBLoader
8183
return;
8284
}
8385

86+
grpmag = ccdb->template getForRun<o2::parameters::GRPMagField>(cGroup.grpmagPath.value, currentRunNumber);
87+
if (grpmag) {
88+
LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object";
89+
o2::base::Propagator::initFieldFromGRP(grpmag);
90+
} else {
91+
LOGF(info, "GRPMagField object returned nullptr, will attempt alternate method");
92+
93+
o2::parameters::GRPObject* grpo = 0x0;
94+
grpo = ccdb->template getForRun<o2::parameters::GRPObject>(cGroup.grpPath.value, currentRunNumber);
95+
if (!grpo) {
96+
LOG(fatal) << "Alternate path failed! Got nullptr from CCDB for path " << cGroup.grpPath << " of object GRPObject for run " << currentRunNumber;
97+
}
98+
o2::base::Propagator::initFieldFromGRP(grpo);
99+
}
100+
if (getMeanVertex) {
101+
// only try this if explicitly requested
102+
mMeanVtx = ccdb->template getForRun<o2::dataformats::MeanVertexObject>(cGroup.mVtxPath.value, currentRunNumber);
103+
} else {
104+
mMeanVtx = nullptr;
105+
}
106+
84107
// load matLUT for this timestamp
85108
if (!lut) {
86109
LOG(info) << "Loading material look-up table for timestamp: " << currentRunNumber;
87110
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->template getForRun<o2::base::MatLayerCylSet>(cGroup.lutPath.value, currentRunNumber));
88111
} else {
89112
LOG(info) << "Material look-up table already in place. Not reloading.";
90113
}
91-
92-
grpmag = ccdb->template getForRun<o2::parameters::GRPMagField>(cGroup.grpmagPath.value, currentRunNumber);
93-
LOG(info) << "Setting global propagator magnetic field to current " << grpmag->getL3Current() << " A for run " << currentRunNumber << " from its GRPMagField CCDB object";
94-
o2::base::Propagator::initFieldFromGRP(grpmag);
95114
LOG(info) << "Setting global propagator material propagation LUT";
96115
o2::base::Propagator::Instance()->setMatLUT(lut);
97-
if (getMeanVertex) {
98-
// only try this if explicitly requested
99-
mMeanVtx = ccdb->template getForRun<o2::dataformats::MeanVertexObject>(cGroup.mVtxPath.value, currentRunNumber);
100-
} else {
101-
mMeanVtx = nullptr;
102-
}
103116

104117
runNumber = currentRunNumber;
105118
}

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ static const float cutsTable[nPart][nCuts]{
6161
struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
6262

6363
Service<o2::framework::O2DatabasePDG> pdg;
64-
Service<o2::framework::O2DatabasePDG> pdgMC;
6564

6665
/// Particle selection part
6766

@@ -716,40 +715,41 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
716715
void doSameEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, int ContType, bool fillQA)
717716
{
718717

718+
randgen = new TRandom2(0);
719719
/// Histogramming same event
720-
if ((ContType == 1 || ContType == 2) && fillQA) {
720+
if ((cfgProcessPM || cfgProcessPP) && fillQA) {
721721
for (const auto& part : groupPartsOne) {
722722
if (part.partType() == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) {
723723
int pdgCode = static_cast<int>(part.tempFitVar());
724-
const auto& pdgParticle = pdgMC->GetParticle(pdgCode);
724+
const auto& pdgParticle = pdg->GetParticle(pdgCode);
725725
if (pdgParticle) {
726726
trackHistoPartOne.fillQA<isMC, false>(part);
727727
}
728728
}
729729
}
730730
}
731731

732-
if ((ContType == 1 || ContType == 3) && fillQA) {
732+
if ((cfgProcessPM || cfgProcessMM) && fillQA) {
733733
for (const auto& part : groupPartsTwo) {
734734
if (part.partType() == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) {
735735
int pdgCode = static_cast<int>(part.tempFitVar());
736-
const auto& pdgParticle = pdgMC->GetParticle(pdgCode);
736+
const auto& pdgParticle = pdg->GetParticle(pdgCode);
737737
if (pdgParticle) {
738738
trackHistoPartTwo.fillQA<isMC, false>(part);
739739
}
740740
}
741741
}
742742
}
743743

744-
if (ContType == 1) {
744+
if (cfgProcessPM) {
745745

746746
/// Now build the combinations for non-identical particle pairs
747747
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
748748

749749
int pdgCodePartOne = static_cast<int>(p1.tempFitVar());
750-
const auto& pdgParticleOne = pdgMC->GetParticle(pdgCodePartOne);
750+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
751751
int pdgCodePartTwo = static_cast<int>(p2.tempFitVar());
752-
const auto& pdgParticleTwo = pdgMC->GetParticle(pdgCodePartTwo);
752+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
753753
if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == trackonefilter.ConfPDGCodePartOne) && (pdgCodePartTwo == tracktwofilter.ConfPDGCodePartTwo)) {
754754
float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2);
755755
sameEventMultCont.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden);
@@ -759,9 +759,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
759759
for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsOne))) {
760760

761761
int pdgCodePartOne = static_cast<int>(p1.tempFitVar());
762-
const auto& pdgParticleOne = pdgMC->GetParticle(pdgCodePartOne);
762+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
763763
int pdgCodePartTwo = static_cast<int>(p2.tempFitVar());
764-
const auto& pdgParticleTwo = pdgMC->GetParticle(pdgCodePartTwo);
764+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
765765

766766
float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2);
767767
double rand;
@@ -793,6 +793,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
793793
}
794794
}
795795
}
796+
delete randgen;
796797
}
797798

798799
/// process function for to call doSameEvent with Monte Carlo
@@ -807,30 +808,37 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
807808
auto thegroupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
808809
auto thegroupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
809810
bool fillQA = true;
810-
randgen = new TRandom2(0);
811+
812+
int pairType = 0;
813+
if (cfgProcessPM) {
814+
pairType = 1;
815+
} else if (cfgProcessPP) {
816+
pairType = 2;
817+
} else if (cfgProcessMM) {
818+
pairType = 3;
819+
}
811820

812821
if (ConfIsCent) {
813822
if (cfgProcessPM) {
814-
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsTwo, col.multV0M(), 1, fillQA);
823+
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsTwo, col.multV0M(), pairType, fillQA);
815824
}
816825
if (cfgProcessPP) {
817-
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsOne, col.multV0M(), 2, fillQA);
826+
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsOne, col.multV0M(), pairType, fillQA);
818827
}
819828
if (cfgProcessMM) {
820-
doSameEventMCTruth<false>(thegroupPartsTwo, thegroupPartsTwo, col.multV0M(), 3, fillQA);
829+
doSameEventMCTruth<false>(thegroupPartsTwo, thegroupPartsTwo, col.multV0M(), pairType, fillQA);
821830
}
822831
} else {
823832
if (cfgProcessPM) {
824-
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsTwo, col.multNtr(), 1, fillQA);
833+
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsTwo, col.multNtr(), pairType, fillQA);
825834
}
826835
if (cfgProcessPP) {
827-
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsOne, col.multNtr(), 2, fillQA);
836+
doSameEventMCTruth<false>(thegroupPartsOne, thegroupPartsOne, col.multNtr(), pairType, fillQA);
828837
}
829838
if (cfgProcessMM) {
830-
doSameEventMCTruth<false>(thegroupPartsTwo, thegroupPartsTwo, col.multNtr(), 3, fillQA);
839+
doSameEventMCTruth<false>(thegroupPartsTwo, thegroupPartsTwo, col.multNtr(), pairType, fillQA);
831840
}
832841
}
833-
delete randgen;
834842
}
835843
PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processSameEventMCTruth, "Enable processing same event for MC truth", false);
836844

@@ -1104,13 +1112,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
11041112
template <bool isMC, typename PartitionType>
11051113
void doMixedEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, int ContType)
11061114
{
1107-
1115+
randgen = new TRandom2(0);
11081116
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
11091117

11101118
int pdgCodePartOne = static_cast<int>(p1.tempFitVar());
1111-
const auto& pdgParticleOne = pdgMC->GetParticle(pdgCodePartOne);
1119+
const auto& pdgParticleOne = pdg->GetParticle(pdgCodePartOne);
11121120
int pdgCodePartTwo = static_cast<int>(p2.tempFitVar());
1113-
const auto& pdgParticleTwo = pdgMC->GetParticle(pdgCodePartTwo);
1121+
const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo);
11141122

11151123
float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2);
11161124
double rand;
@@ -1149,6 +1157,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
11491157
}
11501158
}
11511159
}
1160+
delete randgen;
11521161
}
11531162

11541163
/// process function for to call doMixedEvent with Data
@@ -1157,7 +1166,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
11571166
void processMixedEventNtrMCTruth(o2::aod::FdCollisions const& cols,
11581167
FemtoTruthParticles const&)
11591168
{
1160-
randgen = new TRandom2(0);
1169+
int pairType = 0;
1170+
if (cfgProcessPM) {
1171+
pairType = 1;
1172+
} else if (cfgProcessPP) {
1173+
pairType = 2;
1174+
} else if (cfgProcessMM) {
1175+
pairType = 3;
1176+
}
11611177

11621178
for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningNtr, ConfNEventsMix, -1, cols, cols)) {
11631179

@@ -1167,20 +1183,19 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
11671183
if (cfgProcessPM) {
11681184
auto groupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
11691185
auto groupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
1170-
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, 1);
1186+
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, pairType);
11711187
}
11721188
if (cfgProcessPP) {
11731189
auto groupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
11741190
auto groupPartsTwo = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
1175-
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, 2);
1191+
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, pairType);
11761192
}
11771193
if (cfgProcessMM) {
11781194
auto groupPartsOne = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
11791195
auto groupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
1180-
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, 3);
1196+
doMixedEventMCTruth<false>(groupPartsOne, groupPartsTwo, multiplicityCol, pairType);
11811197
}
11821198
}
1183-
delete randgen;
11841199
}
11851200
PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processMixedEventNtrMCTruth, "Enable processing MC Truth mixed events for multiplicity", false);
11861201
};

0 commit comments

Comments
 (0)