Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
54 void SetData( const RooStats::HistFactory::Data& data ) { fData = data; }
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
61 /// add additional data object
62 void AddAdditionalData( const RooStats::HistFactory::Data& data ) { fAdditionalData.push_back(data); }
63 /// retrieve vector of additional data objects
64 std::vector<RooStats::HistFactory::Data>& GetAdditionalData() { return fAdditionalData; }
65
66 void SetStatErrorConfig( double RelErrorThreshold, Constraint::Type ConstraintType );
67 void SetStatErrorConfig( double RelErrorThreshold, std::string ConstraintType );
68 /// define treatment of statistical uncertainties
70 /// get information about threshold for statistical uncertainties and constraint term
73
75 /// get vector of samples for this channel
76 std::vector< RooStats::HistFactory::Sample >& GetSamples() { return fSamples; }
77 const std::vector< RooStats::HistFactory::Sample >& GetSamples() const { return fSamples; }
78
79 void Print(std::ostream& = std::cout);
80 void PrintXML( std::string Directory, std::string Prefix="" );
81
82 void CollectHistograms();
83 bool CheckHistograms() const;
84
85protected:
86
87 std::string fName;
88 std::string fInputFile;
89 std::string fHistoPath;
90
92
93 /// One can add additional datasets
94 /// These are simply added to the xml under a different name
95 std::vector<RooStats::HistFactory::Data> fAdditionalData;
96
98
99 std::vector< RooStats::HistFactory::Sample > fSamples;
100
101 TH1* GetHistogram( std::string InputFile, std::string HistoPath, std::string HistoName, std::map<std::string, std::unique_ptr<TFile>>& lsof);
102};
103
104 extern Channel BadChannel;
105
106} // namespace HistFactory
107} // namespace RooStats
108
109#endif
This class encapsulates all information for the statistical interpretation of one experiment.
Definition Channel.h:30
HistFactory::Data fData
Definition Channel.h:91
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:95
std::vector< RooStats::HistFactory::Data > & GetAdditionalData()
retrieve vector of additional data objects
Definition Channel.h:64
void Print(std::ostream &=std::cout)
Definition Channel.cxx:75
const HistFactory::StatErrorConfig & GetStatErrorConfig() const
Definition Channel.h:72
HistFactory::StatErrorConfig & GetStatErrorConfig()
get information about threshold for statistical uncertainties and constraint term
Definition Channel.h:71
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:62
std::string GetInputFile() const
get name of input file
Definition Channel.h:47
void PrintXML(std::string Directory, std::string Prefix="")
Definition Channel.cxx:105
HistFactory::StatErrorConfig fStatErrorConfig
Definition Channel.h:97
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:462
const std::vector< RooStats::HistFactory::Sample > & GetSamples() const
Definition Channel.h:77
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
Definition Channel.cxx:202
std::vector< RooStats::HistFactory::Sample > fSamples
Definition Channel.h:99
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
Definition Channel.h:76
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:69
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:30
Configuration to automatically assign nuisance parameters for the statistical error of the Monte Carl...
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
Namespace for the RooStats classes.
Definition Asimov.h:19
Definition file.py:1
static int Prefix[TSIZE]
Definition gifdecode.c:12