21 fNormalizeByTheory(false), fStatErrorActivate(false), fhNominal() {}
25 fName(other.fName), fInputFile(other.fInputFile),
26 fHistoName(other.fHistoName), fHistoPath(other.fHistoPath),
27 fChannelName(other.fChannelName),
29 fOverallSysList(other.fOverallSysList),
30 fNormFactorList(other.fNormFactorList),
31 fHistoSysList(other.fHistoSysList),
32 fHistoFactorList(other.fHistoFactorList),
33 fShapeSysList(other.fShapeSysList),
34 fShapeFactorList(other.fShapeFactorList),
36 fStatError(other.fStatError),
37 fNormalizeByTheory(other.fNormalizeByTheory),
38 fStatErrorActivate(other.fStatErrorActivate),
39 fhNominal(other.fhNominal)
66 fhCountingHist.reset();
71 fhCountingHist.reset();
79 fName( SampName ), fInputFile( SampInputFile),
80 fHistoName( SampHistoName ), fHistoPath( SampHistoPath ),
81 fNormalizeByTheory(true), fStatErrorActivate(false), fhNominal() {}
84 fName( SampName ), fInputFile(
"" ),
85 fHistoName(
"" ), fHistoPath(
"" ),
86 fNormalizeByTheory(true), fStatErrorActivate(false),fhNominal() {}
89 TH1* histo = (
TH1*) fhNominal.GetObject();
96 const TH1* histNominal = GetHisto();
102 fInputFile = OutputFileName;
103 fHistoName = histNominal->
GetName();
104 fHistoPath = DirName;
107 GetStatError().writeToFile( OutputFileName, DirName );
111 for(
unsigned int i = 0; i < GetHistoSysList().size(); ++i ) {
112 GetHistoSysList().at(i).writeToFile( OutputFileName, DirName );
114 for(
unsigned int i = 0; i < GetHistoFactorList().size(); ++i ) {
115 GetHistoFactorList().at(i).writeToFile( OutputFileName, DirName );
117 for(
unsigned int i = 0; i < GetShapeSysList().size(); ++i ) {
118 GetShapeSysList().at(i).writeToFile( OutputFileName, DirName );
120 for(
unsigned int i = 0; i < GetShapeFactorList().size(); ++i ) {
121 GetShapeFactorList().at(i).writeToFile( OutputFileName, DirName );
136 std::string SampleHistName = fName +
"_hist";
139 fhCountingHist.reset();
141 fhCountingHist = std::make_unique<TH1F>( SampleHistName.c_str(), SampleHistName.c_str(), 1, 0, 1 );
142 fhCountingHist->SetBinContent( 1, val );
146 SetHisto( fhCountingHist.get() );
155 stream <<
"\t \t Name: " << fName
156 <<
"\t \t Channel: " << fChannelName
157 <<
"\t NormalizeByTheory: " << (fNormalizeByTheory ?
"True" :
"False")
158 <<
"\t StatErrorActivate: " << (fStatErrorActivate ?
"True" :
"False")
161 stream <<
"\t \t \t \t "
162 <<
"\t InputFile: " << fInputFile
163 <<
"\t HistName: " << fHistoName
164 <<
"\t HistoPath: " << fHistoPath
165 <<
"\t HistoAddress: " << GetHisto()
169 if( fStatError.GetActivate() ) {
170 stream <<
"\t \t \t StatError Activate: " << fStatError.GetActivate()
171 <<
"\t InputFile: " << fInputFile
172 <<
"\t HistName: " << fStatError.GetHistoName()
173 <<
"\t HistoPath: " << fStatError.GetHistoPath()
174 <<
"\t HistoAddress: " << fStatError.GetErrorHist()
196 xml <<
" <Sample Name=\"" << fName <<
"\" "
197 <<
" HistoPath=\"" << fHistoPath <<
"\" "
198 <<
" HistoName=\"" << fHistoName <<
"\" "
199 <<
" InputFile=\"" << fInputFile <<
"\" "
200 <<
" NormalizeByTheory=\"" << (fNormalizeByTheory ? std::string(
"True") : std::string(
"False")) <<
"\" "
205 fStatError.PrintXML( xml );
218 for(
unsigned int i = 0; i < fOverallSysList.size(); ++i ) {
228 for(
unsigned int i = 0; i < fNormFactorList.size(); ++i ) {
239 for(
unsigned int i = 0; i < fHistoSysList.size(); ++i ) {
255 for(
unsigned int i = 0; i < fHistoFactorList.size(); ++i ) {
271 for(
unsigned int i = 0; i < fShapeSysList.size(); ++i ) {
284 for(
unsigned int i = 0; i < fShapeFactorList.size(); ++i ) {
294 xml <<
" </Sample>" << std::endl;
306 fStatError.Activate(
true );
307 fStatError.SetUseHisto(
false );
315 fStatError.Activate(
true );
316 fStatError.SetUseHisto(
true );
318 fStatError.SetInputFile( StatInputFile );
319 fStatError.SetHistoName( StatHistoName );
320 fStatError.SetHistoPath( StatHistoPath );
332 fOverallSysList.push_back( sys );
337 fOverallSysList.push_back(Sys);
349 fNormFactorList.push_back( norm );
354 fNormFactorList.push_back( Factor );
359std::string SysHistoNameLow, std::string SysHistoFileLow, std::string SysHistoPathLow,
360 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
373 fHistoSysList.push_back( sys );
378 fHistoSysList.push_back( Sys );
383 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
396 fHistoFactorList.push_back( factor );
401 fHistoFactorList.push_back(Factor);
409 fShapeFactorList.push_back( factor );
415 fShapeFactorList.push_back(Factor);
429 fShapeSysList.push_back( sys );
434 fShapeSysList.push_back(Sys);
Configuration for an *un*constrained, coherent shape variation of affected samples.
void PrintXML(std::ostream &) const override
Configuration for a constrained, coherent shape variation of affected samples.
void PrintXML(std::ostream &) const override
void SetInputFileHigh(const std::string &InputFileHigh)
void SetName(const std::string &Name)
void SetHistoPathHigh(const std::string &HistoPathHigh)
void SetInputFileLow(const std::string &InputFileLow)
void SetHistoNameHigh(const std::string &HistoNameHigh)
void SetHistoNameLow(const std::string &HistoNameLow)
void SetHistoPathLow(const std::string &HistoPathLow)
Configuration for an un- constrained overall systematic to scale sample normalisations.
void PrintXML(std::ostream &) const
void SetHigh(double High)
void SetName(const std::string &Name)
Configuration for a constrained overall systematic to scale sample normalisations.
void SetName(const std::string &Name)
void PrintXML(std::ostream &) const
void SetHigh(double High)
std::unique_ptr< TH1 > fhCountingHist
std::vector< RooStats::HistFactory::OverallSys > fOverallSysList
void AddShapeSys(std::string Name, Constraint::Type ConstraintType, std::string HistoName, std::string HistoFile, std::string HistoPath="")
void AddOverallSys(std::string Name, double Low, double High)
void writeToFile(std::string FileName, std::string DirName)
const TH1 * GetHisto() const
std::vector< RooStats::HistFactory::HistoFactor > fHistoFactorList
void SetValue(double Val)
RooStats::HistFactory::StatError fStatError
Properties.
void AddNormFactor(std::string const &Name, double Val, double Low, double High)
std::vector< RooStats::HistFactory::NormFactor > fNormFactorList
std::vector< RooStats::HistFactory::HistoSys > fHistoSysList
std::string fChannelName
The Name of the parent channel.
void Print(std::ostream &=std::cout) const
Sample & operator=(const Sample &other)
std::vector< RooStats::HistFactory::ShapeSys > fShapeSysList
void AddHistoFactor(std::string Name, std::string HistoNameLow, std::string HistoFileLow, std::string HistoPathLow, std::string HistoNameHigh, std::string HistoFileHigh, std::string HistoPathHigh)
HistRef fhNominal
The Nominal Shape.
void AddShapeFactor(std::string Name)
std::vector< RooStats::HistFactory::ShapeFactor > fShapeFactorList
void AddHistoSys(std::string Name, std::string HistoNameLow, std::string HistoFileLow, std::string HistoPathLow, std::string HistoNameHigh, std::string HistoFileHigh, std::string HistoPathHigh)
void PrintXML(std::ofstream &xml) const
*Un*constrained bin-by-bin variation of affected histogram.
void PrintXML(std::ostream &) const override
Constrained bin-by-bin variation of affected histogram.
void PrintXML(std::ostream &) const override
void SetInputFile(const std::string &InputFile)
void SetHistoName(const std::string &HistoName)
void SetConstraintType(Constraint::Type ConstrType)
void SetHistoPath(const std::string &HistoPath)
TH1 is the base class of all histogram classes in ROOT.
const char * GetName() const override
Returns name of object.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.