#ifndef _ResonanceDecay_ #define _ResonanceDecay_ #include "particleType.h" #include "HCA_Amplitudes/resonanceinfo.h" #include "Particle.h" #include "FitParamInfo.h" class ResonanceDecay { public: ResonanceDecay(Particle_t locPsiXPID, Particle_t locPsi1PID, Particle_t locPsi2PID, FitParamInfo* locMassFitParamInfo = NULL, FitParamInfo* locWidthFitParamInfo = NULL) { //if you don't want to fit, pass in NULL for the param info dPsiXPID = locPsiXPID; dPsiXJTimes2 = ParticleJTimes2(locPsiXPID); dPsiXParity = ParticleParity(locPsiXPID); dPsiXMass = ParticleMass(locPsiXPID); dPsiXWidth = ParticleWidth(locPsiXPID); dMassFitParamInfo = locMassFitParamInfo; dWidthFitParamInfo = locWidthFitParamInfo; dPsi1PID = locPsi1PID; dPsi1JTimes2 = ParticleJTimes2(locPsi1PID); dPsi1Parity = ParticleParity(locPsi1PID); dPsi1IsResonanceFlag = (bool)IsResonance(locPsi1PID); dPsi2PID = locPsi2PID; dPsi2JTimes2 = ParticleJTimes2(locPsi2PID); dPsi2Parity = ParticleParity(locPsi2PID); dPsi2IsResonanceFlag = (bool)IsResonance(locPsi2PID); } ResonanceDecay(Particle_t locPsi1PID, Particle_t locPsi2PID, double locMass, double locWidth, int locJXTimes2 = -1, int locParityX = -2) { //call this constructor if you want the mass and width to be FIXED dPsiXPID = Unknown; dPsiXJTimes2 = locJXTimes2; dPsiXParity = locParityX; dPsiXMass = locMass; dPsiXWidth = locWidth; dMassFitParamInfo = NULL; dWidthFitParamInfo = NULL; dPsi1PID = locPsi1PID; dPsi1JTimes2 = ParticleJTimes2(locPsi1PID); dPsi1Parity = ParticleParity(locPsi1PID); dPsi1IsResonanceFlag = (bool)IsResonance(locPsi1PID); dPsi2PID = locPsi2PID; dPsi2JTimes2 = ParticleJTimes2(locPsi2PID); dPsi2Parity = ParticleParity(locPsi2PID); dPsi2IsResonanceFlag = (bool)IsResonance(locPsi2PID); } ResonanceDecay(Particle_t locPsi1PID, Particle_t locPsi2PID, FitParamInfo* locMassFitParamInfo, FitParamInfo* locWidthFitParamInfo, int locJXTimes2 = -1, int locParityX = -2) { //call this constructor if you want the mass and width to be FIT dPsiXPID = Unknown; dPsiXJTimes2 = locJXTimes2; dPsiXParity = locParityX; dPsiXMass = locMassFitParamInfo->dValue; dPsiXWidth = locWidthFitParamInfo->dValue; dMassFitParamInfo = locMassFitParamInfo; dWidthFitParamInfo = locWidthFitParamInfo; dPsi1PID = locPsi1PID; dPsi1JTimes2 = ParticleJTimes2(locPsi1PID); dPsi1Parity = ParticleParity(locPsi1PID); dPsi1IsResonanceFlag = (bool)IsResonance(locPsi1PID); dPsi2PID = locPsi2PID; dPsi2JTimes2 = ParticleJTimes2(locPsi2PID); dPsi2Parity = ParticleParity(locPsi2PID); dPsi2IsResonanceFlag = (bool)IsResonance(locPsi2PID); } bool IsMatch(Particle* locPsiX, Particle* locPsi1, Particle* locPsi2) { if(((dPsiXJTimes2 != locPsiX->dJTimes2) && (dPsiXJTimes2 != -1)) || ((dPsiXParity != locPsiX->dParity) && (dPsiXParity != -2))) return false; if(IsMatch(locPsi1, locPsi2)) return true; return IsMatch(locPsi2, locPsi1); //check reverse order } private: ResonanceDecay(void); bool IsMatch(Particle* locPsi1, Particle* locPsi2) { if(locPsi1->dIsResonanceFlag && ((dPsi1JTimes2 != locPsi1->dJTimes2) || (dPsi1Parity != locPsi1->dParity))) return false; else if((!locPsi1->dIsResonanceFlag) && (dPsi1PID != locPsi1->dPID)) return false; if(locPsi2->dIsResonanceFlag && ((dPsi2JTimes2 != locPsi2->dJTimes2) || (dPsi2Parity != locPsi2->dParity))) return false; else if((!locPsi2->dIsResonanceFlag) && (dPsi2PID != locPsi2->dPID)) return false; return true; } public: Particle_t dPsiXPID; //0 if unknown //needed to keep track of different resonances with same jp int dPsiXJTimes2; //-1 if not-specific: this is applied to all J int dPsiXParity; //-2 if not-specific: this is applied to all P double dPsiXMass; double dPsiXWidth; FitParamInfo* dMassFitParamInfo; FitParamInfo* dWidthFitParamInfo; Particle_t dPsi1PID; int dPsi1JTimes2; int dPsi1Parity; bool dPsi1IsResonanceFlag; //if true/false, lookup by J^P/PID Particle_t dPsi2PID; int dPsi2JTimes2; int dPsi2Parity; bool dPsi2IsResonanceFlag; //if true/false, lookup by J^P/PID }; #endif //_ResonanceDecay_