#ifndef _HCA_ContractionResult_ #define _HCA_ContractionResult_ #include #include #include #include "TLorentzVector.h" #include "HCA_Components.h" using namespace std; class HCA_ContractionResult { //one object per fit parameter public: HCA_ContractionResult(void) : dHasWOverWThreshold(false) {} inline bool operator==(const HCA_ContractionResult& locFinalAmplitude) const { if(dHasWOverWThreshold != locFinalAmplitude.dHasWOverWThreshold) return false; if(dJ1 != locFinalAmplitude.dJ1) return false; if(dJ2 != locFinalAmplitude.dJ2) return false; if(dJ12 != locFinalAmplitude.dJ12) return false; if(dS12 != locFinalAmplitude.dS12) return false; if(dL12 != locFinalAmplitude.dL12) return false; if(dHelicity12 != locFinalAmplitude.dHelicity12) return false; if(dPsi1IsPhotonFlag != locFinalAmplitude.dPsi1IsPhotonFlag) return false; if(dPsi2IsPhotonFlag != locFinalAmplitude.dPsi2IsPhotonFlag) return false; if(dContractionIndex != locFinalAmplitude.dContractionIndex) return false; return (dGammaTerms == locFinalAmplitude.dGammaTerms); } inline complex Calculate_Result(TLorentzVector locP4_1_CM, TLorentzVector locP4_2_CM) const { double locGamma1 = dPsi1IsPhotonFlag ? 0.0 : locP4_1_CM.Gamma(); double locGamma2 = dPsi2IsPhotonFlag ? 0.0 : locP4_2_CM.Gamma(); complex locI(0.0, 1.0); double locW12 = (locP4_1_CM + locP4_2_CM).M(); double locW12_Th = locP4_1_CM.M() + locP4_2_CM.M(); complex locParityTerm = locI*locW12/locW12_Th; complex locResult(0.0, 0.0); map, double>::const_iterator locIterator = dGammaTerms.begin(); for(; locIterator != dGammaTerms.end(); ++locIterator) locResult += locIterator->second*pow(locGamma1, locIterator->first.first)*pow(locGamma2, locIterator->first.second); if(dHasWOverWThreshold) locResult *= locParityTerm; return locResult; } inline bool operator!=(const HCA_ContractionResult& locFinalAmplitude) const{return (!((*this) == locFinalAmplitude));} bool dHasWOverWThreshold; map, double> dGammaTerms; //pair is NumGammaTerms_PsiJ1/J2 (including 0, 0), double is coefficient int dJ1; int dJ2; int dHelicity12; int dS12; int dL12; int dJ12; bool dPsi1IsPhotonFlag; bool dPsi2IsPhotonFlag; ContractionScheme dContractionScheme; int dContractionIndex; //identifier for the contraction scheme }; #endif //_HCA_ContractionResult_