101 HistoToWorkspaceFactoryFast::Configuration
const &cfg)
109 cxcoutIHF <<
"Making Model and Measurements (Fast) for measurement: " <<
measurement.GetName() << std::endl;
114 <<
" including bins between " <<
measurement.GetBinLow() <<
" and " <<
measurement.GetBinHigh() << std::endl;
135 size_t pos = prefix.rfind(
'/');
136 if (pos == std::string::npos) {
139 std::string
outputDir = prefix.substr(0,pos);
140 cxcoutDHF <<
"Checking if output directory : " <<
outputDir <<
" - exists" << std::endl;
146 cxcoutDHF <<
"Output directory : " <<
outputDir <<
" - does not exist, try to create" << std::endl;
156 cxcoutIHF <<
"Creating the HistoToWorkspaceFactoryFast factory" << std::endl;
157 HistoToWorkspaceFactoryFast factory{
measurement, cfg};
159 cxcoutIHF <<
"Setting preprocess functions" << std::endl;
160 factory.SetFunctionsToPreprocess(
measurement.GetPreprocessFunctions() );
166 if( ! channel.CheckHistograms() ) {
167 cxcoutEHF <<
"MakeModelAndMeasurementsFast: Channel: " << channel.GetName()
168 <<
" has uninitialized histogram pointers" << std::endl;
173 std::string
ch_name = channel.GetName();
176 std::unique_ptr<RooWorkspace>
ws_single{factory.MakeSingleChannelModel(
measurement, channel )};
178 if (cfg.createPerRegionWorkspaces) {
179 std::string prefix =
measurement.GetOutputFilePrefix();
191 meas_chan.GetChannels().push_back( channel );
192 cxcoutIHF <<
"About to write channel measurement to file" << std::endl;
194 cxcoutPHF <<
"Successfully wrote channel to file" << std::endl;
210 HistoToWorkspaceFactoryFast::ConfigureWorkspaceForMeasurement(
"simPdf", ws.get(),
measurement);
212 if (cfg.createWorkspaceFile) {
213 std::string prefix =
measurement.GetOutputFilePrefix();
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={})