Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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  /// constructor from name, file and path. Name of the histogram should not include the path
31  Data( std::string HistoName, std::string InputFile, std::string HistoPath="" );
32 
33  std::string GetName() { return fName; }
34  void SetName(const std::string& name) { fName=name; }
35 
36  void SetInputFile(const std::string& InputFile) { fInputFile = InputFile; }
37  std::string GetInputFile() { return fInputFile; }
38 
39  void SetHistoName(const std::string& HistoName) { fHistoName = HistoName; }
40  std::string GetHistoName() { return fHistoName; }
41 
42  void SetHistoPath(const std::string& HistoPath) { fHistoPath = HistoPath; }
43  std::string GetHistoPath() { return fHistoPath; }
44 
45  void Print(std::ostream& = std::cout);
46  void PrintXML( std::ostream& );
47  void writeToFile( std::string FileName, std::string DirName );
48 
49  TH1* GetHisto();
50  void SetHisto(TH1* Hist) { fhData = Hist; fHistoName=Hist->GetName(); }
51 
52 protected:
53 
54  std::string fName;
55 
56  std::string fInputFile;
57  std::string fHistoName;
58  std::string fHistoPath;
59 
60 
61  // The Data Histogram
62  HistRef fhData;
63 
64 
65 };
66 
67 }
68 }
69 
70 
71 #endif