ATLAS Offline Software
Functions
interpretSeeds.h File Reference
#include <string>
#include <stdint.h>
Include dependency graph for interpretSeeds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool interpretSeeds (const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset)
 
bool interpretSeeds (const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, uint32_t &offset)
 
bool interpretSeeds (const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2)
 
bool interpretSeeds (const std::string &buffer, std::string &stream, std::vector< uint32_t > &seeds)
 

Function Documentation

◆ interpretSeeds() [1/4]

bool interpretSeeds ( const std::string &  buffer,
std::string &  stream,
std::vector< uint32_t > &  seeds 
)

Definition at line 68 of file interpretSeeds.cxx.

70 {
71  //split the space-separated string in 31 or 33 words:
72  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
73  boost::char_separator<char> sep(" ");
74  tokenizer tokens(buffer, sep);
75  int nToks(distance(tokens.begin(), tokens.end()));
76  bool status = (nToks == 31 || nToks == 33 || nToks == 771);
77  if (status) {
78  tokenizer::iterator token(tokens.begin());
79  stream = *token++;
80  --nToks;
81  if (nToks == 32) nToks=30; //ranlux (FIXME NEEDED?)
82  for (int i=0; i<nToks; i++) {
83  uint32_t value = 0;
84  auto [ptr, ec] = std::from_chars(token->data(), token->data() + token->size(), value);
85  if (ec != std::errc()) {
86  status = false;
87  break;
88  }
89  seeds.push_back(value);
90  ++token;
91  }
92  }
93  return status;
94 }

◆ interpretSeeds() [2/4]

bool interpretSeeds ( const std::string &  buffer,
std::string &  stream,
uint32_t &  seed1,
uint32_t &  seed2 
)
inline

Definition at line 21 of file interpretSeeds.h.

22  {
23  short luxury(0);
24  uint32_t offset(0);
25  return interpretSeeds(buffer, stream, seed1, seed2, luxury, offset);
26 }

◆ interpretSeeds() [3/4]

bool interpretSeeds ( const std::string &  buffer,
std::string &  stream,
uint32_t &  seed1,
uint32_t &  seed2,
short &  luxury,
uint32_t &  offset 
)

Definition at line 41 of file interpretSeeds.cxx.

43 {
44  //split the space-separated string in 3 or 5 or 7 words:
45  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
46  boost::char_separator<char> sep(" ");
47  tokenizer tokens(buffer, sep);
48  int nToks(distance(tokens.begin(), tokens.end()));
49  bool status = (nToks == 3 || nToks == 5 || nToks == 7);
50  if (status) {
51  tokenizer::iterator token(tokens.begin());
52  stream = *token++;
53  //FIXME, try permutations by hand. With more than two we'd need a parser
54  getOffset(token, offset);
55  getLuxury(token, luxury);
56  getOffset(token, offset);
57  auto [ptr1, ec1] = std::from_chars(token->data(), token->data() + token->size(), seed1);
58  ++token;
59  auto [ptr2, ec2] = std::from_chars(token->data(), token->data() + token->size(), seed2);
60  ++token;
61  if (ec1 != std::errc() || ec2 != std::errc()) {
62  status = false;
63  }
64  }
65  return status;
66 }

◆ interpretSeeds() [4/4]

bool interpretSeeds ( const std::string &  buffer,
std::string &  stream,
uint32_t &  seed1,
uint32_t &  seed2,
uint32_t &  offset 
)
inline

Definition at line 13 of file interpretSeeds.h.

15  {
16  short luxury(0);
17  return interpretSeeds(buffer, stream, seed1, seed2, luxury, offset);
18 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
getLuxury
void getLuxury(boost::tokenizer< boost::char_separator< char > >::iterator &token, short &luxLevel)
Definition: interpretSeeds.cxx:13
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
athena.value
value
Definition: athena.py:124
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
beamspotman.tokens
tokens
Definition: beamspotman.py:1280
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
genPbPbJobOpt.seed2
seed2
Definition: genPbPbJobOpt.py:57
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:11
lumiFormat.i
int i
Definition: lumiFormat.py:85
grepfile.sep
sep
Definition: grepfile.py:38
genPbPbJobOpt.seed1
seed1
Definition: genPbPbJobOpt.py:56
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
merge.status
status
Definition: merge.py:16
interpretSeeds
bool interpretSeeds(const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset)
Definition: interpretSeeds.cxx:41
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
getOffset
void getOffset(boost::tokenizer< boost::char_separator< char > >::iterator &token, uint32_t &offset)
Definition: interpretSeeds.cxx:28