![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "TLorentzVector.h"
12 auto randchar = []() ->
char {
13 const char charset[] =
15 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
16 "abcdefghijklmnopqrstuvwxyz";
17 const size_t max_index = (
sizeof(charset) - 1);
18 return charset[
rand() % max_index];
21 std::generate_n(
str.begin(),
length, randchar);
25 size_t ExpPos =
str.find(
exp);
26 if (ExpPos == std::string::npos)
return str;
45 Warning(
"clone()",
"Nullptr given... Segmentation ahead");
46 return std::unique_ptr<TH1>();
50 std::unique_ptr<TH1> ptr (
dynamic_cast<TH1*
>(
H->Clone(
RandomString(10).c_str())));
55 int x(-1),
y(-1),
z(-1);
56 if (Histo ==
nullptr){
57 Warning(
"isOverflowBin()",
"Where is my histogram?");
60 Histo->GetBinXYZ(
bin,
x,
y,
z);
61 if (
x == 0 ||
x == Histo->GetXaxis()->GetNbins() + 1)
return true;
62 if (Histo->GetDimension() >= 2 && (
y == 0 ||
y == Histo->GetYaxis()->GetNbins() + 1))
return true;
63 if (Histo->GetDimension() == 3 && (
z == 0 ||
z == Histo->GetZaxis()->GetNbins() + 1))
return true;
std::string RandomString(size_t s)
Generates a random string consisting of capital & small letters + numbers.
bool isOverflowBin(const TH1 *Histo, int bin)
Checks whether a global bin number belongs to over/underflow or is in the bulk.
std::string LowerString(const std::string &str)
Lowers all characters in the string.
Select isolated Photons, Electrons and Muons.
std::unique_ptr< TH1 > clone(TH1 *H)
Clones a TH1 and handles the ownership then to a unique_ptr.
void tolower(std::string &s)
std::string EraseWhiteSpaces(std::string str)
Removes beginning and trailing white spaces from a string.
std::string ReplaceExpInString(std::string str, const std::string &exp, const std::string &rep)
Replaces all expressions an string by something else.