24 fName(other.fName), fInputFile(other.fInputFile),
25 fHistoName(other.fHistoName), fHistoPath(other.fHistoPath),
26 fChannelName(other.fChannelName),
28 fOverallSysList(other.fOverallSysList),
29 fNormFactorList(other.fNormFactorList),
30 fHistoSysList(other.fHistoSysList),
31 fHistoFactorList(other.fHistoFactorList),
32 fShapeSysList(other.fShapeSysList),
33 fShapeFactorList(other.fShapeFactorList),
35 fStatError(other.fStatError),
36 fNormalizeByTheory(other.fNormalizeByTheory),
37 fStatErrorActivate(other.fStatErrorActivate),
38 fhNominal(other.fhNominal)
65 fhCountingHist.reset();
70 fhCountingHist.reset();
78 fName( SampName ), fInputFile( SampInputFile),
79 fHistoName( SampHistoName ), fHistoPath( SampHistoPath ),
80 fNormalizeByTheory(true), fStatErrorActivate(false)
85 : fName(SampName), fNormalizeByTheory(true), fStatErrorActivate(false)
90 TH1* histo = (
TH1*) fhNominal.GetObject();
97 const TH1* histNominal = GetHisto();
103 fInputFile = OutputFileName;
104 fHistoName = histNominal->
GetName();
105 fHistoPath = DirName;
108 GetStatError().writeToFile( OutputFileName, DirName );
112 for(
unsigned int i = 0; i < GetHistoSysList().size(); ++i ) {
113 GetHistoSysList().at(i).writeToFile( OutputFileName, DirName );
115 for(
unsigned int i = 0; i < GetHistoFactorList().size(); ++i ) {
116 GetHistoFactorList().at(i).writeToFile( OutputFileName, DirName );
118 for(
unsigned int i = 0; i < GetShapeSysList().size(); ++i ) {
119 GetShapeSysList().at(i).writeToFile( OutputFileName, DirName );
121 for(
unsigned int i = 0; i < GetShapeFactorList().size(); ++i ) {
122 GetShapeFactorList().at(i).writeToFile( OutputFileName, DirName );
137 std::string SampleHistName = fName +
"_hist";
140 fhCountingHist.reset();
142 fhCountingHist = std::make_unique<TH1F>( SampleHistName.c_str(), SampleHistName.c_str(), 1, 0, 1 );
143 fhCountingHist->SetBinContent( 1, val );
147 SetHisto( fhCountingHist.get() );
156 stream <<
"\t \t Name: " << fName
157 <<
"\t \t Channel: " << fChannelName
158 <<
"\t NormalizeByTheory: " << (fNormalizeByTheory ?
"True" :
"False")
159 <<
"\t StatErrorActivate: " << (fStatErrorActivate ?
"True" :
"False")
162 stream <<
"\t \t \t \t "
163 <<
"\t InputFile: " << fInputFile
164 <<
"\t HistName: " << fHistoName
165 <<
"\t HistoPath: " << fHistoPath
166 <<
"\t HistoAddress: " << GetHisto()
170 if( fStatError.GetActivate() ) {
171 stream <<
"\t \t \t StatError Activate: " << fStatError.GetActivate()
172 <<
"\t InputFile: " << fInputFile
173 <<
"\t HistName: " << fStatError.GetHistoName()
174 <<
"\t HistoPath: " << fStatError.GetHistoPath()
175 <<
"\t HistoAddress: " << fStatError.GetErrorHist()
197 xml <<
" <Sample Name=\"" << fName <<
"\" "
198 <<
" HistoPath=\"" << fHistoPath <<
"\" "
199 <<
" HistoName=\"" << fHistoName <<
"\" "
200 <<
" InputFile=\"" << fInputFile <<
"\" "
201 <<
" NormalizeByTheory=\"" << (fNormalizeByTheory ? std::string(
"True") : std::string(
"False")) <<
"\" "
206 fStatError.PrintXML( xml );
219 for(
unsigned int i = 0; i < fOverallSysList.size(); ++i ) {
229 for(
unsigned int i = 0; i < fNormFactorList.size(); ++i ) {
240 for(
unsigned int i = 0; i < fHistoSysList.size(); ++i ) {
256 for(
unsigned int i = 0; i < fHistoFactorList.size(); ++i ) {
272 for(
unsigned int i = 0; i < fShapeSysList.size(); ++i ) {
285 for(
unsigned int i = 0; i < fShapeFactorList.size(); ++i ) {
295 xml <<
" </Sample>" << std::endl;
307 fStatError.Activate(
true );
308 fStatError.SetUseHisto(
false );
316 fStatError.Activate(
true );
317 fStatError.SetUseHisto(
true );
319 fStatError.SetInputFile( StatInputFile );
320 fStatError.SetHistoName( StatHistoName );
321 fStatError.SetHistoPath( StatHistoPath );
333 fOverallSysList.push_back( sys );
338 fOverallSysList.push_back(Sys);
350 fNormFactorList.push_back( norm );
355 fNormFactorList.push_back( Factor );
360std::string SysHistoNameLow, std::string SysHistoFileLow, std::string SysHistoPathLow,
361 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
374 fHistoSysList.push_back( sys );
379 fHistoSysList.push_back( Sys );
384 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
397 fHistoFactorList.push_back( factor );
402 fHistoFactorList.push_back(Factor);
410 fShapeFactorList.push_back( factor );
416 fShapeFactorList.push_back(Factor);
430 fShapeSysList.push_back( sys );
435 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.