ATLAS Offline Software
Loading...
Searching...
No Matches
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}
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
void * ptr(T *p)
Definition SGImplSvc.cxx:74
status
Definition merge.py:16
setEventNumber uint32_t

◆ 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);
25 return interpretSeeds(buffer, stream, seed1, seed2, luxury, offset);
26}
bool interpretSeeds(const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset)

◆ 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}
void getOffset(boost::tokenizer< boost::char_separator< char > >::iterator &token, uint32_t &offset)
void getLuxury(boost::tokenizer< boost::char_separator< char > >::iterator &token, short &luxLevel)

◆ 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}