Logo ROOT   6.18/05
Reference Guide
Channel.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_CHANNEL_H
12#define HISTFACTORY_CHANNEL_H
13
14#include <string>
15#include <fstream>
16#include <iostream>
17
18
22
23namespace RooStats{
24namespace HistFactory {
25
26class Channel {
27
28
29public:
30 friend class Measurement;
31
32 Channel();
33 Channel(const Channel& other);
34 Channel(std::string Name, std::string InputFile="");
35
36 /// set name of channel
37 void SetName( const std::string& Name ) { fName = Name; }
38 /// get name of channel
39 std::string GetName() { return fName; }
40 /// set name of input file containing histograms
41 void SetInputFile( const std::string& file ) { fInputFile = file; }
42 /// get name of input file
43 std::string GetInputFile() { return fInputFile; }
44 /// set path for histograms in input file
45 void SetHistoPath( const std::string& file ) { fHistoPath = file; }
46 /// get path to histograms in input file
47 std::string GetHistoPath() { return fHistoPath; }
48
49 /// set data object
50 void SetData( const RooStats::HistFactory::Data& data ) { fData = data; }
51 void SetData( std::string HistoName, std::string InputFile, std::string HistoPath="" );
52 void SetData( double Val );
53 void SetData( TH1* hData );
54 /// get data object
56
57 /// add additional data object
58 void AddAdditionalData( const RooStats::HistFactory::Data& data ) { fAdditionalData.push_back(data); }
59 /// retrieve vector of additional data objects
60 std::vector<RooStats::HistFactory::Data>& GetAdditionalData() { return fAdditionalData; }
61
62 void SetStatErrorConfig( double RelErrorThreshold, Constraint::Type ConstraintType );
63 void SetStatErrorConfig( double RelErrorThreshold, std::string ConstraintType );
64 /// define treatment of statistical uncertainties
66 /// get information about threshold for statistical uncertainties and constraint term
68
70 /// get vector of samples for this channel
71 std::vector< RooStats::HistFactory::Sample >& GetSamples() { return fSamples; }
72
73 void Print(std::ostream& = std::cout);
74 void PrintXML( std::string Directory, std::string Prefix="" );
75
76 void CollectHistograms();
77 bool CheckHistograms();
78
79protected:
80
81 std::string fName;
82 std::string fInputFile;
83 std::string fHistoPath;
84
86
87 /// One can add additional datasets
88 /// These are simply added to the xml under a different name
89 std::vector<RooStats::HistFactory::Data> fAdditionalData;
90
92
93 std::vector< RooStats::HistFactory::Sample > fSamples;
94
95 /// Open a file and copy a histogram
96 TH1* GetHistogram( std::string InputFile, std::string HistoPath, std::string HistoName );
97
98
99};
100
101 extern Channel BadChannel;
102
103} // namespace HistFactory
104} // namespace RooStats
105
106#endif
This class encapsulates all information for the statistical interpretation of one experiment.
Definition: Channel.h:26
HistFactory::Data fData
Definition: Channel.h:85
std::string GetInputFile()
get name of input file
Definition: Channel.h:43
void SetName(const std::string &Name)
set name of channel
Definition: Channel.h:37
std::vector< RooStats::HistFactory::Data > fAdditionalData
One can add additional datasets These are simply added to the xml under a different name.
Definition: Channel.h:89
std::string GetHistoPath()
get path to histograms in input file
Definition: Channel.h:47
std::vector< RooStats::HistFactory::Data > & GetAdditionalData()
retrieve vector of additional data objects
Definition: Channel.h:60
void Print(std::ostream &=std::cout)
Definition: Channel.cxx:73
HistFactory::StatErrorConfig & GetStatErrorConfig()
get information about threshold for statistical uncertainties and constraint term
Definition: Channel.h:67
TH1 * GetHistogram(std::string InputFile, std::string HistoPath, std::string HistoName)
Open a file and copy a histogram.
Definition: Channel.cxx:449
RooStats::HistFactory::Data & GetData()
get data object
Definition: Channel.h:55
void AddAdditionalData(const RooStats::HistFactory::Data &data)
add additional data object
Definition: Channel.h:58
void PrintXML(std::string Directory, std::string Prefix="")
Definition: Channel.cxx:103
HistFactory::StatErrorConfig fStatErrorConfig
Definition: Channel.h:91
void SetData(const RooStats::HistFactory::Data &data)
set data object
Definition: Channel.h:50
void SetInputFile(const std::string &file)
set name of input file containing histograms
Definition: Channel.h:41
void AddSample(RooStats::HistFactory::Sample sample)
Definition: Channel.cxx:65
std::string GetName()
get name of channel
Definition: Channel.h:39
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
Definition: Channel.cxx:201
std::vector< RooStats::HistFactory::Sample > fSamples
Definition: Channel.h:93
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
Definition: Channel.h:71
void SetHistoPath(const std::string &file)
set path for histograms in input file
Definition: Channel.h:45
void SetStatErrorConfig(RooStats::HistFactory::StatErrorConfig Config)
define treatment of statistical uncertainties
Definition: Channel.h:65
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
Definition: Measurement.h:30
Configuration to automatically assign nuisance parameters for the statistical error of the Monte Carl...
Definition: Systematics.h:367
The TH1 histogram class.
Definition: TH1.h:56
Namespace for the RooStats classes.
Definition: Asimov.h:20
Definition: file.py:1
const char * Name
Definition: TXMLSetup.cxx:66
static int Prefix[TSIZE]
Definition: gifdecode.c:12