23 fNormalizeByTheory(false), fStatErrorActivate(false), fhNominal(), fhCountingHist(0) { ; }
27 fName(other.fName), fInputFile(other.fInputFile),
28 fHistoName(other.fHistoName), fHistoPath(other.fHistoPath),
29 fChannelName(other.fChannelName),
31 fOverallSysList(other.fOverallSysList),
32 fNormFactorList(other.fNormFactorList),
33 fHistoSysList(other.fHistoSysList),
34 fHistoFactorList(other.fHistoFactorList),
35 fShapeSysList(other.fShapeSysList),
36 fShapeFactorList(other.fShapeFactorList),
38 fStatError(other.fStatError),
39 fNormalizeByTheory(other.fNormalizeByTheory),
40 fStatErrorActivate(other.fStatErrorActivate),
41 fhNominal(other.fhNominal),
70 delete fhCountingHist;
75 fhCountingHist = NULL;
83 fName( SampName ), fInputFile( SampInputFile),
84 fHistoName( SampHistoName ), fHistoPath( SampHistoPath ),
85 fNormalizeByTheory(true), fStatErrorActivate(false), fhNominal(),
86 fhCountingHist(0) { ; }
89 fName( SampName ), fInputFile(
"" ),
90 fHistoName(
"" ), fHistoPath(
"" ),
91 fNormalizeByTheory(true), fStatErrorActivate(false),fhNominal(),
92 fhCountingHist(0) { ; }
96 delete fhCountingHist;
100 TH1* histo = (
TH1*) fhNominal.GetObject();
108 histNominal->
Write();
113 fInputFile = OutputFileName;
114 fHistoName = histNominal->
GetName();
115 fHistoPath = DirName;
118 GetStatError().writeToFile( OutputFileName, DirName );
122 for(
unsigned int i = 0; i < GetHistoSysList().size(); ++i ) {
123 GetHistoSysList().at(i).writeToFile( OutputFileName, DirName );
125 for(
unsigned int i = 0; i < GetHistoFactorList().size(); ++i ) {
126 GetHistoFactorList().at(i).writeToFile( OutputFileName, DirName );
128 for(
unsigned int i = 0; i < GetShapeSysList().size(); ++i ) {
129 GetShapeSysList().at(i).writeToFile( OutputFileName, DirName );
131 for(
unsigned int i = 0; i < GetShapeFactorList().size(); ++i ) {
132 GetShapeFactorList().at(i).writeToFile( OutputFileName, DirName );
147 std::string SampleHistName = fName +
"_hist";
151 delete fhCountingHist;
153 fhCountingHist =
new TH1F( SampleHistName.c_str(), SampleHistName.c_str(), 1, 0, 1 );
154 fhCountingHist->SetBinContent( 1, val );
158 SetHisto( fhCountingHist );
167 stream <<
"\t \t Name: " << fName
168 <<
"\t \t Channel: " << fChannelName
169 <<
"\t NormalizeByTheory: " << (fNormalizeByTheory ?
"True" :
"False")
170 <<
"\t StatErrorActivate: " << (fStatErrorActivate ?
"True" :
"False")
173 stream <<
"\t \t \t \t "
174 <<
"\t InputFile: " << fInputFile
175 <<
"\t HistName: " << fHistoName
176 <<
"\t HistoPath: " << fHistoPath
177 <<
"\t HistoAddress: " <<
GetHisto()
181 if( fStatError.GetActivate() ) {
182 stream <<
"\t \t \t StatError Activate: " << fStatError.GetActivate()
183 <<
"\t InputFile: " << fInputFile
184 <<
"\t HistName: " << fStatError.GetHistoName()
185 <<
"\t HistoPath: " << fStatError.GetHistoPath()
186 <<
"\t HistoAddress: " << fStatError.GetErrorHist()
208 xml <<
" <Sample Name=\"" << fName <<
"\" "
209 <<
" HistoPath=\"" << fHistoPath <<
"\" "
210 <<
" HistoName=\"" << fHistoName <<
"\" "
211 <<
" InputFile=\"" << fInputFile <<
"\" "
212 <<
" NormalizeByTheory=\"" << (fNormalizeByTheory ? std::string(
"True") : std::string(
"False")) <<
"\" "
217 fStatError.PrintXML( xml );
230 for(
unsigned int i = 0; i < fOverallSysList.size(); ++i ) {
240 for(
unsigned int i = 0; i < fNormFactorList.size(); ++i ) {
252 for(
unsigned int i = 0; i < fHistoSysList.size(); ++i ) {
268 for(
unsigned int i = 0; i < fHistoFactorList.size(); ++i ) {
284 for(
unsigned int i = 0; i < fShapeSysList.size(); ++i ) {
297 for(
unsigned int i = 0; i < fShapeFactorList.size(); ++i ) {
307 xml <<
" </Sample>" << std::endl;
319 fStatError.Activate(
true );
320 fStatError.SetUseHisto(
false );
328 fStatError.Activate(
true );
329 fStatError.SetUseHisto(
true );
331 fStatError.SetInputFile( StatInputFile );
332 fStatError.SetHistoName( StatHistoName );
333 fStatError.SetHistoPath( StatHistoPath );
345 fOverallSysList.push_back( sys );
350 fOverallSysList.push_back(Sys);
363 fNormFactorList.push_back( norm );
368 fNormFactorList.push_back( Factor );
373std::string SysHistoNameLow, std::string SysHistoFileLow, std::string SysHistoPathLow,
374 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
387 fHistoSysList.push_back( sys );
392 fHistoSysList.push_back( Sys );
397 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
410 fHistoFactorList.push_back( factor );
415 fHistoFactorList.push_back(Factor);
423 fShapeFactorList.push_back( factor );
429 fShapeFactorList.push_back(Factor);
443 fShapeSysList.push_back( sys );
448 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.
virtual 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 SetConst(bool Const=true)
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::vector< RooStats::HistFactory::OverallSys > fOverallSysList
void AddShapeSys(std::string Name, Constraint::Type ConstraintType, std::string HistoName, std::string HistoFile, std::string HistoPath="")
void writeToFile(std::string FileName, std::string DirName)
const TH1 * GetHisto() const
std::vector< RooStats::HistFactory::HistoFactor > fHistoFactorList
RooStats::HistFactory::StatError fStatError
Properties.
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
void AddNormFactor(std::string Name, Double_t Val, Double_t Low, Double_t High, bool Const=false)
Sample & operator=(const Sample &other)
std::vector< RooStats::HistFactory::ShapeSys > fShapeSysList
void SetValue(Double_t Val)
void AddOverallSys(std::string Name, Double_t Low, Double_t High)
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)
1-D histogram with a float per channel (see TH1 documentation)}
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
TH1 * GetHisto(TFile *inFile, const std::string name)