ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/UpperLimitsWithShape.C
(Generate patch)

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/UpperLimitsWithShape.C (file contents):
Revision 1.2 by buchmann, Fri Jul 8 06:25:51 2011 UTC vs.
Revision 1.3 by buchmann, Wed Jul 20 08:51:33 2011 UTC

# Line 29 | Line 29 | g++ ShapeFit.C -o ShapeFit.exec `root-co
29   using namespace std;
30  
31   void check_compatibility_with_zero(Value sigresult, ofstream &file) {
32 <  cout << "Checking compatibility with zero for f=" << sigresult << endl;
33 <  cout << "   The result is compatible with zero to " << 1-(TMath::Erf((sigresult.getValue()/(TMath::Sqrt(2)*sigresult.getError())))) << endl;
32 >  dout << "Checking compatibility with zero for f=" << sigresult << endl;
33 >  dout << "   The result is compatible with zero to " << 1-(TMath::Erf((sigresult.getValue()/(TMath::Sqrt(2)*sigresult.getError())))) << endl;
34    file << "Checking compatibility with zero for f=" << sigresult << endl;
35    file << "   The result is compatible with zero to " << 1-(TMath::Erf((sigresult.getValue()/(TMath::Sqrt(2)*sigresult.getError())))) << endl;
36    
# Line 184 | Line 184 | vector<float> establish_upper_limits(TH1
184    Value SMresult(mean[0],error[0]);
185    fit->GetResult(1,mean[1],error[1]);
186    Value sigresult(mean[1],error[1]);
187 <  cout << "Parameters: " << mean[0] << " , " << mean[1] << endl;
187 >  dout << "Parameters: " << mean[0] << " , " << mean[1] << endl;
188    if(mean[0]<0||mean[1]<0) {
189 <    cout << "Fitting failed, one of the parameters is negative !!!!" << endl;
189 >    dout << "Fitting failed, one of the parameters is negative !!!!" << endl;
190      return results;
191    }
192    
# Line 201 | Line 201 | vector<float> establish_upper_limits(TH1
201    
202    Value stretchsm  = SMresult/ofacsm;
203    Value stretchsig = sigresult/ofac;
204 <  cout << "Data consists of: " << endl;
205 <  cout << "   SM : " << SMresult << endl;
206 <  cout << "   signal: " << sigresult << endl;
207 <  cout << "This means that the components have been scaled by: " << endl;
208 <  cout << "   SM: has been stretched by " << (mean[0])/originalfactorSM << " "<< stretchsm<<endl;
209 <  cout << "   Signal: has been stretched by " << (mean[1])/originalfactor <<  " "<< stretchsig<<endl;
204 >  dout << "Data consists of: " << endl;
205 >  dout << "   SM : " << SMresult << endl;
206 >  dout << "   signal: " << sigresult << endl;
207 >  dout << "This means that the components have been scaled by: " << endl;
208 >  dout << "   SM: has been stretched by " << (mean[0])/originalfactorSM << " "<< stretchsm<<endl;
209 >  dout << "   Signal: has been stretched by " << (mean[1])/originalfactor <<  " "<< stretchsig<<endl;
210    
211    file << "------------------------------------------"<<endl;
212    file << "Now considering: Everything pertaining to " << filename << endl;
# Line 222 | Line 222 | vector<float> establish_upper_limits(TH1
222    check_compatibility_with_zero(sigresult,file);
223    //vector<float> results = compute_sigmas(signal,(mean[1])/originalfactor);
224    
225 <  cout << "\\Chi^2 / ndf = " << fit->GetChisquare() << "/" << fit->GetNDF() << endl;
225 >  dout << "\\Chi^2 / ndf = " << fit->GetChisquare() << "/" << fit->GetNDF() << endl;
226    
227    results.push_back(compute_upper_limit_based_on_fit(sigresult,ofac,0));
228    results.push_back(compute_upper_limit_based_on_fit(sigresult,ofac,1));
229    results.push_back(compute_upper_limit_based_on_fit(sigresult,ofac,2));
230    results.push_back(compute_upper_limit_based_on_fit(sigresult,ofac,3));
231    
232 <  cout << "Limits: (in terms of x prediction) " << endl;
232 >  dout << "Limits: (in terms of x prediction) " << endl;
233    file << "Limits: (in terms of x prediction) " << endl;
234    for (int i=0;i<=3;i++) {
235 <    cout << i << " sigma : " << results[i] << endl;
235 >    dout << i << " sigma : " << results[i] << endl;
236      file << i << " sigma : " << results[i] << endl;
237    }
238      
239    
240 <  cout << endl << endl;
240 >  dout << endl << endl;
241    file << endl << endl;
242    
243    if(results[3]<1) {
244 <    cout << "The point has been excluded, since the upper limit corresponding to 3 sigma, " << results[3] << " is < 1" << endl;
244 >    dout << "The point has been excluded, since the upper limit corresponding to 3 sigma, " << results[3] << " is < 1" << endl;
245      file << "The point has been excluded, since the upper limit corresponding to 3 sigma, " << results[3] << " is < 1" << endl;
246      //the ANSII code below will make an X for the excluded point (to celebrate)
247 <    cout << "          __   __" << endl;
248 <    cout << "          \\ \\ / /" << endl;
249 <    cout << "           \\ V / " << endl;
250 <    cout << "           /   \\ " << endl;
251 <    cout << "          / /^\\ \\" << endl;
252 <    cout << "          \\/   \\/" << endl;
247 >    dout << "          __   __" << endl;
248 >    dout << "          \\ \\ / /" << endl;
249 >    dout << "           \\ V / " << endl;
250 >    dout << "           /   \\ " << endl;
251 >    dout << "          / /^\\ \\" << endl;
252 >    dout << "          \\/   \\/" << endl;
253      
254      file << "          __   __" << endl;
255      file << "          \\ \\ / /" << endl;
# Line 261 | Line 261 | vector<float> establish_upper_limits(TH1
261  
262    }
263    else {
264 <    cout << "The 3 sigma limit on this point is " << results[3] << " x prediction" << endl;
264 >    dout << "The 3 sigma limit on this point is " << results[3] << " x prediction" << endl;
265      file << "The point has been excluded, since " << results[3] << " x prediction" << endl;
266    }
267      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines