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() = default;
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() const { 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() const { 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() const { return fHistoPath; }
51
52 /// set data object
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 const RooStats::HistFactory::Data& GetData() const { return fData; }
60
61 /// add additional data object
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 const& directory, std::string const& prefix="" ) const;
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
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:91
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:95
const RooStats::HistFactory::Data & GetData() const
Definition Channel.h:59
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:58
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:58
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:46
HistFactory::StatErrorConfig fStatErrorConfig
Definition Channel.h:97
std::string GetHistoPath() const
get path to histograms in input file
Definition Channel.h:50
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:50
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:428
const std::vector< RooStats::HistFactory::Sample > & GetSamples() const
Definition Channel.h:77
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
Definition Channel.cxx:182
std::vector< RooStats::HistFactory::Sample > fSamples
Definition Channel.h:99
void PrintXML(std::string const &directory, std::string const &prefix="") const
Definition Channel.cxx:88
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:48
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:42
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...
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
Namespace for the RooStats classes.
Definition CodegenImpl.h:58