76 TFile *
f =
new TFile(studyPackFileName) ;
108 void* p = (
void*)
gROOT->ProcessLineFast(
Form(
"TProof::Open(\"%s\")",proofHost)) ;
112 coutE(
Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") ERROR initializing proof, aborting" << endl ;
118 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%lx)->SetProgressDialog(0) ;",(
ULong_t)p)) ;
122 coutP(
Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") sending work package to PROOF servers" << endl ;
126 coutP(
Generation) <<
"RooStudyManager::runProof(" <<
GetName() <<
") starting PROOF processing of " << nExperiments <<
" experiments" << endl ;
128 gROOT->ProcessLineFast(
Form(
"((TProof*)0x%lx)->Process(\"RooProofDriverSelector\",%d) ;",(
ULong_t)p,nExperiments)) ;
151 if (
gROOT->GetListOfProofs()->LastIndex() != -1 &&
gROOT->ProcessLineFast(
"gProof;"))
153 gROOT->ProcessLineFast(
Form(
"gProof->Close(\"%s\") ;",option)) ;
154 gROOT->ProcessLineFast(
"gProof->CloseProgressDialog() ;") ;
158 if (
gROOT->GetListOfProofs()->LastIndex() != -1 &&
gROOT->ProcessLineFast(
"gProof;")) {
159 gROOT->ProcessLineFast(
"delete gProof ;") ;
172 TFile
f(
Form(
"study_data_%s.root",studyName),
"RECREATE") ;
179 ofstream bdr(
Form(
"study_driver_%s.sh",studyName)) ;
180 bdr <<
"#!/bin/sh" << endl
181 <<
Form(
"if [ ! -f study_data_%s.root ] ; then",studyName) << endl
182 <<
"uudecode <<EOR" << endl ;
186 gSystem->
Exec(
Form(
"cat study_data_%s.root | uuencode -m study_data_%s.root >> study_driver_%s.sh",studyName,studyName,studyName)) ;
189 ofstream bdr2 (
Form(
"study_driver_%s.sh",studyName),ios::app) ;
190 bdr2 <<
"EOR" << endl
192 <<
"root -l -b <<EOR" << endl
193 <<
Form(
"RooStudyPackage::processFile(\"%s\",%d) ;",studyName,nExpPerJob) << endl
199 coutI(
DataHandling) <<
"RooStudyManager::prepareBatchInput batch driver file is '" <<
Form(
"study_driver_%s.sh",studyName) <<
"," << endl
200 <<
" input data files is embedded in driver script" << endl ;
204 ofstream bdr(
Form(
"study_driver_%s.sh",studyName)) ;
205 bdr <<
"#!/bin/sh" << endl
206 <<
"root -l -b <<EOR" << endl
207 <<
Form(
"RooStudyPackage::processFile(\"%s\",%d) ;",studyName,nExpPerJob) << endl
211 coutI(
DataHandling) <<
"RooStudyManager::prepareBatchInput batch driver file is '" <<
Form(
"study_driver_%s.sh",studyName) <<
"," << endl
212 <<
" input data file is " <<
Form(
"study_data_%s.root",studyName) << endl ;
229 for (list<string>::iterator iter = flist.begin() ; iter!=flist.end() ; ++iter) {
230 coutP(
DataHandling) <<
"RooStudyManager::processBatchOutput() now reading file " << *iter << endl ;
231 TFile
f(iter->c_str()) ;
233 TList* list =
f.GetListOfKeys() ;
255 (*iter)->aggregateSummaryOutput(olist) ;
267 if (!TString(
name).MaybeWildcard()) {
268 result.push_back(
name) ;
273 TString basename(
name);
275 Int_t dotslashpos = -1;
277 Int_t next_dot = basename.Index(
".root");
279 dotslashpos = next_dot;
280 next_dot = basename.Index(
".root",dotslashpos+1);
282 if (basename[dotslashpos+5]!=
'/') {
289 TString behind_dot_root;
290 if (dotslashpos>=0) {
292 behind_dot_root = basename(dotslashpos+6,basename.Length()-dotslashpos+6);
294 basename.Remove(dotslashpos+5);
297 Int_t slashpos = basename.Last(
'/');
300 directory = basename(0,slashpos);
301 basename.Remove(0,slashpos+1);
314 if (!strcmp(
file,
".") || !strcmp(
file,
".."))
continue;
316 if ( (basename!=
file) &&
s.Index(re) ==
kNPOS)
continue;
326 if (behind_dot_root.Length() != 0)
327 result.push_back(
Form(
"%s/%s/%s",directory.Data(),
file,behind_dot_root.Data())) ;
329 result.push_back(
Form(
"%s/%s",directory.Data(),
file)) ;
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
RooAbsStudy is an abstract base class for RooStudyManager modules.
RooStudyManager is a utility class to manage studies that consist of repeated applications of generat...
void runProof(Int_t nExperiments, const char *proofHost="", Bool_t showGui=kTRUE)
Open PROOF-Lite session.
void prepareBatchInput(const char *studyName, Int_t nExpPerJob, Bool_t unifiedInput)
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).
RooStudyManager(RooWorkspace &w)
void aggregateData(TList *olist)
RooStudyPackage is a utility class to manage studies that consist of repeated applications of generat...
void driver(Int_t nExperiments)
void addStudy(RooAbsStudy &study)
std::list< RooAbsStudy * > & studies()
The RooWorkspace is a persistable container for RooFit projects.
Iterator abstract base class.
virtual TObject * Next()=0
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void Add(TObject *obj)
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
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.
Regular expression class.
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 Unix pathname to a local pathname.
virtual const char * WorkingDirectory()
Return working directory.
virtual int Unlink(const char *name)
Unlink, i.e.
static constexpr double s