44using std::string, std::endl, std::ios, std::list, std::ofstream;
98 coutP(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") opening PROOF session" << endl ;
99 void*
p =
reinterpret_cast<void*
>(
gROOT->ProcessLineFast(
Form(
"TProof::Open(\"%s\")",
proofHost)));
103 coutE(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") ERROR initializing proof, aborting" << endl ;
109 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%zx)->SetProgressDialog(0) ;",
reinterpret_cast<size_t>(
p))) ;
113 coutP(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") sending work package to PROOF servers" << endl ;
114 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%zx)->AddInput((TObject*)0x%zx) ;",
reinterpret_cast<size_t>(
p),
reinterpret_cast<size_t>(
_pkg)) ) ;
117 coutP(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") starting PROOF processing of " <<
nExperiments <<
" experiments" << endl ;
119 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%zx)->Process(\"RooProofDriverSelector\",%d) ;",
reinterpret_cast<size_t>(
p),
nExperiments)) ;
122 coutP(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") aggregating results data" << endl ;
123 TList*
olist =
reinterpret_cast<TList*
>(
gROOT->ProcessLineFast(
Form(
"((TProof*)0x%zx)->GetOutputList()",
reinterpret_cast<size_t>(
p))));
127 coutP(Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") cleaning up input list" << endl ;
128 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%zx)->GetInputList()->Remove((TObject*)0x%zx) ;",
reinterpret_cast<size_t>(
p),
reinterpret_cast<size_t>(
_pkg)) ) ;
142 if (
gROOT->GetListOfProofs()->LastIndex() != -1 &&
gROOT->ProcessLineFast(
"gProof;"))
145 gROOT->ProcessLineFast(
"gProof->CloseProgressDialog() ;") ;
149 if (
gROOT->GetListOfProofs()->LastIndex() != -1 &&
gROOT->ProcessLineFast(
"gProof;")) {
150 gROOT->ProcessLineFast(
"delete gProof ;") ;
153 ooccoutI(
nullptr,Generation) <<
"RooStudyManager: No global Proof objects. No connections closed." << endl ;
171 bdr <<
"#!/bin/sh" << endl
172 <<
Form(
"if [ ! -f study_data_%s.root ] ; then",
studyName) << endl
173 <<
"uudecode <<EOR" << endl ;
181 bdr2 <<
"EOR" << endl
183 <<
"root -l -b <<EOR" << endl
190 coutI(DataHandling) <<
"RooStudyManager::prepareBatchInput batch driver file is '" <<
Form(
"study_driver_%s.sh",
studyName) <<
"," << endl
191 <<
" input data files is embedded in driver script" << endl ;
196 bdr <<
"#!/bin/sh" << endl
197 <<
"root -l -b <<EOR" << endl
202 coutI(DataHandling) <<
"RooStudyManager::prepareBatchInput batch driver file is '" <<
Form(
"study_driver_%s.sh",
studyName) <<
"," << endl
203 <<
" input data file is " <<
Form(
"study_data_%s.root",
studyName) << endl ;
221 coutP(DataHandling) <<
"RooStudyManager::processBatchOutput() now reading file " << *iter << endl ;
225 TObject * obj =
f.Get(key->GetName()) ;
239 (*iter)->aggregateSummaryOutput(
olist) ;
310 while ((obj =
static_cast<TObjString*
>(next()))) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
const_iterator begin() const
const_iterator end() const
Abstract base class for RooStudyManager modules.
Utility class to manage studies that consist of repeated applications of generate-and-fit operations ...
void runProof(Int_t nExperiments, const char *proofHost="", bool showGui=true)
Open PROOF-Lite session.
void expandWildCardSpec(const char *spec, std::list< std::string > &result)
case with one single file
void run(Int_t nExperiments)
void processBatchOutput(const char *filePat)
void addStudy(RooAbsStudy &study)
static void closeProof(Option_t *option="s")
"Option_t *option" takes the parameters forwarded to gProof->Close(option).
void prepareBatchInput(const char *studyName, Int_t nExpPerJob, bool unifiedInput)
RooStudyManager(RooWorkspace &w)
void aggregateData(TList *olist)
Utility class to manage studies that consist of repeated applications of generate-and-fit operations ...
void driver(Int_t nExperiments)
void addStudy(RooAbsStudy &study)
std::list< RooAbsStudy * > & studies()
Persistable container for RooFit projects.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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.
const char * GetName() const override
Returns name of object.
Collectable string class.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void Delete(Option_t *option="")
Delete this object.
Regular expression class.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual const char * WorkingDirectory()
Return working directory.
virtual int Unlink(const char *name)
Unlink, i.e.