#include "RooFit.h"
#include "Riostream.h"
#include "Riostream.h"
#include <iomanip>
#include <fstream>
#include "TClass.h"
#include "RooArgList.h"
#include "RooStreamParser.h"
#include "RooFormula.h"
#include "RooAbsRealLValue.h"
#include "RooAbsCategoryLValue.h"
#include "RooStringVar.h"
#include "RooTrace.h"
ClassImp(RooArgList)
;
RooArgList::RooArgList() :
RooAbsCollection()
{
}
RooArgList::RooArgList(const RooArgSet& set) :
RooAbsCollection(set.GetName())
{
add(set) ;
}
RooArgList::RooArgList(const char *name) :
RooAbsCollection(name)
{
}
RooArgList::RooArgList(const RooAbsArg& var1,
const char *name) :
RooAbsCollection(name)
{
add(var1);
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2);
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3);
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3, const RooAbsArg& var4,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4);
}
RooArgList::RooArgList(const RooAbsArg& var1,
const RooAbsArg& var2, const RooAbsArg& var3,
const RooAbsArg& var4, const RooAbsArg& var5,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4); add(var5);
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3, const RooAbsArg& var4,
const RooAbsArg& var5, const RooAbsArg& var6,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4); add(var5); add(var6);
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3, const RooAbsArg& var4,
const RooAbsArg& var5, const RooAbsArg& var6,
const RooAbsArg& var7,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7) ;
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3, const RooAbsArg& var4,
const RooAbsArg& var5, const RooAbsArg& var6,
const RooAbsArg& var7, const RooAbsArg& var8,
const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7) ;add(var8) ;
}
RooArgList::RooArgList(const RooAbsArg& var1, const RooAbsArg& var2,
const RooAbsArg& var3, const RooAbsArg& var4,
const RooAbsArg& var5, const RooAbsArg& var6,
const RooAbsArg& var7, const RooAbsArg& var8,
const RooAbsArg& var9, const char *name) :
RooAbsCollection(name)
{
add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7); add(var8); add(var9);
}
RooArgList::RooArgList(const TCollection& tcoll, const char* name) :
RooAbsCollection(name)
{
TIterator* iter = tcoll.MakeIterator() ;
TObject* obj ;
while((obj=iter->Next())) {
if (!dynamic_cast<RooAbsArg*>(obj)) {
cout << "RooArgList::RooArgList(TCollection) element " << obj->GetName()
<< " is not a RooAbsArg, ignored" << endl ;
continue ;
}
add(*(RooAbsArg*)obj) ;
}
delete iter ;
}
RooArgList::RooArgList(const RooArgList& other, const char *name)
: RooAbsCollection(other,name)
{
}
RooArgList::~RooArgList()
{
}
RooAbsArg& RooArgList::operator[](Int_t idx) const
{
RooAbsArg* arg = at(idx) ;
if (!arg) {
cout << "RooArgList::operator[](" << GetName() << ") ERROR: index "
<< idx << " out of range (0," << getSize() << ")" << endl ;
RooErrorHandler::softAbort() ;
}
return *arg ;
}
void RooArgList::writeToStream(ostream& os, Bool_t compact)
{
if (!compact) {
cout << "RooArgList::writeToStream(" << GetName() << ") non-compact mode not supported" << endl ;
return ;
}
TIterator *iterator= createIterator();
RooAbsArg *next = 0;
while((0 != (next= (RooAbsArg*)iterator->Next()))) {
next->writeToStream(os,kTRUE) ;
os << " " ;
}
delete iterator;
os << endl ;
}
Bool_t RooArgList::readFromStream(istream& is, Bool_t compact, Bool_t verbose)
{
if (!compact) {
cout << "RooArgList::readFromStream(" << GetName() << ") non-compact mode not supported" << endl ;
return kTRUE ;
}
TIterator *iterator= createIterator();
RooStreamParser parser(is) ;
RooAbsArg *next = 0;
while((0 != (next= (RooAbsArg*)iterator->Next()))) {
if (!next->getAttribute("Dynamic")) {
if (next->readFromStream(is,kTRUE,verbose)) {
parser.zapToEnd() ;
delete iterator ;
return kTRUE ;
}
} else {
}
}
if (!parser.atEOL()) {
TString rest = parser.readLine() ;
if (verbose) {
cout << "RooArgSet::readFromStream(" << GetName()
<< "): ignoring extra characters at end of line: '" << rest << "'" << endl ;
}
}
delete iterator;
return kFALSE ;
}
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.