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

modified pbarp test tools

parent 4f2fd4f1
No related branches found
No related tags found
No related merge requests found
......@@ -150,10 +150,6 @@ void pbarpEnv::setup(pbarpParser& thePbarpParser){
std::string suffixStr;
stringStr >> suffixStr;
decSuffixNames[classStr]=suffixStr;
// boost::shared_ptr<IsobarDecay> theDec=IsobarDecayList::instance()->decay(classStr);
// if (0 != theDec) theDec->setFitParSuffix(suffixStr);
// theDec->setFitParSuffix(suffixStr);
}
//set suffixes for decay classes
......@@ -162,15 +158,20 @@ void pbarpEnv::setup(pbarpParser& thePbarpParser){
_decList->replaceSuffix(itMapStrStr->first, itMapStrStr->second);
_prodDecList->replaceSuffix(itMapStrStr->first, itMapStrStr->second);
boost::shared_ptr<IsobarDecay> theDec=_decList->decay(itMapStrStr->first);
// if(0!= theDec) {
// theDec->setFitParSuffix(itMapStrStr->second);
// continue;
// }
// theDec=_prodDecList->decay(itMapStrStr->first);
// if(0!= theDec) {
// theDec->setFitParSuffix(itMapStrStr->second);
// }
}
std::vector<std::string> theHistMassNames=thePbarpParser.histMassNames();
//fill vector histMassSystems
for ( itStr = theHistMassNames.begin(); itStr != theHistMassNames.end(); ++itStr){
std::stringstream stringStr;
stringStr << (*itStr);
std::string tmpName;
std::vector<std::string> currentStringVec;
while(stringStr >> tmpName){
currentStringVec.push_back(tmpName);
}
_histMassSystems.push_back(currentStringVec);
}
}
......
......@@ -33,6 +33,7 @@ public:
boost::shared_ptr<IsobarDecayList> decayList() {return _decList;}
boost::shared_ptr<IsobarDecayList> prodDecayList() {return _prodDecList;}
boost::shared_ptr<pbarpReaction> reaction() {return _pbarpReaction;}
std::vector<std::vector<std::string> >& histMassSystems() {return _histMassSystems;}
protected:
......@@ -48,4 +49,5 @@ protected:
boost::shared_ptr<IsobarDecayList> _decList;
boost::shared_ptr<IsobarDecayList> _prodDecList;
boost::shared_ptr<pbarpReaction> _pbarpReaction;
std::vector<std::vector<std::string> > _histMassSystems;
};
......@@ -67,7 +67,13 @@ void pbarpEventList::read4Vecs(EventList& evtList, std::vector<EvtDataNew*>& the
EvtDataNew* evtData=new EvtDataNew();
//fill WignerD functions
//cache 4 vectors of inital state particles
std::map<std::string, Vector4<float> >::iterator it4VecMap;
for (it4VecMap=particle4VecMap.begin(); it4VecMap!=particle4VecMap.end(); ++it4VecMap){
evtData->FourVecsString[it4VecMap->first]=it4VecMap->second;
}
//fill WignerD functions
std::vector<boost::shared_ptr<IsobarDecay> > theDecays=pbarpEnv::instance()->prodDecayList()->getList();
std::vector<boost::shared_ptr<IsobarDecay> >::iterator itIso;
for (itIso=theDecays.begin(); itIso!=theDecays.end(); ++itIso){
......
......@@ -27,6 +27,7 @@ pbarpParser::pbarpParser(int argc,char **argv):
("production",po::value< vector<string> >(&_productionSystem), "pair of produced particles")
("decay",po::value< vector<string> >(&_decaySystem), "decay: mother and pair of decay particles")
("replaceParamSuffix",po::value< vector<string> >(&_replaceParSuffix), "replace suffix for fit parameter name")
("histMass",po::value< vector<string> >(&_histMass), "histograms inv mass for the selected final state paricles")
;
_config->add(config);
......@@ -58,5 +59,10 @@ bool pbarpParser::parseCommandLine(int argc, char **argv)
for (it=_replaceParSuffix.begin(); it!=_replaceParSuffix.end();++it){
std::cout << (*it) << "\n";
}
std::cout << "\nhistograms inv mass for systems" << std::endl;
for (it=_histMass.begin(); it!=_histMass.end();++it){
std::cout << (*it) << "\n";
}
return true;
}
......@@ -19,6 +19,7 @@ class pbarpParser : public ParserBase
const std::vector<std::string>& productionSystem() const { return _productionSystem; }
const std::vector<std::string>& decaySystem() const { return _decaySystem; }
const std::vector<std::string>& replaceSuffixNames() const { return _replaceParSuffix; }
const std::vector<std::string>& histMassNames() const { return _histMass; }
protected:
virtual bool parseCommandLine(int argc,char **argv);
......@@ -28,6 +29,7 @@ protected:
std::vector<std::string> _productionSystem;
std::vector<std::string> _decaySystem;
std::vector<std::string> _replaceParSuffix;
std::vector<std::string> _histMass;
};
......
......@@ -4,6 +4,7 @@
#include <vector>
#include <map>
#include <iterator>
#include <boost/shared_ptr.hpp>
#include "Examples/pbarp/pbarpParser.hh"
#include "Particle/ParticleTable.hh"
......@@ -24,6 +25,7 @@
#include "Examples/pbarp/pbarpBaseLh.hh"
#include "Examples/pbarp/pbarpEvtReader.hh"
#include "Examples/pbarp/pbarpEventList.hh"
//#include "Examples/pbarp/pbarpHist.hh"
#include "Event/Event.hh"
#include "Event/EventList.hh"
......@@ -35,6 +37,7 @@
#include "Minuit2/MnPrint.h"
#include "Minuit2/MnScan.h"
#ifdef _OPENMP
#include <omp.h>
#endif
......@@ -165,6 +168,20 @@ int main(int __argc,char *__argv[]){
const std::vector<std::string> fixedParams=theAppParams.fixedParams();
const unsigned int noOfFreeFitParams = upar.Params().size()-fixedParams.size();
if (mode=="qaMode"){
Info << "\nThe parameter values are: " << "\n" << endmsg;
theFitParamBase->printParams(theStartparams);
Info << "\nThe parameter errors are: " << "\n" << endmsg;
theFitParamBase->printParams(theErrorparams);
double theLh=theLhPtr->calcLogLh(theStartparams);
Info <<"theLh = "<< theLh << endmsg;
// pbarpHist theHist(theLhPtr, theStartparams);
}
if (mode=="pwa"){
bool cacheAmps = theAppParams.cacheAmps();
Info << "caching amplitudes enabled / disabled:\t" << cacheAmps << endmsg;
......
#pragma once
#include <cassert>
inline double pow(double x, int p) {
if(p == 0) return 1.0;
if(x == 0.0 && p > 0) return 0.0;
if(p < 0) {p=-p; x=1/x;}
double r = 1.0;
for(;;) {
if(p & 1) r *= x;
if((p >>= 1) == 0) return r;
x *= x;
}
}
inline double pow(double x, unsigned int p) {
if(p == 0) return 1.0;
if(x == 0.0) return 0.0;
double r = 1.0;
for(;;) {
if(p & 1) r *= x;
if((p >>= 1) == 0) return r;
x *= x;
}
}
inline int pow(int x, int p) {
if(p == 0) return 1;
if(x == 0 && p > 0) return 0;
if(p < 0) {assert(x == 1 || x == -1); return (-p % 2) ? x : 1;}
int r = 1;
for(;;) {
if(p & 1) r *= x;
if((p >>= 1) == 0) return r;
x *= x;
}
}
inline unsigned int pow(unsigned int x, unsigned int p) {
if(p == 0) return 1;
if(x == 0) return 0;
unsigned int r = 1;
for(;;) {
if(p & 1) r *= x;
if((p >>= 1) == 0) return r;
x *= x;
}
}
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