84 HistoToWorkspaceFactoryFast::Configuration
const &cfg)
91 cxcoutIHF <<
"Making Model and Measurements (Fast) for measurement: " <<
measurement.GetName() << std::endl;
96 <<
" including bins between " <<
measurement.GetBinLow() <<
" and " <<
measurement.GetBinHigh() << std::endl;
112 std::string prefix =
measurement.GetOutputFilePrefix();
118 size_t pos = prefix.rfind(
'/');
119 if (pos != std::string::npos) {
120 std::string
outputDir = prefix.substr(0,pos);
121 cxcoutDHF <<
"Checking if output directory : " <<
outputDir <<
" - exists" << std::endl;
124 cxcoutDHF <<
"Output directory : " <<
outputDir <<
" - does not exist, try to create" << std::endl;
141 cxcoutIHF <<
"Creating the HistoToWorkspaceFactoryFast factory" << std::endl;
142 HistoToWorkspaceFactoryFast factory{
measurement, cfg};
146 cxcoutIHF <<
"Setting preprocess functions" << std::endl;
147 factory.SetFunctionsToPreprocess(
measurement.GetPreprocessFunctions() );
153 if( ! channel.CheckHistograms() ) {
154 cxcoutEHF <<
"MakeModelAndMeasurementsFast: Channel: " << channel.GetName()
155 <<
" has uninitialized histogram pointers" << std::endl;
160 std::string
ch_name = channel.GetName();
163 std::unique_ptr<RooWorkspace>
ws_single{factory.MakeSingleChannelModel(
measurement, channel )};
165 if (cfg.createPerRegionWorkspaces) {
176 meas_chan.GetChannels().push_back( channel );
177 cxcoutIHF <<
"About to write channel measurement to file" << std::endl;
179 cxcoutPHF <<
"Successfully wrote channel to file" << std::endl;
195 HistoToWorkspaceFactoryFast::ConfigureWorkspaceForMeasurement(
"simPdf", ws.get(),
measurement);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TSystem * gSystem
static RooMsgService & instance()
Return reference to singleton instance.
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory.
virtual int MakeDirectory(const char *name)
Make a directory.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
OwningPtr< T > makeOwningPtr(std::unique_ptr< T > &&ptr)
Internal helper to turn a std::unique_ptr<T> into an OwningPtr.
RooFit::OwningPtr< RooWorkspace > MakeModelAndMeasurementFast(RooStats::HistFactory::Measurement &measurement, HistoToWorkspaceFactoryFast::Configuration const &cfg={})