ra4_stats
0341147a0dc35f80f4e12c6003afb76a38e2ed6e
|
#include <string>
#include <vector>
#include <stdexcept>
#include <iostream>
#include "TTree.h"
#include "RooWorkspace.h"
#include "cut.hpp"
Go to the source code of this file.
Macros | |
#define | ERROR(x) do{throw std::runtime_error(string("Error in file ")+__FILE__+" at line "+to_string(__LINE__)+" (in "+__func__+"): "+x);}while(false) |
#define | DBG(x) do{std::cerr << "In " << __FILE__ << " at line " << __LINE__ << " (in function " << __func__ << "): " << x << std::endl;}while(false) |
Functions | |
bool | Contains (const std::string &str, const std::string &pat) |
bool | StartsWith (const std::string &str, const std::string &pat) |
void | ReplaceAll (std::string &str, const std::string &orig, const std::string &rep) |
void | RmCutOn (std::string &cut, const std::string &orig, const std::string &rep="1") |
size_t | MaxIndex (const std::vector< double > &v) |
void | DefineSet (RooWorkspace &w, const std::string &set_name, const std::vector< std::string > &var_names) |
void | GetCountAndUncertainty (TTree &tree, const Cut &cut, double &count, double &uncertainty) |
std::string | execute (const std::string &cmd) |
std::vector< std::string > | Tokenize (const std::string &input, const std::string &tokens=" ") |
std::string | ChangeExtension (std::string path, const std::string &new_ext) |
std::string | MakeDir (std::string prefix) |
void | parseMasses (const std::string &str, int &mglu, int &mlsp) |
template<typename T > | |
void | Append (T &collection, const typename T::value_type &value) |
#define DBG | ( | x | ) | do{std::cerr << "In " << __FILE__ << " at line " << __LINE__ << " (in function " << __func__ << "): " << x << std::endl;}while(false) |
Definition at line 16 of file utilities.hpp.
Referenced by WorkspaceGenerator::AddABCDParameters(), WorkspaceGenerator::AddBackgroundFractions(), WorkspaceGenerator::AddData(), WorkspaceGenerator::AddDebug(), WorkspaceGenerator::AddDileptonSystematic(), WorkspaceGenerator::AddFullBackgroundPredictions(), WorkspaceGenerator::AddFullPdf(), WorkspaceGenerator::AddKappas(), WorkspaceGenerator::AddMCColSums(), WorkspaceGenerator::AddMCKappa(), WorkspaceGenerator::AddMCPdfs(), WorkspaceGenerator::AddMCPrediction(), WorkspaceGenerator::AddMCProcessSums(), WorkspaceGenerator::AddMCRowSums(), WorkspaceGenerator::AddMCTotal(), WorkspaceGenerator::AddMCYields(), WorkspaceGenerator::AddModels(), WorkspaceGenerator::AddParameterSets(), WorkspaceGenerator::AddPdfs(), WorkspaceGenerator::AddPOI(), WorkspaceGenerator::AddRawBackgroundPredictions(), WorkspaceGenerator::AddSignalPredictions(), WorkspaceGenerator::AddSystematicGenerator(), WorkspaceGenerator::AddSystematicsGenerators(), WorkspaceGenerator::AddToys(), WorkspaceGenerator::DefineParameterSet(), WorkspaceGenerator::GenerateToys(), GetModelLabel(), GetParticleNames(), WorkspaceGenerator::MakeDileptonBin(), WorkspaceGenerator::NeedsDileptonBin(), WorkspaceGenerator::PrintComparison(), PrintTable(), WorkspaceGenerator::ReadSystematicsFile(), WorkspaceGenerator::ResetToys(), WorkspaceGenerator::SetupToys(), WorkspaceGenerator::UpdateWorkspace(), and WorkspaceGenerator::WriteToFile().
#define ERROR | ( | x | ) | do{throw std::runtime_error(string("Error in file ")+__FILE__+" at line "+to_string(__LINE__)+" (in "+__func__+"): "+x);}while(false) |
Definition at line 15 of file utilities.hpp.
Referenced by WorkspaceGenerator::AddToys(), execute(), WorkspaceGenerator::GenerateToys(), main(), MakeDir(), ReadPoints(), WorkspaceGenerator::ReadSystematicsFile(), RemoveBadResults(), Bin::RemoveSystematic(), Process::RemoveSystematic(), WorkspaceGenerator::ResetToys(), Bin::SetSystematicStrength(), Process::SetSystematicStrength(), and WorkspaceGenerator::SetupToys().
void Append | ( | T & | collection, |
const typename T::value_type & | value | ||
) |
Definition at line 48 of file utilities.hpp.
Referenced by WorkspaceGenerator::AddData(), WorkspaceGenerator::AddDileptonSystematic(), WorkspaceGenerator::AddDummyNuisance(), WorkspaceGenerator::AddMCPdfs(), WorkspaceGenerator::AddMCYields(), WorkspaceGenerator::AddPOI(), WorkspaceGenerator::AddRawBackgroundPredictions(), WorkspaceGenerator::AddSystematicGenerator(), WorkspaceGenerator::AddSystematicsGenerators(), GetBinNames(), GetFuncNames(), GetPlainBinNames(), GetProcessNames(), GetVarNames(), and WorkspaceGenerator::ReadSystematicsFile().
std::string ChangeExtension | ( | std::string | path, |
const std::string & | new_ext | ||
) |
Definition at line 115 of file utilities.cpp.
Referenced by main().
bool Contains | ( | const std::string & | str, |
const std::string & | pat | ||
) |
Definition at line 26 of file utilities.cpp.
Referenced by WorkspaceGenerator::AddData(), WorkspaceGenerator::AddMCYields(), WorkspaceGenerator::AddPdfs(), YieldManager::ComputeYield(), WorkspaceGenerator::GenerateToys(), GetBinNames(), GetBkgPred(), GetBkgPredErr(), GetKappaNoSys(), GetKappaNoSysErr(), GetKappaSys(), GetKappaSysErr(), GetLambda(), GetLambdaErr(), GetMCTotal(), GetMCTotalErr(), GetMCYield(), GetObserved(), GetSigPred(), GetSigPredErr(), GetTotPred(), GetTotPredErr(), main(), MakeBackgroundHistos(), MakeCovarianceMatrix(), MakeYieldPlot(), ModifyLumi(), WorkspaceGenerator::NeedsDileptonBin(), PrintTable(), ReadPoints(), WorkspaceGenerator::ResetToys(), SetBounds(), and WorkspaceGenerator::SetupToys().
void DefineSet | ( | RooWorkspace & | w, |
const std::string & | set_name, | ||
const std::vector< std::string > & | var_names | ||
) |
Definition at line 62 of file utilities.cpp.
std::string execute | ( | const std::string & | cmd | ) |
Definition at line 87 of file utilities.cpp.
References ERROR, and scan_aggregate::result.
Referenced by ExtractSignal(), GetLimit(), GetSignificance(), InjectSignal(), main(), ModifyLumi(), and RunFit().
void GetCountAndUncertainty | ( | TTree & | tree, |
const Cut & | cut, | ||
double & | count, | ||
double & | uncertainty | ||
) |
Definition at line 76 of file utilities.cpp.
Referenced by Process::GetYield().
std::string MakeDir | ( | std::string | prefix | ) |
Definition at line 126 of file utilities.cpp.
References ERROR.
Referenced by ExtractSignal(), and main().
size_t MaxIndex | ( | const std::vector< double > & | v | ) |
Definition at line 51 of file utilities.cpp.
void parseMasses | ( | const std::string & | str, |
int & | mglu, | ||
int & | mlsp | ||
) |
Definition at line 21 of file utilities.cpp.
Referenced by main().
void ReplaceAll | ( | std::string & | str, |
const std::string & | orig, | ||
const std::string & | rep | ||
) |
Definition at line 34 of file utilities.cpp.
Referenced by Bin::Bin(), Cut::Clean(), WorkspaceGenerator::CleanLine(), Process::CleanName(), YieldManager::ComputeYield(), main(), MakeCovarianceMatrix(), MakePlot(), PrettyBinName(), PrintTable(), WorkspaceGenerator::ReadSystematicsFile(), and Cut::Replace().
void RmCutOn | ( | std::string & | cut, |
const std::string & | orig, | ||
const std::string & | rep = "1" |
||
) |
Definition at line 42 of file utilities.cpp.
bool StartsWith | ( | const std::string & | str, |
const std::string & | pat | ||
) |
Definition at line 30 of file utilities.cpp.
std::vector<std::string> Tokenize | ( | const std::string & | input, |
const std::string & | tokens = " " |
||
) |
Definition at line 101 of file utilities.cpp.
Referenced by WorkspaceGenerator::ReadSystematicsFile().