Changeset 27 in svn for trunk/interface
- Timestamp:
- Nov 13, 2008, 9:43:35 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/FuncDef.h
r23 r27 72 72 } 73 73 74 void GaussValues(TTree * Analyze,string histo,double &rms, double &mean, string min, 74 void GaussValues(TTree * Analyze,string histo,double &rms, double &mean, string min,string max) 75 75 { 76 76 string temp = histo; … … 79 79 80 80 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()); 83 85 h->SetMarkerSize(0.6); 86 // double MeanFix = ; 84 87 double MeanFix = h->GetMean(); 85 88 double RangMin = h->GetMean()-h->GetRMS(); 86 89 double RangMax = h->GetMean()+h->GetRMS(); 87 TF1 *Gauss = new TF1("Gauss","gaus n",RangMin,RangMax);90 TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax); 88 91 Gauss->FixParameter(1,MeanFix); 89 92 h->Fit("Gauss","R"); … … 95 98 h->Draw("P"); 96 99 h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]"); 97 } 100 Gauss->Delete(); 101 102 } 103 104 void 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 98 129 99 130 TH1F * 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.