Skip to content
Snippets Groups Projects
Commit 9fba824e authored by Bertram Kopf's avatar Bertram Kopf
Browse files

added missing app TMatrixGeneralApp.cc; limited mass and width parameter to positive values

parent b93886aa
No related branches found
No related tags found
No related merge requests found
//************************************************************************//
// //
// Copyright 2013 Bertram Kopf (bertram@ep1.rub.de) //
// Julian Pychy (julian@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
#include <iostream>
#include <cstring>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <memory>
#include "Examples/Tutorial/LineShapes/TMatrixGeneral.hh"
#include "ErrLogger/ErrLogger.hh"
int main(int __argc,char *__argv[]){
ErrLogger::instance()->setLevel(log4cpp::Priority::DEBUG);
if( __argc>1 && ( strcmp( __argv[1], "-help" ) == 0
|| strcmp( __argv[1], "--help" ) == 0 ) ){
Info << "\nThis is a test application for Bla bla\n"
<< endmsg;
return 0;
}
std::string pathToConfigParser;
while ((optind < (__argc-1) ) && (__argv[optind][0]=='-')) {
bool found=false;
std::string sw = __argv[optind];
if (sw=="--path" || sw=="-path"){
optind++;
pathToConfigParser = __argv[optind];
found=true;
}
if (!found){
Warning << "Unknown switch: "
<< __argv[optind] << endmsg;
optind++;
}
}
TMatrixGeneral tMatrixGeneral(pathToConfigParser);
return 0;
}
......@@ -31,16 +31,44 @@ KMatrixBase::KMatrixBase(vector<std::shared_ptr<KPole> > Kpoles, vector<std::sha
,_KPoles(Kpoles)
,_phpVecs(phpVecs)
{
_bgTerms.resize(phpVecs.size());
for(unsigned int i=0; i<phpVecs.size(); ++i){
std::vector<double> currentbgVec;
currentbgVec.resize(phpVecs.size());
for(unsigned int j=0; j<phpVecs.size(); ++j){
currentbgVec[j]=0.;
}
_bgTerms[i]=currentbgVec;
}
}
KMatrixBase::KMatrixBase(vector<std::shared_ptr<AbsPhaseSpace> > phpVecs, int numCols, int numRows) :
Matrix< complex<double> >::Matrix(numCols, numRows)
,_phpVecs(phpVecs)
{
_bgTerms.resize(numRows);
for(int i=0; i<numRows; ++i){
std::vector<double> currentbgVec;
currentbgVec.resize(numCols);
for(int j=0; j<numCols; ++j){
currentbgVec[j]=0.;
}
_bgTerms[i]=currentbgVec;
}
}
KMatrixBase::KMatrixBase(int numCols, int numRows) :
Matrix< complex<double> >::Matrix(numCols, numRows)
{
_bgTerms.resize(numRows);
for(int i=0; i<numRows; ++i){
std::vector<double> currentbgVec;
currentbgVec.resize(numCols);
for(int j=0; j<numCols; ++j){
currentbgVec[j]=0.;
}
_bgTerms[i]=currentbgVec;
}
}
KMatrixBase::~KMatrixBase(){
......
......@@ -61,6 +61,7 @@ public:
protected:
vector<std::shared_ptr<KPole> > _KPoles;
vector<std::shared_ptr<AbsPhaseSpace> > _phpVecs;
vector< vector<double> > _bgTerms;
};
//_____________________________________________________________________________
......
......@@ -47,7 +47,7 @@ void KMatrixRel::evalMatrix(const double mass){
for (int i=0; i<theKMatrix.NumRows(); ++i){
for (int j=0; j<theKMatrix.NumCols(); ++j){
this->operator()(i,j)=theKMatrix(i,j);
this->operator()(i,j)=theKMatrix(i,j)+_bgTerms.at(i).at(j);
}
}
}
......@@ -307,6 +307,8 @@ void FitParamsBase::setMnUsrParamsDouble(MnUserParameters& upar, mapStrDouble& s
if (suffix==_massSuffix || suffix==_widthSuffix){
minVal=theStartVal-5.*theErrVal;
maxVal=theStartVal+5.*theErrVal;
if(minVal<0.) minVal=0.;
upar.Add(theName, theStartVal, theErrVal, minVal, maxVal);
}
// for complex fit parameter; phi component; quick workaround
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment