ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigInDetAnalysisUser
Readcards
src
utils.h
Go to the documentation of this file.
1
/* emacs: this is -*- c++ -*- */
19
20
21
#ifndef READCARDS_UTILS_H
22
#define READCARDS_UTILS_H
23
24
#include <string>
25
#include <vector>
26
#include <iostream>
27
28
29
// get tokens off the front (chop) and back (chomp)
30
std::string
chop
(std::string& ,
const
std::string& );
31
std::string
chomp
(std::string& ,
const
std::string& );
32
33
// chop token off of end of string, leave string unchaged, return the token
34
std::string
choptoken
(std::string& ,
const
std::string& );
35
36
// chop token off of end of string, leave string unchaged, return the token
37
std::string
chomptoken
(std::string& ,
const
std::string& );
38
39
40
// removes whitespace
41
void
removespace
(std::string& s,
const
std::string& s2=
" \t"
);
42
43
// replaces whitespace
44
void
replace
(std::string& s,
const
std::string& s2=
" \t"
,
const
std::string& s3=
"-"
);
45
void
replace
(std::string& s,
char
c1,
char
c2)
noexcept
;
46
47
// chops s1 to the first not of s2
48
std::string
chopfirst
(std::string& s1,
const
std::string& s2=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:/"
);
49
50
// chops s1 from the the last not of s2
51
std::string
choplast
(std::string& s1,
const
std::string& s2=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
);
52
53
// chops from both ends all of s2
54
std::string
chopends
(std::string& s1,
const
std::string& s2=
" \t"
);
55
56
// functions for manipulating filenames
57
std::string
basename
( std::string name );
58
std::string
dirname
( std::string name );
59
60
// removes colons
61
void
depunctuate
(std::string& );
62
63
// helper methods, calculate delta phi form two phi angles
64
double
deltaPhi
(
double
,
double
);
65
66
// checks to see if a particular file can be opened
67
bool
canopen
(
const
std::string& );
68
69
70
// converts number into integer string ...
71
std::string
number
(
const
int
& i,
const
std::string& s=
"%d"
);
72
std::string
number
(
const
double
& d,
const
std::string& s=
"%lf"
);
73
74
75
76
#endif
/* READCARDS_UTILS_H */
77
78
79
80
81
82
83
84
85
86
87
chopfirst
std::string chopfirst(std::string &s1, const std::string &s2="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:/")
Definition
hcg.cxx:262
chopends
std::string chopends(std::string &s1, const std::string &s2=" \t")
Definition
hcg.cxx:292
chomp
std::string chomp(std::string &, const std::string &)
Definition
hcg.cxx:216
dirname
std::string dirname(std::string name)
Definition
utils.cxx:200
deltaPhi
double deltaPhi(double, double)
Definition
utils.cxx:169
removespace
void removespace(std::string &s, const std::string &s2=" \t")
Definition
hcg.cxx:302
replace
void replace(std::string &s, const std::string &s2=" \t", const std::string &s3="-")
Definition
utils.cxx:142
canopen
bool canopen(const std::string &)
Definition
utils.cxx:178
chop
std::string chop(std::string &, const std::string &)
Definition
hcg.cxx:163
choptoken
std::string choptoken(std::string &, const std::string &)
Definition
hcg.cxx:235
basename
std::string basename(std::string name)
Definition
utils.cxx:207
chomptoken
std::string chomptoken(std::string &, const std::string &)
Definition
hcg.cxx:249
number
std::string number(const int &i, const std::string &s="%d")
Definition
utils.cxx:192
depunctuate
void depunctuate(std::string &)
Definition
utils.cxx:157
choplast
std::string choplast(std::string &s1, const std::string &s2="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")
Definition
hcg.cxx:278
Generated on
for ATLAS Offline Software by
1.17.0