Logo ROOT   6.08/07
Reference Guide
Data.cxx
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer, George Lewis
3 /*************************************************************************
4  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 ////////////////////////////////////////////////////////////////////////////////
12 
13 /*
14 BEGIN_HTML
15 <p>
16 </p>
17 END_HTML
18 */
19 //
20 
21 
23 
24 
26  ;
27 }
28 
30  fName( other.fName ),
31  fInputFile( other.fInputFile ),
32  fHistoName( other.fHistoName ),
33  fHistoPath( other.fHistoPath ),
34  fhData( other.fhData )
35 { ; }
36 
37 RooStats::HistFactory::Data::Data( std::string HistoName, std::string InputFile,
38  std::string HistoPath ) :
39  fInputFile( InputFile ), fHistoName( HistoName ), fHistoPath( HistoPath ) {;}
40 
42  return (TH1*) fhData.GetObject();
43 }
44 
45 
46 void RooStats::HistFactory::Data::Print( std::ostream& stream ) {
47 
48 
49  stream << "\t \t InputFile: " << fInputFile
50  << "\t HistoName: " << fHistoName
51  << "\t HistoPath: " << fHistoPath
52  << "\t HistoAddress: " << GetHisto()
53  << std::endl;
54 
55 }
56 
57 void RooStats::HistFactory::Data::writeToFile( std::string OutputFileName, std::string DirName ) {
58 
59  TH1* histData = GetHisto();
60 
61  if( histData != NULL) {
62 
63  histData->Write();
64 
65  // Set the location of the data
66  // in the output measurement
67 
68  fInputFile = OutputFileName;
69  fHistoName = histData->GetName();
70  fHistoPath = DirName;
71 
72  }
73 
74 }
75 
76 
77 void RooStats::HistFactory::Data::PrintXML( std::ostream& xml ) {
78 
79  xml << " <Data HistoName=\"" << GetHistoName() << "\" "
80  << "InputFile=\"" << GetInputFile() << "\" "
81  << "HistoPath=\"" << GetHistoPath() << "\" "
82  << " /> " << std::endl << std::endl;
83 
84 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:830
std::string GetHistoName()
Definition: Data.h:41
std::string GetInputFile()
Definition: Data.h:38
void PrintXML(std::ostream &)
Definition: Data.cxx:77
void writeToFile(std::string FileName, std::string DirName)
Definition: Data.cxx:57
std::string fHistoPath
Definition: Data.h:59
std::string fInputFile
Definition: Data.h:57
std::string fHistoName
Definition: Data.h:58
std::string GetHistoPath()
Definition: Data.h:44
The TH1 histogram class.
Definition: TH1.h:80
void Print(std::ostream &=std::cout)
Definition: Data.cxx:46
#define NULL
Definition: Rtypes.h:82
std::string fName
Definition: Data.h:55