Skip to content
Snippets Groups Projects
Commit 2c935dd1 authored by Julian Pychy's avatar Julian Pychy
Browse files

added pbar momentum argument, dynamic inv. mass range calculation

parent fb441259
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,7 @@ histAngles = K+ from K+ K-
histAngles = K+ from K+ pion0
histAngles = K- from K- pion0
pdgTableFile = /Examples/pbarp/pdt.table
pdgTableFile = /Particle/pdtNew.table
cacheAmps = true
lmax = 2
pbarmom = 1.94
......@@ -4,6 +4,7 @@
#include <getopt.h>
#include <fstream>
#include <string>
#include <iomanip>
#include "PwaUtils/AbsLh.hh"
#include "qft++/relativistic-quantum-mechanics/Utils.hh"
......@@ -89,7 +90,7 @@ double AbsLh::calcLogLh(fitParams& theParamVal){
-logLH_data
+weightSum*logLH_mc_Norm;
Info << "current LH = " << logLH << endmsg;
Info << "current LH = " << std::setprecision(10) << logLH << endmsg;
return logLH;
}
......
......@@ -58,7 +58,7 @@ double PwaFcnBase::operator()(const std::vector<double>& par) const
{
#endif
_fcnCounter++;
DebugMsg << "logLh= " << result <<endmsg;
// DebugMsg << "logLh= " << result <<endmsg;
if ( _fcnCounter%50 == 0) {
_fitParamsBasePtr->printParams(theFitParmValTmp);
......
......@@ -27,6 +27,7 @@ pbarpEnv* pbarpEnv::instance()
pbarpEnv::pbarpEnv() :
AbsEnv()
,_lmax(0)
,_pbarMomentum(0)
{
}
pbarpEnv::~pbarpEnv(){
......@@ -36,6 +37,9 @@ void pbarpEnv::setup(pbarpParser* thePbarpParser){
AbsEnv::setup(thePbarpParser);
//Antiproton momentum
_pbarMomentum = thePbarpParser->getpbarMomentum();
//Lmax
_lmax=thePbarpParser->getLMax();
......
......@@ -32,6 +32,7 @@ public:
void setup(pbarpParser* thePbarpParser);
// ParticleTable* particleTable() {return _particleTable;}
const float pbarMomentum() const {return _pbarMomentum;}
// const int lmax() const {return _lmax;}
// const int noFinalStateParticles() {return _noFinalStateParticles;}
// std::vector<Particle*> finalStateParticles() {return _finalStateParticles;}
......@@ -42,13 +43,13 @@ public:
std::vector<std::vector<std::string> >& histMassSystems() {return _histMassSystems;}
std::vector<boost::shared_ptr<angleHistData> >& angleHistDataVec() {return _angleHistDataVec;}
const std::string outputFileNameSuffix() const {return _outputFileNameSuffix;}
protected:
pbarpEnv();
static pbarpEnv* _instance;
// bool _alreadySetUp;
int _lmax;
float _pbarMomentum;
// int _noFinalStateParticles;
// ParticleTable* _particleTable;
......
......@@ -103,16 +103,30 @@ void pbarpHist::initRootStuff(){
std::string histName="data"+tmpBaseName;
std::string histDescription = "M("+tmpMassHistData->_name+") (data)";
double massMin=-0.05;
double massMax=2.;
double pbarMom = pbarpEnv::instance()->pbarMomentum();
double massMin=0;
double massMax = sqrt(pow(sqrt(0.9383*0.9383 + pbarMom*pbarMom) + 0.9383, 2) - pbarMom*pbarMom);
std::vector<std::string> fspNames=tmpMassHistData->_fspNames;
std::vector<std::string>::iterator itStr2;
for(itStr2=fspNames.begin(); itStr2!=fspNames.end(); ++itStr2){
Particle* currentParticle=pbarpEnv::instance()->particleTable()->particle(*itStr2);
massMin+= currentParticle->mass();
massMax+= currentParticle->mass();
std::vector<Particle*> allFsp = pbarpEnv::instance()->finalStateParticles();
std::vector<Particle*>::iterator itAllFsp;
for(itAllFsp = allFsp.begin(); itAllFsp != allFsp.end(); ++itAllFsp){
bool isObserver = true;
std::vector<std::string>::iterator itStr2;
for(itStr2=fspNames.begin(); itStr2!=fspNames.end(); ++itStr2){
if(*itStr2 == (*itAllFsp)->name())
isObserver = false;
}
if(isObserver)
massMax-= (*itAllFsp)->mass();
else
massMin+= (*itAllFsp)->mass();
}
std::cout << "Setting massMin to " << massMin << std::endl;
std::cout << "Setting massMax to " << massMax << std::endl;
TH1F* currentMassDataHist=new TH1F(histName.c_str(), histDescription.c_str(), 100., massMin, massMax);
currentMassDataHist->Sumw2();
_massDataHistMap[tmpMassHistData]=currentMassDataHist;
......
......@@ -13,10 +13,12 @@ using namespace std;
pbarpParser::pbarpParser(int argc,char **argv):
ParserBase(argc,argv)
,_lMax(3)
,_pbarMomentum(2.)
{
po::options_description common("Common Options");
common.add_options()
("lmax", po::value<unsigned>(&_lMax)->default_value(_lMax),"choose lmax.")
("pbarmom", po::value<float>(&_pbarMomentum)->default_value(_pbarMomentum),"antiproton momentum")
;
_common->add(common);
......@@ -36,7 +38,9 @@ pbarpParser::pbarpParser(int argc,char **argv):
bool pbarpParser::parseCommandLine(int argc, char **argv)
{
ParserBase::parseCommandLine(argc, argv);
std::cout << "Maximum orbital momentum for pbarp system\t Lmax=\t" << _lMax <<std::endl;
std::cout << "Antiproton momentum in lab frame\t pbarmom = " << _pbarMomentum << std::endl;
std::cout << "Maximum orbital momentum for pbarp system\t Lmax = " << _lMax <<std::endl;
std::vector<std::string>::const_iterator it;
std::cout << "\nproduction system:" << std::endl;
......
......@@ -17,6 +17,7 @@ class pbarpParser : public ParserBase
virtual ~pbarpParser(){;}
const unsigned int getLMax() const { return _lMax; }
const float getpbarMomentum() const { return _pbarMomentum; }
const std::vector<std::string>& productionSystem() const { return _productionSystem; }
const std::vector<std::string>& histMassNames() const { return _histMass; }
const std::vector<std::string>& histAngleNames() const { return _histAngles;}
......@@ -25,6 +26,7 @@ class pbarpParser : public ParserBase
protected:
virtual bool parseCommandLine(int argc,char **argv);
unsigned int _lMax;
float _pbarMomentum;
std::vector<std::string> _productionSystem;
std::vector<std::string> _histMass;
std::vector<std::string> _histAngles;
......
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