ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLFactory.cxx
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Danilo Piparo 25/08/2009
3 
4 
5 /*************************************************************************
6  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 ////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #include <iostream>
17 #include <fstream>
18 
19 #include "RooStats/HLFactory.h"
20 #include "TFile.h"
21 #include "TObject.h"
22 #include "TObjArray.h"
23 #include "TObjString.h"
24 
25 #include "RooSimultaneous.h"
26 
27 using namespace std;
28 
30 
31 
32 using namespace RooStats;
33 using namespace RooFit;
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// Constructor with the name of the config file to interpret and the
37 /// verbosity flag. The extension for the config files is assumed to
38 /// be ".rs".
39 
40 HLFactory::HLFactory(const char *name,
41  const char *fileName,
42  bool isVerbose):
43  TNamed(name,name),
44  fComboCat(0),
45  fComboBkgPdf(0),
46  fComboSigBkgPdf(0),
47  fComboDataset(0),
48  fCombinationDone(false),
49  fVerbose(isVerbose),
50  fInclusionLevel(0),
51  fOwnWs(true){
52  TString wsName(name);
53  wsName+="_ws";
54  fWs = new RooWorkspace(wsName,true);
55 
59 
60  // Start the parsing
61  fReadFile(fileName);
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Constructor without a card but with an exrernal workspace.
66 
68  RooWorkspace* externalWs,
69  bool isVerbose):
70  TNamed(name,name),
71  fComboCat(0),
72  fComboBkgPdf(0),
73  fComboSigBkgPdf(0),
74  fComboDataset(0),
75  fCombinationDone(false),
76  fVerbose(isVerbose),
77  fInclusionLevel(0),
78  fOwnWs(false){
79  fWs=externalWs;
83 
84 }
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 
89  TNamed("hlfactory","hlfactory"),
90  fComboCat(0),
91  fComboBkgPdf(0),
92  fComboSigBkgPdf(0),
93  fComboDataset(0),
94  fCombinationDone(false),
95  fVerbose(false),
96  fInclusionLevel(0),
97  fOwnWs(true){
98  fWs = new RooWorkspace("hlfactory_ws",true);
99 
103 
104  }
105 
106 ////////////////////////////////////////////////////////////////////////////////
107 /// destructor
108 
110  if (fComboSigBkgPdf!=NULL)
111  delete fComboSigBkgPdf;
112  if (fComboBkgPdf!=NULL)
113  delete fComboBkgPdf;
114  if (fComboDataset!=NULL)
115  delete fComboDataset;
116  if (fComboCat!=NULL)
117  delete fComboCat;
118 
119  if (fOwnWs)
120  delete fWs;
121 }
122 
123 ////////////////////////////////////////////////////////////////////////////////
124 /// Add a channel to the combination. The channel can be specified as:
125 /// - A signal plus background pdf
126 /// - A background only pdf
127 /// - A dataset
128 /// Once the combination of the pdfs is done, no more channels should be
129 /// added.
130 
131 int HLFactory::AddChannel(const char* label,
132  const char* SigBkgPdfName,
133  const char* BkgPdfName,
134  const char* DatasetName){
135  if (fCombinationDone){
136  std::cerr << "Cannot add anymore channels. "
137  << "Combination already carried out.\n";
138  return -1;
139  }
140 
141  if (SigBkgPdfName!=0){
142  if (fWs->pdf(SigBkgPdfName)==NULL){
143  std::cerr << "Pdf " << SigBkgPdfName << " not found in workspace!\n";
144  return -1;
145  }
146  TObjString* name = new TObjString(SigBkgPdfName);
147  fSigBkgPdfNames.Add(name);
148  }
149 
150  if (BkgPdfName!=0){
151  if (fWs->pdf(BkgPdfName)==NULL){
152  std::cerr << "Pdf " << BkgPdfName << " not found in workspace!\n";
153  return -1;
154  }
155  TObjString* name = new TObjString(BkgPdfName);
156  fBkgPdfNames.Add(name);
157  }
158 
159  if (DatasetName!=0){
160  if (fWs->data(DatasetName)==NULL){
161  std::cerr << "Dataset " << DatasetName << " not found in workspace!\n";
162  return -1;
163  }
164  TObjString* name = new TObjString(DatasetName);
165  fDatasetsNames.Add(name);
166  }
167 
168  if (label!=0){
169  TObjString* name = new TObjString(label);
170  fLabelsNames.Add(name);
171  }
172  return 0;
173 
174 }
175 
176 ////////////////////////////////////////////////////////////////////////////////
177 /// Return the combination of the signal plus background channels.
178 /// The facory owns the object.
179 
181  if (fSigBkgPdfNames.GetSize()==0)
182  return 0;
183 
184  if (fComboSigBkgPdf!=NULL)
185  return fComboSigBkgPdf;
186 
187  if (!fNamesListsConsistent())
188  return NULL;
189 
190  if (fSigBkgPdfNames.GetSize()==1){
193  return fComboSigBkgPdf;
194  }
195 
196  if (!fCombinationDone)
197  fCreateCategory();
198 
199  RooArgList pdfs("pdfs");
200 
202  TObjString* ostring;
203  TObject* obj;
204  while ((obj = it->Next())){
205  ostring=(TObjString*) obj;
206  pdfs.add( *(fWs->pdf(ostring->String())) );
207  }
208  delete it;
209 
210  TString name(GetName());
211  name+="_sigbkg";
212 
213  TString title(GetName());
214  title+="_sigbkg";
215 
217  new RooSimultaneous(name,
218  title,
219  pdfs,
220  *fComboCat);
221 
222  return fComboSigBkgPdf;
223 
224  }
225 ////////////////////////////////////////////////////////////////////////////////
226 /// Return the combination of the background only channels.
227 /// If no background channel is specified a NULL pointer is returned.
228 /// The facory owns the object.
229 
231  if (fBkgPdfNames.GetSize()==0)
232  return 0;
233 
234  if (fComboBkgPdf!=NULL)
235  return fComboBkgPdf;
236 
237  if (!fNamesListsConsistent())
238  return NULL;
239 
240  if (fBkgPdfNames.GetSize()==1){
242  return fComboBkgPdf;
243  }
244 
245  if (!fCombinationDone)
246  fCreateCategory();
247 
248  RooArgList pdfs("pdfs");
249 
251  TObjString* ostring;
252  TObject* obj;
253  while ((obj = it->Next())){
254  ostring=(TObjString*) obj;
255  pdfs.add( *(fWs->pdf(ostring->String())) );
256  }
257 
258  TString name(GetName());
259  name+="_bkg";
260 
261  TString title(GetName());
262  title+="_bkg";
263 
264  fComboBkgPdf=
265  new RooSimultaneous(name,
266  title,
267  pdfs,
268  *fComboCat);
269 
270  return fComboBkgPdf;
271 
272 }
273 
274 ////////////////////////////////////////////////////////////////////////////////
275 /// Return the combination of the datasets.
276 /// If no dataset is specified a NULL pointer is returned.
277 /// The facory owns the object.
278 
280  if (fDatasetsNames.GetSize()==0)
281  return 0;
282 
283  if (fComboDataset!=NULL)
284  return fComboDataset;
285 
286  if (!fNamesListsConsistent())
287  return NULL;
288 
289  if (fDatasetsNames.GetSize()==1){
291  return fComboDataset;
292  }
293 
294  if (!fCombinationDone)
295  fCreateCategory();
296 
297 
299  TObjString* ostring;
300  TObject* obj = it->Next();
301  ostring = (TObjString*) obj;
302  fComboDataset = (RooDataSet*) fWs->data(ostring->String()) ;
303  if (!fComboDataset) return NULL;
304  fComboDataset->Print();
305  TString dataname(GetName());
306  fComboDataset = new RooDataSet(*fComboDataset,dataname+"_TotData");
307  int catindex=0;
308  fComboCat->setIndex(catindex);
310  while ((obj = it->Next())){
311  ostring=(TObjString*) obj;
312  catindex++;
313  RooDataSet * data = (RooDataSet*)fWs->data(ostring->String());
314  if (!data) return NULL;
315  RooDataSet* dummy = new RooDataSet(*data,"");
316  fComboCat->setIndex(catindex);
317  fComboCat->Print();
318  dummy->addColumn(*fComboCat);
319  fComboDataset->append(*dummy);
320  delete dummy;
321  }
322 
323  delete it;
324  return fComboDataset;
325 
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Return the category.
330 /// The facory owns the object.
331 
333  if (fComboCat!=NULL)
334  return fComboCat;
335 
336  if (!fNamesListsConsistent())
337  return NULL;
338 
339  if (!fCombinationDone)
340  fCreateCategory();
341 
342  return fComboCat;
343 
344  }
345 
346 ////////////////////////////////////////////////////////////////////////////////
347 /// Process an additional configuration file
348 
350  return fReadFile(filename,0);
351  }
352 
353 ////////////////////////////////////////////////////////////////////////////////
354 /// Parses the configuration file. The objects can be specified following
355 /// the rules of the RooFactoryWSTool, plus some more flexibility.
356 ///
357 /// The official format for the datacards is ".rs".
358 ///
359 /// All the instructions end with a ";" (like in C++).
360 ///
361 /// Carriage returns and white lines are irrelevant but adviced since they
362 /// improve readability (like in C++).
363 ///
364 /// The (Roo)ClassName::objname(description) can be replaced with the more
365 /// "pythonic" objname = (Roo)ClassName(description).
366 ///
367 /// The comments can be specified with a "//" if on a single line or with
368 /// /* */ if on multiple lines (like in C++).
369 ///
370 /// The "#include path/to/file.rs" statement triggers the inclusion of a
371 /// configuration fragment.
372 ///
373 /// The "import myobject:myworkspace:myrootfile" will add to the Workspace
374 /// the object myobject located in myworkspace recorded in myrootfile.
375 /// Alternatively, one could choose the "import myobject:myrootfile" in case
376 /// no Workspace is present.
377 ///
378 /// The "echo" statement prompts a message on screen.
379 
380 int HLFactory::fReadFile(const char*fileName, bool is_included){
381  // Check the deepness of the inclusion
382  if (is_included)
383  fInclusionLevel+=1;
384  else
385  fInclusionLevel=0;
386 
387  const int maxDeepness=50;
388  if (fInclusionLevel>maxDeepness){
389  TString warning("The inclusion stack is deeper than ");
390  warning+=maxDeepness;
391  warning+=". Is this a recursive inclusion?";
392  Warning("fReadFile", "%s", warning.Data());
393  }
394 
395 
396  // open the config file and go through it
397  std::ifstream ifile(fileName);
398 
399  if(ifile.fail()){
400  TString error("File ");
401  error+=fileName;
402  error+=" could not be opened.";
403  Error("fReadFile", "%s", error.Data());
404  return -1;
405  }
406 
407  TString ifileContent("");
408  ifileContent.ReadFile(ifile);
409  ifile.close();
410 
411  // Tokenise the file using the "\n" char and parse it line by line to strip
412  // the comments.
414 
415  TObjArray* lines_array = ifileContent.Tokenize("\n");
416  TIterator* lineIt=lines_array->MakeIterator();
417 
418  bool in_comment=false;
419  TString line;
420  TObject* line_o;
421 
422  while((line_o=(*lineIt)())){ // Start iteration on lines array
423  line = (static_cast<TObjString*>(line_o))->GetString();
424 
425  // Are we in a multiline comment?
426  if (in_comment)
427  if (line.EndsWith("*/")){
428  in_comment=false;
429  if (fVerbose) Info("fReadFile","Out of multiline comment ...");
430 
431  continue;
432  }
433 
434  // Was line a single line comment?
435 
436  if ((line.BeginsWith("/*") && line.EndsWith("*/")) ||
437  line.BeginsWith("//")){
438  if (fVerbose) Info("fReadFile","In single line comment ...");
439  continue;
440  }
441 
442  // Did a multiline comment just begin?
443  if (line.BeginsWith("/*")){
444  in_comment=true;
445  if (fVerbose) Info("fReadFile","In multiline comment ...");
446  continue;
447  }
448 
449  ifileContentStripped+=line+"\n";
450  }
451 
452  delete lines_array;
453  delete lineIt;
454 
455  // Now proceed with the parsing of the stripped file
456 
457  lines_array = ifileContentStripped.Tokenize(";");
458  lineIt=lines_array->MakeIterator();
459  in_comment=false;
460 
461  const int nNeutrals=2;
462  TString neutrals[nNeutrals]={"\t"," "};
463 
464  while((line_o=(*lineIt)())){
465 
466  line = (static_cast<TObjString*>(line_o))->GetString();
467 
468  // Strip spaces at the beginning and the end of the line
469  line.Strip(TString::kBoth,' ');
470 
471  // Put the single statement in one single line
472  line.ReplaceAll("\n","");
473 
474  // Do we have an echo statement? "A la RooFit"
475  if (line.BeginsWith("echo")){
476  line = line(5,line.Length()-1);
477  if (fVerbose)
478  std::cout << "Echoing line " << line.Data() << std::endl;
479  std::cout << "[" << GetName() << "] echo: "
480  << line.Data() << std::endl;
481  continue;
482  }
483 
484  // Spaces and tabs at this point are not needed.
485  for (int i=0;i<nNeutrals;++i)
486  line.ReplaceAll(neutrals[i],"");
487 
488 
489  if (fVerbose) Info("fReadFile","Reading --> %s <--", line.Data());
490 
491  // Was line a white space?
492  if (line == ""){
493  if (fVerbose) Info("fReadFile", "%s", "Empty line: skipping ...");
494  continue;
495  }
496 
497  // Do we have an include statement?
498  // We treat this recursively.
499  if (line.BeginsWith("#include")){
500  line.ReplaceAll("#include","");
501  if (fVerbose) Info("fReadFile","Reading included file...");
502  fReadFile(line,true);
503  continue;
504  }
505 
506  // We parse the line
507  if (fVerbose) Info("fReadFile","Parsing the line...");
508  fParseLine(line);
509  }
510 
511  delete lineIt;
512  delete lines_array;
513 
514  return 0;
515 }
516 
517 
518 ////////////////////////////////////////////////////////////////////////////////
519 /// Builds the category necessary for the mutidimensional models. Its name
520 /// will be <HLFactory name>_category and the types are specified by the
521 /// model labels.
522 
524  fCombinationDone=true;
525 
526  TString name(GetName());
527  name+="_category";
528 
529  TString title(GetName());
530  title+="_category";
531 
532  fComboCat=new RooCategory(name,title);
533 
535  TObjString* ostring;
536  TObject* obj;
537  while ((obj = it->Next())){
538  ostring=(TObjString*) obj;
539  fComboCat->defineType(ostring->String());
540  }
541 
542  }
543 
544 ////////////////////////////////////////////////////////////////////////////////
545 /// Check the number of entries in each list. If not the same and the list
546 /// is not empty prompt an error.
547 
552  return true;
553  else{
554  std::cerr << "The number of datasets and models added as channels "
555  << " is not the same!\n";
556  return false;
557  }
558  }
559 
560 ////////////////////////////////////////////////////////////////////////////////
561 /// Parse a single line and puts the content in the RooWorkSpace
562 
564  if (fVerbose) Info("fParseLine", "Parsing line: %s", line.Data());
565 
566  TString new_line("");
567 
568  const int nequals = line.CountChar('=');
569 
570  // Build with the factory a var or cat, or pipe the command directly.
571 
572  if (line.Contains("::") || // It is a ordinary statement
573  nequals==0 || //it is a RooRealVar or cat with 0,1,2,3.. indexes
574  (line.Contains("[") &&
575  line.Contains("]") &&
576  nequals>0 && // It is a cat like "tag[B0=1,B0bar=-1]"
577  ! line.Contains("(") &&
578  ! line.Contains(")"))) {
579  fWs->factory(line);
580  return 0;
581  }
582 
583  // Transform the line o_name = o_class(o_descr) in o_class::o_name(o_descr)
584  if (nequals==1 ||
585  (nequals > 1 && line.Contains("SIMUL"))){
586 
587  // Divide the line in 3 components: o_name,o_class and o_descr
588  // assuming that o_name=o_class(o_descr)
589  const int equal_index=line.First('=');
590  const int par_index=line.First('(');
591  TString o_name(line(0,equal_index));
592  TString o_class(line(equal_index+1,par_index-equal_index-1));
593  TString o_descr(line(par_index+1,line.Length()-par_index-2));
594 
595  if (fVerbose) Info("fParseLine", "o_name=%s o_class=%s o_descr=%s",
596  o_name.Data(), o_class.Data(), o_descr.Data());
597 
598  // Now two cases either we wanna produce an object or import something
599  // under a new name.
600  if (o_class =="import"){// import a generic TObject into the WS
601  // Now see if we have a workspace or not, according to the number of
602  // entries in the description..
603 
604  TObjArray* descr_array = o_descr.Tokenize(",");
605 
606  const int n_descr_parts=descr_array->GetEntries();
607 
608  if (n_descr_parts<2 || n_descr_parts>3)
609  Error("fParseLine","Import wrong syntax: cannot process %s", o_descr.Data());
610 
611  TString obj_name (static_cast<TObjString*>(descr_array->At(n_descr_parts-1))->GetString());
612  TString ws_name("");
613  TString rootfile_name (static_cast<TObjString*>(descr_array->At(0))->GetString());
614 
615  TFile* ifile=TFile::Open(rootfile_name);
616  if (ifile==0)
617  return 1;
618 
619  if (n_descr_parts==3){// in presence of a Ws
620  o_descr.ReplaceAll(",",":");
621  fWs->import(o_descr);
622  }
623  else if(n_descr_parts==2){ // in presence of an object in rootfile
624  if (fVerbose)
625  Info("fParseLine","Importing %s from %s under the name of %s",
626  obj_name.Data(), rootfile_name.Data(), o_name.Data());
627  TObject* the_obj=ifile->Get(obj_name);
628  fWs->import(*the_obj,o_name);
629  }
630  delete ifile;
631  return 0;
632  } // end of import block
633 
634  new_line=o_class+"::"+o_name+"("+o_descr+")";
635 
636  if (fVerbose){
637  std::cout << "DEBUG: line: " << line.Data() << std::endl;
638  std::cout << "DEBUG: new_line: " << new_line.Data() << std::endl;
639  }
640 
641  fWs->factory(new_line);
642 
643  return 0;
644  }
645 
646  else { // In case we do not know what to do we pipe it..
647  fWs->factory(line);
648  }
649 
650  return 0;
651 
652 }
653 
654 
655 
656 
virtual Int_t GetEntries() const
Definition: TCollection.h:92
std::istream & ReadFile(std::istream &str)
Replace string with the contents of strm, stopping at an EOF.
Definition: Stringio.cxx:28
An array of TObjects.
Definition: TObjArray.h:39
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooCategory * fComboCat
The category of the combination.
Definition: HLFactory.h:92
Ssiz_t Length() const
Definition: TString.h:390
TLine * line
Collectable string class.
Definition: TObjString.h:32
int AddChannel(const char *label, const char *SigBkgPdfName, const char *BkgPdfName=0, const char *datasetName=0)
Add channel for the combination.
Definition: HLFactory.cxx:131
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
bool fOwnWs
Owns workspace.
Definition: HLFactory.h:134
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set value by specifying the index code of the desired state.
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:635
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsData.h:157
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
static const char * filename()
RooDataSet * GetTotDataSet()
Get the combined dataset.
Definition: HLFactory.cxx:279
Basic string class.
Definition: TString.h:137
ClassImp(RooStats::HLFactory)
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
Definition: HLFactory.h:131
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Definition: TIterator.cxx:21
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:558
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:311
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Definition: TObjArray.cxx:591
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
Definition: HLFactory.h:116
Iterator abstract base class.
Definition: TIterator.h:32
delete lines_array
Definition: HLFactory.cxx:452
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3851
const char * String
Definition: TXMLSetup.cxx:94
const char * Data() const
Definition: TString.h:349
void fCreateCategory()
Create the category for the combinations.
Definition: HLFactory.cxx:523
const int nNeutrals
Definition: HLFactory.cxx:461
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
Add a column with the values of the given (function) argument to this dataset.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsArg.h:227
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
ifileContentStripped
Definition: HLFactory.cxx:449
HLFactory is an High Level model Factory allows you to describe your models in a configuration file (...
Definition: HLFactory.h:41
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
RooDataSet * fComboDataset
The datasets combination.
Definition: HLFactory.h:101
HLFactory()
Default Constructor.
Definition: HLFactory.cxx:88
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
Definition: HLFactory.cxx:230
delete lineIt
Definition: HLFactory.cxx:453
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition: HLFactory.h:95
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2207
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:119
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1056
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
Definition: TString.cxx:430
RooAbsPdf * fComboSigBkgPdf
The signal plus background model combination.
Definition: HLFactory.h:98
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
TString & String()
Definition: TObjString.h:52
int fInclusionLevel
Keep trace of the inclusion deepness.
Definition: HLFactory.h:128
RooCategory represents a fundamental (non-derived) discrete value object.
Definition: RooCategory.h:25
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2227
bool fNamesListsConsistent()
Check the length of the lists.
Definition: HLFactory.cxx:548
~HLFactory()
Default Destructor.
Definition: HLFactory.cxx:109
bool fVerbose
The verbosity flag.
Definition: HLFactory.h:125
int ProcessCard(const char *filename)
Process a configuration file.
Definition: HLFactory.cxx:349
virtual Int_t GetSize() const
Definition: TCollection.h:95
RooCategory * GetTotCategory()
Get the combined dataset.
Definition: HLFactory.cxx:332
void append(RooDataSet &data)
Add all data points of given data set to this data set.
static RooMathCoreReg dummy
bool fCombinationDone
Flag to keep trace of the status of the combination.
Definition: HLFactory.h:104
TList fSigBkgPdfNames
List of channels names to combine for the signal plus background pdfs.
Definition: HLFactory.h:113
TList fLabelsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:122
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:494
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
RooFactoryWSTool & factory()
Return instance to factory tool.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:557
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
virtual void Add(TObject *obj)
Definition: TList.h:81
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
Definition: HLFactory.cxx:563
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
virtual TObject * Next()=0
#define NULL
Definition: Rtypes.h:82
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:604
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index...
RooAbsPdf * GetTotSigBkgPdf()
Get the combined signal plus background pdf.
Definition: HLFactory.cxx:180
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
TObject * obj
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:453
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:42
int fReadFile(const char *fileName, bool is_included=false)
Read the actual cfg file.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904