Skip to content
Merged
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
19 changes: 17 additions & 2 deletions Steer/DigitizerWorkflow/src/SimReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "CommonDataFormat/InteractionRecord.h"
#include "DataFormatsTPC/TPCSectorHeader.h"
#include "DetectorsRaw/HBFUtils.h"
#include <CCDB/BasicCCDBManager.h>
#include <DataFormatsParameters/GRPLHCIFData.h>
#include <FairMQLogger.h>
#include <TMessage.h> // object serialization
#include <memory> // std::unique_ptr
Expand Down Expand Up @@ -121,9 +123,22 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
mgr.getInteractionSampler().setFirstIR({0, o2::raw::HBFUtils::Instance().orbitFirstSampled});
mgr.getDigitizationContext().setFirstOrbitForSampling(o2::raw::HBFUtils::Instance().orbitFirstSampled);

auto setBCFillingHelper = [](auto& sampler, auto& bcPatternString) {
if (bcPatternString == "ccdb") {
LOG(info) << "Fetch bcPattern information from CCDB";
// fetch the GRP Object
auto& ccdb = o2::ccdb::BasicCCDBManager::instance();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you planning to move this class to DPL CCDB backend? Then this code cannot be in the init() but should move to run(). In any case, I think one should at least set the ccdb host (the GRPLHCIFs are in the http://alice-ccdb.cern.ch).
Also, with this code you get the object for now(), for the anchoring one should pass the run timestamp.
Since you have already headers creation / firstTFOrbit fixed, this would work automatically with the DPL backend.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is set up correctly for CCDBManager here (in the outside workflow creation) and I will use CCDBManager until the caching from snapshots is working correctly (which I think is not yet the case).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I did not find where it is set. What exactly does not work with caching? I am already working with export ALICEO2_CCDB_LOCALCACHE=<xxx> to create the cache and with --condition-backend file://<xxx> to use it directly (also can be done via export DPL_CONDITION_BACKEND=file://<xxx>)

auto grpLHC = ccdb.get<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF");
LOG(info) << "Fetched injection scheme " << grpLHC->getInjectionScheme() << " from CCDB";
sampler.setBunchFilling(grpLHC->getBunchFilling());
} else {
sampler.setBunchFilling(bcPatternString);
}
};

auto bcPatternFile = ctx.options().get<std::string>("bcPatternFile");
if (!bcPatternFile.empty()) {
mgr.getInteractionSampler().setBunchFilling(bcPatternFile);
setBCFillingHelper(mgr.getInteractionSampler(), bcPatternFile);
}

mgr.getInteractionSampler().init();
Expand All @@ -145,7 +160,7 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
if (qedprefix.size() > 0) {
o2::steer::InteractionSampler qedInteractionSampler;
if (!bcPatternFile.empty()) {
qedInteractionSampler.setBunchFilling(bcPatternFile);
setBCFillingHelper(qedInteractionSampler, bcPatternFile);
}

// get first and last "hadronic" interaction records and let
Expand Down