Changeset 153 in svn for trunk/interface/FuncDef.h
- Timestamp:
- Jan 7, 2009, 12:24:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/FuncDef.h
r91 r153 79 79 80 80 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); 83 82 string all = min + " && " + max; 84 83 Analyze->Draw(temp.c_str(),all.c_str()); 85 84 h->SetMarkerSize(0.6); 86 85 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); 89 90 h->Fit("Gauss","QR"); 90 91 h->Fit("Gauss","QRI"); … … 92 93 Double_t* params = Gauss->GetParameters(); 93 94 rms=params[2]; 95 //mean= MeanFix; 94 96 mean=params[1]; 95 97 h->Draw("P"); 96 98 h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]"); 97 99 Gauss->Delete(); 98 99 } 100 101 void GaussValuesETmis(TTree * Analyze,string histo,double &rms, string min,string max) 100 } 101 102 void GaussValuesElec(TTree * Analyze,string histo,double &rms, double &mean, string min,string max) 102 103 { 103 104 string temp = histo; … … 106 107 107 108 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); 110 110 string all = min + " && " + max; 111 111 Analyze->Draw(temp.c_str(),all.c_str()); 112 112 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 130 void 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"); 115 145 TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax); 116 146 //TF1 *Gauss = new TF1("Gauss","gaus");
Note:
See TracChangeset
for help on using the changeset viewer.