29 if(
type == Constraint::Gaussian )
return "Gaussian";
30 if(
type == Constraint::Poisson )
return "Poisson";
37 std::cout <<
"Error: Given empty name for ConstraintType" << std::endl;
41 else if ( Name ==
"Gaussian" || Name ==
"Gauss" ) {
42 return Constraint::Gaussian;
45 else if ( Name ==
"Poisson" || Name ==
"Pois" ) {
46 return Constraint::Poisson;
50 std::cout <<
"Error: Unknown name given for Constraint Type: " << Name << std::endl;
58 fLow(1.0), fHigh(1.0),
62 stream <<
"\t \t Name: " << fName
65 <<
"\t High: " << fHigh
66 <<
"\t Const: " << fConst
71 xml <<
" <NormFactor Name=\"" << GetName() <<
"\" "
72 <<
" Val=\"" << GetVal() <<
"\" "
73 <<
" High=\"" << GetHigh() <<
"\" "
74 <<
" Low=\"" << GetLow() <<
"\" "
75 <<
" Const=\"" << (GetConst() ? std::string(
"True") : std::string(
"False")) <<
"\" "
76 <<
" /> " << std::endl;
81 stream <<
"\t \t Name: " << fName
83 <<
"\t High: " << fHigh
88 xml <<
" <OverallSys Name=\"" << GetName() <<
"\" "
89 <<
" High=\"" << GetHigh() <<
"\" "
90 <<
" Low=\"" << GetLow() <<
"\" "
91 <<
" /> " << std::endl;
96 stream <<
"\t \t Name: " << fName
97 <<
"\t HistoFileLow: " << fInputFileLow
98 <<
"\t HistoNameLow: " << fHistoNameLow
99 <<
"\t HistoPathLow: " << fHistoPathLow
100 <<
"\t HistoFileHigh: " << fInputFileHigh
101 <<
"\t HistoNameHigh: " << fHistoNameHigh
102 <<
"\t HistoPathHigh: " << fHistoPathHigh
107 const std::string& DirName ) {
112 auto histLow = GetHistoLow();
113 if( histLow==NULL ) {
114 std::cout <<
"Error: Cannot write " << GetName()
115 <<
" to file: " << FileName
116 <<
" HistoLow is NULL"
121 fInputFileLow = FileName;
122 fHistoPathLow = DirName;
123 fHistoNameLow = histLow->GetName();
125 auto histHigh = GetHistoHigh();
126 if( histHigh==NULL ) {
127 std::cout <<
"Error: Cannot write " << GetName()
128 <<
" to file: " << FileName
129 <<
" HistoHigh is NULL"
134 fInputFileHigh = FileName;
135 fHistoPathHigh = DirName;
136 fHistoNameHigh = histHigh->GetName();
144 xml <<
" <HistoSys Name=\"" << GetName() <<
"\" "
145 <<
" HistoFileLow=\"" << GetInputFileLow() <<
"\" "
146 <<
" HistoNameLow=\"" << GetHistoNameLow() <<
"\" "
147 <<
" HistoPathLow=\"" << GetHistoPathLow() <<
"\" "
149 <<
" HistoFileHigh=\"" << GetInputFileHigh() <<
"\" "
150 <<
" HistoNameHigh=\"" << GetHistoNameHigh() <<
"\" "
151 <<
" HistoPathHigh=\"" << GetHistoPathHigh() <<
"\" "
152 <<
" /> " << std::endl;
158 stream <<
"\t \t Name: " << fName
159 <<
"\t InputFile: " << fInputFileHigh
160 <<
"\t HistoName: " << fHistoNameHigh
161 <<
"\t HistoPath: " << fHistoPathHigh
167 xml <<
" <ShapeSys Name=\"" << GetName() <<
"\" "
168 <<
" InputFile=\"" << GetInputFile() <<
"\" "
169 <<
" HistoName=\"" << GetHistoName() <<
"\" "
170 <<
" HistoPath=\"" << GetHistoPath() <<
"\" "
171 <<
" ConstraintType=\"" << std::string(
Constraint::Name(GetConstraintType())) <<
"\" "
172 <<
" /> " << std::endl;
177 const std::string& DirName ) {
179 auto histError = GetErrorHist();
180 if( histError==NULL ) {
181 std::cout <<
"Error: Cannot write " << GetName()
182 <<
" to file: " << FileName
183 <<
" ErrorHist is NULL"
188 fInputFileHigh = FileName;
189 fHistoPathHigh = DirName;
190 fHistoNameHigh = histError->GetName();
202 xml <<
" <HistoFactor Name=\"" << GetName() <<
"\" "
204 <<
" InputFileLow=\"" << GetInputFileLow() <<
"\" "
205 <<
" HistoNameLow=\"" << GetHistoNameLow() <<
"\" "
206 <<
" HistoPathLow=\"" << GetHistoPathLow() <<
"\" "
208 <<
" InputFileHigh=\"" << GetInputFileHigh() <<
"\" "
209 <<
" HistoNameHigh=\"" << GetHistoNameHigh() <<
"\" "
210 <<
" HistoPathHigh=\"" << GetHistoPathHigh() <<
"\" "
211 <<
" /> " << std::endl;
218 stream <<
"\t \t Name: " << fName << std::endl;
220 if( fHistoNameHigh !=
"" ) {
222 <<
" Shape Hist Name: " << fHistoNameHigh
223 <<
" Shape Hist Path Name: " << fHistoPathHigh
224 <<
" Shape Hist FileName: " << fInputFileHigh
228 if( fConstant ) { stream <<
"\t \t ( Constant ): " << std::endl; }
234 const std::string& DirName ) {
236 if( HasInitialShape() ) {
237 auto histInitialShape = GetInitialShape();
238 if( histInitialShape==NULL ) {
239 std::cout <<
"Error: Cannot write " << GetName()
240 <<
" to file: " << FileName
241 <<
" InitialShape is NULL"
245 histInitialShape->Write();
246 fInputFileHigh = FileName;
247 fHistoPathHigh = DirName;
248 fHistoNameHigh = histInitialShape->GetName();
257 xml <<
" <ShapeFactor Name=\"" << GetName() <<
"\" ";
258 if( fHasInitialShape ) {
259 xml <<
" InputFile=\"" << GetInputFile() <<
"\" "
260 <<
" HistoName=\"" << GetHistoName() <<
"\" "
261 <<
" HistoPath=\"" << GetHistoPath() <<
"\" ";
263 xml <<
" /> " << std::endl;
269 stream <<
"\t \t RelErrorThreshold: " << fRelErrorThreshold
275 xml <<
" <StatErrorConfig RelErrorThreshold=\"" << GetRelErrorThreshold()
279 <<
"/> " << std::endl << std::endl;
286 stream <<
"\t \t Activate: " << fActivate
287 <<
"\t InputFile: " << fInputFileHigh
288 <<
"\t HistoName: " << fHistoNameHigh
289 <<
"\t histoPath: " << fHistoPathHigh
295 if( GetActivate() ) {
296 xml <<
" <StatError Activate=\""
297 << (GetActivate() ? std::string(
"True") : std::string(
"False"))
299 <<
" InputFile=\"" << GetInputFile() <<
"\" "
300 <<
" HistoName=\"" << GetHistoName() <<
"\" "
301 <<
" HistoPath=\"" << GetHistoPath() <<
"\" "
302 <<
" /> " << std::endl;
309 const std::string& DirName ) {
313 std::string statErrorHistName =
"statisticalErrors";
315 auto hStatError = GetErrorHist();
316 if( hStatError == NULL ) {
317 std::cout <<
"Error: Stat Error error hist is NULL" << std::endl;
320 hStatError->Write(statErrorHistName.c_str());
322 fInputFileHigh = OutputFileName;
323 fHistoNameHigh = statErrorHistName;
324 fHistoPathHigh = DirName;
void PrintXML(std::ostream &) const override
virtual void PrintXML(std::ostream &) const override
virtual void writeToFile(const std::string &FileName, const std::string &DirName)
virtual void Print(std::ostream &=std::cout) const
void Print(std::ostream &=std::cout) const
void PrintXML(std::ostream &) const
void PrintXML(std::ostream &) const
void Print(std::ostream &=std::cout) const
void PrintXML(std::ostream &) const override
void writeToFile(const std::string &FileName, const std::string &DirName) override
void Print(std::ostream &=std::cout) const override
void PrintXML(std::ostream &) const override
void writeToFile(const std::string &FileName, const std::string &DirName) override
void Print(std::ostream &=std::cout) const override
void PrintXML(std::ostream &) const
void Print(std::ostream &=std::cout) const
void Print(std::ostream &=std::cout) const override
void PrintXML(std::ostream &) const override
void writeToFile(const std::string &FileName, const std::string &DirName) override
Type GetType(const std::string &Name)
std::string Name(Type type)