CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FitHist.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
8 void
10 {
11  //-----------------------------------------------
12  // read all configurables defined in FitHisto-
13  // grams from config file. Throw human readable
14  // exception when misspellings occure
15  //-----------------------------------------------
16  try{
17  //-----------------------------------------------
18  // histogram steering
19  //-----------------------------------------------
20  readVector( cfg.read<std::string>( "titleIndex"), axesIndex_);
21  readLabels( cfg.read<std::string>( "xAxesFit" ), xAxesFit_ );
22  readLabels( cfg.read<std::string>( "yAxesFit" ), yAxesFit_ );
23 
24  //-----------------------------------------------
25  // histogram manipulations
26  //-----------------------------------------------
27  readVector( cfg.read<std::string>( "targetLabel" ), targetHistList_);
28  fitFuncName_ = cfg.read<std::string>( "fitFunctionName" );
29  fitFuncTitle_= cfg.read<std::string>( "fitFunctionTitle");
30  fitFuncType_ = cfg.read<int> ( "fitFunctionType" );
31  fitFuncLowerBound_= cfg.read<double>( "fitLowerBound" );
32  fitFuncUpperBound_= cfg.read<double>( "fitUpperBound" );
33  evalType_ = cfg.read<int>( "evalType" );
34  }
35  catch(...){
36  std::cerr << "ERROR during reading of config file" << std::endl;
37  std::cerr << " misspelled variables in cfg ?" << std::endl;
38  std::cerr << " [--called in configBlockFit]" << std::endl;
39  std::exit(1);
40  }
41 }
42 
43 bool
45 {
46  //-----------------------------------------------
47  // check list of target histogram labels, return
48  // true if all elements are supported and false
49  // otherwise
50  //-----------------------------------------------
51  bool statusOk=true;
52  for(unsigned int idx=0; idx<targetHistList_.size(); ++idx){
53  if( statusOk ) statusOk=isInFitTargetList(targetHistList_[idx]);
54  }
55  return statusOk;
56 }
57 
58 bool
60 {
61  //-----------------------------------------------
62  // check if given target prefix is suported
63  //-----------------------------------------------
64  TString target(label);
65  if( !(target.CompareTo(FitTarget::Cal ) ||
66  target.CompareTo(FitTarget::Res ) ||
67  target.CompareTo(FitTarget::Sigma ) ||
68  target.CompareTo(FitTarget::Mean ) )){
69  std::cerr << "ERROR while filling target histogram" << std::endl;
70  std::cerr << " can't find prefix: " << target << std::endl;
71  return false;
72  }
73  return true;
74 }
75 
76 TH1F&
77 FitHist::findFitHistogram(const TObjArray& hist, TString& zip, TString& name, int& bin)
78 {
79  //---------------------------------------------
80  // returns fit histogram of bin 'bin'to
81  // corresponding target histogram
82  //---------------------------------------------
83 
84  //prepare reference name
85  TString refName( name );
86  refName+="_";
87  refName+=bin;
88  refName.Remove(0, refName.First('_')+1); //chop of prefix
89 
90  //---------------------------------------------
91  // loop array of histograms & search for ref
92  //---------------------------------------------
93  for(int idx=0; idx<hist.GetEntriesFast(); ++idx){
94  TH1F& cmp = *((TH1F*)(hist)[idx]);
95  TString buffer( cmp.GetName() );
96  if( buffer.BeginsWith( zip ) ){
97  TString cmpName( cmp.GetName() ); // chop off root directory and
98  cmpName.Remove(0, cmpName.First('/')+1); // file from histogram name
99  if( cmpName.BeginsWith(FitTarget::Fit) && cmpName.Contains(refName) ){
100  return cmp;
101  }
102  }
103  }
104  std::cout << "WARNING: could not find required histogram fit_"
105  << refName << "_x" << std::endl
106  << " return reference to Null" << std::endl;
107  return *(TH1F*)0;
108 }
109 
110 TH1F&
111 FitHist::findTargetHistogram(const TObjArray& hist, TString& zip, TString& name, TString& target)
112 {
113  //---------------------------------------------
114  // returns target histogram to corresponding
115  // fit histogram
116  //---------------------------------------------
117 
118  //prepare reference name
119  TString refName( name );
120  refName.Remove(0, refName.First('_')+1); //chop of prefix
121  refName.Remove(refName.Last('_'), refName.Length()); //chop of postfix
122 
123  //---------------------------------------------
124  // loop array of histograms & search for ref
125  //---------------------------------------------
126  for(int idx=0; idx<hist.GetEntriesFast(); ++idx){
127  TH1F& cmp = *((TH1F*)(hist)[idx]);
128  TString buffer( cmp.GetName() );
129  if( buffer.BeginsWith( zip ) ){
130  // prepare compare string
131  TString cmpName( cmp.GetName() ); // chop off root directory and
132  cmpName.Remove(0, cmpName.First('/')+1); // file from histogram name
133  if( cmpName.BeginsWith(target) && cmpName.Contains(refName) ){
134  return cmp;
135  }
136  }
137  }
138  std::cout << "WARNING: could not find required histogram "
139  << target << refName << std::endl
140  << " return reference to Null" << std::endl;
141  return *(TH1F*)0;
142 }
143 
144 double
145 FitHist::normalize(TString& buffer, double val)
146 {
147  return ( (!buffer.CompareTo(FitTarget::Res ) && val>0.) ) ? 1./val : 1.;
148 }
149 
150 void
151 FitHist::fillTargetHistogramBin(TH1F& htarget, TH1F& hfit, int bin, TString& buffer, Quantile& func)
152 {
153  if( !buffer.CompareTo(FitTarget::Cal) || !buffer.CompareTo(FitTarget::Mean ) ){
154  htarget.SetBinContent( bin, func.value( hfit ) ); htarget.SetBinError( bin, func.valueError( hfit ) );
155  }
156  if( !buffer.CompareTo(FitTarget::Res) || !buffer.CompareTo(FitTarget::Sigma) ){
157  double norm=normalize(buffer, func.value( hfit ));
158  htarget.SetBinContent( bin, norm*func.spread( hfit ) ); htarget.SetBinError ( bin, norm*func.spreadError( hfit ) );
159  }
160 }
161 
162 void
163 FitHist::fillTargetHistogramBin(TH1F& htarget, TH1F& hfit, int bin, TString& buffer, MaximalValue& func)
164 {
165  if( !buffer.CompareTo(FitTarget::Cal) || !buffer.CompareTo(FitTarget::Mean ) ){
166  htarget.SetBinContent( bin, func.value( hfit ) ); htarget.SetBinError( bin, func.valueError( hfit ) );
167  }
168  if( !buffer.CompareTo(FitTarget::Res) || !buffer.CompareTo(FitTarget::Sigma) ){
169  double norm=normalize(buffer, func.value( hfit ));
170  htarget.SetBinContent( bin, norm*func.spread( hfit ) ); htarget.SetBinError ( bin, norm*func.spreadError( hfit ) );
171  }
172 }
173 
174 void
175 FitHist::fillTargetHistogramBin(TH1F& htarget, TH1F& hfit, int bin, TString& buffer, HistogramMean& func)
176 {
177  if( !buffer.CompareTo(FitTarget::Cal) || !buffer.CompareTo(FitTarget::Mean ) ){
178  htarget.SetBinContent( bin, func.value( hfit ) ); htarget.SetBinError( bin, func.valueError( hfit ) );
179  }
180  if( !buffer.CompareTo(FitTarget::Res) || !buffer.CompareTo(FitTarget::Sigma) ){
181  double norm=normalize(buffer, func.value( hfit ));
182  htarget.SetBinContent( bin, norm*func.spread( hfit ) ); htarget.SetBinError ( bin, norm*func.spreadError( hfit ) );
183  }
184 }
185 
186 void
187 FitHist::fillTargetHistogramBin(TH1F& htarget, TH1F& hfit, int bin, TString& buffer, StabilizedGauss& func)
188 {
189  if( !buffer.CompareTo(FitTarget::Cal) || !buffer.CompareTo(FitTarget::Mean ) ){
190  htarget.SetBinContent( bin, func.value( hfit ) ); htarget.SetBinError( bin, func.valueError( hfit ) );
191  }
192  if( !buffer.CompareTo(FitTarget::Res) || !buffer.CompareTo(FitTarget::Sigma) ){
193  double norm=normalize(buffer, func.value( hfit ));
194  htarget.SetBinContent( bin, norm*func.spread( hfit ) ); htarget.SetBinError ( bin, norm*func.spreadError( hfit ) );
195  }
196 }
197 
198 void
199 FitHist::fillTargetHistogramBin(TH1F& htarget, TH1F& hfit, int bin)
200 {
201  if( !hfit.GetEntries()>0 ) return;
202 
203  //-----------------------------------------------
204  // fill corresponding bin in target histogram
205  //-----------------------------------------------
206  TString buffer(htarget.GetName());
207  buffer.Remove(0, buffer.First('/')+1);
208  buffer.Remove(buffer.First('_')+1, buffer.Length());
209 
210  switch(evalType_){
211  case kStabilizedGauss:
212  {
213  StabilizedGauss func(fitFuncName_.c_str());
214  fillTargetHistogramBin(htarget, hfit, bin, buffer, func);
215  break;
216  }
217  case kHistogramMean:
218  {
219  HistogramMean func;
220  fillTargetHistogramBin(htarget, hfit, bin, buffer, func);
221  break;
222  }
223  case kMaximalValue:
224  {
225  MaximalValue func(0.9, 0.05);
226  fillTargetHistogramBin(htarget, hfit, bin, buffer, func);
227  break;
228  }
229  case kQuantile:
230  {
231  Quantile func(0.5, 0.05);
232  fillTargetHistogramBin(htarget, hfit, bin, buffer, func);
233  break;
234  }
235  default:
236 
237  break;
238  }
239 }
240 
241 void
243 {
244  //-----------------------------------------------
245  // get proper axes label for fit histograms; get
246  // the proper histogram idx from int the vector
247  // axesIndex_, as the same label will be used
248  // many times for each fit bin thi saves from
249  // repeatedly passing the same labels.
250  //-----------------------------------------------
251  if(idx<(int)axesIndex_.size()){
252  int jdx = axesIndex_[idx];
253  if( jdx<(int)xAxesFit_.size() && jdx<(int)yAxesFit_.size() ){
254  setAxesStyle( hist, xAxesFit_[jdx].c_str(), yAxesFit_[jdx].c_str() );
255  }
256  else if( jdx<(int)xAxesFit_.size() ){
257  setAxesStyle( hist, xAxesFit_[jdx].c_str(), "events" );
258  }
259  }
260  else{
261  setAxesStyle( hist, hist.GetName(), "events" );
262  }
263 }
264 
265 void
266 FitHist::addBinLabelToFitHist(const TObjArray& hist, int& bin, TString& name, TString& zip)
267 {
268  //---------------------------------------------
269  // add pave text to fitted histograms keeping
270  // information of the corresponding bin edges
271  //---------------------------------------------
272  TPaveText* text = new TPaveText(0.25, 0.85, 0.95, 0.95, "NDC");
273  text->SetBorderSize( 0 );
274  text->SetFillStyle( 4000 );
275  text->SetTextAlign( 12 );
276  text->SetTextSize ( 0.06 );
277  text->SetTextColor( 1 );
278  text->SetTextFont ( 62 );
279 
280  char labelname[100];
281  TString buffer(targetHistList_[0]); buffer+="_";
282  TH1F& target = findTargetHistogram(hist, zip, name, buffer);
283  double lowerEdge = target.GetBinLowEdge(bin+1);
284  double upperEdge = target.GetBinLowEdge(bin+1)+target.GetBinWidth(bin+1);
285  sprintf(labelname, "[%3.0f GeV; %3.0f GeV]", lowerEdge, upperEdge );//FIXME: this does not need to be GeV only
286  text->AddText( labelname );
287  text->Draw();
288 }
289 
290 void
292 {
293  if( hist.GetFunction(fitFuncName_.c_str()) ){
294  TPaveText* pars = new TPaveText(0.40, 0.55, 0.95, 0.70, "NDC");
295  pars->SetBorderSize( 0 );
296  pars->SetFillStyle( 4000 );
297  pars->SetTextAlign( 12 );
298  pars->SetTextSize ( 0.06 );
299  pars->SetTextColor( 1 );
300  pars->SetTextFont ( 62 );
301 
302  char parstring[100];
303  if(fitFuncType_==0){
304  sprintf(parstring, "#mu=%3.2f ; #sigma=%3.2f",
305  hist.GetFunction(fitFuncName_.c_str())->GetParameter( 1 ),
306  hist.GetFunction(fitFuncName_.c_str())->GetParameter( 2 ) );
307  }
308  pars->AddText( parstring );
309  pars->Draw();
310  }
311 }
312 
313 void
315 {
316  //-----------------------------------------------
317  // define canvas
318  //-----------------------------------------------
319  TCanvas *canv = new TCanvas("canv", "fit histograms", 600, 600);
320  setCanvasStyle( *canv );
321  canv->SetGridx( 1 ); canv->SetLogx ( 0 );
322  canv->SetGridy( 1 ); canv->SetLogy ( 0 );
323 
324  //-----------------------------------------------
325  // loop histograms via the list of histogram
326  // names stored in histList_, open a new page
327  // for each histogram; open a new file for each
328  // sample.
329  //-----------------------------------------------
330  std::vector<TObjArray>::const_iterator hist = sampleList_.begin();
331  for(int idx=0; hist!=sampleList_.end(); ++hist, ++idx){
332  //-----------------------------------------------
333  // open output file
334  //-----------------------------------------------
335  TString output( writeTo_.c_str() );
336  output += "/inspectFit_";
337  if(outputLabelList_.size()>=sampleList_.size())
338  output += outputLabelList_[idx];
339  else
340  output == idx;
341  output += ".ps";
342  TPostScript psFile( output, 111 ); //112 for portrat
343  //---------------------------------------------
344  // loop histograms via the list of histogram
345  // names stored in histList_, open a new page
346  // for each histogram; fit any histogram con-
347  // taining the prefix 'fit'
348  //---------------------------------------------
349  int label=0;
350  for(int jdx=0; jdx<(*hist).GetEntriesFast(); ++jdx){
351  TH1F& hfit = *((TH1F*)(*hist)[jdx]); //recieve histogram
352  // prepare compare string
353  TString cmp( hfit.GetName() ); // chop off root directory and
354  cmp.Remove(0, cmp.First('/')+1); // file from histogram name
355  //prepare zip code
356  TString zip( hfit.GetName() ); // chop off histogram name keep
357  zip.Remove(zip.First('/'), zip.Length()); // file and directory
358  if ( cmp.BeginsWith(FitTarget::Fit) ){ //search for prefix 'fit'
359  psFile.NewPage();
360  if(verbose_){
361  std::cout << std::endl << "about to fit histogram: "
362  << hfit.GetName() << " as " << cmp << std::endl;
363  }
364  //-----------------------------------------------
365  // determine proper bin by choping off everything
366  // but the postfix which should correspond to the
367  // bin of NameScheme
368  //-----------------------------------------------
369  TString buffer( cmp );
370  int bin = buffer.Remove(0, buffer.Last('_')+1).Atoi();
371 
372  hfit.SetLineWidth( 5 );
373  hfit.SetLineColor( 4 );
374  hfit.SetLineStyle( 1 );
375  hfit.SetMarkerStyle( 20 );
376  hfit.SetMarkerSize( 2.0 );
377  hfit.SetMarkerColor( 4 );
378  hfit.SetMaximum(1.5*hfit.GetMaximum());
379  setFitHistogramAxes( hfit, label++ );
380  //hfit.Fit( "gaus" );
381 
382  //do stable fit
383  StabilizedGauss func(fitFuncName_.c_str(), fitFuncType_, fitFuncLowerBound_, fitFuncUpperBound_);
384  func.fit(hfit);
385 
386  hfit.Draw("esame");
387  //---------------------------------------------
388  // add TPaveLabel to keep info of binning
389  // recieved from target hitogram
390  //---------------------------------------------
391  addParLabelToFitHist( hfit );
392  addBinLabelToFitHist(*hist, bin, cmp, zip);
393 
394  //---------------------------------------------
395  // add legend to fitted histogram
396  //---------------------------------------------
397  TLegend* leg = new TLegend(0.25,0.70,0.95,0.87);
398  setLegendStyle( *leg );
399  leg->AddEntry( &hfit, legend(idx).c_str(), "PL" );
400  leg->AddEntry( hfit.GetFunction(fitFuncName_.c_str()), fitFuncTitle_.c_str(), "L" );
401  leg->Draw( "same" );
402  canv->RedrawAxis( );
403  canv->Update( );
404  if(jdx<((*hist).GetEntriesFast()-1)) delete leg;
405  }
406  }
407  psFile.Close();
408  }
409  canv->Close();
410  delete canv;
411 }
412 
413 void
415 {
416  //-----------------------------------------------
417  // define canvas
418  //-----------------------------------------------
419  TCanvas *canv = new TCanvas("canv", "fit histograms", 600, 600);
420  setCanvasStyle( *canv );
421  canv->SetGridx( 1 ); canv->SetLogx ( 0 );
422  canv->SetGridy( 1 ); canv->SetLogy ( 0 );
423 
424  //-----------------------------------------------
425  // loop histograms via the list of histogram
426  // names stored in histList_, open a new page
427  // for each histogram; open a new file for each
428  // sample.
429  //-----------------------------------------------
430  std::vector<TObjArray>::const_iterator hist = sampleList_.begin();
431  for(int idx=0; hist!=sampleList_.end(); ++hist, ++idx){
432  //---------------------------------------------
433  // loop histograms via the list of histogram
434  // names stored in histList_, open a new page
435  // for each histogram; fit any histogram con-
436  // taining the prefix 'fit'
437  //---------------------------------------------
438  int label=0;
439  for(int jdx=0; jdx<(*hist).GetEntriesFast(); ++jdx){
440  TH1F& hfit = *((TH1F*)(*hist)[jdx]); //recieve histogram
441  // prepare compare string
442  TString cmp( hfit.GetName() ); // chop off root directory and
443  cmp.Remove(0, cmp.First('/')+1); // file from histogram name
444  //prepare zip code
445  TString zip( hfit.GetName() ); // chop off histogram name keep
446  zip.Remove(zip.First('/'), zip.Length()); // file and directory
447  if ( cmp.BeginsWith(FitTarget::Fit) ){ //search for prefix 'fit'
448  //-----------------------------------------------
449  // open output file
450  //-----------------------------------------------
451  TString output( writeTo_.c_str() );
452  output += "/";
453  output += histList_[ jdx ];
454  output += "_";
455  if(outputLabelList_.size()>=sampleList_.size())
456  output += outputLabelList_[idx];
457  else
458  output == idx;
459  output += ".eps";
460  TPostScript psFile( output, 113 );
461  psFile.NewPage();
462 
463  //-----------------------------------------------
464  // determine proper bin by choping off everything
465  // bit the postfix which should correspond to the
466  // bin of NameScheme
467  //-----------------------------------------------
468  TString buffer( cmp );
469  int bin = buffer.Remove(0, buffer.Last('_')+1).Atoi();
470 
471  hfit.SetLineWidth( 5 );
472  hfit.SetLineColor( 4 );
473  hfit.SetLineStyle( 1 );
474  hfit.SetMarkerStyle( 20 );
475  hfit.SetMarkerSize( 2.0 );
476  hfit.SetMarkerColor( 4 );
477  setFitHistogramAxes( hfit, label++ );
478  //hfit.Fit( "gaus" );
479 
480  //do stable fit
481  StabilizedGauss func(fitFuncName_.c_str(), fitFuncType_, fitFuncLowerBound_, fitFuncUpperBound_);
482  func.fit(hfit);
483 
484  hfit.Draw("esame");
485  //---------------------------------------------
486  // add TPaveLabel to keep info of binning
487  // recieved from target hitogram
488  //---------------------------------------------
489  addParLabelToFitHist( hfit );
490  addBinLabelToFitHist( *hist, bin, cmp, zip );
491 
492  //---------------------------------------------
493  // add legend to fitted histogram
494  //---------------------------------------------
495  TLegend* leg = new TLegend(0.25,0.70,0.95,0.87);
496  setLegendStyle( *leg );
497  leg->AddEntry( &hfit, legend(idx).c_str(), "PL" );
498  leg->AddEntry( hfit.GetFunction(fitFuncName_.c_str()), fitFuncTitle_.c_str(), "L" );
499  leg->Draw( "same" );
500  canv->RedrawAxis( );
501  canv->Update( );
502  psFile.Close();
503  delete leg;
504  }
505  }
506  }
507  canv->Close();
508  delete canv;
509 }
510 
511 void
513 {
514  //---------------------------------------------
515  // fill all target histograms
516  //---------------------------------------------
517  for(unsigned int idx=0; idx<targetHistList_.size(); ++idx){
518  fillTargetHistogram(targetHistList_[idx]);
519  }
520 }
521 
522 void
524 {
525  //---------------------------------------------
526  // loop array of samples via sampleList_, which
527  // contains all histograms in TObjectArrays for
528  // each sample
529  //---------------------------------------------
530  std::vector<TObjArray>::const_iterator hist = sampleList_.begin();
531  for(; hist!=sampleList_.end(); ++hist){
532  //---------------------------------------------
533  // loop histograms & search for prefix target;
534  // check if it's contained in list of valid
535  // targets first
536  //---------------------------------------------
537  TString buffer( target );
538  if( isInFitTargetList(target) ){
539  for(int jdx=0; jdx<(*hist).GetEntriesFast(); ++jdx){
540  TH1F& htarget = *((TH1F*)(*hist)[jdx]);
541  // prepare compare string
542  TString cmp( htarget.GetName() ); // chop off root directory and
543  cmp.Remove(0, cmp.First('/')+1); // file from histogram name
544  //prepare zip code
545  TString zip( htarget.GetName() ); // chop off histogram name keep
546  zip.Remove(zip.First('/'), zip.Length()); // file and directory
547  if( cmp.BeginsWith( buffer ) ){ //found target hist
548  //---------------------------------------------
549  // now fill the bins of the target hist
550  //---------------------------------------------
551  for(int kdx=0; kdx<htarget.GetNbinsX(); ++kdx){
552  TH1F& hfit = findFitHistogram(*hist, zip, cmp, kdx);
553  fillTargetHistogramBin(htarget, hfit, (kdx+1));
554  }
555  }
556  }
557  }
558  }
559 }
560 
561 void
563 {
564  //---------------------------------------------
565  // write filled target histogram to output file
566  // if specified
567  //---------------------------------------------
568  if( isOutputRequested() ){
569  //-----------------------------------------------
570  // open hist file for book keeping of hist names
571  //-----------------------------------------------
572  TString name( output_ );
573  name.Remove(name.Last('.'), name.Length());
574  name+=".hist"; //replace .root by .hist
575  ofstream histFile(name, std::ios::out);
576 
577  //-----------------------------------------------
578  // open root output file and create directory
579  // if necessary
580  //-----------------------------------------------
581  TFile file( output_.c_str(), "update" );
582  if( !file.GetDirectory(rootOutDir_.c_str()) )
583  // create new directory if it does not yet exist
584  file.mkdir( rootOutDir_.c_str(), rootOutDir_.c_str() );
585  else
586  // clean-up directory if it was existing already
587  (file.GetDirectory(rootOutDir_.c_str()))->Delete("*;*");
588  file.cd(rootOutDir_.c_str());
589 
590  // loop over requested target histogram labels if desired
591  for(unsigned int jdx=0; jdx<targetHistList_.size(); ++jdx){
592  TString buffer( targetHistList_[jdx] );
593  //-----------------------------------------------
594  // loop and write out histograms
595  //-----------------------------------------------
596  std::vector<TObjArray>::const_iterator hist = sampleList_.begin();
597  for( ;hist!=sampleList_.end(); ++hist){
598  for(int idx=0; idx<(int)histList_.size(); ++idx){
599  TString cmp( ((TH1F*)(*hist)[idx])->GetName() );
600  if( cmp.BeginsWith( buffer ) ){ //found target hist
601  histFile << ((TH1F*)(*hist)[idx])->GetName() << "\n";
602  ((TH1F*)(*hist)[idx])->Write();
603  }
604  } // end of histList_ loop
605  }
606  } // end of targetHistList_ loop
607  file.Close();
608  }
609 }
double spreadError(TH1F &hist)
Definition: CompMethods.h:23
double value(TH1F &hist)
Definition: CompMethods.h:44
void fitAndDrawPs()
Definition: FitHist.cc:314
const std::string & label
Definition: MVAComputer.cc:186
T read(const std::string &key) const
Definition: ConfigFile.h:173
double valueError(TH1F &hist)
Definition: CompMethods.h:21
void addBinLabelToFitHist(const TObjArray &, int &, TString &, TString &)
Definition: FitHist.cc:266
double valueError(TH1F &hist)
Definition: CompMethods.h:72
void configBlockFit(ConfigFile &)
Definition: FitHist.cc:9
void fitAndDrawEps()
Definition: FitHist.cc:414
TH1F & findFitHistogram(const TObjArray &, TString &, TString &, int &)
Definition: FitHist.cc:77
void writeFitOutput()
Definition: FitHist.cc:562
bool isInFitTargetList(std::string &)
Definition: FitHist.cc:59
double valueError(TH1F &hist)
Definition: CompMethods.h:45
double spreadError(TH1F &hist)
Definition: CompMethods.h:74
void readVector(std::string s, std::vector< T > &vec)
Definition: CompHist.h:23
static const char * Cal
Definition: FitHist_fwd.h:6
double value(TH1F &hist)
Definition: CompMethods.h:71
double valueError(TH1F &hist)
Definition: CompMethods.h:89
void addParLabelToFitHist(const TH1F &)
Definition: FitHist.cc:291
double spread(TH1F &hist)
Definition: CompMethods.h:22
tuple norm
Definition: lumiNorm.py:78
double value(TH1F &hist)
Definition: CompMethods.h:20
tuple text
Definition: runonSM.py:42
void fillTargetHistograms()
Definition: FitHist.cc:512
double normalize(TString &, double)
Definition: FitHist.cc:145
static const char * Sigma
Definition: FitHist_fwd.h:8
tuple out
Definition: dbtoconf.py:99
double value(TH1F &hist)
Definition: CompMethods.h:88
static const char * Fit
Definition: FitHist_fwd.h:5
static const char * Res
Definition: FitHist_fwd.h:7
void fillTargetHistogram(std::string &)
Definition: FitHist.cc:523
bool checkTargetHistList()
Definition: FitHist.cc:44
void setFitHistogramAxes(TH1F &, int)
Definition: FitHist.cc:242
TH1F & findTargetHistogram(const TObjArray &, TString &, TString &, TString &)
Definition: FitHist.cc:111
double spread(TH1F &hist)
Definition: CompMethods.h:90
tuple cout
Definition: gather_cfg.py:41
void fit(TH1F &)
Definition: CompMethods.cc:39
double spreadError(TH1F &hist)
Definition: CompMethods.h:91
double spreadError(TH1F &hist)
Definition: CompMethods.cc:92
double spread(TH1F &hist)
Definition: CompMethods.h:73
void fillTargetHistogramBin(TH1F &, TH1F &, int)
Definition: FitHist.cc:199
double spread(TH1F &hist)
Definition: CompMethods.h:46
static const char * Mean
Definition: FitHist_fwd.h:9