70 list<RooAbsStudy*>::const_iterator iter = other.
_studies.begin() ;
71 for (;iter!=other.
_studies.end() ; ++iter) {
72 _studies.push_back((*iter)->clone()) ;
103 for (list<RooAbsStudy*>::iterator iter=
_studies.begin() ; iter!=
_studies.end() ; ++iter) {
104 (*iter)->attach(*
_ws) ;
105 (*iter)->initialize() ;
116 Int_t prescale = nExperiments>100 ?
Int_t(nExperiments/100) : 1 ;
117 for (
Int_t i=0 ; i<nExperiments ; i++) {
119 coutP(Generation) <<
"RooStudyPackage::run(" <<
GetName() <<
") processing experiment " << i <<
"/" << nExperiments << endl ;
131 for (list<RooAbsStudy*>::iterator iter=
_studies.begin() ; iter!=
_studies.end() ; ++iter) {
144 for (list<RooAbsStudy*>::iterator iter=
_studies.begin() ; iter!=
_studies.end() ; ++iter) {
145 (*iter)->finalize() ;
156 for (list<RooAbsStudy*>::iterator iter=
_studies.begin() ; iter!=
_studies.end() ; ++iter) {
158 (*iter)->finalize() ;
160 RooDataSet* summaryData = (*iter)->summaryData() ;
163 cout <<
"registering summary dataset: " ; summaryData->
Print() ;
164 olist->
Add(summaryData) ;
168 if (detailedData && detailedData->
GetSize()>0) {
171 cout <<
"registering detailed dataset " << detailedData->IsA()->
GetName() <<
"::"
172 << detailedData->
GetName() <<
" with " << detailedData->
GetSize() <<
" elements" << endl ;
179 olist->
Add(detailedData) ;
180 (*iter)->releaseDetailData() ;
201 if (worknumber !=
"undef")
202 iworker =
int( worknumber.
Atof()*10 + 0.1);
205 for (
int i = 0; i <= iworker; ++i )
222 string name_fin =
Form(
"study_data_%s.root",studyName) ;
223 TFile fin(name_fin.c_str()) ;
226 cout <<
"RooStudyPackage::processFile() ERROR input file " << name_fin <<
" does not contain a RooStudyPackage named 'studypack'" << endl ;
232 cout <<
"RooStudyPackage::processFile() Initial random seed for this run is " << seqno << endl ;
240 TFile fout(
Form(
"study_result_%s_%d.root",studyName,seqno),
"RECREATE") ;
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
RooAbsStudy is an abstract base class for RooStudyManager modules.
RooDataSet is a container class to hold unbinned data.
void SetName(const char *name) override
Change the name of this dataset into the given name.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
void SetName(const char *name)
const char * GetName() const
Returns name of object.
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooStudyPackage is a utility class to manage studies that consist of repeated applications of generat...
void driver(Int_t nExperiments)
Int_t initRandom()
Choose random seed for this process in case pass a definite seed to have it deterministic use also wo...
std::list< RooAbsStudy * > _studies
static void processFile(const char *infile, Int_t nexp)
Read in study package.
void addStudy(RooAbsStudy &study)
void finalize()
Finalize all studies.
void initialize()
Make iterator over copy of studies attached to workspace.
void exportData(TList *olist, Int_t seqno)
void run(Int_t nExperiments)
The RooWorkspace is a persistable container for RooFit projects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this collection.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
void Close(Option_t *option="") override
Close a file.
Iterator abstract base class.
virtual TObject * Next()=0
virtual void Add(TObject *obj)
The TNamed class is the base class for all named ROOT classes.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Double_t Atof() const
Return floating-point value contained in string.