// @(#)root/roostats:$Id$
// Author: Kyle Cranmer, George Lewis 
/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//_________________________________________________
/*
BEGIN_HTML
<p>
</p>
END_HTML
*/
//


#include "RooStats/HistFactory/Systematics.h"
#include "RooStats/HistFactory/HistFactoryException.h"


// Constraints
std::string RooStats::HistFactory::Constraint::Name( Constraint::Type type ) {

  if( type == Constraint::Gaussian ) return "Gaussian";
  if( type == Constraint::Poisson )  return "Poisson";
  return "";
}

RooStats::HistFactory::Constraint::Type RooStats::HistFactory::Constraint::GetType( const std::string& Name ) {

  if( Name == "" ) {
    std::cout << "Error: Given empty name for ConstraintType" << std::endl;
    throw hf_exc();
  }
  
  else if ( Name == "Gaussian" || Name == "Gauss" ) {
    return Constraint::Gaussian;
  }

  else if ( Name == "Poisson" || Name == "Pois" ) {
    return Constraint::Poisson;
  }

  else {
    std::cout << "Error: Unknown name given for Constraint Type: " << Name << std::endl;
    throw hf_exc();
  }

}

// Norm Factor
RooStats::HistFactory::NormFactor::NormFactor() : fName(""), fVal(1.0), 
						  fLow(1.0), fHigh(1.0), 
						  fConst(true) {;}

void RooStats::HistFactory::NormFactor::Print( std::ostream& stream ) {
  stream << "\t \t Name: " << fName
	 << "\t Val: " << fVal
	 << "\t Low: " << fLow
	 << "\t High: " << fHigh
	 << "\t Const: " << fConst
	 << std::endl;
}

void RooStats::HistFactory::NormFactor::PrintXML( std::ostream& xml ) {
  xml << "      <NormFactor Name=\"" << GetName() << "\" "
      << " Val=\""   << GetVal()   << "\" "
      << " High=\""  << GetHigh()  << "\" "
      << " Low=\""   << GetLow()   << "\" "
      << " Const=\"" << (GetConst() ? std::string("True") : std::string("False")) << "\" "
      << "  /> " << std::endl;
}

// Overall Sys
void RooStats::HistFactory::OverallSys::Print( std::ostream& stream ) {
  stream << "\t \t Name: " << fName
	 << "\t Low: " << fLow
	 << "\t High: " << fHigh
	 << std::endl;
}

void RooStats::HistFactory::OverallSys::PrintXML( std::ostream& xml ) {
  xml << "      <OverallSys Name=\"" << GetName() << "\" "
      << " High=\"" << GetHigh() << "\" "
      << " Low=\""  << GetLow()  << "\" "
      << "  /> " << std::endl;
}

// HistoSys
TH1* RooStats::HistFactory::HistoSys::GetHistoLow() {
  TH1* histo_low = (TH1*) fhLow.GetObject();
  return histo_low;
}

TH1* RooStats::HistFactory::HistoSys::GetHistoHigh() {
  TH1* histo_high = (TH1*) fhHigh.GetObject();
  return histo_high;
}

void RooStats::HistFactory::HistoSys::Print( std::ostream& stream ) {
  stream << "\t \t Name: " << fName
	 << "\t HistoFileLow: " << fInputFileLow
	 << "\t HistoNameLow: " << fHistoNameLow
	 << "\t HistoPathLow: " << fHistoPathLow
	 << "\t HistoFileHigh: " << fInputFileHigh
	 << "\t HistoNameHigh: " << fHistoNameHigh
	 << "\t HistoPathHigh: " << fHistoPathHigh
	 << std::endl;
}

void RooStats::HistFactory::HistoSys::PrintXML( std::ostream& xml ) {
  xml << "      <HistoSys Name=\"" << GetName() << "\" "
      << " HistoFileLow=\""  << GetInputFileLow()  << "\" "
      << " HistoNameLow=\""  << GetHistoNameLow()  << "\" "
      << " HistoPathLow=\""  << GetHistoPathLow()  << "\" "

      << " HistoFileHigh=\""  << GetInputFileHigh()  << "\" "
      << " HistoNameHigh=\""  << GetHistoNameHigh()  << "\" "
      << " HistoPathHigh=\""  << GetHistoPathHigh()  << "\" "
      << "  /> " << std::endl;
}

void RooStats::HistFactory::HistoSys::writeToFile( const std::string& FileName, 
						   const std::string& DirName ) {

  // This saves the histograms to a file and 
  // changes the name of the local file and histograms
  
  TH1* histLow = GetHistoLow();
  if( histLow==NULL ) {
    std::cout << "Error: Cannot write " << GetName()
	      << " to file: " << FileName
	      << " HistoLow is NULL" 
	      << std::endl;
    throw hf_exc();
  }
  histLow->Write();
  fInputFileLow = FileName;
  fHistoPathLow = DirName;
  fHistoNameLow = histLow->GetName(); 

  TH1* histHigh = GetHistoHigh();
  if( histHigh==NULL ) {
    std::cout << "Error: Cannot write " << GetName()
	      << " to file: " << FileName
	      << " HistoHigh is NULL" 
	      << std::endl;
    throw hf_exc();
  }
  histHigh->Write();
  fInputFileHigh = FileName;
  fHistoPathHigh = DirName;
  fHistoNameHigh = histHigh->GetName();

  return;

}


// Shape Sys

TH1* RooStats::HistFactory::ShapeSys::GetErrorHist() {
  TH1* error_hist = (TH1*) fhError.GetObject();
  return error_hist;
}


void RooStats::HistFactory::ShapeSys::Print( std::ostream& stream ) {
  stream << "\t \t Name: " << fName
	 << "\t InputFile: " << fInputFile
	 << "\t HistoName: " << fHistoName
	 << "\t HistoPath: " << fHistoPath
	 << std::endl;
}


void RooStats::HistFactory::ShapeSys::PrintXML( std::ostream& xml ) {
  xml << "      <ShapeSys Name=\"" << GetName() << "\" "
      << " InputFile=\""  << GetInputFile()  << "\" "
      << " HistoName=\""  << GetHistoName()  << "\" "
      << " HistoPath=\""  << GetHistoPath()  << "\" "
      << " ConstraintType=\"" << std::string(Constraint::Name(GetConstraintType())) << "\" "
      << "  /> " << std::endl;
}


void RooStats::HistFactory::ShapeSys::writeToFile( const std::string& FileName, 
						   const std::string& DirName ) {

  TH1* histError = GetErrorHist();
  if( histError==NULL ) {
    std::cout << "Error: Cannot write " << GetName()
	      << " to file: " << FileName
	      << " ErrorHist is NULL" 
	      << std::endl;
    throw hf_exc();
  }
  histError->Write();
  fInputFile = FileName;
  fHistoPath = DirName;
  fHistoName = histError->GetName(); 

  return;

}




// HistoFactor

void RooStats::HistFactory::HistoFactor::Print( std::ostream& stream ) {
  stream << "\t \t Name: " << fName
	 << "\t InputFileLow: " << fInputFileLow
	 << "\t HistoNameLow: " << fHistoNameLow
	 << "\t HistoPathLow: " << fHistoPathLow
	 << "\t InputFileHigh: " << fInputFileHigh
	 << "\t HistoNameHigh: " << fHistoNameHigh
	 << "\t HistoPathHigh: " << fHistoPathHigh
	 << std::endl;
}


TH1* RooStats::HistFactory::HistoFactor::GetHistoLow() {
  TH1* histo_low = (TH1*) fhLow.GetObject();
  return histo_low;
}

TH1* RooStats::HistFactory::HistoFactor::GetHistoHigh() {
  TH1* histo_high = (TH1*) fhHigh.GetObject();
  return histo_high;
}


void RooStats::HistFactory::HistoFactor::writeToFile( const std::string& FileName, 
						      const std::string& DirName ) {


  // This saves the histograms to a file and 
  // changes the name of the local file and histograms
  
  TH1* histLow = GetHistoLow();
  if( histLow==NULL ) {
    std::cout << "Error: Cannot write " << GetName()
	      << " to file: " << FileName
	      << " HistoLow is NULL" 
	      << std::endl;
    throw hf_exc();
  }
  histLow->Write();
  fInputFileLow = FileName;
  fHistoPathLow = DirName;
  fHistoNameLow = histLow->GetName(); 

  TH1* histHigh = GetHistoHigh();
  if( histHigh==NULL ) {
    std::cout << "Error: Cannot write " << GetName()
	      << " to file: " << FileName
	      << " HistoHigh is NULL" 
	      << std::endl;
    throw hf_exc();
  }
  histHigh->Write();
  fInputFileHigh = FileName;
  fHistoPathHigh = DirName;
  fHistoNameHigh = histHigh->GetName();

  return;

}

void RooStats::HistFactory::HistoFactor::PrintXML( std::ostream& xml ) {
  xml << "      <HistoFactor Name=\"" << GetName() << "\" "

      << " InputFileLow=\""  << GetInputFileLow()  << "\" "
      << " HistoNameLow=\""  << GetHistoNameLow()  << "\" "
      << " HistoPathLow=\""  << GetHistoPathLow()  << "\" "

      << " InputFileHigh=\""  << GetInputFileHigh()  << "\" "
      << " HistoNameHigh=\""  << GetHistoNameHigh()  << "\" "
      << " HistoPathHigh=\""  << GetHistoPathHigh()  << "\" "
      << "  /> " << std::endl;
}


// Shape Factor
RooStats::HistFactory::ShapeFactor::ShapeFactor() : fConstant(false), 
						    fHasInitialShape(false),
						    fhInitialShape(NULL) {;}

void RooStats::HistFactory::ShapeFactor::Print( std::ostream& stream ) {

  stream << "\t \t Name: " << fName << std::endl;
  
  if( fHistoName != "" ) {
    stream << "\t \t "
	   << " Shape Hist Name: " << fHistoName
	   << " Shape Hist Path Name: " << fHistoPath
	   << " Shape Hist FileName: " << fInputFile
	   << std::endl;
  }

  if( fConstant ) { stream << "\t \t ( Constant ): " << std::endl; }

}


void RooStats::HistFactory::ShapeFactor::writeToFile( const std::string& FileName, 
						      const std::string& DirName ) {

  if( HasInitialShape() ) {
    TH1* histInitialShape = GetInitialShape();
    if( histInitialShape==NULL ) {
      std::cout << "Error: Cannot write " << GetName()
		<< " to file: " << FileName
		<< " InitialShape is NULL" 
		<< std::endl;
      throw hf_exc();
    }
    histInitialShape->Write();
    fInputFile = FileName;
    fHistoPath = DirName;
    fHistoName = histInitialShape->GetName(); 
  }

  return;

}


void RooStats::HistFactory::ShapeFactor::PrintXML( std::ostream& xml ) {
  xml << "      <ShapeFactor Name=\"" << GetName() << "\" ";
  if( fHasInitialShape ) {
    xml << " InputFile=\""  << GetInputFile()  << "\" "
	<< " HistoName=\""  << GetHistoName()  << "\" "
	<< " HistoPath=\""  << GetHistoPath()  << "\" ";
  }
  xml << "  /> " << std::endl;
}


// Stat Error Config
void RooStats::HistFactory::StatErrorConfig::Print( std::ostream& stream ) {
  stream << "\t \t RelErrorThreshold: " << fRelErrorThreshold
	 << "\t ConstraintType: " << Constraint::Name( fConstraintType )
	 << std::endl;
}  

void RooStats::HistFactory::StatErrorConfig::PrintXML( std::ostream& xml ) {
  xml << "    <StatErrorConfig RelErrorThreshold=\"" << GetRelErrorThreshold() 
      << "\" "
      << "ConstraintType=\"" << Constraint::Name( GetConstraintType() ) 
      << "\" "
      << "/> " << std::endl << std::endl;

}


// Stat Error
TH1* RooStats::HistFactory::StatError::GetErrorHist() {
  return (TH1*) fhError.GetObject();
}


void RooStats::HistFactory::StatError::Print( std::ostream& stream ) {
  stream << "\t \t Activate: " << fActivate
	 << "\t InputFile: " << fInputFile
	 << "\t HistoName: " << fHistoName
	 << "\t histoPath: " << fHistoPath
	 << std::endl;
}  

void RooStats::HistFactory::StatError::PrintXML( std::ostream& xml ) {

  if( GetActivate() ) {
    xml << "      <StatError Activate=\"" 
	<< (GetActivate() ? std::string("True") : std::string("False"))  
	<< "\" "
	<< " InputFile=\"" << GetInputFile() << "\" "
	<< " HistoName=\"" << GetHistoName() << "\" "
	<< " HistoPath=\"" << GetHistoPath() << "\" "
	<< " /> " << std::endl;
  }

}


void RooStats::HistFactory::StatError::writeToFile( const std::string& OutputFileName, 
						    const std::string& DirName ) {

  if( fUseHisto ) {
    
    std::string statErrorHistName = "statisticalErrors";
    
    TH1* hStatError = GetErrorHist();
    if( hStatError == NULL ) {
      std::cout << "Error: Stat Error error hist is NULL" << std::endl;
      throw hf_exc();
    }
    hStatError->Write(statErrorHistName.c_str());
    
    fInputFile = OutputFileName;
    fHistoName = statErrorHistName;
    fHistoPath = DirName;
    
  }

  return;

}
 Systematics.cxx:1
 Systematics.cxx:2
 Systematics.cxx:3
 Systematics.cxx:4
 Systematics.cxx:5
 Systematics.cxx:6
 Systematics.cxx:7
 Systematics.cxx:8
 Systematics.cxx:9
 Systematics.cxx:10
 Systematics.cxx:11
 Systematics.cxx:12
 Systematics.cxx:13
 Systematics.cxx:14
 Systematics.cxx:15
 Systematics.cxx:16
 Systematics.cxx:17
 Systematics.cxx:18
 Systematics.cxx:19
 Systematics.cxx:20
 Systematics.cxx:21
 Systematics.cxx:22
 Systematics.cxx:23
 Systematics.cxx:24
 Systematics.cxx:25
 Systematics.cxx:26
 Systematics.cxx:27
 Systematics.cxx:28
 Systematics.cxx:29
 Systematics.cxx:30
 Systematics.cxx:31
 Systematics.cxx:32
 Systematics.cxx:33
 Systematics.cxx:34
 Systematics.cxx:35
 Systematics.cxx:36
 Systematics.cxx:37
 Systematics.cxx:38
 Systematics.cxx:39
 Systematics.cxx:40
 Systematics.cxx:41
 Systematics.cxx:42
 Systematics.cxx:43
 Systematics.cxx:44
 Systematics.cxx:45
 Systematics.cxx:46
 Systematics.cxx:47
 Systematics.cxx:48
 Systematics.cxx:49
 Systematics.cxx:50
 Systematics.cxx:51
 Systematics.cxx:52
 Systematics.cxx:53
 Systematics.cxx:54
 Systematics.cxx:55
 Systematics.cxx:56
 Systematics.cxx:57
 Systematics.cxx:58
 Systematics.cxx:59
 Systematics.cxx:60
 Systematics.cxx:61
 Systematics.cxx:62
 Systematics.cxx:63
 Systematics.cxx:64
 Systematics.cxx:65
 Systematics.cxx:66
 Systematics.cxx:67
 Systematics.cxx:68
 Systematics.cxx:69
 Systematics.cxx:70
 Systematics.cxx:71
 Systematics.cxx:72
 Systematics.cxx:73
 Systematics.cxx:74
 Systematics.cxx:75
 Systematics.cxx:76
 Systematics.cxx:77
 Systematics.cxx:78
 Systematics.cxx:79
 Systematics.cxx:80
 Systematics.cxx:81
 Systematics.cxx:82
 Systematics.cxx:83
 Systematics.cxx:84
 Systematics.cxx:85
 Systematics.cxx:86
 Systematics.cxx:87
 Systematics.cxx:88
 Systematics.cxx:89
 Systematics.cxx:90
 Systematics.cxx:91
 Systematics.cxx:92
 Systematics.cxx:93
 Systematics.cxx:94
 Systematics.cxx:95
 Systematics.cxx:96
 Systematics.cxx:97
 Systematics.cxx:98
 Systematics.cxx:99
 Systematics.cxx:100
 Systematics.cxx:101
 Systematics.cxx:102
 Systematics.cxx:103
 Systematics.cxx:104
 Systematics.cxx:105
 Systematics.cxx:106
 Systematics.cxx:107
 Systematics.cxx:108
 Systematics.cxx:109
 Systematics.cxx:110
 Systematics.cxx:111
 Systematics.cxx:112
 Systematics.cxx:113
 Systematics.cxx:114
 Systematics.cxx:115
 Systematics.cxx:116
 Systematics.cxx:117
 Systematics.cxx:118
 Systematics.cxx:119
 Systematics.cxx:120
 Systematics.cxx:121
 Systematics.cxx:122
 Systematics.cxx:123
 Systematics.cxx:124
 Systematics.cxx:125
 Systematics.cxx:126
 Systematics.cxx:127
 Systematics.cxx:128
 Systematics.cxx:129
 Systematics.cxx:130
 Systematics.cxx:131
 Systematics.cxx:132
 Systematics.cxx:133
 Systematics.cxx:134
 Systematics.cxx:135
 Systematics.cxx:136
 Systematics.cxx:137
 Systematics.cxx:138
 Systematics.cxx:139
 Systematics.cxx:140
 Systematics.cxx:141
 Systematics.cxx:142
 Systematics.cxx:143
 Systematics.cxx:144
 Systematics.cxx:145
 Systematics.cxx:146
 Systematics.cxx:147
 Systematics.cxx:148
 Systematics.cxx:149
 Systematics.cxx:150
 Systematics.cxx:151
 Systematics.cxx:152
 Systematics.cxx:153
 Systematics.cxx:154
 Systematics.cxx:155
 Systematics.cxx:156
 Systematics.cxx:157
 Systematics.cxx:158
 Systematics.cxx:159
 Systematics.cxx:160
 Systematics.cxx:161
 Systematics.cxx:162
 Systematics.cxx:163
 Systematics.cxx:164
 Systematics.cxx:165
 Systematics.cxx:166
 Systematics.cxx:167
 Systematics.cxx:168
 Systematics.cxx:169
 Systematics.cxx:170
 Systematics.cxx:171
 Systematics.cxx:172
 Systematics.cxx:173
 Systematics.cxx:174
 Systematics.cxx:175
 Systematics.cxx:176
 Systematics.cxx:177
 Systematics.cxx:178
 Systematics.cxx:179
 Systematics.cxx:180
 Systematics.cxx:181
 Systematics.cxx:182
 Systematics.cxx:183
 Systematics.cxx:184
 Systematics.cxx:185
 Systematics.cxx:186
 Systematics.cxx:187
 Systematics.cxx:188
 Systematics.cxx:189
 Systematics.cxx:190
 Systematics.cxx:191
 Systematics.cxx:192
 Systematics.cxx:193
 Systematics.cxx:194
 Systematics.cxx:195
 Systematics.cxx:196
 Systematics.cxx:197
 Systematics.cxx:198
 Systematics.cxx:199
 Systematics.cxx:200
 Systematics.cxx:201
 Systematics.cxx:202
 Systematics.cxx:203
 Systematics.cxx:204
 Systematics.cxx:205
 Systematics.cxx:206
 Systematics.cxx:207
 Systematics.cxx:208
 Systematics.cxx:209
 Systematics.cxx:210
 Systematics.cxx:211
 Systematics.cxx:212
 Systematics.cxx:213
 Systematics.cxx:214
 Systematics.cxx:215
 Systematics.cxx:216
 Systematics.cxx:217
 Systematics.cxx:218
 Systematics.cxx:219
 Systematics.cxx:220
 Systematics.cxx:221
 Systematics.cxx:222
 Systematics.cxx:223
 Systematics.cxx:224
 Systematics.cxx:225
 Systematics.cxx:226
 Systematics.cxx:227
 Systematics.cxx:228
 Systematics.cxx:229
 Systematics.cxx:230
 Systematics.cxx:231
 Systematics.cxx:232
 Systematics.cxx:233
 Systematics.cxx:234
 Systematics.cxx:235
 Systematics.cxx:236
 Systematics.cxx:237
 Systematics.cxx:238
 Systematics.cxx:239
 Systematics.cxx:240
 Systematics.cxx:241
 Systematics.cxx:242
 Systematics.cxx:243
 Systematics.cxx:244
 Systematics.cxx:245
 Systematics.cxx:246
 Systematics.cxx:247
 Systematics.cxx:248
 Systematics.cxx:249
 Systematics.cxx:250
 Systematics.cxx:251
 Systematics.cxx:252
 Systematics.cxx:253
 Systematics.cxx:254
 Systematics.cxx:255
 Systematics.cxx:256
 Systematics.cxx:257
 Systematics.cxx:258
 Systematics.cxx:259
 Systematics.cxx:260
 Systematics.cxx:261
 Systematics.cxx:262
 Systematics.cxx:263
 Systematics.cxx:264
 Systematics.cxx:265
 Systematics.cxx:266
 Systematics.cxx:267
 Systematics.cxx:268
 Systematics.cxx:269
 Systematics.cxx:270
 Systematics.cxx:271
 Systematics.cxx:272
 Systematics.cxx:273
 Systematics.cxx:274
 Systematics.cxx:275
 Systematics.cxx:276
 Systematics.cxx:277
 Systematics.cxx:278
 Systematics.cxx:279
 Systematics.cxx:280
 Systematics.cxx:281
 Systematics.cxx:282
 Systematics.cxx:283
 Systematics.cxx:284
 Systematics.cxx:285
 Systematics.cxx:286
 Systematics.cxx:287
 Systematics.cxx:288
 Systematics.cxx:289
 Systematics.cxx:290
 Systematics.cxx:291
 Systematics.cxx:292
 Systematics.cxx:293
 Systematics.cxx:294
 Systematics.cxx:295
 Systematics.cxx:296
 Systematics.cxx:297
 Systematics.cxx:298
 Systematics.cxx:299
 Systematics.cxx:300
 Systematics.cxx:301
 Systematics.cxx:302
 Systematics.cxx:303
 Systematics.cxx:304
 Systematics.cxx:305
 Systematics.cxx:306
 Systematics.cxx:307
 Systematics.cxx:308
 Systematics.cxx:309
 Systematics.cxx:310
 Systematics.cxx:311
 Systematics.cxx:312
 Systematics.cxx:313
 Systematics.cxx:314
 Systematics.cxx:315
 Systematics.cxx:316
 Systematics.cxx:317
 Systematics.cxx:318
 Systematics.cxx:319
 Systematics.cxx:320
 Systematics.cxx:321
 Systematics.cxx:322
 Systematics.cxx:323
 Systematics.cxx:324
 Systematics.cxx:325
 Systematics.cxx:326
 Systematics.cxx:327
 Systematics.cxx:328
 Systematics.cxx:329
 Systematics.cxx:330
 Systematics.cxx:331
 Systematics.cxx:332
 Systematics.cxx:333
 Systematics.cxx:334
 Systematics.cxx:335
 Systematics.cxx:336
 Systematics.cxx:337
 Systematics.cxx:338
 Systematics.cxx:339
 Systematics.cxx:340
 Systematics.cxx:341
 Systematics.cxx:342
 Systematics.cxx:343
 Systematics.cxx:344
 Systematics.cxx:345
 Systematics.cxx:346
 Systematics.cxx:347
 Systematics.cxx:348
 Systematics.cxx:349
 Systematics.cxx:350
 Systematics.cxx:351
 Systematics.cxx:352
 Systematics.cxx:353
 Systematics.cxx:354
 Systematics.cxx:355
 Systematics.cxx:356
 Systematics.cxx:357
 Systematics.cxx:358
 Systematics.cxx:359
 Systematics.cxx:360
 Systematics.cxx:361
 Systematics.cxx:362
 Systematics.cxx:363
 Systematics.cxx:364
 Systematics.cxx:365
 Systematics.cxx:366
 Systematics.cxx:367
 Systematics.cxx:368
 Systematics.cxx:369
 Systematics.cxx:370
 Systematics.cxx:371
 Systematics.cxx:372
 Systematics.cxx:373
 Systematics.cxx:374
 Systematics.cxx:375
 Systematics.cxx:376
 Systematics.cxx:377
 Systematics.cxx:378
 Systematics.cxx:379
 Systematics.cxx:380
 Systematics.cxx:381
 Systematics.cxx:382
 Systematics.cxx:383
 Systematics.cxx:384
 Systematics.cxx:385
 Systematics.cxx:386
 Systematics.cxx:387
 Systematics.cxx:388
 Systematics.cxx:389
 Systematics.cxx:390
 Systematics.cxx:391
 Systematics.cxx:392
 Systematics.cxx:393
 Systematics.cxx:394
 Systematics.cxx:395
 Systematics.cxx:396
 Systematics.cxx:397
 Systematics.cxx:398
 Systematics.cxx:399
 Systematics.cxx:400
 Systematics.cxx:401
 Systematics.cxx:402
 Systematics.cxx:403
 Systematics.cxx:404
 Systematics.cxx:405
 Systematics.cxx:406
 Systematics.cxx:407
 Systematics.cxx:408
 Systematics.cxx:409
 Systematics.cxx:410
 Systematics.cxx:411
 Systematics.cxx:412
 Systematics.cxx:413
 Systematics.cxx:414