#include "HCA_ConfigGenerator/ResonanceNodeGenerator.h" #include "HCA_ConfigGenerator/HCA_ConfigGenerator.h" using namespace std; int main() { //USER: SETUP PARTICLE INFO // Final paticles !!!MUST!!! (!!!!!) be in the same order as in the data! (root tree) Particle_t locBeamPID = Gamma; Particle_t locTargetPID = Deuteron; deque locFinalStatePIDs; locFinalStatePIDs.push_back(PiPlus); locFinalStatePIDs.push_back(PiMinus); locFinalStatePIDs.push_back(Deuteron); //USER: SETUP EXCHANGE NODES //Create Exchange Transition Nodes deque locExchangeNodes; ExchangeNode* locExchangeNode = NULL; // g, d -> rho, d locExchangeNode = new ExchangeNode(Rho0, Deuteron, "TChannel_Basic"); //particles, class name // fixed t-slope // locExchangeNode->dClassConfigArguments = "1_2 2.0"; //particles, t-slope // fit t-slope locExchangeNode->dClassConfigArguments = "1_2 [Param_TSlope_Rho]"; //particles, t-slope //is auto-prefaced by helicity sum FitParamInfo* locTSlopeFitParamInfo_rho = new FitParamInfo("Param_TSlope_Rho", 2.0, "bounded", 0.0, 10.0); locExchangeNode->dFitParams.push_back(locTSlopeFitParamInfo_rho); locExchangeNodes.push_back(locExchangeNode); // g, d -> pi+, X^0 locExchangeNode = new ExchangeNode(PiPlus, Unknown, "TChannel_Basic"); //particles, class name // fixed t-slope // locExchangeNode->dClassConfigArguments = "1 2.0"; //particles, t-slope //is auto-prefaced by helicity sum // fit t-slope locExchangeNode->dClassConfigArguments = "1 [Param_TSlope_DPim]"; //particles, t-slope FitParamInfo* locTSlopeFitParamInfo_dpim = new FitParamInfo("Param_TSlope_DPim", 2.0, "bounded", 0.0, 10.0); locExchangeNode->dFitParams.push_back(locTSlopeFitParamInfo_dpim); locExchangeNodes.push_back(locExchangeNode); // g, d -> pi-, X^++ locExchangeNode = new ExchangeNode(PiMinus, Unknown, "TChannel_Basic"); //particles, class name // fixed t-slope // locExchangeNode->dClassConfigArguments = "2 2.0"; //particles, t-slope //is auto-prefaced by helicity sum // fit t-slope locExchangeNode->dClassConfigArguments = "2 [Param_TSlope_DPip]"; //particles, t-slope FitParamInfo* locTSlopeFitParamInfo_dpip = new FitParamInfo("Param_TSlope_DPip", 2.0, "bounded", 0.0, 10.0); locExchangeNode->dFitParams.push_back(locTSlopeFitParamInfo_dpip); locExchangeNodes.push_back(locExchangeNode); //Create Particles Particle *locPsiBeam, *locPsiTarget; deque locFinalStateParticles; ResonanceNodeGenerator locResonanceNodeGenerator(locBeamPID, locTargetPID, locFinalStatePIDs); locResonanceNodeGenerator.Create_Particles(locBeamPID, locTargetPID, locFinalStatePIDs, locPsiBeam, locPsiTarget, locFinalStateParticles); //Generate Resonance (Production, Decay) Transition Nodes deque locTransitionTrees; { //USER: TWEAK VARIABLES //Control Params locResonanceNodeGenerator.dMaxParticleCharge = 2; locResonanceNodeGenerator.dMinParticleCharge = -1; //Limit Flags locResonanceNodeGenerator.dLimitToOneSFlag = false; //if true, choose only one S12 (the smallest) for each possible L12 locResonanceNodeGenerator.dFixParticlePermutationFlag = false; //if true, don't permute final state particles amongst decay chain locations: keep fixed //USER-DEFINED: KNOWN RESONANCE DECAYS: //rho -> pi+, pi-, rho params fixed ResonanceDecay* locResonanceDecay_2pi = new ResonanceDecay(Rho0, PiPlus, PiMinus); locResonanceNodeGenerator.dResonanceDecays.push_back(locResonanceDecay_2pi); //X -> d, pi+, X any J^P //fit X mass, width /* FitParamInfo* locMassFitParamInfo_dpip = new FitParamInfo("Param_BW_DPip_Mass", 2.142, "bounded", 2.0, 2.5); FitParamInfo* locWidthFitParamInfo_dpip = new FitParamInfo("Param_BW_DPip_Width", 0.116, "bounded", 0.05, 0.5); ResonanceDecay* locResonanceDecay_dpip = new ResonanceDecay(Deuteron, PiPlus, locMassFitParamInfo_dpip, locWidthFitParamInfo_dpip); */ //fix X mass & width ResonanceDecay* locResonanceDecay_dpip = new ResonanceDecay(Deuteron, PiPlus, 2.142, 0.116); locResonanceNodeGenerator.dResonanceDecays.push_back(locResonanceDecay_dpip); //X -> d, pi-, fit X params, X any J^P //fit X mass, width /* FitParamInfo* locMassFitParamInfo_dpim = new FitParamInfo("Param_BW_DPim_Mass", 2.150, "bounded", 2.0, 2.5); FitParamInfo* locWidthFitParamInfo_dpim = new FitParamInfo("Param_BW_DPim_Width", 0.110, "bounded", 0.05, 0.5); ResonanceDecay* locResonanceDecay_dpim = new ResonanceDecay(Deuteron, PiMinus, locMassFitParamInfo_dpim, locWidthFitParamInfo_dpim); */ //fix X mass & width ResonanceDecay* locResonanceDecay_dpim = new ResonanceDecay(Deuteron, PiMinus, 2.150, 0.110); locResonanceNodeGenerator.dResonanceDecays.push_back(locResonanceDecay_dpim); //DEBUG locResonanceNodeGenerator.dDebugFlag = false; //REGISTER PARTICLES locResonanceNodeGenerator.Register_Particles(locPsiBeam, locPsiTarget, locFinalStateParticles); //GENERATE int locMaxSChannelJTimes2 = -1; //if < 0, no s-channel (generate for other (input) exchange channels) int locMaxDecayJTimes2 = 4; locTransitionTrees = locResonanceNodeGenerator.Generate(locMaxSChannelJTimes2, locMaxDecayJTimes2, locExchangeNodes); } //USER CREATE CUSTOM TRANSITION TREES HERE //Add them to locTransitionTrees, if any //Generate AmpTools Config File { HCA_ConfigGenerator locHCAConfigGenerator(locBeamPID, locTargetPID, locFinalStatePIDs); //USER TWEAK VARIABLES //Beam Energy //For MC Generation locHCAConfigGenerator.dBeamEnergy = 2.0; //In Lab Frame //Breit-Wigner Control Params locHCAConfigGenerator.dBinInSqrtSFlag = true; locHCAConfigGenerator.dNoBreitWignersFlag = false; //Fit Control Params locHCAConfigGenerator.dMaxNumFitIterations = 10000; //Limit Flags locHCAConfigGenerator.dLimitToOneContractionSchemeFlag = false; //Include phase space amplitude locHCAConfigGenerator.dIncludePhaseSpaceFlag = false; //USER SETUP FILE/CLASS NAME INFO string locFitBaseName = "HCA_MotherFit_d2pi"; //DEBUG locHCAConfigGenerator.dDebugFlag = false; //FILE/CLASS NAME INFO locHCAConfigGenerator.dConfigFileName = locFitBaseName + string(".cfg"); locHCAConfigGenerator.dSeedFileName = locFitBaseName + string("_seed.txt"); locHCAConfigGenerator.dNormalizationIntegralFileName = "NIFILE"; locHCAConfigGenerator.dFitName = "FITNAME"; //Template-sources locHCAConfigGenerator.dGenerateDataFileName = "GENMCFILE"; locHCAConfigGenerator.dAcceptedDataFileName = "ACCMCFILE"; locHCAConfigGenerator.dExperimentDataFileName = "DATAFILE"; //SET PARTICLES locHCAConfigGenerator.Set_Particles(locPsiBeam, locPsiTarget, locFinalStateParticles); //SET FIT PARAMS set locFitParams; locResonanceNodeGenerator.Get_FitParams(locFitParams); locHCAConfigGenerator.Set_FitParams(locFitParams); //GENERATE locHCAConfigGenerator.Generate(locTransitionTrees); } return 0; }