29 namespace HistFactory {
31 EstimateSummary::EstimateSummary(){
35 IncludeStatError =
false;
37 RelErrorThreshold=0.0;
41 EstimateSummary::~EstimateSummary(){}
44 cout <<
"EstimateSummary (name = " <<
name <<
" empty = " <<
name.empty() <<
")"<< endl;
45 cout <<
" TObj name = " << this->
GetName() << endl;
46 cout <<
" Channel = " << channel << endl;
47 cout <<
" NormName = " << normName << endl;
48 cout <<
" Nominal ptr = " << nominal << endl;
49 if (nominal) cout <<
" Nominal hist name = " << nominal->GetName() << endl;
50 cout <<
" Number of hist variations = " << systSourceForHist.size()
51 <<
" " << lowHists.size() <<
" " 52 <<
" " << highHists.size() << endl;
53 cout <<
" Number of overall systematics = " << overallSyst.size() << endl;
56 void EstimateSummary::AddSyst(
const string &
sname,
TH1* low,
TH1* high){
57 systSourceForHist.push_back(sname);
58 lowHists.push_back(low);
59 highHists.push_back(high);
68 cout <<
"names don't match : " <<
name <<
" vs " << other.
name << endl;
72 cout <<
"channel names don't match : " << channel <<
" vs " << other.
channel << endl;
76 cout <<
"norm names don't match : " << normName <<
" vs " << other.
normName << endl;
80 cout <<
"norm names don't match : " << shapeFactorName <<
" vs " << other.
shapeFactorName << endl;
84 if(! CompareHisto( this->nominal, other.
nominal ) ) {
85 cout <<
"nominal histo don't match" << endl;
89 cout <<
"Include Stat Error bools don't match : " << IncludeStatError <<
" vs " << other.
IncludeStatError << endl;
93 cout <<
"Stat Constraint Types don't match : " << StatConstraintType <<
" vs " << other.
StatConstraintType << endl;
97 cout <<
"Relative Stat Error Thresholds don't match : " << RelErrorThreshold <<
" vs " << other.
RelErrorThreshold << endl;
101 if(! CompareHisto( this->relStatError, other.
relStatError ) ) {
102 cout <<
"relStatError histo don't match" << endl;
106 cout <<
"Shape Factor Names don't match : " << shapeFactorName <<
" vs " << other.
shapeFactorName << endl;
113 for( vector<string>::const_iterator itr=systSourceForHist.begin(); itr!=systSourceForHist.end(); ++itr){
116 if(! (CompareHisto( lowHists[ counter ], other.
lowHists[ ind ]))){
117 cout <<
"contents of sys histo low " << *itr <<
" did not match" << endl;
119 else if (!( CompareHisto( highHists[counter], other.
highHists[ ind ]) ) ){
120 cout <<
"contents of sys histo high " << *itr <<
" did not match" << endl;
123 cout <<
"mismatch in systSourceForHist : " << systSourceForHist.size() <<
" vs " << other.
systSourceForHist.size() << endl;
124 for( vector<string>::const_iterator itr_this=systSourceForHist.begin(); itr_this!=systSourceForHist.end(); ++itr_this){
125 cout <<
" this contains: " << *itr_this << endl;
128 cout <<
" other contains: " << *itr_other << endl;
135 if( overallSyst.size() != other.
overallSyst.size()){
136 cout <<
"mismatch in overallSyst : " << overallSyst.size() <<
" vs " << other.
overallSyst.size() << endl;
139 for( map<
string, pair<double, double> >::const_iterator itr=overallSyst.begin(); itr!=overallSyst.end(); ++itr){
140 map<string, pair<double, double> >::const_iterator found=other.
overallSyst.find(itr->first);
142 cout <<
"mismatch in overallSyst, didn't find " << itr->first << endl;
145 if(! (itr->second.first==found->second.first && itr->second.second==found->second.second)){
146 cout <<
"mismatch in overall Syst value of " << itr->first << endl;
153 bool EstimateSummary::CompareHisto(
const TH1 * one,
const TH1 * two)
const {
155 if (!one && !two)
return true;
156 if (!one)
return false;
157 if (!two)
return false;
std::string GetName(const std::string &scope_name)
std::vector< TH1 * > lowHists
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
std::string shapeFactorName
std::map< std::string, std::pair< double, double > > overallSyst
ConstraintType StatConstraintType
std::vector< TH1 * > highHists
std::vector< std::string > systSourceForHist
Namespace for the RooStats classes.
void Print(std::ostream &os, const OptionType &opt)
Bool_t operator==(const TDatime &d1, const TDatime &d2)
Double_t RelErrorThreshold
virtual Int_t GetNbinsX() const