13 #include "TDirectory.h" 21 const char MinuitParameterSet::prtNameChars[] = {
'+',
'-',
'*',
'>',
',',
'(',
')',
'[',
']',
'\0'};
22 const char MinuitParameterSet::ntpNameChars[] = {
'p',
'm',
's',
'_',
'_',
'_',
'_',
'_',
'_',
'\0'};
26 if(0 == _defaultMinuitParameterSet){
29 return _defaultMinuitParameterSet;
32 MinuitParameterSet::MinuitParameterSet(){}
34 : _parPtrList(other._parPtrList)
39 for(
unsigned int i=0; i<
size(); i++){
50 if(0 == parPtr)
return false;
52 cout <<
"MinuitParameterSet::add " 53 <<
" adding parPtr " << parPtr->
name() << endl;
57 cout <<
"MinuitParameterSet::add " 58 <<
" already have parPtr " << parPtr->
name() << endl;
74 cout <<
"WARNING in MinuitParameterSet::unregister" 75 <<
" parPtr you want to unregister is not part of this list!" 111 for(std::vector<IMinuitParameter*>::iterator it =
_parPtrList.begin();
125 cout <<
"Hello from MinuitParameterSet::makeNewNtpForOwner" << endl;
128 if(0 == ntpFile) ntpFile =
new TFile(
"MinuitParameterSetFile.root" 131 TNtupleD* ntp =
new TNtupleD(
"MinuitParameterSetNtp" 132 ,
"MinuitParameterSetNtp" 139 for(
unsigned int i=1; i <
s.size(); i++){
141 if(
s[i-1] ==
'-' &&
s[i] ==
'>'){
142 s[i-1] =
't';
s[i] =
'o';
156 for(
unsigned int i=0; i <
size(); i++){
161 name = ((string) (TString(name).ReplaceAll(
"GS",
"")));
162 name = ((string) (TString(name).ReplaceAll(
"Lass",
"")));
163 name = ((string) (TString(name).ReplaceAll(
"RhoOmega",
"")));
164 if(str !=
"") str +=
":";
165 str += (name +
"_mean" +
":"); n++;
166 str += (name +
"_init" +
":"); n++;
167 str += (name +
"_err:"); n++;
168 str += (name +
"_pull"); n++;
171 cout <<
"MinuitParameterSet::ntpNames():" 172 <<
" made " << n <<
" names " << str << endl;
173 cout <<
" this becomes: prtToNtpName(str) " 182 cout <<
"hello from MinuitParameterSet::fillNtp " << endl;
183 cout <<
" you called me with: " << ntp << endl;
187 if(dbThis) cout <<
"got an ntuple ptr: " << ntp << endl;
188 Double_t* array =
new Double_t[
size()*4];
189 if(dbThis) cout <<
"made array" << endl;
191 for(
unsigned int i=0; i <
size(); i++){
197 Double_t pull=-9999.0;
204 cout <<
"checking how ntuple behaves with GetEntries()" << endl;
205 cout <<
" ntp->GetEntries() = " << ntp->GetEntries() << endl;
207 if(dbThis)cout <<
"filled the array, now putting this into the ntp" << endl;
209 if(dbThis)cout <<
"filled into the ntuple, now deleting array" << endl;
211 if(dbThis)cout <<
"done. returning" << endl;
217 for(
unsigned int i=0; i <
size(); i++){
224 for(
unsigned int i=0; i <
size(); i++){
232 os <<
"\n ======== MinuitParameterSet::(FitResult - StartValue)/error ========\n";
233 for(
unsigned int i=0; i < this->
size(); i++){
239 os <<
"\n ====================================================================" 245 cout <<
"WARNING: MiniutParameterSet::setCovMatrix: given matrix has the wrong size!" << endl ;
246 cout <<
"N. parameters: " <<
size() <<
", matrix is " <<
covMatrix.GetNcols() <<
"x" static const char prtNameChars[]
virtual double meanInit() const =0
virtual void printResultVsInput(std::ostream &os=std::cout) const =0
virtual bool setParSetIndex(int psetIndex)=0
std::vector< IMinuitParameter * > _parPtrList
void fillNtp(TFile *&ntpFile, TNtupleD *&ntp) const
bool addToEnd(IMinuitParameter *parPtr)
virtual int iFixInit() const =0
bool setCovMatrix(const CovMatrix &)
Set the covariance matrix.
IMinuitParameter * getParPtr(unsigned int i)
unsigned int size() const
virtual double err() const =0
void deleteListAndObjects()
virtual const std::string & name() const =0
void deleteListKeepObjects()
bool unregister(IMinuitParameter *patPtr)
TMatrixTSym< double > CovMatrix
void printResultVsInput(std::ostream &os=std::cout) const
TNtupleD * makeNewNtpForOwner(TFile *&ntpFile) const
bool add(IMinuitParameter *parPtr)
static std::string prtToNtpName(const std::string &s_in)
virtual bool setParSet(MinuitParameterSet *ps)=0
const CovMatrix & covMatrix() const
Get the covariance matrix.
virtual void print(std::ostream &os=std::cout) const =0
void print(std::ostream &os=std::cout) const
void printVariable(std::ostream &os=std::cout) const
static const char ntpNameChars[]
MinuitParameterSet getFloating()
std::string ntpNames() const