Logo ROOT   6.16/01
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/** \class RooStats::HistFactory::Data
13 * \ingroup HistFactory
14*/
15
16
18
19
21 ;
22}
23
25 fName( other.fName ),
26 fInputFile( other.fInputFile ),
27 fHistoName( other.fHistoName ),
28 fHistoPath( other.fHistoPath ),
29 fhData( other.fhData )
30{ ; }
31
32RooStats::HistFactory::Data::Data( std::string HistoName, std::string InputFile,
33 std::string HistoPath ) :
34 fInputFile( InputFile ), fHistoName( HistoName ), fHistoPath( HistoPath ) {;}
35
37 return (TH1*) fhData.GetObject();
38}
39
40
41void RooStats::HistFactory::Data::Print( std::ostream& stream ) {
42
43
44 stream << "\t \t InputFile: " << fInputFile
45 << "\t HistoName: " << fHistoName
46 << "\t HistoPath: " << fHistoPath
47 << "\t HistoAddress: " << GetHisto()
48 << std::endl;
49
50}
51
52void RooStats::HistFactory::Data::writeToFile( std::string OutputFileName, std::string DirName ) {
53
54 TH1* histData = GetHisto();
55
56 if( histData != NULL) {
57
58 histData->Write();
59
60 // Set the location of the data
61 // in the output measurement
62
63 fInputFile = OutputFileName;
64 fHistoName = histData->GetName();
65 fHistoPath = DirName;
66
67 }
68
69}
70
71
72void RooStats::HistFactory::Data::PrintXML( std::ostream& xml ) {
73
74 xml << " <Data HistoName=\"" << GetHistoName() << "\" "
75 << "InputFile=\"" << GetInputFile() << "\" "
76 << "HistoPath=\"" << GetHistoPath() << "\" "
77 << " /> " << std::endl << std::endl;
78
79}
void PrintXML(std::ostream &)
Definition: Data.cxx:72
void Print(std::ostream &=std::cout)
Definition: Data.cxx:41
void writeToFile(std::string FileName, std::string DirName)
Definition: Data.cxx:52
The TH1 histogram class.
Definition: TH1.h:56
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
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:785
TH1 * GetHisto(TFile *inFile, const std::string name)
Definition: Helper.cxx:115