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
24class TFile;
25
26namespace RooStats{
27namespace HistFactory {
28
29class Channel {
30
31
32public:
33 friend class Measurement;
34
35 Channel();
36 Channel(const Channel& other);
37 Channel(std::string Name, std::string InputFile="");
38
39 /// set name of channel
40 void SetName( const std::string& Name ) { fName = Name; }
41 /// get name of channel
42 std::string GetName() { return fName; }
43 /// set name of input file containing histograms
44 void SetInputFile( const std::string& file ) { fInputFile = file; }
45 /// get name of input file
46 std::string GetInputFile() { return fInputFile; }
47 /// set path for histograms in input file
48 void SetHistoPath( const std::string& file ) { fHistoPath = file; }
49 /// get path to histograms in input file
50 std::string GetHistoPath() { return fHistoPath; }
51
52 /// set data object
53 void SetData( const RooStats::HistFactory::Data& data ) { fData = data; }
54 void SetData( std::string HistoName, std::string InputFile, std::string HistoPath="" );
55 void SetData( double Val );
56 void SetData( TH1* hData );
57 /// get data object
59
60 /// add additional data object
61 void AddAdditionalData( const RooStats::HistFactory::Data& data ) { fAdditionalData.push_back(data); }
62 /// retrieve vector of additional data objects
63 std::vector<RooStats::HistFactory::Data>& GetAdditionalData() { return fAdditionalData; }
64
65 void SetStatErrorConfig( double RelErrorThreshold, Constraint::Type ConstraintType );
66 void SetStatErrorConfig( double RelErrorThreshold, std::string ConstraintType );
67 /// define treatment of statistical uncertainties
69 /// get information about threshold for statistical uncertainties and constraint term
71
73 /// get vector of samples for this channel
74 std::vector< RooStats::HistFactory::Sample >& GetSamples() { return fSamples; }
75
76 void Print(std::ostream& = std::cout);
77 void PrintXML( std::string Directory, std::string Prefix="" );
78
79 void CollectHistograms();
80 bool CheckHistograms();
81
82protected:
83
84 std::string fName;
85 std::string fInputFile;
86 std::string fHistoPath;
87
89
90 /// One can add additional datasets
91 /// These are simply added to the xml under a different name
92 std::vector<RooStats::HistFactory::Data> fAdditionalData;
93
95
96 std::vector< RooStats::HistFactory::Sample > fSamples;
97
98 TH1* GetHistogram( std::string InputFile, std::string HistoPath, std::string HistoName, std::map<std::string, std::unique_ptr<TFile>>& lsof);
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:29
HistFactory::Data fData
Definition: Channel.h:88
std::string GetInputFile()
get name of input file
Definition: Channel.h:46
void SetName(const std::string &Name)
set name of channel
Definition: Channel.h:40
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:92
std::string GetHistoPath()
get path to histograms in input file
Definition: Channel.h:50
std::vector< RooStats::HistFactory::Data > & GetAdditionalData()
retrieve vector of additional data objects
Definition: Channel.h:63
void Print(std::ostream &=std::cout)
Definition: Channel.cxx:75
HistFactory::StatErrorConfig & GetStatErrorConfig()
get information about threshold for statistical uncertainties and constraint term
Definition: Channel.h:70
RooStats::HistFactory::Data & GetData()
get data object
Definition: Channel.h:58
void AddAdditionalData(const RooStats::HistFactory::Data &data)
add additional data object
Definition: Channel.h:61
void PrintXML(std::string Directory, std::string Prefix="")
Definition: Channel.cxx:105
HistFactory::StatErrorConfig fStatErrorConfig
Definition: Channel.h:94
void SetData(const RooStats::HistFactory::Data &data)
set data object
Definition: Channel.h:53
void SetInputFile(const std::string &file)
set name of input file containing histograms
Definition: Channel.h:44
void AddSample(RooStats::HistFactory::Sample sample)
Definition: Channel.cxx:67
std::string GetName()
get name of channel
Definition: Channel.h:42
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:463
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
Definition: Channel.cxx:203
std::vector< RooStats::HistFactory::Sample > fSamples
Definition: Channel.h:96
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
Definition: Channel.h:74
void SetHistoPath(const std::string &file)
set path for histograms in input file
Definition: Channel.h:48
void SetStatErrorConfig(RooStats::HistFactory::StatErrorConfig Config)
define treatment of statistical uncertainties
Definition: Channel.h:68
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:369
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:53
The TH1 histogram class.
Definition: TH1.h:56
@ HistFactory
Definition: RooGlobalFunc.h:69
Namespace for the RooStats classes.
Definition: Asimov.h:19
Definition: file.py:1
const char * Name
Definition: TXMLSetup.cxx:66
static int Prefix[TSIZE]
Definition: gifdecode.c:12