00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "RooFit.h"
00026 #include "RooMsgService.h"
00027 #include "RooAbsDataStore.h"
00028
00029 #include "Riostream.h"
00030 #include <iomanip>
00031 #include "TClass.h"
00032
00033 using namespace std ;
00034
00035 ClassImp(RooAbsDataStore)
00036 ;
00037
00038
00039
00040 RooAbsDataStore::RooAbsDataStore()
00041 {
00042
00043 _iterator = _vars.createIterator() ;
00044 _cacheIter = _cachedVars.createIterator() ;
00045 _doDirtyProp = kTRUE ;
00046 }
00047
00048
00049
00050
00051
00052 RooAbsDataStore::RooAbsDataStore(const char* name, const char* title, const RooArgSet& vars) :
00053 TNamed(name,title)
00054 {
00055
00056
00057
00058 _vars.add(vars) ;
00059
00060 _iterator = _vars.createIterator() ;
00061 _cacheIter = _cachedVars.createIterator() ;
00062 _doDirtyProp = kTRUE ;
00063 }
00064
00065
00066
00067
00068
00069 RooAbsDataStore::RooAbsDataStore(const RooAbsDataStore& other, const char* newname) : TNamed(other), RooPrintable(other)
00070 {
00071 if (newname) {
00072 SetName(newname) ;
00073 }
00074 _vars.add(other._vars) ;
00075 _iterator = _vars.createIterator() ;
00076 _cacheIter = _cachedVars.createIterator() ;
00077 _doDirtyProp = other._doDirtyProp ;
00078 }
00079
00080
00081
00082
00083 RooAbsDataStore::RooAbsDataStore(const RooAbsDataStore& other, const RooArgSet& vars, const char* newname) : TNamed(other), RooPrintable(other)
00084 {
00085 if (newname) {
00086 SetName(newname) ;
00087 }
00088 _vars.add(vars) ;
00089 _iterator = _vars.createIterator() ;
00090 _cacheIter = _cachedVars.createIterator() ;
00091 _doDirtyProp = other._doDirtyProp ;
00092 }
00093
00094
00095
00096
00097 RooAbsDataStore::~RooAbsDataStore()
00098 {
00099
00100 delete _iterator ;
00101 delete _cacheIter ;
00102 }
00103
00104
00105
00106
00107 Bool_t RooAbsDataStore::valid() const
00108 {
00109
00110
00111 return kTRUE ;
00112 }
00113
00114
00115
00116 void RooAbsDataStore::printName(ostream& os) const
00117 {
00118
00119
00120 os << GetName() ;
00121 }
00122
00123
00124
00125
00126 void RooAbsDataStore::printTitle(ostream& os) const
00127 {
00128
00129 os << GetTitle() ;
00130 }
00131
00132
00133
00134
00135 void RooAbsDataStore::printClassName(ostream& os) const
00136 {
00137
00138 os << IsA()->GetName() ;
00139 }
00140
00141
00142
00143
00144 void RooAbsDataStore::printValue(ostream& os) const
00145 {
00146
00147 os << numEntries() << " entries" ;
00148 }
00149
00150
00151
00152
00153 void RooAbsDataStore::printArgs(ostream& os) const
00154 {
00155
00156
00157 os << "[" ;
00158 _iterator->Reset() ;
00159 RooAbsArg* arg ;
00160 Bool_t first(kTRUE) ;
00161 while((arg=(RooAbsArg*)_iterator->Next())) {
00162 if (first) {
00163 first=kFALSE ;
00164 } else {
00165 os << "," ;
00166 }
00167 os << arg->GetName() ;
00168 }
00169 os << "]" ;
00170 }
00171
00172
00173
00174
00175
00176
00177
00178 Int_t RooAbsDataStore::defaultPrintContents(Option_t* ) const
00179 {
00180
00181
00182 return kName|kClassName|kArgs|kValue ;
00183 }
00184
00185
00186
00187
00188
00189
00190 void RooAbsDataStore::printMultiline(ostream& os, Int_t , Bool_t verbose, TString indent) const
00191 {
00192
00193
00194 os << indent << "DataStore " << GetName() << " (" << GetTitle() << ")" << endl ;
00195 os << indent << " Contains " << numEntries() << " entries" << endl;
00196
00197 if (!verbose) {
00198 os << indent << " Observables " << _vars << endl ;
00199 } else {
00200 os << indent << " Observables: " << endl ;
00201 _vars.printStream(os,kName|kValue|kExtras|kTitle,kVerbose,indent+" ") ;
00202 }
00203
00204 if(verbose) {
00205 if (_cachedVars.getSize()>0) {
00206 os << indent << " Caches " << _cachedVars << endl ;
00207 }
00208
00209
00210
00211
00212
00213
00214 }
00215 }
00216
00217
00218