laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauPrint.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2004 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
29 #include <iostream>
30 
31 #include "TMath.h"
32 
33 #include "LauPrint.hh"
34 
36 
37 
39 {
40 }
41 
43 {
44 }
45 
46 void LauPrint::printFormat(std::ostream& stream, Double_t value) const
47 {
48  // Print double value to a specified level of precision
49  char* string = new char[100];
50 
51  if (TMath::Abs(value) < 1e-30) {
52  sprintf(string, "%5.3f", 0.0);
53  } else if (TMath::Abs(value) < 0.01) {
54  sprintf(string, "%5.3e", value);
55  } else if (TMath::Abs(value) < 0.1) {
56  sprintf(string, "%5.3f", value);
57  } else {
58  sprintf(string, "%5.3f", value);
59  }
60 
61  stream<<string;
62 
63  delete[] string; string = 0;
64 }
65 
ClassImp(LauAbsCoeffSet)
File containing declaration of LauPrint class.
Class to define various output print commands.
Definition: LauPrint.hh:43
virtual ~LauPrint()
Destructor.
Definition: LauPrint.cc:42
void printFormat(std::ostream &stream, Double_t value) const
Method to choose the printing format to a specified level of precision.
Definition: LauPrint.cc:46
Double_t value() const
The value of the parameter.