Fork me on GitHub

Changeset 27 in svn for trunk/interface


Ignore:
Timestamp:
Nov 13, 2008, 9:43:35 AM (16 years ago)
Author:
severine ovyn
Message:

Jet resol OK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/FuncDef.h

    r23 r27  
    7272}
    7373
    74 void GaussValues(TTree * Analyze,string histo,double &rms, double &mean, string min, string max)
     74void GaussValues(TTree * Analyze,string histo,double &rms, double &mean, string min,string max)
    7575{
    7676  string temp = histo;
     
    7979
    8080  string nom = histo.erase(0,histo.find(">>")+2);
    81   TH1F *h = new TH1F(nom.c_str(),"",100,0,2);
    82   Analyze->Draw(temp.c_str(),mintemp.c_str(),maxtemp.c_str());
     81  TH1F *h = new TH1F(nom.c_str(),"",200,0,3);
     82
     83  string all = min + " && " + max;
     84  Analyze->Draw(temp.c_str(),all.c_str());
    8385  h->SetMarkerSize(0.6);
     86//  double MeanFix = ;
    8487  double MeanFix = h->GetMean();
    8588  double RangMin = h->GetMean()-h->GetRMS();
    8689  double RangMax = h->GetMean()+h->GetRMS();
    87   TF1 *Gauss = new TF1("Gauss","gausn",RangMin,RangMax);
     90  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
    8891  Gauss->FixParameter(1,MeanFix);
    8992  h->Fit("Gauss","R");
     
    9598  h->Draw("P");
    9699  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
    97 }
     100Gauss->Delete();
     101 
     102}
     103
     104void GaussValuesETmis(TTree * Analyze,string histo,double &rms, double &mean, string min,string max)
     105{
     106  string temp = histo;
     107  string mintemp = min;
     108  string maxtemp = max;
     109
     110  string nom = histo.erase(0,histo.find(">>")+2);
     111  TH1F *h = new TH1F(nom.c_str(),"",50,-300,300);
     112
     113  string all = min + " && " + max;
     114  Analyze->Draw(temp.c_str(),all.c_str());
     115  h->SetMarkerSize(0.6);
     116  double RangMin = h->GetMean()-h->GetRMS();
     117  double RangMax = h->GetMean()+h->GetRMS();
     118  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
     119  h->Fit("Gauss","R");
     120  h->Fit("Gauss","RI");
     121  h->Fit("Gauss","RI");
     122  Double_t* params = Gauss->GetParameters();
     123  rms=params[2];
     124  mean=params[1];
     125  h->Draw("P");
     126  h->GetXaxis()->SetTitle("E_{T}^{rec}-E_{T}^{MC} [GeV]");
     127}
     128
    98129
    99130TH1F * HiggsMakeNormTH1F(Float_t Scale, Int_t numBin,Float_t minX,Float_t maxX, TTree * Analyze,string histo, Int_t Lcolor, Int_t Fcolor, Int_t Lstyle,Int_t width=2,bool Log=false)
Note: See TracChangeset for help on using the changeset viewer.