Logo ROOT   6.12/07
Reference Guide
Data.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: George Lewis, Kyle Cranmer
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 #ifndef HISTFACTORY_DATA_H
12 #define HISTFACTORY_DATA_H
13 
14 #include <string>
15 #include <fstream>
16 #include <iostream>
17 
18 //#include "RooStats/HistFactory/HistCollector.h"
20 
21 namespace RooStats{
22 namespace HistFactory {
23 
24 class Data {
25 
26 public:
27  //friend class Channel;
28 
29  Data();
30  Data( const Data& other );
31  /// constructor from name, file and path. Name of the histogram should not include the path
32  Data( std::string HistoName, std::string InputFile, std::string HistoPath="" );
33 
34  std::string GetName() { return fName; }
35  void SetName(const std::string& name) { fName=name; }
36 
37  void SetInputFile(const std::string& InputFile) { fInputFile = InputFile; }
38  std::string GetInputFile() { return fInputFile; }
39 
40  void SetHistoName(const std::string& HistoName) { fHistoName = HistoName; }
41  std::string GetHistoName() { return fHistoName; }
42 
43  void SetHistoPath(const std::string& HistoPath) { fHistoPath = HistoPath; }
44  std::string GetHistoPath() { return fHistoPath; }
45 
46  void Print(std::ostream& = std::cout);
47  void PrintXML( std::ostream& );
48  void writeToFile( std::string FileName, std::string DirName );
49 
50  TH1* GetHisto();
51  void SetHisto(TH1* Hist) { fhData = Hist; fHistoName=Hist->GetName(); }
52 
53 protected:
54 
55  std::string fName;
56 
57  std::string fInputFile;
58  std::string fHistoName;
59  std::string fHistoPath;
60 
61 
62  // The Data Histogram
64 
65 
66 };
67 
68 }
69 }
70 
71 
72 #endif
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void SetHistoName(const std::string &HistoName)
Definition: Data.h:40
std::string GetName()
Definition: Data.h:34
void SetInputFile(const std::string &InputFile)
Definition: Data.h:37
std::string GetHistoName()
Definition: Data.h:41
std::string GetInputFile()
Definition: Data.h:38
void PrintXML(std::ostream &)
Definition: Data.cxx:77
void SetName(const std::string &name)
Definition: Data.h:35
void writeToFile(std::string FileName, std::string DirName)
Definition: Data.cxx:57
void SetHisto(TH1 *Hist)
Definition: Data.h:51
std::string fHistoPath
Definition: Data.h:59
void SetHistoPath(const std::string &HistoPath)
Definition: Data.h:43
std::string fInputFile
Definition: Data.h:57
std::string fHistoName
Definition: Data.h:58
std::string GetHistoPath()
Definition: Data.h:44
Namespace for the RooStats classes.
Definition: Asimov.h:20
The TH1 histogram class.
Definition: TH1.h:56
void Print(std::ostream &=std::cout)
Definition: Data.cxx:46
char name[80]
Definition: TGX11.cxx:109
std::string fName
Definition: Data.h:55