56 m_functionality( flag ),
57 m_configurationInfo(
NULL ),
58 m_minuitMinimizationManager(
NULL),
59 m_parameterManager(
NULL),
136 cout <<
"AmpToolsInterface WARNING: not creating an AmplitudeManager for reaction " 137 << reactionName << endl;
166 cout <<
"AmpToolsInterface WARNING: not creating a DataReader for data associated with reaction " 167 << reactionName << endl;
169 cout <<
"AmpToolsInterface WARNING: not creating a DataReader for generated MC associated with reaction " 170 << reactionName << endl;
172 cout <<
"AmpToolsInterface WARNING: not creating a DataReader for accepted MC associated with reaction " 173 << reactionName << endl;
185 cout <<
"AmpToolsInterface WARNING: no name given to NormInt file for reaction " 186 << reactionName << endl;
193 cout <<
"AmpToolsInterface WARNING: not creating a NormIntInterface for reaction " 194 << reactionName << endl;
209 cout <<
"AmpToolsInterface WARNING: not creating a LikelihoodCalculator for reaction " 210 << reactionName << endl;
242 if (likCalc)
return (*likCalc)();
266 ofstream outFile(outputFile.c_str());
285 normInt->exportNormIntCache( reaction->
normIntFile() );
392 for (
unsigned int i = 0; i <
MAXAMPVECS; i++){
408 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
420 unsigned int iDataSet){
423 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
435 unsigned int iDataSet){
438 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
449 unsigned int iDataSet) {
452 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
473 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
484 unsigned int iDataSet){
487 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
498 unsigned int iDataSet)
const {
501 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
505 if (iEvent >=
m_ampVecs[iDataSet].m_iNTrueEvents || iEvent < 0){
506 cout <<
"AmpToolsInterface ERROR: out of bounds in intensity call" << endl;
517 unsigned int iDataSet)
const {
520 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
524 if (iEvent >=
m_ampVecs[iDataSet].m_iNTrueEvents || iEvent < 0){
525 cout <<
"AmpToolsInterface ERROR: out of bounds in decayAmplitude call" << endl;
536 return complex<double>
547 double scale = intenMan->
getScale( ampName );
550 return scale * prodAmp;
556 unsigned int iDataSet)
const {
559 cout <<
"AmpToolsInterface: ERROR data set index out of range" << endl;
564 double runningIntensity = 0.0;
569 for (
unsigned int iSum = 0; iSum < sums.size(); iSum++){
571 complex<double> runningAmplitude(0.0,0.0);
575 vector<AmplitudeInfo*> amps =
577 for (
unsigned int iAmp = 0; iAmp < amps.size(); iAmp++){
580 complex<double> D =
decayAmplitude(iEvent,amps[iAmp]->fullName(),iDataSet);
582 runningAmplitude += P*D;
586 runningIntensity += norm(runningAmplitude);
590 return runningIntensity;
600 cout <<
"AmpToolsInterface ERROR: kinematics incompatible with this reaction" << endl;
604 cout <<
" +++++++++++++++++++++++++++++++++" << endl;
605 cout <<
" EVENT KINEMATICS " << endl;
606 streamsize defaultStreamSize = cout.precision(15);
607 for (
unsigned int imom = 0; imom < momenta.size(); imom++){
608 cout <<
" particle " << reaction->
particleList()[imom] << endl;
609 cout <<
" E = " << momenta[imom].E() << endl;
610 cout <<
" Px = " << momenta[imom].Px() << endl;
611 cout <<
" Py = " << momenta[imom].Py() << endl;
612 cout <<
" Pz = " << momenta[imom].Pz() << endl;
614 cout.precision(defaultStreamSize);
615 cout <<
" +++++++++++++++++++++++++++++++++" << endl << endl;
627 cout <<
"NOTE: printAmplitudes is being called for a reaction " 628 <<
" that is not setup for an amplitude fit." 629 <<
" (Nothing more will be printed.)" << endl;
645 #ifdef GPU_ACCELERATION 650 int nAmps = ampNames.size();
656 int iAmpFactOffset = 0;
658 for (
unsigned int iamp = 0; iamp < nAmps; iamp++){
660 cout <<
" ----------------------------------" << endl;
661 cout <<
" AMPLITUDE = " << ampNames[iamp] << endl;
662 cout <<
" ----------------------------------" << endl << endl;
664 vector< const Amplitude* > ampFactors = ampMan->
getFactors(ampNames[iamp]);
665 vector <vector <int> > permutations = ampMan->
getPermutations(ampNames[iamp]);
667 int nPerm = permutations.size();
668 int nFact = ampFactors.size();
670 int iLocalOffset = 0;
672 for (
unsigned int iperm = 0; iperm < nPerm; iperm++){
674 cout <<
" PERMUTATION = ";
675 for (
unsigned int ipar = 0; ipar < permutations[iperm].size(); ipar++){
676 cout << permutations[iperm][ipar] <<
" ";
679 cout << endl << endl;
681 int iOffsetP = iAmpFactOffset + 2 * iperm;
683 for (
unsigned int ifact = 0; ifact < nFact; ifact++){
685 int iOffsetF = iOffsetP + 2 * nPerm * ifact;
687 cout <<
" AMPLITUDE FACTOR = " << ampFactors[ifact]->name() << endl;
688 cout <<
" RESULT = ( " 700 iAmpFactOffset += iLocalOffset;
713 cout <<
" ---------------------------------" << endl;
714 cout <<
" CALCULATING INTENSITY" << endl;
715 cout <<
" ---------------------------------" << endl << endl;
717 cout << endl <<
" INTENSITY = " << intensity << endl << endl << endl;
ReactionInfo * reaction(const string &reactionName) const
virtual DataReader * clone() const =0
unsigned long long m_iNEvents
virtual Amplitude * clone() const =0
vector< CoherentSumInfo * > coherentSumList(const string &reactionName="", const string &sumName="") const
void allocateTerms(const IntensityManager &intenMan, bool bAllocIntensity=false)
const pair< string, vector< string > > & accMC() const
void setupFromConfigurationInfo(ConfigurationInfo *cfgInfo)
bool calcTerms(AmpVecs &Vecs) const
void allocateCPUAmpStorage(const IntensityManager &intenMan)
double calcIntensity(const Kinematics *kinematics) const
void registerAmplitudeFactor(const Amplitude &defaultAmplitude)
const vector< string > & particleList() const
void copyAmpsFromGPU(AmpVecs &a)
void writeResults(const string &fileName) const
virtual double calcIntensities(AmpVecs &Vecs) const =0
int termIndex(const string &termName) const
const vector< string > & getTermNames() const
const vector< const Amplitude *> & getFactors(const string &name) const
const pair< string, vector< string > > & genMC() const
unsigned long long m_iNTrueEvents
const pair< string, vector< string > > & data() const
virtual Type type() const =0
const AmpParameter & getScale(const string &name) const
const vector< TLorentzVector > & particleList() const
void loadData(DataReader *pDataReader, bool bForceNegativeWeight=false)
bool normIntFileInput() const
const vector< vector< int > > & getPermutations(const string &name) const
complex< double > productionFactor(const string &termName) const
vector< AmplitudeInfo * > amplitudeList(const string &reactionName="", const string &sumName="", const string &Name="") const
Kinematics * getEvent(int i)
string fitOutputFileName() const
void loadEvent(const Kinematics *pKinematics, unsigned long long iEvent=0, unsigned long long iNTrueEvents=1, bool bForceNegativeWeight=false)
vector< ReactionInfo * > reactionList(const string &reactionName="") const
void setPrecision(double precision)
string reactionName() const
const pair< string, vector< string > > & bkgnd() const
string normIntFile() const