Fork me on GitHub

Changeset 153 in svn for trunk/interface


Ignore:
Timestamp:
Jan 7, 2009, 12:24:34 PM (16 years ago)
Author:
severine ovyn
Message:

used for publi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/FuncDef.h

    r91 r153  
    7979
    8080  string nom = histo.erase(0,histo.find(">>")+2);
    81   TH1F *h = new TH1F(nom.c_str(),"",50,-1,3);
    82 
     81  TH1F *h = new TH1F(nom.c_str(),"",100,0,3);
    8382  string all = min + " && " + max;
    8483  Analyze->Draw(temp.c_str(),all.c_str());
    8584  h->SetMarkerSize(0.6);
    8685  double MeanFix = h->GetMean();
    87   TF1 *Gauss = new TF1("Gauss","gaus",-1,3);
    88   Gauss->FixParameter(1,MeanFix);
     86  double RangMin = (h->GetMean()-2*h->GetRMS());
     87  double RangMax = (h->GetMean()+2*h->GetRMS());
     88  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
     89//  Gauss->FixParameter(1,MeanFix);
    8990  h->Fit("Gauss","QR");
    9091  h->Fit("Gauss","QRI");
     
    9293  Double_t* params = Gauss->GetParameters();
    9394  rms=params[2];
     95  //mean= MeanFix;
    9496  mean=params[1];
    9597  h->Draw("P");
    9698  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
    9799Gauss->Delete();
    98  
    99 }
    100 
    101 void GaussValuesETmis(TTree * Analyze,string histo,double &rms, string min,string max)
     100}
     101
     102void GaussValuesElec(TTree * Analyze,string histo,double &rms, double &mean, string min,string max)
    102103{
    103104  string temp = histo;
     
    106107
    107108  string nom = histo.erase(0,histo.find(">>")+2);
    108   TH1F *h = new TH1F(nom.c_str(),"",20,-100,100);
    109 
     109  TH1F *h = new TH1F(nom.c_str(),"",20,-1,3);
    110110  string all = min + " && " + max;
    111111  Analyze->Draw(temp.c_str(),all.c_str());
    112112  h->SetMarkerSize(0.6);
    113   double RangMin = h->GetMean()-h->GetRMS();
    114   double RangMax = h->GetMean()+h->GetRMS();
     113  double MeanFix = h->GetMean();
     114  TF1 *Gauss = new TF1("Gauss","gaus",-0.5,1.5);
     115  Gauss->FixParameter(1,MeanFix);
     116  h->Fit("Gauss","QR");
     117  h->Fit("Gauss","QRI");
     118  h->Fit("Gauss","QRI");
     119  Double_t* params = Gauss->GetParameters();
     120  rms=params[2];
     121  //mean= MeanFix;
     122  mean=params[1];
     123  h->Draw("P");
     124  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
     125  Gauss->Delete();
     126}
     127 
     128
     129
     130void GaussValuesETmis(TTree * Analyze,string histo,double &rms, string min,string max)
     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(),"",50,-50,50);
     138
     139  string all = min + " && " + max;
     140  Analyze->Draw(temp.c_str(),all.c_str());
     141  h->SetMarkerSize(0.6);
     142  double RangMin = (h->GetMean()-2*h->GetRMS());
     143  double RangMax = (h->GetMean()+2*h->GetRMS());
     144  //TF1 *Gauss = new TF1("Gauss","gaus");
    115145  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
    116146  //TF1 *Gauss = new TF1("Gauss","gaus");
Note: See TracChangeset for help on using the changeset viewer.