diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py index fe45172ac3be9c2ece6fb3f6602db9169a14ea17..72de33222c81676d30d0dfe52e5fd40bf2eb39b0 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py @@ -68,18 +68,18 @@ rob_list = [ ] rob_access_dict = { - '01 :GET:RND20: Retrieve ': rob_list, - '02 :GET:RND10: Retrieve ': rob_list, - '03 :GET:RND5: Retrieve ': rob_list, - '04 :GET:RND10: Retrieve ': rob_list, - '05 :GET:RND20: Retrieve ': rob_list, - '06 :GET:RND50: Retrieve ': rob_list, - '07 :GET:RND10: Retrieve ': rob_list, - '08 :GET:RND5: Retrieve ': rob_list, - '09 :GET:RND20: Retrieve ': rob_list, - '10 :GET:RND20: Retrieve ': rob_list, - '11 :GET:RND10: Retrieve ': rob_list, - '12 :GET:RND10: Retrieve ': rob_list + '01 :ADDGET:RND20:': rob_list, # Prefetch+Retrieve 20 random ROBs from rob_list + '02 :GET:RND10: ': rob_list, # Retrieve 10 random ROBs from rob_list + '03 :GET:RND5: ': rob_list, # Retrieve 5 random ROBs from rob_list + '04 :ADD:RND10: ': rob_list, # Prefetch 10 random ROBs from rob_list + '05 :ADD:RND20: ': rob_list, # Prefetch 20 random ROBs from rob_list + '06 :ADDGET:RND50:': rob_list, # Prefetch+Retrieve 50 random ROBs from rob_list + '07 :ADDGET:RND10:': rob_list, # Prefetch+Retrieve 10 random ROBs from rob_list + '08 :ADDGET:RND5: ': rob_list, # Prefetch+Retrieve 5 random ROBs from rob_list + '09 :GET:RND20: ': rob_list, # Retrieve 20 random ROBs from rob_list + '10 :ADDGET:RND20:': rob_list, # Prefetch+Retrieve 20 random ROBs from rob_list + '11 :GET:RND10: ': rob_list, # Retrieve 10 random ROBs from rob_list + '12 :ADDGET:RND10:': rob_list # Prefetch+Retrieve 10 random ROBs from rob_list } class MTCalibPebHypoOptions: diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx index a7442a31b97fdf1c3ed2e7b7be6c5a9c6af9734c..83c6a217465ae114f30247bb0c15ccd9de585282 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx @@ -200,35 +200,31 @@ StatusCode MTCalibPebHypoTool::decide(const MTCalibPebHypoTool::Input& input) co else robs = robVec; // Execute the ROB requests - switch (instr.type) { - case ROBRequestInstruction::Type::ADD: { - // Prefetch ROBs - ATH_MSG_DEBUG("Preloading ROBs: " << idsToString(robs)); - m_robDataProviderSvc->addROBData(input.eventContext, robs, name()+"-ADD"); - break; - } - case ROBRequestInstruction::Type::GET: { - // Retrieve ROBs - ATH_MSG_DEBUG("Retrieving ROBs: " << idsToString(robs)); - // VROBFRAG is a typedef for std::vector<const eformat::ROBFragment<const uint32_t*>*> - IROBDataProviderSvc::VROBFRAG robFragments; - m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET"); - ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size()); - if (!robFragments.empty()) - ATH_MSG_DEBUG("List of ROBs found: " << std::endl << format(robFragments)); - break; - } - case ROBRequestInstruction::Type::COL: { - // Event building - ATH_MSG_DEBUG("Requesting full event ROBs"); - int nrobs = m_robDataProviderSvc->collectCompleteEventData(input.eventContext, name()+"-COL"); - ATH_MSG_DEBUG("Number of ROBs retrieved: " << nrobs); - break; - } - default: { - ATH_MSG_ERROR("Invalid ROB request instruction " << instr.toString()); - return StatusCode::FAILURE; - } + using ReqType = ROBRequestInstruction::Type; + if (instr.type == ReqType::ADD || instr.type == ReqType::ADDGET) { + // Prefetch ROBs + ATH_MSG_DEBUG("Preloading ROBs: " << idsToString(robs)); + m_robDataProviderSvc->addROBData(input.eventContext, robs, name()+"-ADD"); + } + if (instr.type == ReqType::GET || instr.type == ReqType::ADDGET) { + // Retrieve ROBs + ATH_MSG_DEBUG("Retrieving ROBs: " << idsToString(robs)); + // VROBFRAG is a typedef for std::vector<const eformat::ROBFragment<const uint32_t*>*> + IROBDataProviderSvc::VROBFRAG robFragments; + m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET"); + ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size()); + if (!robFragments.empty()) + ATH_MSG_DEBUG("List of ROBs found: " << std::endl << format(robFragments)); + } + if (instr.type == ReqType::COL) { + // Event building + ATH_MSG_DEBUG("Requesting full event ROBs"); + int nrobs = m_robDataProviderSvc->collectCompleteEventData(input.eventContext, name()+"-COL"); + ATH_MSG_DEBUG("Number of ROBs retrieved: " << nrobs); + } + if (instr.type == ReqType::INVALID) { + ATH_MSG_ERROR("Invalid ROB request instruction " << instr.toString()); + return StatusCode::FAILURE; } // Sleep between ROB requests @@ -290,6 +286,7 @@ MTCalibPebHypoTool::ROBRequestInstruction::ROBRequestInstruction(std::string_vie #endif if (str.find(":ADD:")!=std::string_view::npos) type = ROBRequestInstruction::ADD; else if (str.find(":GET:")!=std::string_view::npos) type = ROBRequestInstruction::GET; + else if (str.find(":ADDGET:")!=std::string_view::npos) type = ROBRequestInstruction::ADDGET; else if (str.find(":COL:")!=std::string_view::npos) type = ROBRequestInstruction::COL; if (size_t pos=str.find(":RND"); pos!=std::string_view::npos) { size_t firstDigit=pos+4; @@ -307,6 +304,7 @@ const std::string MTCalibPebHypoTool::ROBRequestInstruction::toString() const { if (type==INVALID) s+="INVALID"; else if (type==ADD) s+="ADD"; else if (type==GET) s+="GET"; + else if (type==ADDGET) s+="ADDGET"; else if (type==COL) s+="COL"; s += ", isRandom="; s += isRandom ? "true" : "false"; diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h index a4e13f068bb75a06ce2919aaa9a10646563418a7..58bad04d0e515216b0948781258b1c58a1fa6d75 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEXPARTIALEB_MTCALIBPEBHYPOTOOL_H @@ -52,7 +52,7 @@ private: /// String form for debug print-outs const std::string toString() const; /// Type of instruction - enum Type {INVALID, ADD, GET, COL} type = INVALID; + enum Type {INVALID, ADD, GET, ADDGET, COL} type = INVALID; /// Flag switching requests of a random sub-sample of the ROB list bool isRandom = false; /// Size of random request @@ -83,11 +83,11 @@ private: Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > m_robAccessDictProp { this, "ROBAccessDict", {}, "Dictionary of prefetch/retrieve operations with given ROB IDs. The value is a vector of ROB IDs. " - "The string key has to contain :ADD: (prefetch), :GET: (retrieve), or :COL: (full event building). :ADD: and :GET: " - "may be also appended with :RNDX: where X is an integer. In this case, random X ROBs will be prefetched/retrieved " - "from the provided list, e.g. :GET:RND10: retrieves 10 random ROBs from the list. Otherwise the full list is used. " - "Note std::map is sorted by std::less<std::string>, so starting the key with a number may be needed to enforce " - "ordering, e.g. '01 :ADD:RND10:'." + "The string key has to contain :ADD: (prefetch), :GET: (retrieve), :ADDGET: (prefetch+retrieve) or :COL: (full " + "event building). :ADD:, :GET: and :ADDGET: may be also appended with :RNDX: where X is an integer. In this case, " + "random X ROBs will be prefetched/retrieved from the provided list, e.g. :GET:RND10: retrieves 10 random ROBs from " + "the list. Otherwise the full list is used. Note std::map is sorted by std::less<std::string>, so starting the key " + "with a number may be needed to enforce ordering, e.g. '01 :ADD:RND10:'." }; Gaudi::Property<unsigned int> m_timeBetweenRobReqMillisec { this, "TimeBetweenROBReqMillisec", 0,