Logo ROOT  
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
24RooStats::HistFactory::Data::Data( std::string HistoName, std::string InputFile,
25 std::string HistoPath ) :
26 fInputFile( InputFile ), fHistoName( HistoName ), fHistoPath( HistoPath ) {;}
27
29 return (TH1*) fhData.GetObject();
30}
31
32
33void RooStats::HistFactory::Data::Print( std::ostream& stream ) {
34
35
36 stream << "\t \t InputFile: " << fInputFile
37 << "\t HistoName: " << fHistoName
38 << "\t HistoPath: " << fHistoPath
39 << "\t HistoAddress: " << GetHisto()
40 << std::endl;
41
42}
43
44void RooStats::HistFactory::Data::writeToFile( std::string OutputFileName, std::string DirName ) {
45
46 TH1* histData = GetHisto();
47
48 if( histData != NULL) {
49
50 histData->Write();
51
52 // Set the location of the data
53 // in the output measurement
54
55 fInputFile = OutputFileName;
56 fHistoName = histData->GetName();
57 fHistoPath = DirName;
58
59 }
60
61}
62
63
64void RooStats::HistFactory::Data::PrintXML( std::ostream& xml ) {
65
66 xml << " <Data HistoName=\"" << GetHistoName() << "\" "
67 << "InputFile=\"" << GetInputFile() << "\" "
68 << "HistoPath=\"" << GetHistoPath() << "\" "
69 << " /> " << std::endl << std::endl;
70
71}
void PrintXML(std::ostream &)
Definition: Data.cxx:64
void Print(std::ostream &=std::cout)
Definition: Data.cxx:33
void writeToFile(std::string FileName, std::string DirName)
Definition: Data.cxx:44
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:796
TH1 * GetHisto(TFile *inFile, const std::string name)
Definition: Helper.cxx:115