28 fNormalizeByTheory(
false), fStatErrorActivate(
false), fhNominal(), fhCountingHist(0) { ; }
32 fName(other.fName), fInputFile(other.fInputFile),
33 fHistoName(other.fHistoName), fHistoPath(other.fHistoPath),
34 fChannelName(other.fChannelName),
36 fOverallSysList(other.fOverallSysList),
37 fNormFactorList(other.fNormFactorList),
38 fHistoSysList(other.fHistoSysList),
39 fHistoFactorList(other.fHistoFactorList),
40 fShapeSysList(other.fShapeSysList),
41 fShapeFactorList(other.fShapeFactorList),
43 fStatError(other.fStatError),
44 fNormalizeByTheory(other.fNormalizeByTheory),
45 fStatErrorActivate(other.fStatErrorActivate),
46 fhNominal(other.fhNominal),
58 fName( SampName ), fInputFile( SampInputFile),
59 fHistoName( SampHistoName ), fHistoPath( SampHistoPath ),
60 fNormalizeByTheory(true), fStatErrorActivate(
false), fhNominal(),
61 fhCountingHist(0) { ; }
64 fName( SampName ), fInputFile(
"" ),
65 fHistoName(
"" ), fHistoPath(
"" ),
66 fNormalizeByTheory(true), fStatErrorActivate(
false),fhNominal(),
67 fhCountingHist(0) { ; }
71 delete fhCountingHist;
75 TH1* histo = (
TH1*) fhNominal.GetObject();
88 fInputFile = OutputFileName;
89 fHistoName = histNominal->
GetName();
93 GetStatError().writeToFile( OutputFileName, DirName );
97 for(
unsigned int i = 0; i < GetHistoSysList().size(); ++i ) {
98 GetHistoSysList().at(i).writeToFile( OutputFileName, DirName );
100 for(
unsigned int i = 0; i < GetHistoFactorList().size(); ++i ) {
101 GetHistoFactorList().at(i).writeToFile( OutputFileName, DirName );
103 for(
unsigned int i = 0; i < GetShapeSysList().size(); ++i ) {
104 GetShapeSysList().at(i).writeToFile( OutputFileName, DirName );
106 for(
unsigned int i = 0; i < GetShapeFactorList().size(); ++i ) {
107 GetShapeFactorList().at(i).writeToFile( OutputFileName, DirName );
122 std::string SampleHistName = fName +
"_hist";
126 delete fhCountingHist;
128 fhCountingHist =
new TH1F( SampleHistName.c_str(), SampleHistName.c_str(), 1, 0, 1 );
129 fhCountingHist->SetBinContent( 1, val );
133 SetHisto( fhCountingHist );
142 stream <<
"\t \t Name: " << fName
143 <<
"\t \t Channel: " << fChannelName
144 <<
"\t NormalizeByTheory: " << (fNormalizeByTheory ?
"True" :
"False")
145 <<
"\t StatErrorActivate: " << (fStatErrorActivate ?
"True" :
"False")
148 stream <<
"\t \t \t \t "
149 <<
"\t InputFile: " << fInputFile
150 <<
"\t HistName: " << fHistoName
151 <<
"\t HistoPath: " << fHistoPath
152 <<
"\t HistoAddress: " <<
GetHisto()
156 if( fStatError.GetActivate() ) {
157 stream <<
"\t \t \t StatError Activate: " << fStatError.GetActivate()
158 <<
"\t InputFile: " << fInputFile
159 <<
"\t HistName: " << fStatError.GetHistoName()
160 <<
"\t HistoPath: " << fStatError.GetHistoPath()
161 <<
"\t HistoAddress: " << fStatError.GetErrorHist()
183 xml <<
" <Sample Name=\"" << fName <<
"\" "
184 <<
" HistoPath=\"" << fHistoPath <<
"\" "
185 <<
" HistoName=\"" << fHistoName <<
"\" "
186 <<
" InputFile=\"" << fInputFile <<
"\" "
187 <<
" NormalizeByTheory=\"" << (fNormalizeByTheory ? std::string(
"True") : std::string(
"False")) <<
"\" "
192 fStatError.PrintXML( xml );
205 for(
unsigned int i = 0; i < fOverallSysList.size(); ++i ) {
215 for(
unsigned int i = 0; i < fNormFactorList.size(); ++i ) {
227 for(
unsigned int i = 0; i < fHistoSysList.size(); ++i ) {
243 for(
unsigned int i = 0; i < fHistoFactorList.size(); ++i ) {
259 for(
unsigned int i = 0; i < fShapeSysList.size(); ++i ) {
272 for(
unsigned int i = 0; i < fShapeFactorList.size(); ++i ) {
282 xml <<
" </Sample>" << std::endl;
295 fStatError.Activate(
true );
296 fStatError.SetUseHisto(
false );
304 fStatError.Activate(
true );
305 fStatError.SetUseHisto(
true );
307 fStatError.SetInputFile( StatInputFile );
308 fStatError.SetHistoName( StatHistoName );
309 fStatError.SetHistoPath( StatHistoPath );
321 fOverallSysList.push_back( sys );
326 fOverallSysList.push_back(Sys);
339 fNormFactorList.push_back( norm );
344 fNormFactorList.push_back( Factor );
349 std::string SysHistoNameLow, std::string SysHistoFileLow, std::string SysHistoPathLow,
350 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
363 fHistoSysList.push_back( sys );
368 fHistoSysList.push_back( Sys );
373 std::string SysHistoNameHigh, std::string SysHistoFileHigh, std::string SysHistoPathHigh ) {
386 fHistoFactorList.push_back( factor );
391 fHistoFactorList.push_back(Factor);
399 fShapeFactorList.push_back( factor );
405 fShapeFactorList.push_back(Factor);
419 fShapeSysList.push_back( sys );
424 fShapeSysList.push_back(Sys);
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
void SetName(const std::string &Name)
void ActivateStatError()
Note that histogram name should not include the path of the histogram in the file.
void SetConstraintType(Constraint::Type ConstrType)
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
void SetHistoNameHigh(const std::string &HistoNameHigh)
void SetHistoPathLow(const std::string &HistoPathLow)
TH1 * GetHisto(TFile *inFile, const std::string name)
void PrintXML(std::ostream &)
void SetHistoPathHigh(const std::string &HistoPathHigh)
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
void AddShapeFactor(std::string Name)
void AddHistoFactor(std::string Name, std::string HistoNameLow, std::string HistoFileLow, std::string HistoPathLow, std::string HistoNameHigh, std::string HistoFileHigh, std::string HistoPathHigh)
void AddShapeSys(std::string Name, Constraint::Type ConstraintType, std::string HistoName, std::string HistoFile, std::string HistoPath="")
void Print(std::ostream &=std::cout)
void SetInputFileLow(const std::string &InputFileLow)
void PrintXML(std::ostream &)
void SetHistoNameLow(const std::string &HistoNameLow)
void SetHistoPathLow(const std::string &HistoPathLow)
void writeToFile(std::string FileName, std::string DirName)
void SetValue(Double_t Val)
void SetName(const std::string &Name)
void SetHistoName(const std::string &HistoName)
void SetName(const std::string &Name)
void SetName(const std::string &Name)
void AddHistoSys(std::string Name, std::string HistoNameLow, std::string HistoFileLow, std::string HistoPathLow, std::string HistoNameHigh, std::string HistoFileHigh, std::string HistoPathHigh)
void SetConst(bool Const=true)
void SetHigh(double High)
void SetInputFileLow(const std::string &InputFileLow)
void SetHistoNameLow(const std::string &HistoNameLow)
virtual const char * GetName() const
Returns name of object.
void SetHistoPathHigh(const std::string &HistoPathHigh)
void PrintXML(std::ostream &)
void AddOverallSys(std::string Name, Double_t Low, Double_t High)
void SetHigh(double High)
void AddNormFactor(std::string Name, Double_t Val, Double_t Low, Double_t High, bool Const=false)
void SetHistoNameHigh(const std::string &HistoNameHigh)
void PrintXML(std::ostream &)
void PrintXML(std::ostream &)
void SetName(const std::string &Name)
void SetHistoPath(const std::string &HistoPath)
void SetName(const std::string &Name)
void PrintXML(std::ostream &)
double norm(double *x, double *p)
void PrintXML(std::ofstream &xml)
void SetInputFile(const std::string &InputFile)
void SetInputFileHigh(const std::string &InputFileHigh)
void SetInputFileHigh(const std::string &InputFileHigh)