150void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
153 int defaultlanes = std::max(1u, std::thread::hardware_concurrency() / 2);
154 std::string laneshelp(
"Number of tpc processing lanes. A lane is a pipeline of algorithms.");
155 workflowOptions.push_back(
156 ConfigParamSpec{
"tpc-lanes", VariantType::Int, defaultlanes, {laneshelp}});
158 std::string sectorshelp(
"List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15");
160 workflowOptions.push_back(
161 ConfigParamSpec{
"tpc-sectors", VariantType::String, sectorDefault.c_str(), {sectorshelp}});
163 std::string onlyhelp(
"Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)");
164 workflowOptions.push_back(
167 std::string skiphelp(
"Comma separate list of detectors to skip/ignore. (Default is none)");
168 workflowOptions.push_back(
174 std::string forceaccepthelp(
"Whether or not to always rely on accept/skip filters for detectors, independent of GRP content");
175 workflowOptions.push_back(
176 ConfigParamSpec{
"forceSelectedDets", VariantType::Bool,
false, {forceaccepthelp}});
178 std::string onlyctxhelp(
"Produce only the digitization context; Don't actually digitize");
182 std::string tpcrthelp(
"deprecated option, please connect workflows on the command line by pipe");
183 workflowOptions.push_back(
184 ConfigParamSpec{
"tpc-reco-type", VariantType::String,
"", {tpcrthelp}});
191 std::string simhelp(
"Comma separated list of simulation prefixes (for background, signal productions)");
192 workflowOptions.push_back(
196 std::string keyvaluehelp(
"Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')");
197 workflowOptions.push_back(
198 ConfigParamSpec{
"configKeyValues", VariantType::String,
"", {keyvaluehelp}});
199 workflowOptions.push_back(
200 ConfigParamSpec{
"configFile", VariantType::String,
"", {
"configuration file for configurable parameters"}});
223 workflowOptions.push_back(
ConfigParamSpec{
"disable-trd-trapsim", VariantType::Bool,
false, {
"disable the trap simulation of the TRD"}});
224 workflowOptions.push_back(
ConfigParamSpec{
"trd-digit-downscaling", VariantType::Int, 1, {
"only keep TRD digits for every n-th trigger"}});
226 workflowOptions.push_back(
ConfigParamSpec{
"combine-devices", VariantType::Bool,
false, {
"combined multiple DPL worker/writer devices"}});
229 workflowOptions.push_back(
ConfigParamSpec{
"with-trigger", VariantType::Bool,
false, {
"enable distribution of CTP trigger digits"}});
232 workflowOptions.push_back(
ConfigParamSpec{
"store-ctp-lumi", VariantType::Float, -1.f, {
"store CTP lumi scaler in CTP digits (if >= 0)"}});
457 std::string dplProcessName =
whoAmI(configcontext);
460 bool initServices = !isDPLinternal && !isDumpWorkflow && !ismaster;
469 ConfigurableParam::updateFromFile(configcontext.
options().
get<std::string>(
"configFile"));
474 ConfigurableParam::updateFromString(configcontext.
options().
get<std::string>(
"configKeyValues"));
480 std::shared_ptr<o2::parameters::GRPObject const> grp(
nullptr);
484 const auto GRPTIMEKEY =
"GRPTIMESTART";
489 auto t = grp->getTimeStart();
495 LOG(fatal) <<
"Expected env value not found";
498 return boost::lexical_cast<uint64_t>(tstr);
508 getGRPStartTime(grp.get());
510 if (!hbfu.startTime) {
511 hbfu.setValue(
"HBFUtils.startTime",
std::to_string(getGRPStartTime(grp.get())));
525 LOG(info) <<
"Setting timestamp of BasicCCDBManager to " << dph.
creation;
535 ConfigurableParam::setValue(
"DigiParams.digitizationgeometry_prefix", simPrefixes[0]);
536 ConfigurableParam::setValue(
"DigiParams.grpfile", grpfile);
538 LOG(info) <<
"MC-TRUTH " << !configcontext.
options().
get<
bool>(
"disable-mc");
539 bool mctruth = !configcontext.
options().
get<
bool>(
"disable-mc");
540 ConfigurableParam::setValue(
"DigiParams",
"mctruth", mctruth);
546 if (!configcontext.
options().
get<
bool>(
"disable-write-ini")) {
557 for (
auto&
f : filterers) {
570 std::stringstream
str;
571 str <<
"GRPDETKEY_" <<
id.getName();
572 if (
gIsMaster and grp.get() !=
nullptr) {
573 auto ok = grp->isDetReadOut(
id);
589 if (configcontext.
options().
get<
bool>(
"only-context")) {
593 auto accepted = accept(
id);
596 auto forceAccepted = configcontext.
options().
get<
bool>(
"forceSelectedDets");
597 bool is_ingrp = isInGRPReadout(
id);
599 auto isRun = accepted && (forceAccepted || is_ingrp);
601 LOG(info) <<
id.getName()
602 <<
" is in grp? " << (is_ingrp ?
"yes" :
"no") <<
";"
603 <<
" is taken although not in grp? " << (!is_ingrp && (accepted && forceAccepted) ?
"yes" :
"no") <<
";"
604 <<
" is skipped? " << (!accepted ?
"yes" :
"no") <<
";"
605 <<
" is run? " << (isRun ?
"yes" :
"no");
610 std::vector<o2::detectors::DetID> detList;
613 std::vector<int> tpcsectors;
615 if (isEnabled(o2::detectors::DetID::TPC)) {
616 if (!helpasked && ismaster) {
620 tpcsectors = o2::RangeTokenizer::tokenize<int>(configcontext.
options().
get<std::string>(
"tpc-sectors"));
622 auto lanes = helpasked ? 1 :
getNumTPCLanes(tpcsectors, configcontext);
623 detList.emplace_back(o2::detectors::DetID::TPC);
625 auto internalwrite = configcontext.
options().
get<
bool>(
"tpc-chunked-writer");
626 auto distortionType = configcontext.
options().
get<
int>(
"tpc-distortion-type");
628 specs.insert(specs.end(), tpcPipelines.begin(), tpcPipelines.end());
630 if (configcontext.
options().
get<std::string>(
"tpc-reco-type").empty() ==
false) {
631 throw std::runtime_error(
"option 'tpc-reco-type' is deprecated, please connect workflows on the command line by pipe");
633 if (!internalwrite) {
640 const int firstOtherChannel = 36;
641 int fanoutsize = firstOtherChannel;
644 if (isEnabled(o2::detectors::DetID::ITS)) {
645 detList.emplace_back(o2::detectors::DetID::ITS);
653#ifdef ENABLE_UPGRADES
655 if (isEnabled(o2::detectors::DetID::IT3)) {
656 detList.emplace_back(o2::detectors::DetID::IT3);
665 if (isEnabled(o2::detectors::DetID::TRK)) {
666 detList.emplace_back(o2::detectors::DetID::TRK);
674 if (isEnabled(o2::detectors::DetID::FT3)) {
675 detList.emplace_back(o2::detectors::DetID::FT3);
681 if (isEnabled(o2::detectors::DetID::TF3)) {
682 detList.emplace_back(o2::detectors::DetID::TF3);
691 if (isEnabled(o2::detectors::DetID::MFT)) {
692 detList.emplace_back(o2::detectors::DetID::MFT);
701 if (isEnabled(o2::detectors::DetID::TOF)) {
702 auto useCCDB = configcontext.
options().
get<
bool>(
"use-ccdb-tof");
703 useCCDB |= configcontext.
options().
get<
bool>(
"ccdb-tof-sa");
706 detList.emplace_back(o2::detectors::DetID::TOF);
707 auto maskDRM = (uint32_t)configcontext.
options().
get<
int>(
"tof-drm-bitmask");
717 if (isEnabled(o2::detectors::DetID::FT0)) {
718 auto useCCDB = configcontext.
options().
get<
bool>(
"use-ccdb-ft0");
720 detList.emplace_back(o2::detectors::DetID::FT0);
728 if (isEnabled(o2::detectors::DetID::FV0)) {
729 detList.emplace_back(o2::detectors::DetID::FV0);
737 if (isEnabled(o2::detectors::DetID::EMC)) {
738 auto useCCDB = !configcontext.
options().
get<
bool>(
"no-use-ccdb-emc");
739 bool requireCTPInputs = !configcontext.
options().
get<
bool>(
"no-require-ctpinputs-emc");
740 detList.emplace_back(o2::detectors::DetID::EMC);
748 if (isEnabled(o2::detectors::DetID::HMP)) {
749 detList.emplace_back(o2::detectors::DetID::HMP);
757 if (isEnabled(o2::detectors::DetID::ZDC)) {
758 detList.emplace_back(o2::detectors::DetID::ZDC);
766 if (isEnabled(o2::detectors::DetID::TRD)) {
767 detList.emplace_back(o2::detectors::DetID::TRD);
770 auto disableTrapSim = configcontext.
options().
get<
bool>(
"disable-trd-trapsim");
771 auto trdDigitDownscaling = configcontext.
options().
get<
int>(
"trd-digit-downscaling");
772 if (!disableTrapSim) {
786 if (isEnabled(o2::detectors::DetID::MCH)) {
787 detList.emplace_back(o2::detectors::DetID::MCH);
795 if (isEnabled(o2::detectors::DetID::MID)) {
796 detList.emplace_back(o2::detectors::DetID::MID);
804 if (isEnabled(o2::detectors::DetID::FDD)) {
805 detList.emplace_back(o2::detectors::DetID::FDD);
813 if (isEnabled(o2::detectors::DetID::PHS)) {
814 detList.emplace_back(o2::detectors::DetID::PHS);
822 if (isEnabled(o2::detectors::DetID::CPV)) {
823 detList.emplace_back(o2::detectors::DetID::CPV);
830 if (isEnabled(o2::detectors::DetID::CTP)) {
831 detList.emplace_back(o2::detectors::DetID::CTP);
832 float lumiScaler = configcontext.
options().
get<
float>(
"store-ctp-lumi");
839 if (!configcontext.
options().
get<
bool>(
"only-context")) {
843 bool combine = configcontext.
options().
get<
bool>(
"combine-devices");
845 for (
auto& s : digitizerSpecs) {
848 for (
auto& s : writerSpecs) {
852 std::vector<DataProcessorSpec> remaining;
853 specs.push_back(
specCombiner(
"Digitizations", digitizerSpecs, remaining));
854 specs.push_back(
specCombiner(
"Writers", writerSpecs, remaining));
855 for (
auto& s : remaining) {
865 bool haveCCDBInputSpec =
false;
866 for (
auto spec : specs) {
867 for (
auto in : spec.inputs) {
868 if (in.lifetime == Lifetime::Condition) {
869 haveCCDBInputSpec =
true;
874 if (!haveCCDBInputSpec && specs.size() > 0) {
875 LOG(info) <<
"No one uses DPL CCDB .. injecting a dummy CCDB query into " << specs.back().name;
876 specs.back().inputs.emplace_back(
"_dummyOrbitReset",
"CTP",
"ORBITRESET", 0, Lifetime::Condition,
881 bool withTrigger = configcontext.
options().
get<
bool>(
"with-trigger");
882 LOG(info) <<
" TRIGGER " << withTrigger;