Skip to content

Commit 84ec789

Browse files
author
Maurice Coquet
committed
[PWGDQ] Manual setting for zShift to avoid CCDB fetch
1 parent acff8cf commit 84ec789

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ struct TableMakerMC {
215215
Configurable<std::string> fGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
216216
Configurable<std::string> fGrpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
217217
Configurable<std::string> fZShiftPath{"zShiftPath", "Users/m/mcoquet/ZShift", "CCDB path for z shift to apply to forward tracks"};
218+
Configurable<bool> fUseRemoteZShift{"cfgUseRemoteZShift", true, "Enable getting Zshift from ccdb"};
219+
Configurable<float> fManualZShift{"cfgManualZShift", 0.f, "Manual value for the Zshift for muons."};
218220
Configurable<std::string> fGrpMagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"};
219221
Configurable<int64_t> timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"};
220222
} fConfigCCDB;
@@ -1194,13 +1196,17 @@ struct TableMakerMC {
11941196
}
11951197
} else {
11961198
fGrpMag = fCCDB->getForTimeStamp<o2::parameters::GRPMagField>(fConfigCCDB.fGrpMagPath, bcs.begin().timestamp());
1197-
auto* fZShift = fCCDB->getForTimeStamp<std::vector<float>>(fConfigCCDB.fZShiftPath, bcs.begin().timestamp());
11981199
if (fGrpMag != nullptr) {
11991200
o2::base::Propagator::initFieldFromGRP(fGrpMag);
12001201
VarManager::SetMagneticField(fGrpMag->getNominalL3Field());
12011202
}
1202-
if (fZShift != nullptr && !fZShift->empty()) {
1203-
VarManager::SetZShift((*fZShift)[0]);
1203+
if (fConfigCCDB.fUseRemoteZShift) {
1204+
auto* fZShift = fCCDB->getForTimeStamp<std::vector<float>>(fConfigCCDB.fZShiftPath, bcs.begin().timestamp());
1205+
if (fZShift != nullptr && !fZShift->empty()) {
1206+
VarManager::SetZShift((*fZShift)[0]);
1207+
}
1208+
} else {
1209+
VarManager::SetZShift(fConfigCCDB.fManualZShift.value);
12041210
}
12051211
if (fConfigVariousOptions.fPropMuon) {
12061212
VarManager::SetupMuonMagField();

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ struct TableMaker {
254254
Configurable<std::string> fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
255255
Configurable<std::string> fConfigGrpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
256256
Configurable<std::string> fZShiftPath{"zShiftPath", "Users/m/mcoquet/ZShift", "CCDB path for z shift to apply to forward tracks"};
257+
Configurable<bool> fUseRemoteZShift{"cfgUseRemoteZShift", true, "Enable getting Zshift from ccdb"};
258+
Configurable<float> fManualZShift{"cfgManualZShift", 0.f, "Manual value for the Zshift for muons."};
257259
Configurable<std::string> fConfigGrpMagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"};
258260
} fConfigCCDB;
259261

@@ -1574,14 +1576,18 @@ struct TableMaker {
15741576
}
15751577
} else {
15761578
fGrpMag = fCCDB->getForTimeStamp<o2::parameters::GRPMagField>(fConfigCCDB.fConfigGrpMagPath, bcs.begin().timestamp());
1577-
auto* fZShift = fCCDB->getForTimeStamp<std::vector<float>>(fConfigCCDB.fZShiftPath, bcs.begin().timestamp());
15781579
if (fGrpMag != nullptr) {
15791580
o2::base::Propagator::initFieldFromGRP(fGrpMag);
15801581
VarManager::SetMagneticField(fGrpMag->getNominalL3Field());
15811582
}
1582-
if (fZShift != nullptr && !fZShift->empty()) {
1583-
VarManager::SetZShift((*fZShift)[0]);
1584-
}
1583+
if (fConfigCCDB.fUseRemoteZShift) {
1584+
auto* fZShift = fCCDB->getForTimeStamp<std::vector<float>>(fConfigCCDB.fZShiftPath, bcs.begin().timestamp());
1585+
if (fZShift != nullptr && !fZShift->empty()) {
1586+
VarManager::SetZShift((*fZShift)[0]);
1587+
}
1588+
} else {
1589+
VarManager::SetZShift(fConfigCCDB.fManualZShift.value);
1590+
}
15851591
if (fConfigVariousOptions.fPropMuon) {
15861592
VarManager::SetupMuonMagField();
15871593
}

0 commit comments

Comments
 (0)