laura is hosted by Hepforge, IPPP Durham
Laura++  v1r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauPrint.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2004 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
15 #include <iostream>
16 
17 #include "TMath.h"
18 
19 #include "LauPrint.hh"
20 
21 ClassImp(LauPrint)
22 
23 
25 {
26 }
27 
29 {
30 }
31 
32 void LauPrint::printFormat(std::ostream& stream, Double_t value) const
33 {
34  // Print double value to a specified level of precision
35  char* string = new char[100];
36 
37  if (TMath::Abs(value) < 1e-30) {
38  sprintf(string, "%5.3f", 0.0);
39  } else if (TMath::Abs(value) < 0.01) {
40  sprintf(string, "%5.3e", value);
41  } else if (TMath::Abs(value) < 0.1) {
42  sprintf(string, "%5.3f", value);
43  } else {
44  sprintf(string, "%5.3f", value);
45  }
46 
47  stream<<string;
48 
49  delete[] string; string = 0;
50 }
51 
File containing declaration of LauPrint class.
Class to define various output print commands.
Definition: LauPrint.hh:29
virtual ~LauPrint()
Destructor.
Definition: LauPrint.cc:28
void printFormat(std::ostream &stream, Double_t value) const
Method to choose the printing format to a specified level of precision.
Definition: LauPrint.cc:32
Double_t value() const
The value of the parameter.