Changeset 486 in svn for trunk/interface
- Timestamp:
- Jul 14, 2009, 3:23:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/FuncDef.h
r478 r486 83 83 Analyze->Draw(temp.c_str(),all.c_str()); 84 84 h->SetMarkerSize(0.6); 85 double MeanFix = h->GetMean();85 //double MeanFix = h->GetMean(); 86 86 double RangMin = (h->GetMean()-1.5*h->GetRMS()); 87 87 double RangMax = (h->GetMean()+1.5*h->GetRMS()); … … 101 101 102 102 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; 103 void 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 130 void 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; 112 139 Analyze->Draw(temp.c_str(),all.c_str()); 113 140 h->SetMarkerSize(0.6); 114 141 mean = h->GetMean(); 115 double RangMin = (h->GetMean()-2*h->GetRMS()); 116 double RangMax = (h->GetMean()+2*h->GetRMS()); 117 } 118 142 } 119 143 120 144 … … 160 184 Analyze->Draw(temp.c_str(),all.c_str()); 161 185 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()); 164 188 //TF1 *Gauss = new TF1("Gauss","gaus"); 165 189 TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
Note:
See TracChangeset
for help on using the changeset viewer.