Logo ROOT  
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
17
18#include <string>
19#include <fstream>
20#include <iostream>
21#include <map>
22#include <memory>
23#include <vector>
24
25class TFile;
26
27namespace RooStats{
28namespace HistFactory {
29
30class Channel {
31
32
33public:
34 friend class Measurement;
35
36 Channel();
37 Channel(const Channel& other);
38 Channel(std::string Name, std::string InputFile="");
39
40 /// set name of channel
41 void SetName( const std::string& Name ) { fName = Name; }
42 /// get name of channel
43 std::string GetName() const { return fName; }
44 /// set name of input file containing histograms
45 void SetInputFile( const std::string& file ) { fInputFile = file; }
46 /// get name of input file
47 std::string GetInputFile() const { return fInputFile; }
48 /// set path for histograms in input file
49 void SetHistoPath( const std::string& file ) { fHistoPath = file; }
50 /// get path to histograms in input file
51 std::string GetHistoPath() const { return fHistoPath; }
52
53 /// set data object
55 void SetData( std::string HistoName, std::string InputFile, std::string HistoPath="" );
56 void SetData( double Val );
57 void SetData( TH1* hData );
58 /// get data object
60 const RooStats::HistFactory::Data& GetData() const { return fData; }
61
62 /// add additional data object
64 /// retrieve vector of additional data objects
65 std::vector<RooStats::HistFactory::Data>& GetAdditionalData() { return fAdditionalData; }
66
67 void SetStatErrorConfig( double RelErrorThreshold, Constraint::Type ConstraintType );
68 void SetStatErrorConfig( double RelErrorThreshold, std::string ConstraintType );
69 /// define treatment of statistical uncertainties
71 /// get information about threshold for statistical uncertainties and constraint term
74
76 /// get vector of samples for this channel
77 std::vector< RooStats::HistFactory::Sample >& GetSamples() { return fSamples; }
78 const std::vector< RooStats::HistFactory::Sample >& GetSamples() const { return fSamples; }
79
80 void Print(std::ostream& = std::cout);
81 void PrintXML( std::string const& directory, std::string const& prefix="" ) const;
82
83 void CollectHistograms();
84 bool CheckHistograms() const;
85
86protected:
87
88 std::string fName;
89 std::string fInputFile;
90 std::string fHistoPath;
91
93
94 /// One can add additional datasets
95 /// These are simply added to the xml under a different name
96 std::vector<RooStats::HistFactory::Data> fAdditionalData;
97
99
100 std::vector< RooStats::HistFactory::Sample > fSamples;
101
102 TH1* GetHistogram( std::string InputFile, std::string HistoPath, std::string HistoName, std::map<std::string, std::unique_ptr<TFile>>& lsof);
103};
104
105 extern Channel BadChannel;
106
107} // namespace HistFactory
108} // namespace RooStats
109
110#endif
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
This class encapsulates all information for the statistical interpretation of one experiment.
Definition: Channel.h:30
HistFactory::Data fData
Definition: Channel.h:92
void SetName(const std::string &Name)
set name of channel
Definition: Channel.h:41
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:96
const RooStats::HistFactory::Data & GetData() const
Definition: Channel.h:60
std::vector< RooStats::HistFactory::Data > & GetAdditionalData()
retrieve vector of additional data objects
Definition: Channel.h:65
void Print(std::ostream &=std::cout)
Definition: Channel.cxx:75
const HistFactory::StatErrorConfig & GetStatErrorConfig() const
Definition: Channel.h:73
HistFactory::StatErrorConfig & GetStatErrorConfig()
get information about threshold for statistical uncertainties and constraint term
Definition: Channel.h:72
RooStats::HistFactory::Data & GetData()
get data object
Definition: Channel.h:59
void AddAdditionalData(const RooStats::HistFactory::Data &data)
add additional data object
Definition: Channel.h:63
std::string GetInputFile() const
get name of input file
Definition: Channel.h:47
HistFactory::StatErrorConfig fStatErrorConfig
Definition: Channel.h:98
std::string GetHistoPath() const
get path to histograms in input file
Definition: Channel.h:51
void SetData(const RooStats::HistFactory::Data &data)
set data object
Definition: Channel.h:54
void SetInputFile(const std::string &file)
set name of input file containing histograms
Definition: Channel.h:45
void AddSample(RooStats::HistFactory::Sample sample)
Definition: Channel.cxx:67
TH1 * GetHistogram(std::string InputFile, std::string HistoPath, std::string HistoName, std::map< std::string, std::unique_ptr< TFile > > &lsof)
Open a file and copy a histogram.
Definition: Channel.cxx:458
const std::vector< RooStats::HistFactory::Sample > & GetSamples() const
Definition: Channel.h:78
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
Definition: Channel.cxx:199
std::vector< RooStats::HistFactory::Sample > fSamples
Definition: Channel.h:100
void PrintXML(std::string const &directory, std::string const &prefix="") const
Definition: Channel.cxx:105
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
Definition: Channel.h:77
void SetHistoPath(const std::string &file)
set path for histograms in input file
Definition: Channel.h:49
void SetStatErrorConfig(RooStats::HistFactory::StatErrorConfig Config)
define treatment of statistical uncertainties
Definition: Channel.h:70
std::string GetName() const
get name of channel
Definition: Channel.h:43
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
Definition: Measurement.h:31
Configuration to automatically assign nuisance parameters for the statistical error of the Monte Carl...
Definition: Systematics.h:372
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
@ HistFactory
Definition: RooGlobalFunc.h:63
Namespace for the RooStats classes.
Definition: Asimov.h:19
Definition: file.py:1
const char * Name
Definition: TXMLSetup.cxx:67