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 62 of file interpretSeeds.cxx.

64 {
65  //split the space-separated string in 31 or 33 words:
66  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
67  boost::char_separator<char> sep(" ");
68  tokenizer tokens(buffer, sep);
69  int nToks(distance(tokens.begin(), tokens.end()));
70  bool status = (nToks == 31 || nToks == 33 || nToks == 771);
71  if (status) {
72  tokenizer::iterator token(tokens.begin());
73  stream = *token++;
74  --nToks;
75  try {
76  if (nToks == 32) nToks=30; //ranlux (FIXME NEEDED?)
77  for (int i=0; i<nToks; i++) {
78 #if defined(__GNUC__) && !defined(__clang__)
79 #pragma GCC diagnostic push
80 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
81 #endif
82  seeds.push_back(boost::lexical_cast<uint32_t>(*token++));
83 #if defined(__GNUC__) && !defined(__clang__)
84 #pragma GCC diagnostic pop
85 #endif
86  }
87  } catch (const boost::bad_lexical_cast& e) {
88  status = false;
89  }
90  }
91  return status;
92 }

◆ 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 28 of file interpretSeeds.cxx.

30 {
31  //split the space-separated string in 3 or 5 or 7 words:
32  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
33  boost::char_separator<char> sep(" ");
34  tokenizer tokens(buffer, sep);
35  int nToks(distance(tokens.begin(), tokens.end()));
36  bool status = (nToks == 3 || nToks == 5 || nToks == 7);
37  if (status) {
38  tokenizer::iterator token(tokens.begin());
39  stream = *token++;
40  //FIXME, try permutations by hand. With more than two we'd need a parser
41  getOffset(token, offset);
42  getLuxury(token, luxury);
43  getOffset(token, offset);
44 
45  try {
46 #if defined(__GNUC__) && !defined(__clang__)
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
49 #endif
50  seed1 = boost::lexical_cast<uint32_t>(*token++);
51  seed2 = boost::lexical_cast<uint32_t>(*token++);
52 #if defined(__GNUC__) && !defined(__clang__)
53 #pragma GCC diagnostic pop
54 #endif
55  } catch (const boost::bad_lexical_cast& e) {
56  status = false;
57  }
58  }
59  return status;
60 }

◆ 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:12
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
genPbPbJobOpt.seed2
seed2
Definition: genPbPbJobOpt.py:57
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
grepfile.sep
sep
Definition: grepfile.py:38
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
genPbPbJobOpt.seed1
seed1
Definition: genPbPbJobOpt.py:56
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
merge.status
status
Definition: merge.py:17
interpretSeeds
bool interpretSeeds(const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset)
Definition: interpretSeeds.cxx:28
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:21