Fork me on GitHub

Changeset 486 in svn


Ignore:
Timestamp:
Jul 14, 2009, 3:23:30 PM (15 years ago)
Author:
Xavier Rouby
Message:

updates needed for atlas jet/met resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/FuncDef.h

    r478 r486  
    8383  Analyze->Draw(temp.c_str(),all.c_str());
    8484  h->SetMarkerSize(0.6);
    85   double MeanFix = h->GetMean();
     85  //double MeanFix = h->GetMean();
    8686  double RangMin = (h->GetMean()-1.5*h->GetRMS());
    8787  double RangMax = (h->GetMean()+1.5*h->GetRMS());
     
    101101
    102102
    103 void GaussValuesAsymmetry(TTree * Analyze,string histo, double &mean, string min,string max)
    104 {
    105   string temp = histo;
    106   string mintemp = min;
    107   string maxtemp = max;
    108 
    109   string nom = histo.erase(0,histo.find(">>")+2);
    110   TH1F *h = new TH1F(nom.c_str(),"",500,-10,40);
    111   string all = min + " && " + max;
     103void GaussValuesAsymmetry(TTree * Analyze,string histo, double &mean, string min,string max,string cut="1==1")
     104{
     105  string temp = histo;
     106  string mintemp = min;
     107  string maxtemp = max;
     108
     109  string nom = histo.erase(0,histo.find(">>")+2);
     110  TH1F *h = new TH1F(nom.c_str(),nom.c_str(),50,-3,3);
     111  //string all = min + " && " + max + " && abs(JetPTResol.Eta) < 0.5";
     112  string all = min + " && " + max + " && " + cut;
     113  Analyze->Draw(temp.c_str(),all.c_str());
     114  h->SetMarkerSize(0.6);
     115//  mean = h->GetMean();
     116    TF1 *Gauss = new TF1("Gauss","gaus",-0.4,0.4);
     117    //Gauss->FixParameter(1,MeanFix);
     118  h->Fit("Gauss","QR");
     119  h->Fit("Gauss","QRI");
     120  h->Fit("Gauss","QRI");
     121  Double_t* params = Gauss->GetParameters();
     122  mean=params[1];
     123  h->Draw("P");
     124  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
     125  Gauss->Delete();
     126//  double RangMin = (h->GetMean()-2*h->GetRMS());
     127//  double RangMax = (h->GetMean()+2*h->GetRMS());
     128}
     129
     130void GaussValuesAsymmetry2(TTree * Analyze,string histo, double &mean, string min,string max,string cut="1==1")
     131{
     132  string temp = histo;
     133  string mintemp = min;
     134  string maxtemp = max;
     135
     136  string nom = histo.erase(0,histo.find(">>")+2);
     137  TH1F *h = new TH1F(nom.c_str(),nom.c_str(),50,-3,3);
     138  string all = min + " && " + max + " && " + cut;
    112139  Analyze->Draw(temp.c_str(),all.c_str());
    113140  h->SetMarkerSize(0.6);
    114141  mean = h->GetMean();
    115   double RangMin = (h->GetMean()-2*h->GetRMS());
    116   double RangMax = (h->GetMean()+2*h->GetRMS());
    117 }
    118 
     142}
    119143
    120144
     
    160184  Analyze->Draw(temp.c_str(),all.c_str());
    161185  h->SetMarkerSize(0.6);
    162   double RangMin = (h->GetMean()-1.9*h->GetRMS());
    163   double RangMax = (h->GetMean()+1.9*h->GetRMS());
     186  double RangMin = (h->GetMean()-2.5*h->GetRMS());
     187  double RangMax = (h->GetMean()+2.5*h->GetRMS());
    164188  //TF1 *Gauss = new TF1("Gauss","gaus");
    165189  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
Note: See TracChangeset for help on using the changeset viewer.