ATLAS Offline Software
Loading...
Searching...
No Matches
MTCalibPebHypoTool::ROBRequestInstruction Struct Reference

ROB request instruction description. More...

Collaboration diagram for MTCalibPebHypoTool::ROBRequestInstruction:

Public Types

enum  Type {
  INVALID , ADD , GET , ADDGET ,
  COL
}
 Type of instruction. More...

Public Member Functions

 ROBRequestInstruction (std::string_view str)
 Constructor from string key in the ROBAccessDict property.
const std::string toString () const
 String form for debug print-outs.

Public Attributes

enum MTCalibPebHypoTool::ROBRequestInstruction::Type type = INVALID
bool isRandom = false
 Flag switching requests of a random sub-sample of the ROB list.
size_t nRandom = 0
 Size of random request.

Detailed Description

ROB request instruction description.

Definition at line 49 of file MTCalibPebHypoTool.h.

Member Enumeration Documentation

◆ Type

Constructor & Destructor Documentation

◆ ROBRequestInstruction()

MTCalibPebHypoTool::ROBRequestInstruction::ROBRequestInstruction ( std::string_view str)

Constructor from string key in the ROBAccessDict property.

Definition at line 312 of file MTCalibPebHypoTool.cxx.

312 {
313 // Work around a bug in clang 9.
314#if __clang_major__ == 9
315 std::string str (strv.begin(), strv.end());
316#else
317 const std::string_view& str = strv;
318#endif
319 if (str.find(":ADD:")!=std::string_view::npos) type = ROBRequestInstruction::ADD;
320 else if (str.find(":GET:")!=std::string_view::npos) type = ROBRequestInstruction::GET;
321 else if (str.find(":ADDGET:")!=std::string_view::npos) type = ROBRequestInstruction::ADDGET;
322 else if (str.find(":COL:")!=std::string_view::npos) type = ROBRequestInstruction::COL;
323 if (size_t pos=str.find(":RND"); pos!=std::string_view::npos) {
324 size_t firstDigit=pos+4;
325 size_t lastDigit=str.find_first_of(":",firstDigit);
326 size_t num = std::stoul(str.substr(firstDigit,lastDigit).data());
327 isRandom = true;
328 nRandom = num;
329 }
330}
bool isRandom
Flag switching requests of a random sub-sample of the ROB list.

Member Function Documentation

◆ toString()

const std::string MTCalibPebHypoTool::ROBRequestInstruction::toString ( ) const

String form for debug print-outs.

Definition at line 333 of file MTCalibPebHypoTool.cxx.

333 {
334 std::string s;
335 s += "type=";
336 if (type==INVALID) s+="INVALID";
337 else if (type==ADD) s+="ADD";
338 else if (type==GET) s+="GET";
339 else if (type==ADDGET) s+="ADDGET";
340 else if (type==COL) s+="COL";
341 s += ", isRandom=";
342 s += isRandom ? "true" : "false";
343 s += ", nRandom=";
344 s += std::to_string(nRandom);
345 return s;
346}

Member Data Documentation

◆ isRandom

bool MTCalibPebHypoTool::ROBRequestInstruction::isRandom = false

Flag switching requests of a random sub-sample of the ROB list.

Definition at line 57 of file MTCalibPebHypoTool.h.

◆ nRandom

size_t MTCalibPebHypoTool::ROBRequestInstruction::nRandom = 0

Size of random request.

Definition at line 59 of file MTCalibPebHypoTool.h.

◆ type

enum MTCalibPebHypoTool::ROBRequestInstruction::Type MTCalibPebHypoTool::ROBRequestInstruction::type = INVALID

The documentation for this struct was generated from the following files: