diff --git a/doc/ReleaseNotes.md b/doc/ReleaseNotes.md index 259b395..b59d5c3 100644 --- a/doc/ReleaseNotes.md +++ b/doc/ReleaseNotes.md @@ -1,841 +1,845 @@ # Laura++ release notes +4th February 2020 Dan Johnson +* Extend the K-matrix implementation to handle non-zero spin + - see https://phab.hepforge.org/T135 + 1st February 2021 Dan Johnson * Allow floating of parameters in the K-matrix - see https://phab.hepforge.org/T59 2nd December 2020 Thomas Latham * Fix LauFormulaPar to follow change in behaviour of TFormula - see https://phab.hepforge.org/T129 27th November 2020 Dan Johnson * Allow slope of NR exponential model to vary negative - improves fit stability in low-statistics fits - see https://phab.hepforge.org/T128 17th September 2020 Mark Whitehead * Begin updates to use inclusive language. Simultaneous fits now handled by Coordinator and Tasks - see https://phab.hepforge.org/T112 19th August 2020 Thomas Latham * Remove explicit normalisation of numerator Blatt-Weisskopf factors - See https://phab.hepforge.org/T93 22nd May 2020 Thomas Latham * Fix uninitialised variable (related to rho-omega mixing) in LauIsobarDynamics 12th December 2019 Thomas Latham & Daniel Johnson * Fix issue with generation of events for categories with small expected yield - See https://phab.hepforge.org/T76 21st November 2019 Thomas Latham * Add QuasiFlatSqDalitz example, which generates toy according to EvtGen's FLATSQDALITZ model 6th - 20th November 2019 Thomas Latham * Adopt CMake as the build system - See https://phab.hepforge.org/T33 === ## Laura++ v3r5 6th August 2019 Thomas Latham * Add some extra charmonium states to list of known resonances * Minor modifications to code for importing parameter values from file 17th May 2019 Thomas Latham * Fix licences and Doxygen in pole, nonresonant form factors, and rescattering line shapes * Add journal reference for pole line shape * Fix class names and add Doxygen to LauCalcChiSq, LauResultsExtractor, LauMergeDataFiles * Update Doxyfile from more recent Doxygen version * Make consistent the use of ClassDef and ClassImp everywhere * Add functions to return the "sanitised" names of parent and daughters 8th January 2019 Thomas Latham * Workaround for issue with splitting toy MC files when generating large number of experiments 5th December 2018 Thomas Latham * Move sources and headers for the utilities library into the main library - makes examples dir executables only (in preparation for CMake build) 22nd, 23rd July and 4th August 2018 Juan Otalora * Add pole, nonresonant form factors, and rescattering line shapes 17th April 2018 Daniel O'Hanlon * Fix bug in rho-omega mixing fit-fraction calculation: rho fit-fraction was not normalised to the total DP rate 23rd March 2018 Thomas Latham * Some fixes in LauRhoOmegaMix that propagate the following settings to the subcomponents: - spinType_ - flipHelicity_ - ignoreMomenta_ - ignoreSpin_ - ignoreBarrierScaling_ 23rd February 2018 Thomas Latham * Add section on structure of package to README file (requested by CPC technial editor) * Add copyright notice to files in test directory 21st February 2018 Thomas Latham * Improve comments in functions calculating helicity angles in LauKinematics 19th February 2018 Daniel O'Hanlon * Fix bug in LauCPFitModel introduced in code for importing parameters (25/01/18) - When parameters are asked to be randomised via useRandomInitFitPars, those parameters that were already fixed in the model, in addition to those that are fixed on import, were being freed. 19th February 2018 Daniel O'Hanlon * Bug fixes in rho/omega fit fractions calculation 25th January 2018 Daniel O'Hanlon * Add feature for importing parameters into LauCPFitModels from previous fit output files. 23rd January 2018 Daniel O'Hanlon * Calculate separate rho and omega fit-fractions for LauRhoOmegaMix, when turned on with calculateRhoOmegaFitFractions in LauIsobarDynamics. === ## Laura++ v3r4 16th January 2018 Thomas Latham * Update licence for all files to the Apache Software License Version 2.0 14th December 2017 Thomas Latham * Correct LauFlatteRes to use the exact formulae from the papers that report the default parameter values for each supported resonance - Deals correctly now with the cases where the m0 is absorbed into the couplings - Now uses the correct value of g1 for the a_0(980) (needed to be squared) - Also sets the mass values to those reported in those papers - Added printout to specify what is being done in each case * Improve the consistency between the weightEvents functions in LauSimpleFitModel and LauCPFitModel - Also remove the unecessary division by ASqMax in LauIsobarDynamics::getEventWeight 4th December 2017 Thomas Latham * Allow background yields to be specified as any LauAbsRValue (i.e. LauParameter or now also LauFormulaPar) 30th November 2017 Thomas Latham * In LauFitDataTree::readExperimentData add a check that the tree contains the branch "iExpt" and if not: - If the requested experiment is 0 then read all data in the tree (and print a warning) - Otherwise print an error message and return 29th November 2017 Thomas Latham * Improve error messages in LauCPFitModel::weightEvents === ## Laura++ v3r3 23rd November 2017 Thomas Latham * Add an example written as a python script: GenFit3pi.py * Various improvements to the other example code 23rd November 2017 Thomas Latham * Fix bug in the LauAbsResonance constructor used by the K-matrix - "resonance" charge is now set to the sum of the daughter charges 1st November 2017 Thomas Latham * Fix bug in LauFlatteRes - m_0 factor multiplying the width was, if useAdlerTerm_ is true, replaced by f_Adler rather than being multiplied by it - only affected case where using LauFlatteRes to describe K_0*(1430) === ## Laura++ v3r2 18th October 2017 Thomas Latham * Modify LauDaughters::testDPSymmetry to: - produce an ERROR message and exit if the symmetric DP does not have its daughters arranged correctly - detect also flavour-conjugate DPs and set a corresponding flag that can be retrieved via LauDaughters::gotFlavourConjugateDP - in this case if the daughters are sub-optimally arranged print a WARNING * Modify LauIsobarDynamics::calcDPNormalisationScheme so that any narrow resonance regions are symmetrised appropriately if the DP is fully-symmetric, symmetric or is flavour-conjugate (and in this last case, symmetrisation of the integration has been forced via a new boolean function) 11th October 2017 Thomas Latham * Allow the user to specify the randomiser to be used to randomise the initial values of the isobar parameters - simply use the new static function LauAbsCoeffSet::setRandomiser - if not specified it defaults to the current use of LauRandom::zeroSeedRandom 10th October 2017 Thomas Latham * Make symmetrisation of vetoes automatic in LauVetoes for symmetric DPs - but add new allowed indices (4 and 5) to allow vetoes to be applied to mMin or mMax if desired * Also apply to fully symmetric DPs * In addition implement the more efficient calculation of the amplitude in the fully symmetric case 23rd September 2017 Thomas Latham * Fix expressions for Covariant option for Blatt-Weisskopf momentum for spin > 1 * Make use of setSpinFormalism to set the formalism to Legendre for NR types (instead of kludging with ignoreMomentum) 15th September 2017 Thomas Latham * Various improvements to the examples 6th September 2017 Thomas Latham * Improve doxygen comments for event-embedding functions in fit models 5th September 2017 Thomas Latham * Improve efficiency of Covariant spin factor calculations 31st August 2017 Thomas Latham * Add further option for parent Blatt-Weisskopf momentum - Covariant (corresponding to Covariant spin factor) 8th August 2017 Thomas Latham * Implement expressions for the spin factor based on covariant tensor formalism * Make it much simpler to switch between formalism options via new functions in LauResonanceMaker: - setSpinFormalism, setBWType, setBWBachelorRestFrame - default settings are unchanged (and are equivalent to setting LauAbsResonance::Zemach_P, LauBlattWeisskopfFactor::BWPrimeBarrier, LauBlattWeisskopfFactor::ResonanceFrame, respectively) 21st July 2017 Thomas Latham * Add note to README file about compilation issue on Ubuntu 16.04 LTS 21st July 2017 Thomas Latham * Create public functions to update the kinematics based on one invariant mass and the corresponding helicity angle 20th June 2017 Daniel O'Hanlon * Terminate when asked to read a non-existent K-matrix parameter file 8th June 2017 Thomas Latham * Fix compilation error on gcc 4.9 30th May 2017 Thomas Latham * Permit different efficiency histograms to be defined in classic/square DP and force enable calculation of square DP coords (here and for background PDFs) if required 29th May 2017 Thomas Latham * Propagate information on EDM from the minimiser to the fit models and into the fit results ntuple 29th May 2017 Thomas Latham * Ensure that the kinematics will calculate the square DP co-ordinates if the integration requires them 29th May 2017 Thomas Latham * Reintegrate the RooFit-slave branch into the trunk (and delete the branch) 28th March 2017 Thomas Latham (in branch for developing RooFit-based slave) * Rename cacheFitData to verifyFitData in all fit models and RF-slave 28th March 2017 Daniel O'Hanlon * Fix bug in LauCPFitModel::weightEvents 24th March 2017 Thomas Latham (in branch for developing RooFit-based slave) * Refactor code between fit models, master, slave and fit-object classes 22nd March 2017 Thomas Latham (in branch for developing RooFit-based slave) * Make the compilation of the RF-based slave class, and its associated example binary, optional 22nd March 2017 Thomas Latham (in branch for developing RooFit-based slave) * Complete working example of RooFit-based slave - Have identified some scope for refactoring of code - Also want to make the compilation of this class, and its associated example binary, optional 15th March 2017 Mark Whitehead (in branch for developing time-dependent model) * Handle event-by-event mistag probabilities 7th March 2017 Thomas Latham * Rename the command for weighting events from "reweight" to "weight" 3rd March 2017 Daniel O'Hanlon * Implement LauCPFitModel::weightEvents based on the same function in LauSimpleFitModel 1st March 2017 Thomas Latham (in branch for developing RooFit-based slave) * Fix root-cling related errors 28th February 2017 Thomas Latham (in branch for developing RooFit-based slave) * Start work on creation of RooFit-based slave class - Will allow RooFit-based fitters to plug-in straightforwardly to the simultaneous fitting (JFit) framework 20th February 2017 Thomas Latham * Add warning messages to LauBkgndDPModel::setBkgndHisto when supplied backgroud histogram pointers are null 31st January 2017 Thomas Latham * Audit of the code to automate the creation of the integration binning scheme. - Fix one bug, some tidy-ups, and reintroduce a couple of lost features: - the use of a single square-DP grid if a narrow resonance is found in m12 - extension of region down to threshold if the narrow resonance is close to threshold 22nd January 2017 Daniel O'Hanlon * Fix bug in automated integration scheme where resonances were assumed to have been added in order of ascending mass 14th December 2016 Daniel O'Hanlon * Add several light resonances to the list in LauResonanceMaker 13th December 2016 Daniel O'Hanlon * Automate the determination of the integration scheme for an arbitrary number of narrow resonances in m13 and m23 12th December 2016 Daniel O'Hanlon * Efficiency saving from modifying the behaviour of LauIsobarDynamics::calculateAmplitudes, LauIsobarDynamics::resAmp and LauIsobarDynamics::incohResAmp in the case of symmetric DPs - Previously, there were 2N calls to LauKinematics::flipAndUpdateKinematics for N resonances, now reduced to 2 21st November 2016 John Back * Added two K-matrix examples for creating pedagogical plots (with associated data files): - B3piKMatrixPlots for K-matrix elements, propagator, and pole and SVP production terms - B3piKMatrixMassProj for pole and SVP mass projections generated over the DP 17th November 2016 John Back * Modifications of the K matrix implementation: - Changed the format of the parameter file to use keywords, with updated examples - The scattering coefficients are now symmetrised, unless "ScattSymmetry 0" is used - Allow the option to use the Adler zero suppression term for the production poles and SVPs (default = off). These are specified with the useProdAdler boolean in the LauKMatrixProdPole/SVP constructors - Added a few helper functions for obtaining coefficients and (internal) matrices - Added a method to return the Lorentz-invariant transition amplitude for plots/tests 1st November 2016 Wenbin Qian * Add calculation of so-called covariant factors for spin amplitude === ## Laura++ v3r1 9th September 2016 Thomas Latham * Modification of LauFitNtuple to check the size of the covariance matrix wrt known number of parameters and act accordingly: - If it is empty, just fill a diagonal correlation matrix and issue a warning. - If it results from a failed first stage of a two-stage fit then the correlation matrix is padded with 1s and 0s for the parameters that were fixed in the first stage. * Remove the feature that allows parameters to float in first stage of a two-stage fit but to be fixed in second. * Minor fix to LauAbsCoeffSet: the names of parameters would be mangled if they were the same as the basename, e.g. A1_A would become A1_ while A1_B would be correct. 8th September 2016 Thomas Latham * Modifications to LauResonanceInfo to allow customisation of which extra parameters are shared between charge conjugate or shared-parameter records. - Where the parameters are not shared they are independently created instead of being cloned. * Modification of LauRhoOmegaMix to take advantage of the above to have the magB and phiB parameters independent. * Addition to LauResonanceMaker of rho(770)_COPY record that is a shared record with rho(770) - this allows the above new feature to be used. * Minor unrelated improvement to information messages in LauIsobarDynamics. 25th August 2016 John Back * Modified LauRhoOmegaMix to allow either a RelBW or GS lineshape for the rho, as well as allowing the option to set the second-order denominator term to be equal to unity. Also fixed the bug where the spinTerm was not included in the rho-omega amplitude. Changed the LauAbsResonance enum from RhoOmegaMix to RhoOmegaMix_GS, RhoOmegaMix_RBW, RhoOmegaMix_GS_1 and RhoOmegaMix_RBW_1, where _1 sets the denominator term to unity and _GS or _RBW sets the appropriate rho lineshape. The omega is always a RelBW. * Added to LauAbsResonance: ignoreSpin and ignoreBarrierScaling boolean flags, which ignore either the spin terms or the barrier scaling factors for the amplitude. The latter does not turn off the resonance barrier factor for mass-dependent widths * Added to LauResonanceMaker: getResInfo(resonanceName), which retrieves the resonance information. This is used to obtain the PDG omega values for initialising LauRhoOmegaMix * Made LauRelBreitWignerRes ignore momentum-dependent terms for the resonance width if ignoreMomenta is set. This is used in the LauRhoOmegaMix for the omega lineshape where its width does not depend on momentum 23rd May 2016 John Back * Added new lineshape model for rho-omega mass mixing, LauRhoOmegaMix. 12th April 2016 Thomas Latham * Switch to integrating in square DP when narrow resonances are found in m12. - The integration grid size can be specified by the user 19th January 2016 John Back * Correct the f(m^2) factor in the denominator of the LauGounarisSakuraiRes lineshape to use Gamma_0 instead of Gamma(m) 14th January 2016 Thomas Latham * Documentation improvements 7th December 2015 Thomas Latham * Resolve bug that meant the order of resonances in LauIsobarDynamics was assumed to match with the order in which the complex coefficients are supplied to the fit model - The ordering of resonances is defined by LauIsobarDynamics: - Firstly all coherent resonances in order of addition - Followed by all incoherent resonances in order of addition - The complex coefficients are now rearranged to match that order - Printout of the model summary at the end of initialisation has been enhanced to indicate the ordering - Doxygen updated to reflect these changes 12th November 2015 Daniel Craik * Added support for Akima splines and linear interpolation to Lau1DCubicSpline * LauAbsModIndPartWave, LauModIndPartWaveRealImag and LauModIndPartWaveMagPhase updated to allow choice of spline interpolation method * LauEFKLLMRes updated to use Akima splines 10th November 2015 Thomas Latham & Daniel Craik * Add the EFKLLM form-factor model for the Kpi S-wave and an example using this lineshape * Modify LauResonanceMaker::getResonance to use a switch for greater clarity and easier checking on missing cases 4th November 2015 Daniel Craik * Add checks to LauIsobarDynamics::addResonance and LauIsobarDynamics::addIncohResonance to stop the wrong type of LauResonanceModel being used - LauAbsResonance::isIncoherentModel method added to identify incoherent models 8th September 2015 Mark Whitehead * Add the ability to modify the error of parameters via the CoeffSet - setParameterError added to LauAbsCoeffSet * Tweak the handling of initial error values passed to MINUIT (to determine initial step size) in LauMinuit 7th September 2015 Mark Whitehead * Add the ability to Gaussian constrain parameters via the CoeffSet - addGaussianConstraint added to LauAbsCoeffSet 12th June 2015 Thomas Latham * Modifications to Belle-style nonresonant models - LauBelleNR modified to use pure Legendre polynomials of cos(theta) in the spin term (i.e. to remove the q*p factors) - New form added to LauBelleSymNR (LauAbsResonance::BelleSymNRNoInter) that removes the interference term between the two DP halves - The new form also works with non-zero spin (warning added if non-zero spin specified for BelleSymNR and TaylorNR) 8th June 2015 Thomas Latham * Further work on the blinding mechanism: - New method added LauParameter::blindParameter that activates the blinding. - The rest of the framework updated to use another new method LauParameter::unblindedValue in all likelihood calculations etc. - Example GenFitNoDP updated to include lines to optionally blind the yield parameters. 29th May 2015 Daniel Craik * Added LauBlind class for blinding and unblinding a value with an offset based on a blinding string 26th May 2015 Daniel Craik * Stopped LauCPFitModel passing fixed signal/background yields or asymmetries to Minuit to avoid hitting limit of 101 fixed parameters 22nd April 2015 Daniel Craik * Updated MIPW classes to use Lau1DCubicSpline 19th April 2015 Daniel Craik * Added Lau1DCubicSpline class for 1D spline interpolation 26th March 2015 Thomas Latham * Reworked MIPW code into abstract base class and derived classes to allow different representations of the amplitude at each knot 31st December 2015 Daniel Craik * Added unbinned goodness of fit tests to examples 12th January 2015 Daniel Craik * Calculate effective masses for virtual resonances above the upper kinematic limit 10th December 2014 Daniel Craik * Added coefficient sets to extract gamma from a simultaneous fit to CP and nonCP final states, such as the B0->D_CP K pi and B0->D0bar K pi Dalitz plots, as proposed in Phys. Rev. D79, 051301 (2009) - LauPolarGammaCPCoeffSet uses the CP parameters r, delta and gamma directly - LauRealImagGammaCPCoeffSet parameterises CPV as X_CP+/- and Y_CP+/- - LauCartesianGammaCPCoeffSet parameterises CPV as X_CP, Y_CP DeltaX_CP DeltaY_CP - Fixed CP parameters are not passed to the fitter so the same coefficient sets can be used for both the CP and nonCP Dalitz plots - LauPolarGammaCPCoeffSet allows for a single gamma parameter to be shared between multiple resonances - LauAbsCoeffSet::adjustName made virtual to allow global variables such as gamma to not receive a prefix === ## Laura++ v3r0p1 19th June 2015 Thomas Latham * Factor out the JFit slave code from LauAbsFitModel into a new base class LauSimFitSlave 19th June 2015 Thomas Latham * Fix check in LauIsobarDynamics::calcDPNormalisationScheme to avoid using hardcoded number === ## Laura++ v3r0 24th October 2014 Thomas Latham * Fixed bug in floating of Blatt-Weisskopf barrier radii - The values at the pole mass were not being updated when the radii changed 21st October 2014 Daniel Craik * Fixed bug in LauIsobarDynamics where multiple incoherent amplitudes led to nonsensical fit fractions 17th October 2014 John Back * Added the ability to calculate the transition amplitude matrix T in LauKMatrixPropagator, as well as a few other minor speed-up changes and code checks. Example/PlotKMatrixTAmp.cc can be used to check the T amplitude variation, phase shift and inelasticity, for a given K matrix channel, as a function of the invariant mass squared variable s 15th October 2014 Thomas Latham * Add methods to LauIsobarDynamics to make the integration binning more tunable by the user: - setNarrowResonanceThreshold - modify the value below which a resonance is considered to be narrow (defaults to 0.02 GeV/c2) - setIntegralBinningFactor - modify the factor by which the narrow resonance width is divided to obtain the bin size (defaults to 100) * Print warning messages if the memory usage is likely to be very large 13th October 2014 Thomas Latham * Modify Makefile to allow compilation with ROOT 6 (in addition to maintaining support for ROOT 5) * Fix a few compilation errors on MacOSX 10.9 13th October 2014 Daniel Craik * Update LauModIndPartWave to allow knots at kinematic limits to be modified - Add new method setKnotAmp to modify existing knots (and the knot at the upper kinematic limit which is automatically added at initialisation) * Update doxygen for LauIsobarDynamics::addIncoherentResonance to mention that incoherent resonances must be added last 10th October 2014 Thomas Latham * Add new method to LauResonanceMaker to set whether the radius of a given Blatt-Weisskopf category should be fixed of floated * Modify the methods of LauResonanceMaker to set the radius value and whether it should be floated so that they work before and after the resonances have been created 9th October 2014 John Back * Corrected the eta-eta' and 4pi phase space factors in LauKMatrixPropagator, which is used for the K-matrix amplitude: - calcEtaEtaPRho() does not include the mass difference term m_eta - m_eta' following the recommendation in hep-ph/0204328 and from advice from M Pennington - calcFourPiRho() incorporates a better parameterisation of the double integral of Eq 4 in hep-ph/0204328 which avoids the exponential increase for small values of s (~< 0.1) - More detailed comments are provided in the above two functions to explain what is going on and the reason for the choices made 6th October 2014 Thomas Latham * Implement the mechanism for floating Blatt-Weisskopf barrier factor radius parameters 30th September 2014 Thomas Latham * Fix issue in the checks on toy MC generation validity - in the case of exceeding max iterations it was possible to enter an infinite loop - the checks now detect all three possible states: - aSqMaxSet_ is too low (generation is biased) => increase aSqMaxSet_ value - aSqMaxSet_ is too high => reduce aSqMaxSet_ value to improve efficiency - aSqMaxSet_ is high (causing low efficiency) but cannot be lowered without biasing => increase iterationsMax_ limit * Update resonance parameter in LauResonanceMaker to match PDG 2014 * Modify behaviour when TTree objects are saved into files to avoid having multiple cycle numbers present 29th September 2014 Daniel Craik * Add support for incoherent resonances in the signal model - LauIsobarDynamics updated to include incoherent terms - ABC for incoherent resonances, LauAbsIncohRes, added deriving from LauAbsResonance - LauGaussIncohRes added to implement a Gaussian incoherent resonance, deriving from LauAbsIncohRes - Small changes to various other classes to enable incoherent terms * Fixed small bug in LauMagPhaseCoeffSet which could hang if phase is exactly pi or -pi * Added charged version of the BelleNR resonances to LauResonanceMaker * Updated parameters in LauConstants to match PDG 2014 14th July 2014 Thomas Latham * Add intial support for fully-symmetric final states such as B0 -> KS KS KS - Performs the symmetrisation of the signal model - Background (and efficiency) histogram classes need some work if the user wants to provide folded histograms 8th July 2014 Daniel Craik * Add class for model-independent partial wave - Uses splines to produce a smooth amplitude from a set of magnitude and phase values at given invariant masses - The individual magnitudes and phases can be floated in the fit 16th June 2014 Thomas Latham * Allow floating of resonance parameters in simultaneous fits 13th June 2014 Thomas Latham * Fix bug in LauResonanceInfo cloning method, where the width parameter was given a clone of the mass 10th June 2014 Thomas Latham * Add new function to allow sharing of resonance parameters between components that are not charged conjugates, e.g. LASS_BW and LASS_NR 9th June 2014 Thomas Latham and Daniel Craik * Fix bug in the new integration scheme - Was not accounting for cases where several resonances share a floating parameter - Meant that the integrals and caches for that resonance were not being updated * Introduce a change in the implementation of the helicity flip for neutral parent decays - Prior to this change the helicity was flipped for any neutral resonance in the decay of a neutral particle. - Now the flip no longer occurs in flavour-specific decays (such as Bs0 -> D0bar K- pi+ or B0 -> K+ pi- pi0) since it is only required in flavour-conjugate modes (such as B0 -> KS pi+ pi-). - This does not affect any physical results but it does contribute a pi phase flip to some odd-spin resonances (for example K*(892)0 in Bs0->D0barKpi). - Therefore results are not necessarily comparable between fits run before and after this changeset. - This change will first be released in v3r0. === ## Laura++ v2r2 5th June 2014 Thomas Latham * Fix issue in asymmetric efficiency histogram errors - Fluctuation of bins was incorrectly sampling - assumed area each side of peak was the same 5th June 2014 Thomas Latham (in branch for release in v3r0) * Introduce intelligent calculation of amplitudes during recalculation of integrals and recaching of data points - Floating resonance parameters is now much more efficient * Make resonance parameters second-stage, also improves fit timing when floating them 3rd June 2014 Rafael Coutinho * Implement generation of toy MC from fit results in fitSlave 27th May 2014 Thomas Latham (in branch for release in v3r0) * Complete audit of special functions * Remove unncessary LauAbsDPDynamics base class and move all functionality into LauIsobarDynamics 20th May 2014 Daniel Craik (in branch for release in v3r0) * Add support for K*_0(1430) and a_0(980) to LauFlatteRes 16th-19th May 2014 Thomas Latham and Daniel Craik (in branch for release in v3r0) * Update all other lineshapes so that their parameters can float - The only resonance parameters that now cannot float are the Blatt-Weisskopf barrier factor radii 15th May 2014 Thomas Latham (in branch for release in v3r0) * Change the mechanism for getting floating resonance parameters into the fit - Moved from LauResonanceMaker to the resonances themselves - Lays some groundwork for improving the efficiency of recalculating the integrals - LauBelleNR and LauBelleSymNR lineshape parameters can now be floated 13th May 2014 Daniel Craik (in branch for release in v3r0) * Fix bug where illegal characters were being propagated from resonance names into TBranch names 6th May 2014 Thomas Latham (in branch for release in v3r0) * Provide accessors for mass and width parameters 5th May 2014 Louis Henry * Fix compilation problem by making LauDatabasePDG destructor virtual 4th May 2014 Thomas Latham * Provide a new argument to LauSimpleFitModel::splitSignalComponent and LauCPFitModel::splitSignalComponent to allow fluctuation of the bins on the SCF fraction histogram 29th April 2014 Thomas Latham * Fix bug in the determination of the integration scheme - Nearby narrow resonances caused problems if their "zones" overlap - These zones are now merged together 29th April 2014 Thomas Latham (in branch for release in v3r0) * Some improvments to integration scheme storage 26th April 2014 Juan Otalora (in branch for release in v3r0) * Make integation scheme fixed after first determination - is stored in a new class LauDPPartialIntegralInfo - used on subsequent re-evaluations of the integrals 23rd April 2014 Thomas Latham * Attempt to improve clarity of LauIsobarDynamics::addResonance function - the 3rd argument is now an enumeration of the various resonance models - removed the optional arguments regarding the change of mass, width & spin - the same functionality can be obtained by using the returned pointer and calling changeResonance - the resonance name now only affects the lineshape in the LauPolNR case - the BelleSymNR / TaylorNR choice is now made in the 3rd argument - similarly for the BelleNR / (newly introduced) PowerLawNR choice * Add new PowerLawNR nonresonant model (part of LauBelleNR) * All examples updated to use new interface 23rd April 2014 Thomas Latham * Address issue of setting values of resonance parameters for all models - decided to do away with need to have LauIsobarDynamics know everything - LauIsobarDynamics::addResonance now returns a pointer to LauAbsResonance - parameters can be changed through LauAbsResonance::setResonanceParameter - LauIsobarDynamics still knows about Blatt-Weisskopf factors - better to only need to set this once - Update GenFit3pi example to demonstrate mechanism 22nd April 2014 Thomas Latham * Allow Gaussian constraints to be added in simultaneous fitting - constraints will be ignored by the slaves - those added directly to fit parameters will be propogated to the master and handled there - those on combinations of parameters should be added in the master process 22nd April 2014 Mark Whitehead * Update Laura to cope with resonances of spin 4 and spin 5 - Zemach spin terms added to src/LauAbsResonance.cc - BW barrier factors added to src/LauRelBreitWignerRes.cc 19th April 2014 Daniel Craik * Add LauWeightedSumEffModel which gives an efficiency model from the weighted sum of several LauEffModel objects. * Added pABC, LauAbsEffModel, for LauEffModel and LauWeightedSumEffModel. * Various classes updated to use pointers to LauAbsEffModel instead of LauEffModel. 15th April 2014 Daniel Craik * Enable LauEfficiencyModel to contain several Lau2DAbsDP objects with the total efficiency calculated as the product. 10th April 2014 Mark Whitehead * Fix an issue with the likelihood penalty term for Gaussian constraints - Factor two missing in the denominator - New penalty term is: ( x-mean )^2 / 2*(width^2) 4th April 2014 Thomas Latham * Add storage of fit fractions that have not been efficiency corrected === ## Laura++ v2r1 1st April 2014 Thomas Latham * Fix issue in LauFitter that prevents compilation with g++ 4.8 - Missing virtual destructor - Take opportunity to audit other special functions 31st March 2014 Mark Whitehead (in branch for release in v2r1) * Added an efficiency branch to the ntuple produced for toy data samples - Both LauSimpleFitModel and LauCPFitModel updated 28th March 2014 Daniel Craik (in branch for release in v2r2) * Added support for asymmetric errors to Lau2DHistDP, Lau2DSplineDP and LauEffModel. 27th March 2014 Daniel Craik * Changed histogram classes to use seeded random number generator for fluctuation and raising or lowering of bins and updated doxygen. 20th March 2014 Mark Whitehead (in branch for release in v2r1) * Added the ability to add Gaussian contraints to LauFormulaPars of fit parameters - User supplies the information but the LauFormulaPar is constructed behind the scenes 18th March 2014 Thomas Latham * Improve behaviour of toy generation from fit results 13th March 2014 Juan Otalora (in branch for release in v3r0) * Extended ability to float mass and width to other resonance lineshapes (Flatte, LASS and G-S) 11th March 2014 Mark Whitehead (in branch for release in v2r1) * Added the functionality to make LauFormulaPars usable in fits - Added a new class LauAbsRValue which LauParameter and LauFormularPar inherit from - Many files updated to accept LauAbsRValues instead of LauParameters * Fairly major clean up of obsolete functions in LauAbsPdf - Only LauLinearPdf used any of them, this has now been updated 10th March 2014 Thomas Latham (in branch for release in v3r0) * First attempt at floating resonance parameters (work mostly from Juan) - Only works for RelBW lineshape - Can only float mass and width - Works nicely! - Still needs much work to generalise and make more efficient === ## Laura++ v2r0 8th March 2014 Thomas Latham * Some additional functionality for the CoeffSet classes: - allow the parameter values to be set (optionally setting the initial and generated values as well) - allow the parameters to be set to float or to be fixed in the fit These are needed when cloning but wanting some of the parameters to have different values and/or floating behaviour from the cloned set. * Improve the printout of the setting of the coefficient values in the fit models and the creation of resonances * Add LauFlatNR for the unform NR model - ends its rather strange special treatment * Fix bug setting resAmpInt to 0 for LauPolNR * Many other improvements to the info/warning/error printouts * Modify GenFitBelleCPKpipi example to demonstrate cloning in action * Add -Werror to compiler flags (treats warnings as errors) 5th March 2014 Thomas Latham * Some improvements to LauPolNR to speed up amplitude calculation 2nd March 2014 Thomas Latham * A number of updates to the CoeffSet classes: - allow specification of the basename just after construction (before being given to the fit model) - allow configuration of the parameter fit ranges (through static methods of base class) - more adaptable cloning of the parameters (e.g. can only clone phase but allow magnitude to float independently) - allow CP-violating parameters to be second-stage in Belle and CLEO formats * Some improvements to the Doxygen and runtime information printouts 20th February 2014 Louis Henry * Add LauPolNR - class for modelling the nonresonant contribution based on BaBar 3K model (arXiv:1201.5897) 6th February 2014 Thomas Latham * Correct helicity convention information in Doxygen for LauKinematics === ## Laura++ v1r2 5th February 2014 Thomas Latham * Add rule to the Makefile that creates a rootmap file for the library 4th February 2014 Daniel Craik * Fixed bug in Lau2DSplineDPPdf - normalisation was not being calculated * Added out-of-range warning in LauBkgndDPModel and supressed excessive warnings 3rd February 2014 Mark Whitehead (in branch for release in v2r0) * Added a new class to allow parameters to be a function of other parameters - inc/LauFormulaPar.hh - src/LauFormulaPar.cc 28th January 2014 Daniel Craik * Improved out-of-range efficiency warnings in LauEffModel and supressed excessive errors * Modified LauIsobarDynamics to allow LASS parameters to be configured for LauLASSBWRes and LauLASSNRRes 27th January 2014 Daniel Craik * Added spline interpolation to DP backgrounds - Added Lau2DSplineDPPdf which uses a spline to model a normalised PDF across a DP - Added pABC, Lau2DAbsDPPdf, for Lau2DHistDPPdf and Lau2DSplineDPPdf and moved common code in Lau2DHistDPPdf and Lau2DSplineDPPdf into ABC Lau2DAbsHistDPPdf - LauBkgndDPModel, modified to use Lau2DAbsDPPdf instead of Lau2DHistDPPdf - setBkgndSpline method added to LauBkgndDPModel to allow use of splines 22nd January 2014 Thomas Latham * Improve some error checks and corresponding warning messages in LauCPFitModel::setSignalDPParameters 16th January 2014 Thomas Latham * Add LauRealImagCPCoeffSet, which provides an (x,y), (xbar,ybar) way of parametrising the complex coefficients. * Try to improve timing in the *CoeffSet classes by making the complex coeffs into member variables. 20th December 2013 Daniel Craik * Added Lau2DCubicSpline which provides cubic spline interpolation of a histogram - Added Lau2DSplineDP which uses a spline to model variation across a DP (eg efficiency) - Added pABC, Lau2DAbsDP, for Lau2DHistDP and Lau2DSplineDP and moved common code in Lau2DHistDP and Lau2DSplineDP into ABC Lau2DAbsHistDP - LauEffModel, LauDPDepSumPdf and LauDPDepMapPdf modified to use Lau2DAbsDP instead of Lau2DHistDP - setEffSpline method added to LauEffModel and useSpline flag added to constructor for LauDPDepSumPdf to allow use of splines 18th December 2013 Mark Whitehead (in branch for release in v2r0) * Added functionality to include Gaussian constraints on floated parameters in the fit. The files updated are: - inc/LauAbsFitModel.hh - inc/LauParameter.hh - src/LauAbsFitModel.cc - src/LauParameter.cc 5th December 2013 Thomas Latham * Fix small bug in GenFitKpipi example where background asymmetry parameter had its limits the wrong way around 4th December 2013 Daniel Craik * Updated 2D chi-squared code to use adaptive binning. 3rd December 2013 Thomas Latham * Generalise the Makefile in the examples directory - results in minor changes to the names of 3 of the binaries 3rd December 2013 Thomas Latham (in branch for release in v2r0) * Have the master save an ntuple with all fitter parameters and the full correlation matrix information. 29th November 2013 Thomas Latham * Fixed bug in ResultsExtractor where the output file was not written 29th November 2013 Thomas Latham (in branch for release in v2r0) * Allow the slave ntuples to store the partial covariance matrices in the simultaneous fitting 26th November 2013 Thomas Latham (in branch for release in v2r0) * Added first version of the simultaneous fitting framework === ## Laura++ v1r1p1 22nd November 2013 Thomas Latham * Fixed bug in LauCPFitModel where values of q = -1 extra PDFs were used regardless of the event charge. === ## Laura++ v1r1 20th November 2013 Mark Whitehead * Changed convention for the barrier factors, swapping from p* to p. This seems to give more physically reasonable results. The files updated are: - src/LauGounarisSakuraiRes.cc - src/LauRelBreitWignerRes.cc 18th October 2013 Thomas Latham * Fix dependency problem in Makefile 8th October 2013 Thomas Latham * Some fixes to yield implementation * Minor bug fix in DP background histogram class 7th October 2013 Mark Whitehead * Update to accept the yields and yield asymmetries as LauParameters. All examples have been updated to reflect this change. This updated the following files: - inc/LauCPFitModel.hh - inc/LauSimpleFitModel.hh - inc/LauAbsFitModel.hh - src/LauCPFitModel.cc - src/LauSimpleFitModel.cc * Addition of the following particles to src/LauResonanceMaker.cc Ds*+-, Ds0*(2317)+-, Ds2*(2573)+-, Ds1*(2700)+- and Bs*0 === ## Laura++ v1r0 13th September 2013 Thomas Latham * Initial import of the package into HEPforge diff --git a/inc/LauAbsResonance.hh b/inc/LauAbsResonance.hh index 2867023..02a6b1a 100644 --- a/inc/LauAbsResonance.hh +++ b/inc/LauAbsResonance.hh @@ -1,578 +1,579 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauAbsResonance.hh \brief File containing declaration of LauAbsResonance class. */ /*! \class LauAbsResonance \brief Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc.) Abstract Class for defining the type for all classes used to model resonances in the Dalitz plot, such as Breit-Wigner functions. In addition, some common functionality is implemented, including data such as the mass and width of the desired state. */ #ifndef LAU_ABS_RESONANCE #define LAU_ABS_RESONANCE #include "TString.h" #include "LauBlattWeisskopfFactor.hh" #include "LauComplex.hh" #include "LauParameter.hh" class LauDaughters; class LauKinematics; class LauResonanceInfo; class LauAbsResonance { public: //! Define the allowed resonance types enum LauResonanceModel { BW, /*!< simple Breit-Wigner */ RelBW, /*!< relativistic Breit-Wigner */ GS, /*!< a modified Breit-Wigner from Gounaris-Sakurai */ Flatte, /*!< Flatte or coupled-channel Breit-Wigner */ Sigma, /*!< special shape for the sigma or f_0(600) */ Kappa, /*!< special shape for the kappa, a low-mass Kpi scalar */ Dabba, /*!< special shape for the dabba, a low-mass Dpi scalar */ LASS, /*!< the LASS amplitude to describe the Kpi S-wave */ LASS_BW, /*!< the resonant part of the LASS amplitude */ LASS_NR, /*!< the nonresonant part of the LASS amplitude */ EFKLLM, /*!< a form-factor-based description of the Kpi S-wave */ - KMatrix, /*!< S-wave description using K-matrix and P-vector */ + KMatrix, /*!< description using K-matrix and P-vector */ FlatNR, /*!< a uniform nonresonant amplitude */ NRModel, /*!< a theoretical model nonresonant amplitude */ BelleNR, /*!< an empirical exponential nonresonant amplitude */ PowerLawNR, /*!< an empirical power law nonresonant amplitude */ BelleSymNR, /*!< an empirical exponential nonresonant amplitude for symmetrised DPs */ BelleSymNRNoInter, /*!< an empirical exponential nonresonant amplitude for symmetrised DPs without interference */ TaylorNR, /*!< an empirical Taylor expansion nonresonant amplitude for symmetrised DPs */ PolNR, /*!< an empirical polynomial nonresonant amplitude */ Pole, /*!< scalar Pole lineshape */ PolarFFNR, /*!< Polar Form Factor nonresonant amplitude */ PolarFFSymNR, /*!< Polar Form Factor nonresonant amplitude for symmetrised DPs */ PolarFFSymNRNoInter, /*!< Polar Form Factor nonresonant amplitude for symmetrised DPs without interference */ Rescattering, /*!< KK-PiPi inelastic scattering amplitude */ Rescattering2, /*!< KK-PiPi inelastic scattering amplitude */ RescatteringNoInter, /*!< KK-PiPi inelastic scattering amplitude */ MIPW_MagPhase, /*!< a model independent partial wave - magnitude and phase representation */ MIPW_RealImag, /*!< a model independent partial wave - real and imaginary part representation */ GaussIncoh, /*!< an incoherent Gaussian shape */ RhoOmegaMix_GS, /*!< mass mixing model using GS for res 1 and RBW for res 2 */ RhoOmegaMix_RBW, /*!< mass mixing model using two RBWs */ RhoOmegaMix_GS_1, /*!< mass mixing model using GS for res 1 and RBW for res 2, with denominator factor = 1 */ RhoOmegaMix_RBW_1 /*!< mass mixing model using two RBWs, with denominator factor = 1 */ }; //! Define the allowed spin formalisms enum LauSpinType { Zemach_P, /*!< Zemach tensor formalism, bachelor momentum in resonance rest frame */ Zemach_Pstar, /*!< Zemach tensor formalism, bachelor momentum in parent rest frame */ Covariant, /*!< Covariant tensor formalism */ Legendre /*!< Legendre polynomials only */ }; //! Is the resonance model incoherent? /*! \param [in] model the resonance model \return true if the model is incoherent */ static bool isIncoherentModel(LauResonanceModel model); //! Constructor (for use by standard resonances) /*! \param [in] resInfo the object containing information on the resonance name, mass, width, spin, charge, etc. \param [in] resPairAmpInt the number of the daughter not produced by the resonance \param [in] daughters the daughter particles */ LauAbsResonance(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters); //! Constructor (for use by K-matrix components) /*! \param [in] resName the name of the component \param [in] resPairAmpInt the number of the daughter not produced by the resonance \param [in] daughters the daughter particles + \param [in] resSpin the spin of the final channel into which the K-matrix scatters */ - LauAbsResonance(const TString& resName, const Int_t resPairAmpInt, const LauDaughters* daughters); + LauAbsResonance(const TString& resName, const Int_t resPairAmpInt, const LauDaughters* daughters, const Int_t resSpin); //! Destructor virtual ~LauAbsResonance(); //! Initialise the model virtual void initialise() = 0; //! Calculate the complex amplitude /*! \param [in] kinematics the kinematic variables of the current event \return the complex amplitude */ virtual LauComplex amplitude(const LauKinematics* kinematics); //! Get the resonance model type /*! \return the resonance model type */ virtual LauResonanceModel getResonanceModel() const = 0; //! Get the spin type /*! \return the spin formalism */ LauSpinType getSpinType() const {return spinType_;} //! Get the name of the resonance /*! \return the resonance name */ const TString& getResonanceName() const {return resName_;} //! Get the name of the resonance /*! \return the resonance name */ const TString& getSanitisedName() const {return sanitisedName_;} //! Get the integer to identify which DP axis the resonance belongs to /*! \return the DP axis identification number, the ID of the bachelor */ Int_t getPairInt() const {return resPairAmpInt_;} //! Get the spin of the resonance /*! \return the resonance spin */ Int_t getSpin() const {return resSpin_;} //! Get the charge of the resonance /*! \return the resonance charge */ Int_t getCharge() const {return resCharge_;} //! Get the mass of the resonance /*! \return the resonance mass */ Double_t getMass() const {return (resMass_!=0) ? resMass_->unblindValue() : -1.0;} //! Get the width of the resonance /*! \return the resonance width */ Double_t getWidth() const {return (resWidth_!=0) ? resWidth_->unblindValue() : -1.0;} //! Get the mass parameter of the resonance /*! \return the resonance mass parameter */ LauParameter* getMassPar() {return resMass_;} //! Get the width parameter of the resonance /*! \return the resonance width parameter */ LauParameter* getWidthPar() {return resWidth_;} //! Retrieve the resonance parameters, e.g. so that they can be loaded into a fit /*! \return floating parameters of the resonance */ virtual const std::vector& getFloatingParameters() { return this->getParameters(); }; //! Is the amplitude pre-symmetrised? /*! The default value is kFALSE, so pre-symmetrised lineshapes should override this. \return whether the amplitude is already symmetrised */ virtual Bool_t preSymmetrised() const {return kFALSE;} //! Get the helicity flip flag /*! \return the flip helicity flag */ Bool_t flipHelicity() const {return flipHelicity_;} //! Set the helicity flip flag /*! \param [in] boolean the helicity flip status */ void flipHelicity(const Bool_t boolean) {flipHelicity_ = boolean;} //! Get the ignore momenta flag /*! Whether to ignore the momentum factors in both the spin factor and the mass-dependent width \return the ignore momenta flag */ Bool_t ignoreMomenta() const {return ignoreMomenta_;} //! Set the ignore momenta flag /*! Whether to ignore the momentum factors in both the spin factor and the mass-dependent width \param [in] boolean the ignore momenta status */ void ignoreMomenta(const Bool_t boolean) {ignoreMomenta_ = boolean;} //! Get the ignore spin flag /*! Whether to set the spinTerm to unity always \return the ignore spin flag */ Bool_t ignoreSpin() const {return ignoreSpin_;} //! Set the ignore spin flag /*! Whether to set the spinTerm to unity always \param [in] boolean the ignore spin status */ void ignoreSpin(const Bool_t boolean) {ignoreSpin_ = boolean;} //! Get the ignore barrier factor scaling flag /*! Whether to ignore barrier factor scaling in the amplitude numerator, they are still used for the mass-dependent width \return the ignore barrier amplitude scaling flag */ Bool_t ignoreBarrierScaling() const {return ignoreBarrierScaling_;} //! Set the ignore barrier factor scaling flag /*! Whether to ignore barrier factor scaling in the amplitude numerator, they are still used for the mass-dependent width \param [in] boolean the ignore barrier factor scaling status */ void ignoreBarrierScaling(const Bool_t boolean) {ignoreBarrierScaling_ = boolean;} //! Allow the mass, width and spin of the resonance to be changed /*! Negative values wil be ignored, so if, for example, you want to only change the spin you can provide negative values for the mass and width \param [in] newMass new value of the resonance mass \param [in] newWidth new value of the resonance width \param [in] newSpin new value of the resonance spin */ void changeResonance(const Double_t newMass, const Double_t newWidth, const Int_t newSpin); //! Allow the Blatt-Weisskopf radius for the resonance and parent factors to be changed /*! Negative values wil be ignored, so if, for example, you want to only change the parent radius you can provide a negative value for the resonance radius \param [in] resRadius new value of the resonance radius \param [in] parRadius new value of the parent radius */ void changeBWBarrierRadii(const Double_t resRadius, const Double_t parRadius); //! Set value of the various parameters /*! \param [in] name the name of the parameter to be changed \param [in] value the new parameter value */ virtual void setResonanceParameter(const TString& name, const Double_t value); //! Allow the various parameters to float in the fit /*! \param [in] name the name of the parameter to be floated */ virtual void floatResonanceParameter(const TString& name); //! Access the given resonance parameter /*! \param [in] name the name of the parameter \return the corresponding parameter */ virtual LauParameter* getResonanceParameter(const TString& name); //! Fix or release the resonance mass /*! \param [in] parFixed new status of mass */ void fixMass(const Bool_t parFixed) { if (resMass_!=0) { resMass_->fixed(parFixed); } } //! Fix or release the resonance width /*! \param [in] parFixed new status of width */ void fixWidth(const Bool_t parFixed) { if (resWidth_!=0) { resWidth_->fixed(parFixed); } } //! Get the status of resonance mass (fixed or released) /*! \return the status of resonance mass (fixed or released) */ Bool_t fixMass() const { return (resMass_!=0) ? resMass_->fixed() : kTRUE; } //! Get the status of resonance width (fixed or released) /*! \return the status of resonance width (fixed or released) */ Bool_t fixWidth() const { return (resWidth_!=0) ? resWidth_->fixed() : kTRUE; } //! Set the spin formalism to be used /*! \param [in] spinType the spin formalism */ void setSpinType(const LauSpinType spinType) {spinType_ = spinType;} //! Set the form factor model and parameters /*! \param [in] resFactor the barrier factor for the resonance decay \param [in] parFactor the barrier factor for the parent decay */ void setBarrierRadii(LauBlattWeisskopfFactor* resFactor, LauBlattWeisskopfFactor* parFactor) { resBWFactor_ = resFactor; parBWFactor_ = parFactor; } //! Fix or release the Blatt-Weisskopf barrier radii void fixBarrierRadii(const Bool_t fixResRadius, const Bool_t fixParRadius); //! Get the status of resonance barrier radius (fixed or released) Bool_t fixResRadius() const; //! Get the status of parent barrier radius (fixed or released) Bool_t fixParRadius() const; //! Get the radius of the resonance barrier factor Double_t getResRadius() const; //! Get the radius of the parent barrier factor Double_t getParRadius() const; protected: //! Get the name of the parent particle TString getNameParent() const; //! Get the name of the first daughter of the resonance TString getNameDaug1() const; //! Get the name of the second daughter of the resonance TString getNameDaug2() const; //! Get the name of the daughter that does not originate form the resonance TString getNameBachelor() const; //! Get the parent particle mass Double_t getMassParent() const; //! Get the mass of daughter 1 Double_t getMassDaug1() const; //! Get the mass of daughter 2 Double_t getMassDaug2() const; //! Get the mass of the bachelor daughter Double_t getMassBachelor() const; //! Get the Charge of the parent particle Int_t getChargeParent() const; //! Get the charge of daughter 1 Int_t getChargeDaug1() const; //! Get the charge of daughter 2 Int_t getChargeDaug2() const; //! Get the charge of the bachelor daughter Int_t getChargeBachelor() const; //! Get the current value of the daughter momentum in the resonance rest frame Double_t getQ() const {return q_;} //! Get the current value of the bachelor momentum in the resonance rest frame Double_t getP() const {return p_;} //! Get the current value of the bachelor momentum in the parent rest frame Double_t getPstar() const {return pstar_;} //! Get the current value of the full spin-dependent covariant factor Double_t getCovFactor() const {return covFactor_;} //! Get the centrifugal barrier for the parent decay LauBlattWeisskopfFactor* getParBWFactor() {return parBWFactor_;} const LauBlattWeisskopfFactor* getParBWFactor() const {return parBWFactor_;} //! Get the centrifugal barrier for the resonance decay LauBlattWeisskopfFactor* getResBWFactor() {return resBWFactor_;} const LauBlattWeisskopfFactor* getResBWFactor() const {return resBWFactor_;} //! Access the resonance info object LauResonanceInfo* getResInfo() const {return resInfo_;} //! Access the daughters object const LauDaughters* getDaughters() const {return daughters_;} //! Calculate the amplitude spin term using the Zemach tensor formalism /*! \param [in] pProd the momentum factor (either q * p or q * pstar) */ Double_t calcZemachSpinFactor( const Double_t pProd ) const; //! Calculate the amplitude spin term using the covariant tensor formalism /*! \param [in] pProd the momentum factor (q * pstar) */ Double_t calcCovSpinFactor( const Double_t pProd ); //! Calculate the spin-dependent covariant factor /*! \param [in] erm E_ij in the parent rest-frame divided by m_ij (equivalent to sqrt(1 + p^2/mParent^2)) */ void calcCovFactor( const Double_t erm ); //! Calculate the Legendre polynomial for the spin factor /*! Uses the current-event value of cosHel_ */ Double_t calcLegendrePoly() const; //! Calculate the Legendre polynomial for the spin factor (specifying the cosHel value) /*! \param [in] cosHel the cosine of the helicity angle */ Double_t calcLegendrePoly( const Double_t cosHel ); //! Complex resonant amplitude /*! \param [in] mass appropriate invariant mass for the resonance \param [in] spinTerm spin term */ virtual LauComplex resAmp(Double_t mass, Double_t spinTerm) = 0; //! Clear list of floating parameters void clearFloatingParameters() { resParameters_.clear(); } //! Add parameter to the list of floating parameters /*! \param [in] param the parameter to be added to the list */ void addFloatingParameter( LauParameter* param ); //! Access the list of floating parameters std::vector& getParameters() { return resParameters_; } private: //! Copy constructor (not implemented) LauAbsResonance(const LauAbsResonance& rhs); //! Copy assignment operator (not implemented) LauAbsResonance& operator=(const LauAbsResonance& rhs); //! Information on the resonance LauResonanceInfo* resInfo_{0}; //! Information on the particles const LauDaughters* daughters_; //! Parent name TString nameParent_{""}; //! Daughter 1 name TString nameDaug1_{""}; //! Daughter 2 name TString nameDaug2_{""}; //! Bachelor name TString nameBachelor_{""}; //! Parent charge Int_t chargeParent_{0}; //! Daughter 1 charge Int_t chargeDaug1_{0}; //! Daughter 2 charge Int_t chargeDaug2_{0}; //! Bachelor charge Int_t chargeBachelor_{0}; //! Parent mass Double_t massParent_{0.0}; //! Daughter 1 mass Double_t massDaug1_{0.0}; //! Daughter 2 mass Double_t massDaug2_{0.0}; // Bachelor mass Double_t massBachelor_{0.0}; //! Resonance name TString resName_; //! Resonance name with illegal characters removed TString sanitisedName_; //! Resonance mass LauParameter* resMass_{0}; //! Resonance width LauParameter* resWidth_{0}; //! All parameters of the resonance std::vector resParameters_; //! Resonance spin - Int_t resSpin_{0}; + Int_t resSpin_; //! Resonance charge Int_t resCharge_{0}; //! DP axis identifier Int_t resPairAmpInt_; //! Blatt Weisskopf barrier for parent decay LauBlattWeisskopfFactor* parBWFactor_{0}; //! Blatt Weisskopf barrier for resonance decay LauBlattWeisskopfFactor* resBWFactor_{0}; //! Spin formalism LauSpinType spinType_{Zemach_P}; //! Boolean to flip helicity Bool_t flipHelicity_{kFALSE}; //! Boolean to ignore the momentum factors in both the spin factor and the mass-dependent width Bool_t ignoreMomenta_{kFALSE}; //! Boolean to set the spinTerm to unity always Bool_t ignoreSpin_{kFALSE}; //! Boolean to ignore barrier factor scaling in the amplitude numerator, they are still used for the mass-dependent width Bool_t ignoreBarrierScaling_{kFALSE}; // Event kinematics information //! Invariant mass Double_t mass_{0.0}; //! Helicity angle cosine Double_t cosHel_{0.0}; //! Daughter momentum in resonance rest frame Double_t q_{0.0}; //! Bachelor momentum in resonance rest frame Double_t p_{0.0}; //! Bachelor momentum in parent rest frame Double_t pstar_{0.0}; //! Covariant factor /*! sqrt(1 + z*z), where z = p / mParent Can also be expressed as E_ij in the parent rest-frame divided by m_ij - indeed this is how LauKinematics calculates it. \see LauKinematics::getcov12 \see LauKinematics::getcov13 \see LauKinematics::getcov23 */ Double_t erm_{1.0}; //! Covariant factor (full spin-dependent expression) Double_t covFactor_{1.0}; ClassDef(LauAbsResonance,0) // Abstract resonance class }; #endif diff --git a/inc/LauBlattWeisskopfFactor.hh b/inc/LauBlattWeisskopfFactor.hh index feabe71..0d3db74 100644 --- a/inc/LauBlattWeisskopfFactor.hh +++ b/inc/LauBlattWeisskopfFactor.hh @@ -1,139 +1,139 @@ /* Copyright 2014 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauBlattWeisskopfFactor.hh \brief File containing declaration of LauBlattWeisskopfFactor class. */ /*! \class LauBlattWeisskopfFactor \brief Class that implements the Blatt-Weisskopf barrier factor This factor is used in resonance models such as the Relativistic Breit-Wigner. */ #ifndef LAU_BLATTWEISSKOPFFACTOR #define LAU_BLATTWEISSKOPFFACTOR #include "Rtypes.h" class LauParameter; class LauResonanceInfo; class LauBlattWeisskopfFactor { public: //! Define the allowed types of barrier factors enum BarrierType { BWBarrier, /*!< Blatt-Weisskopf barrier factor (for use when momentum terms not used in angular term) */ BWPrimeBarrier, /*!< Blatt-Weisskopf barrier factor (for use when momentum terms are used in angular term) - the default */ ExpBarrier /*!< expoential barrier factor (mostly used for virtual contributions) */ }; //! Define the rest frame in which the momentum should be calculated (only relevant for bachelor) enum RestFrame { Covariant, /*!< use expression from Covariant spin factor */ ParentFrame, /*!< momentum calculated in parent rest frame */ ResonanceFrame /*!< momentum calculated in resonance rest frame */ }; //! Define resonance categories that will share common barrier factor radii enum BlattWeisskopfCategory { Default, //*!< indicates that LauResonanceMaker should use the appropriate category for the given resonance */ Parent, //*!< indicates that this is the factor for the decay of the parent particle */ Indep, //*!< indicates that this resonance should be independent of all others */ Light, //*!< default category for light unflavoured states, e.g. rho(77), f0(980), etc. */ Kstar, //*!< default category for K* states */ Charm, //*!< default category for D* states */ StrangeCharm, //*!< default category for Ds* states */ Charmonium, //*!< default category for ccbar states */ Beauty, //*!< default category for B* states */ StrangeBeauty, //*!< default category for Bs* states */ CharmBeauty, //*!< default category for Bc* states */ Custom1, //*!< user-defined category */ Custom2, //*!< user-defined category */ Custom3, //*!< user-defined category */ Custom4 //*!< user-defined category */ }; //! Constructor LauBlattWeisskopfFactor( const LauResonanceInfo& resInfo, const BarrierType barrierType, const RestFrame restFrame, const BlattWeisskopfCategory category ); //! Constructor LauBlattWeisskopfFactor( const LauResonanceInfo& resInfo, const Double_t resRadius, const BarrierType barrierType, const RestFrame restFrame, const BlattWeisskopfCategory category ); //! Destructor virtual ~LauBlattWeisskopfFactor(); //! Method to create a new factor with cloned radius parameter /*! \param newSpin the value of the spin to use for the created instance */ - LauBlattWeisskopfFactor* createClone( const UInt_t newSpin ); + LauBlattWeisskopfFactor* createClone( const UInt_t newSpin , const BarrierType newBarrierType ); //! Retrieve the radius parameter const LauParameter* getRadiusParameter() const { return radius_; } //! Retrieve the radius parameter LauParameter* getRadiusParameter() { return radius_; } //! Retrieve the barrier type BarrierType getBarrierType() const { return barrierType_; } //! Retrieve the rest frame information RestFrame getRestFrame() const { return restFrame_; } //! Calculate form factor value /*! \param p the value of the momentum */ Double_t calcFormFactor( const Double_t p ) const; protected: //! Set the name of the radius parameter TString setRadiusName( const LauResonanceInfo& resInfo, const BlattWeisskopfCategory category ); private: //! Copy constructor - LauBlattWeisskopfFactor( const LauBlattWeisskopfFactor& other, const UInt_t newSpin ); + LauBlattWeisskopfFactor( const LauBlattWeisskopfFactor& other, const UInt_t newSpin, const BarrierType newBarrierType ); //! Copy assignment operator (not implemented) LauBlattWeisskopfFactor& operator=( const LauBlattWeisskopfFactor& other ); //! Resonance spin const UInt_t spin_; //! Radius parameter LauParameter* radius_; //! Barrier type const BarrierType barrierType_; //! Rest frame const RestFrame restFrame_; ClassDef(LauBlattWeisskopfFactor, 0) }; #endif diff --git a/inc/LauIsobarDynamics.hh b/inc/LauIsobarDynamics.hh index 1b522a7..fd7414b 100644 --- a/inc/LauIsobarDynamics.hh +++ b/inc/LauIsobarDynamics.hh @@ -1,983 +1,983 @@ /* Copyright 2005 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauIsobarDynamics.hh \brief File containing declaration of LauIsobarDynamics class. */ /*! \class LauIsobarDynamics \brief Class for defining signal dynamics using the isobar model. */ #ifndef LAU_ISOBAR_DYNAMICS #define LAU_ISOBAR_DYNAMICS #include #include #include "TString.h" #include "LauAbsResonance.hh" #include "LauComplex.hh" class LauCacheData; class LauDaughters; class LauAbsEffModel; class LauAbsIncohRes; class LauFitDataTree; class LauKMatrixPropagator; class LauDPPartialIntegralInfo; class LauKinematics; class LauIsobarDynamics { public: //! The type used for containing multiple self cross feed fraction models for different categories (e.g. tagging categories) typedef std::map LauTagCatScfFractionModelMap; //! The possible statuses for toy MC generation enum ToyMCStatus { GenOK, /*!< Generation completed OK */ MaxIterError, /*!< Maximum allowed number of iterations completed without success (ASqMax is too high) */ ASqMaxError /*!< An amplitude squared value was returned that was larger than the maximum expected (ASqMax is too low) */ }; //! Constructor /*! \param [in] daughters the daughters of the decay \param [in] effModel the model to describe the efficiency across the Dalitz plot \param [in] scfFractionModel the model to describe the fraction of poorly constructed events (the self cross feed fraction) across the Dalitz plot */ LauIsobarDynamics(LauDaughters* daughters, LauAbsEffModel* effModel, LauAbsEffModel* scfFractionModel = 0); //! Constructor /*! \param [in] daughters the daughters of the decay \param [in] effModel the model to describe the efficiency across the Dalitz plot \param [in] scfFractionModel the models to describe the fraction of poorly constructed events (the self cross feed fraction) across the Dalitz plot for various tagging categories */ LauIsobarDynamics(LauDaughters* daughters, LauAbsEffModel* effModel, LauTagCatScfFractionModelMap scfFractionModel); //! Destructor virtual ~LauIsobarDynamics(); //! Initialise the Dalitz plot dynamics /*! \param [in] coeffs the complex coefficients for the resonances */ void initialise(const std::vector& coeffs); //! recalculate Normalization void recalculateNormalisation(); //! Set the name of the file to which to save the results of the integrals /*! \param [in] fileName the name of the file */ inline void setIntFileName(const TString& fileName) {intFileName_ = fileName;} // Integration //! Set the widths of the bins to use when integrating across the Dalitz plot or square Dalitz plot /*! Specify the bin widths required when performing the DP integration. Note that the integration is not performed in m13^2 vs m23^2 space but in either m13 vs m23 space or mPrime vs thetaPrime space, with the appropriate Jacobian applied. The default bin widths in m13 vs m23 space are 0.005 GeV. The default bin widths in mPrime vs thetaPrime space are 0.001. \param [in] m13BinWidth the bin width to use when integrating over m13 \param [in] m23BinWidth the bin width to use when integrating over m23 \param [in] mPrimeBinWidth the bin width to use when integrating over mPrime \param [in] thPrimeBinWidth the bin width to use when integrating over thetaPrime */ void setIntegralBinWidths(const Double_t m13BinWidth, const Double_t m23BinWidth, const Double_t mPrimeBinWidth = 0.001, const Double_t thPrimeBinWidth = 0.001); //! Set the value below which a resonance width is considered to be narrow /*! Narrow resonances trigger different integration behaviour - dividing the DP into regions where a finer binning is used. This can cause high memory usage, so use this method and LauIsobarDynamics::setIntegralBinningFactor to tune this behaviour, if needed. \param [in] narrowWidth the value below which a resonance is considered to be narrow (defaults to 0.02 GeV/c2) */ void setNarrowResonanceThreshold(const Double_t narrowWidth) { narrowWidth_ = narrowWidth; } //! Set the factor relating the width of a narrow resonance and the binning size in its integration region /*! Narrow resonances trigger different integration behaviour - dividing the DP into regions where a finer binning is used. This can cause high memory usage, so use this method and LauIsobarDynamics::setNarrowResonanceThreshold to tune this behaviour, if needed. \param [in] binningFactor the factor by which the resonance width is divided to obtain the bin size (defaults to 100) */ void setIntegralBinningFactor(const Double_t binningFactor) { binningFactor_ = binningFactor; } //! Force the symmetrisation of the integration in m13 <-> m23 for non-symmetric but flavour-conjugate final states /*! This can be necessary for time-dependent fits (where interference terms between A and Abar need to be integrated) \param [in] force toggle forcing symmetrisation of the integration for apparently flavour-conjugate final states */ void forceSymmetriseIntegration(const Bool_t force) { forceSymmetriseIntegration_ = force; } //! Add a resonance to the Dalitz plot /*! NB the stored order of resonances is: - Firstly, all coherent resonances (i.e. those added using addResonance() or addKMatrixProdPole() or addKMatrixProdSVP()) in order of addition - Followed by all incoherent resonances (i.e. those added using addIncoherentResonance()) in order of addition \param [in] resName the name of the resonant particle \param [in] resPairAmpInt the index of the daughter not produced by the resonance \param [in] resType the model for the resonance dynamics \param [in] bwCategory the Blatt-Weisskopf barrier factor category \return the newly created resonance */ LauAbsResonance* addResonance(const TString& resName, const Int_t resPairAmpInt, const LauAbsResonance::LauResonanceModel resType, const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory = LauBlattWeisskopfFactor::Default); //! Add an incoherent resonance to the Dalitz plot /*! NB the stored order of resonances is: - Firstly, all coherent resonances (i.e. those added using addResonance() or addKMatrixProdPole() or addKMatrixProdSVP()) in order of addition - Followed by all incoherent resonances (i.e. those added using addIncoherentResonance()) in order of addition \param [in] resName the name of the resonant particle \param [in] resPairAmpInt the index of the daughter not produced by the resonance \param [in] resType the model for the resonance dynamics \return the newly created resonance */ LauAbsResonance* addIncoherentResonance(const TString& resName, const Int_t resPairAmpInt, const LauAbsResonance::LauResonanceModel resType); //! Define a new K-matrix Propagator /*! \param [in] propName the name of the propagator \param [in] paramFileName the file that defines the propagator \param [in] resPairAmpInt the index of the bachelor \param [in] nChannels the number of channels \param [in] nPoles the number of poles \param [in] rowIndex the index of the row to be used when summing over all amplitude channels: S-wave corresponds to rowIndex = 1. */ - void defineKMatrixPropagator(const TString& propName, const TString& paramFileName, - Int_t resPairAmpInt, Int_t nChannels, Int_t nPoles, Int_t rowIndex = 1); + LauKMatrixPropagator* defineKMatrixPropagator( const TString& propName, const TString& paramFileName, + Int_t resPairAmpInt, Int_t nChannels, Int_t nPoles, Int_t rowIndex = 1); //! Add a K-matrix production pole term to the model /*! NB the stored order of resonances is: - Firstly, all coherent resonances (i.e. those added using addResonance() or addKMatrixProdPole() or addKMatrixProdSVP()) in order of addition - Followed by all incoherent resonances (i.e. those added using addIncoherentResonance()) in order of addition \param [in] poleName the name of the pole \param [in] propName the name of the propagator to use \param [in] poleIndex the index of the pole within the propagator \param [in] useProdAdler boolean to turn on/off the production Adler zero factor (default = off) */ void addKMatrixProdPole(const TString& poleName, const TString& propName, Int_t poleIndex, Bool_t useProdAdler = kFALSE); //! Add a K-matrix slowly-varying part (SVP) term to the model /*! NB the stored order of resonances is: - Firstly, all coherent resonances (i.e. those added using addResonance() or addKMatrixProdPole() or addKMatrixProdSVP()) in order of addition - Followed by all incoherent resonances (i.e. those added using addIncoherentResonance()) in order of addition \param [in] SVPName the name of the term \param [in] propName the name of the propagator to use \param [in] channelIndex the index of the channel within the propagator \param [in] useProdAdler boolean to turn on/off the production Adler zero factor (default = off) */ void addKMatrixProdSVP(const TString& SVPName, const TString& propName, Int_t channelIndex, Bool_t useProdAdler = kFALSE); //! Set the maximum value of A squared to be used in the accept/reject /*! \param [in] value the new value */ inline void setASqMaxValue(Double_t value) {aSqMaxSet_ = value;} //! Retrieve the maximum value of A squared to be used in the accept/reject /*! \return the maximum value of A squared */ inline Double_t getASqMaxSetValue() const { return aSqMaxSet_; } //! Retrieve the maximum of A squared that has been found while generating /*! \return the maximum of A squared that has been found */ inline Double_t getASqMaxVarValue() const { return aSqMaxVar_; } //! Generate a toy MC signal event /*! \return kTRUE if the event is successfully generated, kFALSE otherwise */ Bool_t generate(); //! Check the status of the toy MC generation /*! \param [in] printErrorMessages whether error messages should be printed \param [in] printInfoMessages whether info messages should be printed \return the status of the toy MC generation */ ToyMCStatus checkToyMC(Bool_t printErrorMessages = kTRUE, Bool_t printInfoMessages = kFALSE); //! Retrieve the maximum number of iterations allowed when generating an event /*! \return the maximum number of iterations allowed */ inline Int_t maxGenIterations() const {return iterationsMax_;} //! Calculate the likelihood (and all associated information) for the given event number /*! \param [in] iEvt the event number */ void calcLikelihoodInfo(const UInt_t iEvt); //! Calculate the likelihood (and all associated information) given values of the Dalitz plot coordinates /*! \param [in] m13Sq the invariant mass squared of the first and third daughters \param [in] m23Sq the invariant mass squared of the second and third daughters */ void calcLikelihoodInfo(const Double_t m13Sq, const Double_t m23Sq); //! Calculate the likelihood (and all associated information) given values of the Dalitz plot coordinates and the tagging category /*! Also obtain the self cross feed fraction to cache with the rest of the Dalitz plot quantities. \param [in] m13Sq the invariant mass squared of the first and third daughters \param [in] m23Sq the invariant mass squared of the second and third daughters \param [in] tagCat the tagging category */ void calcLikelihoodInfo(const Double_t m13Sq, const Double_t m23Sq, const Int_t tagCat); //! Calculate the fit fractions, mean efficiency and total DP rate /*! \param [in] init whether the calculated values should be stored as the initial/generated values or the fitted values */ void calcExtraInfo(const Bool_t init = kFALSE); //! Calculates whether an event with the current kinematics should be accepted in order to produce a distribution of events that matches the model e.g. when reweighting embedded data /*! Uses the accept/reject method. \return kTRUE if the event has been accepted, kFALSE otherwise */ Bool_t gotReweightedEvent(); //! Calculate the acceptance rate, for events with the current kinematics, when generating events according to the model /*! \return the weight for the current kinematics */ Double_t getEventWeight(); //! Retrieve the total amplitude for the current event /*! \return the total amplitude */ inline const LauComplex& getEvtDPAmp() const {return totAmp_;} //! Retrieve the invariant mass squared of the first and third daughters in the current event /*! \return the invariant mass squared of the first and third daughters in the current event */ inline Double_t getEvtm13Sq() const {return m13Sq_;} //! Retrieve the invariant mass squared of the second and third daughters in the current event /*! \return the invariant mass squared of the second and third daughters in the current event */ inline Double_t getEvtm23Sq() const {return m23Sq_;} //! Retrieve the square Dalitz plot coordinate, m', for the current event /*! \return the square Dalitz plot coordinate, m', for the current event */ inline Double_t getEvtmPrime() const {return mPrime_;} //! Retrieve the square Dalitz plot coordinate, theta', for the current event /*! \return the square Dalitz plot coordinate, theta', for the current event */ inline Double_t getEvtthPrime() const {return thPrime_;} //! Retrieve the efficiency for the current event /*! \return the efficiency for the current event */ inline Double_t getEvtEff() const {return eff_;} //! Retrieve the fraction of events that are poorly reconstructed (the self cross feed fraction) for the current event /*! \return the self cross feed fraction for the current event */ inline Double_t getEvtScfFraction() const {return scfFraction_;} //! Retrieve the Jacobian, for the transformation into square DP coordinates, for the current event /*! \return the Jacobian for the current event */ inline Double_t getEvtJacobian() const {return jacobian_;} //! Retrieve the total intensity multiplied by the efficiency for the current event /*! \return the total intensity multiplied by the efficiency for the current event */ inline Double_t getEvtIntensity() const {return ASq_;} //! Retrieve the likelihood for the current event /*! The likelihood is the normalised total intensity: evtLike_ = ASq_/DPNorm_ \return the likelihood for the current event */ inline Double_t getEvtLikelihood() const {return evtLike_;} //! Retrieve the normalised dynamic part of the amplitude of the given amplitude component at the current point in the Dalitz plot /*! \param [in] resID the index of the component within the model \return the amplitude of the given component */ inline LauComplex getDynamicAmp(const Int_t resID) const {return ff_[resID].scale(fNorm_[resID]);} //! Retrieve the Amplitude of resonance resID /*! \param [in] resID the index of the component within the model \return the amplitude of the given component */ inline LauComplex getFullAmplitude(const Int_t resID) const {return Amp_[resID] * this->getDynamicAmp(resID);} //! Retrieve the event-by-event running totals of amplitude cross terms for all pairs of amplitude components /*! \return the event-by-event running totals of amplitude cross terms */ inline const std::vector< std::vector >& getFiFjSum() const {return fifjSum_;} //! Retrieve the event-by-event running totals of efficiency corrected amplitude cross terms for all pairs of amplitude components /*! \return the event-by-event running totals of amplitude cross terms with efficiency corrections applied */ inline const std::vector< std::vector >& getFiFjEffSum() const {return fifjEffSum_;} //! Retrieve the normalisation factors for the dynamic parts of the amplitudes for all of the amplitude components /*! \return the normalisation factors */ inline const std::vector& getFNorm() const {return fNorm_;} //! Fill the internal data structure that caches the resonance dynamics /*! \param [in] fitDataTree the data source */ void fillDataTree(const LauFitDataTree& fitDataTree); //! Recache the amplitude values for those that have changed void modifyDataTree(); //! Check whether this model includes a named resonance /*! \param [in] resName the resonance \return true if the resonance is present, false otherwise */ Bool_t hasResonance(const TString& resName) const; //! Retrieve the index for the given resonance /*! \param [in] resName the resonance \return the index of the resonance if it is present, -1 otherwise */ Int_t resonanceIndex(const TString& resName) const; //! Retrieve the name of the charge conjugate of a named resonance /*! \param [in] resName the resonance \return the name of the charge conjugate */ TString getConjResName(const TString& resName) const; //! Retrieve the named resonance /*! \param [in] resName the name of the resonance to retrieve \return the requested resonance */ const LauAbsResonance* findResonance(const TString& resName) const; //! Retrieve a resonance by its index /*! \param [in] resIndex the index of the resonance to retrieve \return the requested resonance */ const LauAbsResonance* getResonance(const UInt_t resIndex) const; //! Update the complex coefficients for the resonances /*! \param [in] coeffs the new set of coefficients */ void updateCoeffs(const std::vector& coeffs); //! Collate the resonance parameters to initialise (or re-initialise) the model /*! NB: This has been factored out of the initialise() method to allow for use in the importation of parameters in LauAbsFitModel */ void collateResonanceParameters(); //! Set the helicity flip flag for new amplitude components /*! \param [in] boolean the helicity flip flag */ inline void flipHelicityForCPEigenstates(const Bool_t boolean) {flipHelicity_ = boolean;} //! Retrieve the mean efficiency across the Dalitz plot /*! \return the mean efficiency across the Dalitz plot */ inline const LauParameter& getMeanEff() const {return meanDPEff_;} //! Retrieve the overall Dalitz plot rate /*! \return the overall Dalitz plot rate */ inline const LauParameter& getDPRate() const {return DPRate_;} //! Retrieve the fit fractions for the amplitude components /*! \return the fit fractions */ inline const LauParArray& getFitFractions() const {return fitFrac_;} //! Retrieve the fit fractions for the amplitude components /*! \return the fit fractions */ inline const LauParArray& getFitFractionsEfficiencyUncorrected() const {return fitFracEffUnCorr_;} //! Retrieve the total number of amplitude components /*! \return the total number of amplitude components */ inline UInt_t getnTotAmp() const {return nAmp_+nIncohAmp_;} //! Retrieve the number of coherent amplitude components /*! \return the number of coherent amplitude components */ inline UInt_t getnCohAmp() const {return nAmp_;} //! Retrieve the number of incoherent amplitude components /*! \return the number of incoherent amplitude components */ inline UInt_t getnIncohAmp() const {return nIncohAmp_;} //! Retrieve the normalisation factor for the log-likelihood function /*! \return the normalisation factor */ inline Double_t getDPNorm() const {return DPNorm_;} //! Retrieve the daughters /*! \return the daughters */ inline const LauDaughters* getDaughters() const {return daughters_;} //! Retrieve the Dalitz plot kinematics /*! \return the Dalitz plot kinematics */ inline const LauKinematics* getKinematics() const {return kinematics_;} //! Retrieve the Dalitz plot kinematics /*! \return the Dalitz plot kinematics */ inline LauKinematics* getKinematics() {return kinematics_;} //! Retrieve the model for the efficiency across the Dalitz plot /*! \return the efficiency model */ inline const LauAbsEffModel* getEffModel() const {return effModel_;} //! Check whether a self cross feed fraction model is being used /*! \return true if a self cross feed fraction model is being used, false otherwise */ inline Bool_t usingScfModel() const { return ! scfFractionModel_.empty(); } //! Retrieve any extra parameters/quantities (e.g. K-matrix total fit fractions) /*! \return any extra parameters */ inline const std::vector& getExtraParameters() const {return extraParameters_;} //! Retrieve the floating parameters of the resonance models /*! \return the list of floating parameters */ inline std::vector& getFloatingParameters() {return resonancePars_;} //! Whether to calculate separate rho and omega fit-fractions from LauRhoOmegaMix inline void calculateRhoOmegaFitFractions(const Bool_t calcFF) { calculateRhoOmegaFitFractions_ = calcFF; } protected: //! Print a summary of the model to be used void initSummary(); //! Initialise the internal storage for this model void initialiseVectors(); //! Zero the various values used to store integrals info void resetNormVectors(); //! Calculate the Dalitz plot normalisation integrals across the whole Dalitz plot void calcDPNormalisation(); //! Form the regions that are produced by the spaces between narrow resonances /*! \param [in] regions the regions defined around narrow resonances \param [in] min the minimum value of the invariant mass \param [in] max the maximum value of the invariant mass \return vector of pointers to LauDPPartialIntegralInfo objects that contain the individual coarse regions */ std::vector< std::pair > formGapsFromRegions(const std::vector< std::pair >& regions, const Double_t min, const Double_t max) const; //! Removes entries in the vector of LauDPPartialIntegralInfo* that are null /*! \param [in] regions the list of region pointers */ void cullNullRegions(std::vector& regions) const; //! Wrapper for LauDPPartialIntegralInfo constructor /*! \param [in] minm13 the minimum of the m13 range \param [in] maxm13 the maximum of the m13 range \param [in] minm23 the minimum of the m23 range \param [in] maxm23 the maximum of the m23 range \param [in] m13BinWidth the m13 bin width \param [in] m23BinWidth the m23 bin width \param [in] precision the precision required for the Gauss-Legendre weights \param [in] nAmp the number of coherent amplitude components \param [in] nIncohAmp the number of incoherent amplitude components \return 0 if the integration region has no internal points, otherwise returns a pointer to the newly constructed LauDPPartialIntegralInfo object */ LauDPPartialIntegralInfo* newDPIntegrationRegion(const Double_t minm13, const Double_t maxm13, const Double_t minm23, const Double_t maxm23, const Double_t m13BinWidth, const Double_t m23BinWidth, const Double_t precision, const UInt_t nAmp, const UInt_t nIncohAmp) const; //! Correct regions to ensure that the finest integration grid takes precedence /*! \param [in] regions the windows in invariant mass \param [in] binnings the corresponding binnings for each window */ void correctDPOverlap(std::vector< std::pair >& regions, const std::vector& binnings) const; //! Create the integration grid objects for the m23 narrow resonance regions, including the overlap regions with the m13 narrow resonances /*! The overlap regions will have an m13Binnings x m23Binnings grid. The other regions will have a defaultBinning x m23Binnings grid. \param [in] m13Regions the limits of each narrow-resonance region in m13 \param [in] m23Regions the limits of each narrow-resonance region in m23 \param [in] m13Binnings the binning of each narrow-resonance region in m13 \param [in] m23Binnings the binning of each narrow-resonance region in m23 \param [in] precision the precision required for the Gauss-Legendre weights \param [in] defaultBinning the binning used in the bulk of the phase space \return vector of pointers to LauDPPartialIntegralInfo objects that contain the individual regions */ std::vector m23IntegrationRegions(const std::vector< std::pair >& m13Regions, const std::vector< std::pair >& m23Regions, const std::vector& m13Binnings, const std::vector& m23Binnings, const Double_t precision, const Double_t defaultBinning) const; //! Create the integration grid objects for the m13 narrow resonance regions, excluding the overlap regions with the m23 narrow resonances /*! The regions will have a m13Binnings x defaultBinning grid. The overlap regions are created by the m23IntegrationRegions function. \param [in] m13Regions the limits of each narrow-resonance region in m13 \param [in] m23Regions the limits of each narrow-resonance region in m23 \param [in] m13Binnings the binning of each narrow-resonance region in m13 \param [in] precision the precision required for the Gauss-Legendre weights \param [in] defaultBinning the binning used in the bulk of the phase space \return vector of pointers to LauDPPartialIntegralInfo objects that contain the individual regions */ std::vector m13IntegrationRegions(const std::vector< std::pair >& m13Regions, const std::vector< std::pair >& m23Regions, const std::vector& m13Binnings, const Double_t precision, const Double_t defaultBinning) const; //! Calculate the Dalitz plot normalisation integrals across the whole Dalitz plot void calcDPNormalisationScheme(); //! Determine which amplitudes and integrals need to be recalculated void findIntegralsToBeRecalculated(); //! Calculate the Dalitz plot normalisation integrals over a given range /*! \param [in] intInfo the integration information object */ void calcDPPartialIntegral(LauDPPartialIntegralInfo* intInfo); //! Write the results of the integrals (and related information) to a file void writeIntegralsFile(); //! Set the dynamic part of the amplitude for a given amplitude component at the current point in the Dalitz plot /*! \param [in] index the index of the amplitude component \param [in] realPart the real part of the amplitude \param [in] imagPart the imaginary part of the amplitude */ void setFFTerm(const UInt_t index, const Double_t realPart, const Double_t imagPart); //! Set the dynamic part of the intensity for a given incoherent amplitude component at the current point in the Dalitz plot /*! \param [in] index the index of the incoherent amplitude component \param [in] value the intensity */ void setIncohIntenTerm(const UInt_t index, const Double_t value); //! Calculate the amplitudes for all resonances for the current kinematics void calculateAmplitudes(); //! Calculate or retrieve the cached value of the amplitudes for all resonances at the specified integration grid point /*! \param [in,out] intInfo the integration information object \param [in] m13Point the grid index in m13 \param [in] m23Point the grid index in m23 */ void calculateAmplitudes( LauDPPartialIntegralInfo* intInfo, const UInt_t m13Point, const UInt_t m23Point ); //! Add the amplitude values (with the appropriate weight) at the current grid point to the running integral values /*! \param [in] weight the weight to apply */ void addGridPointToIntegrals(const Double_t weight); //! Calculate the total Dalitz plot amplitude at the current point in the Dalitz plot /*! \param [in] useEff whether to apply efficiency corrections */ void calcTotalAmp(const Bool_t useEff); //! Obtain the efficiency of the current event from the model /*! \return the efficiency */ Double_t retrieveEfficiency(); //! Obtain the self cross feed fraction of the current event from the model /*! \param [in] tagCat the tagging category of the current event \return the self cross feed fraction */ Double_t retrieveScfFraction(Int_t tagCat); //! Set the maximum of A squared that has been found /*! \param [in] value the new value */ inline void setASqMaxVarValue(Double_t value) {aSqMaxVar_ = value;} //! Calculate the normalisation factor for the log-likelihood function /*! \return the normalisation factor */ Double_t calcSigDPNorm(); //! Calculate the dynamic part of the amplitude for a given component at the current point in the Dalitz plot /*! \param [in] index the index of the amplitude component within the model */ LauComplex resAmp(const UInt_t index); //! Calculate the dynamic part of the intensity for a given incoherent component at the current point in the Dalitz plot /*! \param [in] index the index of the incoherent component within the model */ Double_t incohResAmp(const UInt_t index); //! Load the data for a given event /*! \param [in] iEvt the number of the event */ void setDataEventNo(UInt_t iEvt); //! Retrieve the named resonance /*! \param [in] resName the name of the resonance to retrieve \return the requested resonance */ LauAbsResonance* findResonance(const TString& resName); //! Retrieve a resonance by its index /*! \param [in] resIndex the index of the resonance to retrieve \return the requested resonance */ LauAbsResonance* getResonance(const UInt_t resIndex); //! Remove the charge from the given particle name /*! \param [in,out] string the particle name */ void removeCharge(TString& string) const; //! Check whether a resonance is a K-matrix component of a given propagator /*! \param [in] resAmpInt the index of the resonance within the model \param [in] propName the name of the K-matrix propagator \return true if the resonance is a component of the given propagator, otherwise return false */ Bool_t gotKMatrixMatch(UInt_t resAmpInt, const TString& propName) const; private: //! Copy constructor (not implemented) LauIsobarDynamics(const LauIsobarDynamics& rhs); //! Copy assignment operator (not implemented) LauIsobarDynamics& operator=(const LauIsobarDynamics& rhs); //! The type used for containing the K-matrix propagators typedef std::map KMPropMap; //! The type used for mapping K-matrix components to their propagators typedef std::map KMStringMap; //! The daughters of the decay LauDaughters* daughters_; //! The kinematics of the decay LauKinematics* kinematics_; //! The efficiency model across the Dalitz plot LauAbsEffModel* effModel_; //! The self cross feed fraction models across the Dalitz plot /*! These model the fraction of signal events that are poorly reconstructed (the self cross feed fraction) as a function of Dalitz plot position. If the self cross feed is depependent on the tagging category then seperate models can be defined. */ LauTagCatScfFractionModelMap scfFractionModel_; //! The number of amplitude components UInt_t nAmp_; //! The number of incoherent amplitude components UInt_t nIncohAmp_; //! The complex coefficients for the amplitude components std::vector Amp_; //! The normalisation factor for the log-likelihood function Double_t DPNorm_; //! The fit fractions for the amplitude components LauParArray fitFrac_; //! The efficiency-uncorrected fit fractions for the amplitude components LauParArray fitFracEffUnCorr_; //! The overall Dalitz plot rate LauParameter DPRate_; //! The mean efficiency across the Dalitz plot LauParameter meanDPEff_; //! The cached data for all events std::vector data_; //! The cached data for the current event LauCacheData* currentEvent_; //! any extra parameters/quantities (e.g. K-matrix total fit fractions) std::vector extraParameters_; //! The resonances in the model std::vector sigResonances_; //! The incoherent resonances in the model std::vector sigIncohResonances_; //! The K-matrix propagators KMPropMap kMatrixPropagators_; //! The names of the M-matrix components in the model mapped to their propagators KMStringMap kMatrixPropSet_; //! The resonance types of all of the amplitude components std::vector resTypAmp_; //! The index of the daughter not produced by the resonance for each amplitude component std::vector resPairAmp_; //! The resonance types of all of the incoherent amplitude components std::vector incohResTypAmp_; //! The index of the daughter not produced by the resonance for each incoherent amplitude component std::vector incohResPairAmp_; //! The PDG codes of the daughters std::vector typDaug_; //! Whether the Dalitz plot is symmetrical Bool_t symmetricalDP_; //! Whether the Dalitz plot is fully symmetric Bool_t fullySymmetricDP_; //! Whether the Dalitz plot is a flavour-conjugate final state Bool_t flavConjDP_; //! Whether the integrals have been performed Bool_t integralsDone_; //! Whether the scheme for the integration has been determined Bool_t normalizationSchemeDone_; //! Force the symmetrisation of the integration in m13 <-> m23 for non-symmetric but flavour-conjugate final states Bool_t forceSymmetriseIntegration_; //! The storage of the integration scheme std::vector dpPartialIntegralInfo_; //! The name of the file to save integrals to TString intFileName_; //! The bin width to use when integrating over m13 Double_t m13BinWidth_; //! The bin width to use when integrating over m23 Double_t m23BinWidth_; //! The bin width to use when integrating over mPrime Double_t mPrimeBinWidth_; //! The bin width to use when integrating over thetaPrime Double_t thPrimeBinWidth_; //! The value below which a resonance width is considered to be narrow Double_t narrowWidth_; //! The factor relating the width of the narrowest resonance and the binning size Double_t binningFactor_; //! The invariant mass squared of the first and third daughters Double_t m13Sq_; //! The invariant mass squared of the second and third daughters Double_t m23Sq_; //! The square Dalitz plot coordinate, m' Double_t mPrime_; //! The square Dalitz plot coordinate theta' Double_t thPrime_; //! The tagging category Int_t tagCat_; //! The efficiency at the current point in the Dalitz plot Double_t eff_; //!The fraction of events that are poorly reconstructed (the self cross feed fraction) at the current point in the Dalitz plot Double_t scfFraction_; //! The Jacobian, for the transformation into square DP coordinates at the current point in the Dalitz plot Double_t jacobian_; //! The value of A squared for the current event Double_t ASq_; //! The normalised likelihood for the current event Double_t evtLike_; //! The total amplitude for the current event LauComplex totAmp_; //! The event-by-event running total of efficiency corrected amplitude cross terms for each pair of amplitude components /*! Calculated as the sum of ff_[i]*ff_[j]*efficiency for all events */ std::vector< std::vector > fifjEffSum_; //! The event-by-event running total of the amplitude cross terms for each pair of amplitude components /*! Calculated as the sum of ff_[i]*ff_[j] for all events */ std::vector< std::vector > fifjSum_; //! The dynamic part of the amplitude for each amplitude component at the current point in the Dalitz plot std::vector ff_; //! The dynamic part of the intensity for each incoherent amplitude component at the current point in the Dalitz plot std::vector incohInten_; //! The event-by-event running total of the dynamical amplitude squared for each amplitude component std::vector fSqSum_; //! The event-by-event running total of the dynamical amplitude squared for each amplitude component std::vector fSqEffSum_; //! The normalisation factors for the dynamic parts of the amplitude for each amplitude component std::vector fNorm_; //! The maximum allowed number of attempts when generating an event Int_t iterationsMax_; //! The number of unsucessful attempts to generate an event so far Int_t nSigGenLoop_; //! The maximum allowed value of A squared Double_t aSqMaxSet_; //! The maximum value of A squared that has been seen so far while generating Double_t aSqMaxVar_; //! The helicity flip flag for new amplitude components Bool_t flipHelicity_; //! Flag to recalculate the normalisation Bool_t recalcNormalisation_; //! List of floating resonance parameters std::vector resonancePars_; //! List of floating resonance parameter values from previous calculation std::vector resonanceParValues_; //! Indices in sigResonances_ to point to the corresponding signal resonance(s) for each floating parameter std::vector< std::vector > resonanceParResIndex_; //! Resonance indices for which the amplitudes and integrals should be recalculated std::set integralsToBeCalculated_; //! Whether to calculate separate rho and omega fit fractions from the LauRhoOmegaMix model Bool_t calculateRhoOmegaFitFractions_; ClassDef(LauIsobarDynamics,0) }; #endif diff --git a/inc/LauKMatrixProdPole.hh b/inc/LauKMatrixProdPole.hh index 6b9bae7..25c7bee 100644 --- a/inc/LauKMatrixProdPole.hh +++ b/inc/LauKMatrixProdPole.hh @@ -1,109 +1,107 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixProdPole.hh \brief File containing declaration of LauKMatrixProdPole class. */ /*! \class LauKMatrixProdPole \brief Class for defining a K-matrix production pole amplitude term. Class for defining a K-matrix production pole amplitude term */ #ifndef LAU_KMATRIX_PROD_POLE #define LAU_KMATRIX_PROD_POLE #include "LauAbsResonance.hh" #include "TString.h" class LauKMatrixPropagator; class LauDaughters; class LauKinematics; class LauKMatrixProdPole : public LauAbsResonance { public: //! Constructor /*! \param [in] poleName name of the pole \param [in] poleIndex number of pole \param [in] resPairAmpInt the number of the daughter not produced by the resonance \param [in] propagator a K-matrix propagator \param [in] daughters the daughter particles \param [in] useProdAdler boolean to turn on/off the production Adler zero factor */ LauKMatrixProdPole( const TString& poleName, Int_t poleIndex, Int_t resPairAmpInt, LauKMatrixPropagator* propagator, const LauDaughters* daughters, Bool_t useProdAdler = kFALSE); //! Destructor virtual ~LauKMatrixProdPole(); // Initialise the model virtual void initialise() {return;} - //! The amplitude calculation - /*! - \param [in] kinematics the kinematic variables of the current event - \return the complex amplitude - */ - virtual LauComplex amplitude(const LauKinematics* kinematics); - //! Get the resonance model type /*! \return the resonance model type */ virtual LauAbsResonance::LauResonanceModel getResonanceModel() const {return LauAbsResonance::KMatrix;} //! Retrieve the resonance parameters, e.g. so that they can be loaded into a fit /*! - \return floating parameters of the resonance + \return floating parameters of the resonance */ virtual const std::vector& getFloatingParameters(); protected: - //! Function not meant to be called, amplitude is called directly in this case - virtual LauComplex resAmp(Double_t mass, Double_t spinTerm); + //! The amplitude calculation + /*! + \param [in] mass the invariant-mass for the channel + \param [in] spinTerm the spin-term for the final channel + \return the complex amplitude + */ + virtual LauComplex resAmp(const Double_t mass, const Double_t spinTerm); private: //! Copy constructor (not implemented) LauKMatrixProdPole(const LauKMatrixProdPole& rhs); //! Copy assignment operator (not implemented) LauKMatrixProdPole& operator=(const LauKMatrixProdPole& rhs); //! The K-matrix propagator LauKMatrixPropagator* thePropagator_; //! The number of the pole Int_t poleIndex_; //! Boolean to turn on/off the production Adler zero factor Bool_t useProdAdler_; ClassDef(LauKMatrixProdPole, 0) // K-matrix production pole }; #endif diff --git a/inc/LauKMatrixProdSVP.hh b/inc/LauKMatrixProdSVP.hh index a1e1d7a..50f8f53 100644 --- a/inc/LauKMatrixProdSVP.hh +++ b/inc/LauKMatrixProdSVP.hh @@ -1,109 +1,107 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixProdSVP.hh \brief File containing declaration of LauKMatrixProdSVP class. */ /*! \class LauKMatrixProdSVP \brief Class for defining a K-matrix production "slowly-varying part" (SVP) amplitude Class for defining a K-matrix production "slowly-varying part" (SVP) amplitude */ #ifndef LAU_KMATRIX_PROD_SVP #define LAU_KMATRIX_PROD_SVP #include "LauAbsResonance.hh" #include "TString.h" class LauKMatrixPropagator; class LauDaughters; class LauKinematics; class LauKMatrixProdSVP : public LauAbsResonance { - public: + public: //! Constructor /*! \param [in] SVPName name of the slowly varying part (SVP) \param [in] channelIndex the channel number \param [in] resPairAmpInt the number of the daughter not produced by the resonance \param [in] propagator a K-matrix propagator \param [in] daughters the daughter particles \param [in] useProdAdler boolean to turn on/off the production Adler zero factor - */ - LauKMatrixProdSVP(const TString& SVPName, Int_t channelIndex, Int_t resPairAmpInt, - LauKMatrixPropagator* propagator, const LauDaughters* daughters, - Bool_t useProdAdler = kFALSE); + */ + LauKMatrixProdSVP( const TString& SVPName, Int_t channelIndex, Int_t resPairAmpInt, + LauKMatrixPropagator* propagator, const LauDaughters* daughters, + Bool_t useProdAdler = kFALSE); //! Destructor virtual ~LauKMatrixProdSVP(); //! Initialise the model - virtual void initialise() {return;} - - //! The amplitude calculation - /*! - \param [in] kinematics the kinematic variables of the current event - \return the complex amplitude - */ - virtual LauComplex amplitude(const LauKinematics* kinematics); + virtual void initialise() {return;} //! Get the resonance model type - /*! - \return the resonance model type - */ + /*! + \return the resonance model type + */ virtual LauAbsResonance::LauResonanceModel getResonanceModel() const {return LauAbsResonance::KMatrix;} //! Retrieve the resonance parameters, e.g. so that they can be loaded into a fit /*! - \return floating parameters of the resonance + \return floating parameters of the resonance */ const std::vector& getFloatingParameters(); - + protected: - //! Function not meant to be called - virtual LauComplex resAmp(Double_t mass, Double_t spinTerm); + //! The amplitude calculation + /*! + \param [in] mass the invariant-mass for the channel + \param [in] spinTerm the spin-term for the final channel + \return the complex amplitude + */ + virtual LauComplex resAmp(const Double_t mass, const Double_t spinTerm); private: //! Copy constructor (not implemented) LauKMatrixProdSVP(const LauKMatrixProdSVP& rhs); //! Copy assignment operator (not implemented) LauKMatrixProdSVP& operator=(const LauKMatrixProdSVP& rhs); //! The K-matrix propagator - LauKMatrixPropagator* thePropagator_; + LauKMatrixPropagator* thePropagator_; //! The number of the channel Int_t channelIndex_; - //! Boolean to turn on/off the production Adler zero factor - Bool_t useProdAdler_; + //! Boolean to turn on/off the production Adler zero factor + Bool_t useProdAdler_; ClassDef(LauKMatrixProdSVP, 0) // K-matrix production SVP term }; -#endif +#endif \ No newline at end of file diff --git a/inc/LauKMatrixPropagator.hh b/inc/LauKMatrixPropagator.hh index fffaa41..46619a5 100644 --- a/inc/LauKMatrixPropagator.hh +++ b/inc/LauKMatrixPropagator.hh @@ -1,551 +1,637 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixPropagator.hh - \brief File containing declaration of LauKMatrixPropagator class. + \brief File containing declaration of LauKMatrixPropagator class. */ /*! \class LauKMatrixPropagator - \brief Class for defining a K-matrix propagator. + \brief Class for defining a K-matrix propagator. - Class used to define a K-matrix propagator. - See the following papers for info: - hep-ph/0204328, hep-ex/0312040, [hep-ex]0804.2089 and hep-ph/9705401. + Class used to define a K-matrix propagator. + See the following papers for info: + hep-ph/0204328, hep-ex/0312040, [hep-ex]0804.2089 and hep-ph/9705401. */ #ifndef LAU_KMATRIX_PROPAGATOR #define LAU_KMATRIX_PROPAGATOR -#include "LauComplex.hh" -#include "LauKinematics.hh" -#include "LauParameter.hh" +#include "LauConstants.hh" +#include "LauResonanceMaker.hh" +#include "LauResonanceInfo.hh" #include "TMatrixD.h" #include "TString.h" #include #include +class LauParameter; +class LauKinematics; +class LauComplex; + class LauKMatrixPropagator { public: //! Constructor /*! \param [in] name name of the propagator \param [in] paramFileName the parameter file name \param [in] resPairAmpInt the number of the daughter not produced by the resonance \param [in] nChannels the number of channels \param [in] nPoles the number of poles \param [in] rowIndex this specifies which row of the propagator should be used when summing over the amplitude channels */ LauKMatrixPropagator( const TString& name, const TString& paramFileName, - Int_t resPairAmpInt, Int_t nChannels, Int_t nPoles, - Int_t rowIndex = 1 ); + const Int_t resPairAmpInt, const Int_t nChannels, const Int_t nPoles, + const Int_t rowIndex = 1 ); //! Destructor - virtual ~LauKMatrixPropagator(); - - //! Calculate the invariant mass squared s - /*! - \param [in] kinematics the kinematics of the current event - */ - void updatePropagator(const LauKinematics* kinematics); + virtual ~LauKMatrixPropagator(); //! Calculate the K-matrix propagator for the given s value /*! \param [in] s the invariant mass squared */ - void updatePropagator(Double_t s); + void updatePropagator(const Double_t s); //! Read an input file to set parameters /*! \param [in] inputFile name of the input file */ void setParameters(const TString& inputFile); + //! Set flag to ignore Blatt-Weisskopf-like barrier factor + void ignoreBWBarrierFactor() {includeBWBarrierFactor_=kFALSE;} + //! Get the scattering K matrix /*! \return the real, symmetric scattering K matrix */ TMatrixD getKMatrix() const {return ScattKMatrix_;} //! Get the real part of the propagator full matrix /*! \return the real part of the propagator full matrix */ TMatrixD getRealPropMatrix() const {return realProp_;} //! Get the negative imaginary part of the full propagator matrix /*! \return the negative imaginary part of the full propagator matrix */ TMatrixD getNegImagPropMatrix() const {return negImagProp_;} //! Get the real part of the term of the propagator /*! \param [in] channelIndex the channel number \return the real part of the propagator term */ - Double_t getRealPropTerm(Int_t channelIndex) const; + Double_t getRealPropTerm(const Int_t channelIndex) const; //! Get the imaginary part of the term of the propagator /*! \param [in] channelIndex the channel number \return the imaginiary part of the propagator term */ - Double_t getImagPropTerm(Int_t channelIndex) const; + Double_t getImagPropTerm(const Int_t channelIndex) const; //! Get the 1/(m_pole^2 -s) terms for the scattering and production K-matrix formulae /*! \param [in] poleIndex the number of the pole required \return the value of 1/(m_pole^2 -s) */ - Double_t getPoleDenomTerm(Int_t poleIndex) const; + Double_t getPoleDenomTerm(const Int_t poleIndex) const; - //! Get coupling parameters, set according to the input file + //! Get spin of K-matrix + /*! + \param [in] iChannel the index of the channel + \return the value of the orbital angular momentum, L_, for this channel + */ + Int_t getL(const Int_t iChannel) const {return L_[iChannel];} + + //! Get index of final channel + /*! + \return the index of the channel into which the scattering happens + */ + Int_t getIndex() const {return index_;}; + + //! Get pole mass parameters, set according to the input file /*! \param [in] poleIndex number of the required pole \param [in] channelIndex number of the required channel - \return the parameter of the coupling constant + \return the parameter of the pole mass */ - LauParameter& getPoleMassSqParameter(Int_t poleIndex); + LauParameter& getPoleMassSqParameter(const Int_t poleIndex); //! Get coupling constants that were loaded from the input file /*! \param [in] poleIndex number of the required pole \param [in] channelIndex number of the required channel \return the value of the coupling constant */ - Double_t getCouplingConstant(Int_t poleIndex, Int_t channelIndex) const; + Double_t getCouplingConstant(const Int_t poleIndex, const Int_t channelIndex) const; //! Get coupling parameters, set according to the input file /*! \param [in] poleIndex number of the required pole \param [in] channelIndex number of the required channel \return the parameter of the coupling constant */ - LauParameter& getCouplingParameter(Int_t poleIndex, Int_t channelIndex); + LauParameter& getCouplingParameter(const Int_t poleIndex, const Int_t channelIndex); //! Get scattering constants that were loaded from the input file /*! \param [in] channel1Index number of the first channel index \param [in] channel2Index number of the second channel index \return the value of the scattering constant */ - Double_t getScatteringConstant(Int_t channel1Index, Int_t channel2Index) const; + Double_t getScatteringConstant(const Int_t channel1Index, const Int_t channel2Index) const; //! Get scattering parameters, set according to the input file /*! \param [in] channel1Index number of the first channel index \param [in] channel2Index number of the second channel index \return the parameter of the scattering constant */ - LauParameter& getScatteringParameter(Int_t channel1Index, Int_t channel2Index); + LauParameter& getScatteringParameter(const Int_t channel1Index, const Int_t channel2Index); //! Get mSq0 production parameter /*! \return the mSq0 parameter */ LauParameter& getmSq0() {return mSq0_;} //! Get s0Scatt production parameter /*! \return the s0Scatt parameter */ LauParameter& gets0Scatt() {return s0Scatt_;} //! Get s0 production parameter /*! \return the s0Prod parameter */ LauParameter& gets0Prod() {return s0Prod_;} //! Get sA production parameter /*! \return the sA parameter */ - LauParameter& getsA() {return sA_;} + LauParameter& getsA() {return sA_;} //! Get sA0 production parameter /*! \return the sA0 parameter */ - LauParameter& getsA0() {return sA0_;} + LauParameter& getsA0() {return sA0_;} //! Get the "slowly-varying part" term of the amplitude /*! \return the svp term */ Double_t getProdSVPTerm() const {return prodSVP_;} //! Get the full complex propagator term for a given channel /*! \param [in] channelIndex the number of the required channel \return the complex propagator term */ - LauComplex getPropTerm(Int_t channelIndex) const; + LauComplex getPropTerm(const Int_t channelIndex) const; //! Get the DP axis identifier /*! \return the value to identify the DP axis in question */ Int_t getResPairAmpInt() const {return resPairAmpInt_;} //! Get the number of channels /*! \return the number of channels */ Int_t getNChannels() const {return nChannels_;} //! Get the number of poles /*! \return the number of poles */ Int_t getNPoles() const {return nPoles_;} //! Get the propagator name /*! \return the name of the propagator */ TString getName() const {return name_;} //! Get the unitary transition amplitude for the given channel /*! \param [in] s The invariant mass squared \param [in] channel The index number of the channel process \return the complex amplitude T */ - LauComplex getTransitionAmp(Double_t s, Int_t channel); + LauComplex getTransitionAmp(const Double_t s, const Int_t channel); - //! Get the complex phase space term for the given channel and invariant mass squared - /*! - \param [in] s The invariant mass squared - \param [in] channel The index number of the channel process - \return the complex phase space term rho(channel, channel) + //! Get the complex phase space term for the given channel and invariant mass squared + /*! + \param [in] s The invariant mass squared + \param [in] channel The index number of the channel process + \return the complex phase space term rho(channel, channel) */ - LauComplex getPhaseSpaceTerm(Double_t s, Int_t channel); + LauComplex getPhaseSpaceTerm(const Double_t s, const Int_t channel); - //! Get the Adler zero factor, which is set when updatePropagator is called - /*! - \return the Adler zero factor + //! Get the Adler zero factor, which is set when updatePropagator is called + /*! + \return the Adler zero factor */ - Double_t getAdlerZero() const {return adlerZeroFactor_;} - + Double_t getAdlerZero() const {return adlerZeroFactor_;} - //! Get the THat amplitude for the given s and channel number - /*! - \param [in] s The invariant mass squared + //! Get the THat amplitude for the given s and channel number + /*! + \param [in] s The invariant mass squared \param [in] channel The index number of the channel process \return the complex THat amplitude */ - LauComplex getTHat(Double_t s, Int_t channel); + LauComplex getTHat(const Double_t s, const Int_t channel); protected: + // Integers to specify the allowed channels for the phase space calculations. + // Please keep Zero at the start and leave TotChannels at the end + // whenever more channels are added to this. + //! Integers to specify the allowed channels for the phase space calculations + enum class KMatrixChannels {Zero, PiPi, KK, FourPi, EtaEta, EtaEtaP, + KPi, KEtaP, KThreePi, D0K, Dstar0K, TotChannels}; + //! Calculate the scattering K-matrix for the given value of s /*! \param [in] s the invariant mass squared */ - void calcScattKMatrix(Double_t s); + void calcScattKMatrix(const Double_t s); //! Calculate the real and imaginary part of the phase space density diagonal matrix /*! \param [in] s the invariant mass squared */ - void calcRhoMatrix(Double_t s); + void calcRhoMatrix(const Double_t s); + + //! Retrieve the complex phasespace density for a given channel + /*! + \param [in] s the invariant mass squared + \param [in] phaseSpaceIndex the phasespace index of the channel + \return the complex phasespace density + */ + LauComplex getRho(const Double_t s, const LauKMatrixPropagator::KMatrixChannels) const; + + //! Calculate the (real) gamma angular-momentum barrier matrix + /*! + \param [in] s the invariant mass squared + */ + void calcGammaMatrix(const Double_t s); + + //! Calculate the gamma angular-momentum barrier + /*! + \param [in] s the invariant mass squared + \return the centrifugal barrier factor for L=0,1, or 2 + */ + Double_t calcGamma(const Int_t iCh, const Double_t s, KMatrixChannels phaseSpaceIndex) const; //! Calulate the term 1/(m_pole^2 - s) for the scattering and production K-matrix formulae /*! \param [in] s the invariant mass squared */ - void calcPoleDenomVect(Double_t s); + void calcPoleDenomVect(const Double_t s); + + //! Calculate the D0K+ phase space factor + /*! + \param [in] s the invariant mass squared + \return the complex phase space factor + */ + LauComplex calcD0KRho(const Double_t s) const; + + //! Calculate the D*0K+ phase space factor + /*! + \param [in] s the invariant mass squared + \return the complex phase space factor + */ + LauComplex calcDstar0KRho(const Double_t s) const; //! Calculate the pipi phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcPiPiRho(Double_t s) const; + LauComplex calcPiPiRho(const Double_t s) const; //! Calculate the KK phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcKKRho(Double_t s) const; + LauComplex calcKKRho(const Double_t s) const; //! Calculate the 4 pi phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcFourPiRho(Double_t s) const; + LauComplex calcFourPiRho(const Double_t s) const; //! Calculate the eta-eta phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcEtaEtaRho(Double_t s) const; + LauComplex calcEtaEtaRho(const Double_t s) const; //! Calculate the eta-eta' phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcEtaEtaPRho(Double_t s) const; + LauComplex calcEtaEtaPRho(const Double_t s) const; //! Calculate the Kpi phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcKPiRho(Double_t s) const; + LauComplex calcKPiRho(const Double_t s) const; //! Calculate the K-eta' phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcKEtaPRho(Double_t s) const; + LauComplex calcKEtaPRho(const Double_t s) const; //! Calculate the Kpipipi phase space factor /*! \param [in] s the invariant mass squared \return the complex phase space factor */ - LauComplex calcKThreePiRho(Double_t s) const; + LauComplex calcKThreePiRho(const Double_t s) const; //! Calculate the "slow-varying part" /*! \param [in] s the invariant mass squared \param [in] s0 the invariant mass squared at the Adler zero \return the SVP term */ - Double_t calcSVPTerm(Double_t s, Double_t s0) const; + Double_t calcSVPTerm(const Double_t s, const Double_t s0) const; //! Update the scattering "slowly-varying part" /*! \param [in] s the invariant mass squared */ - void updateScattSVPTerm(Double_t s); + void updateScattSVPTerm(const Double_t s); //! Update the production "slowly-varying part" /*! \param [in] s the invariant mass squared */ - void updateProdSVPTerm(Double_t s); + void updateProdSVPTerm(const Double_t s); //! Calculate the multiplicative factor containing severa Adler zero constants /*! \param [in] s the invariant mass squared */ - void updateAdlerZeroFactor(Double_t s); + void updateAdlerZeroFactor(const Double_t s); //! Check the phase space factors that need to be used /*! \param [in] phaseSpaceInt phase space types \return true of false */ - Bool_t checkPhaseSpaceType(Int_t phaseSpaceInt) const; + Bool_t checkPhaseSpaceType(const Int_t phaseSpaceInt) const; - //! Get the unitary transition amplitude matrix for the given kinematics - /*! - \param [in] kinematics The pointer to the constant kinematics + //! Get the unitary transition amplitude matrix for the given kinematics + /*! + \param [in] kinematics The pointer to the constant kinematics */ - void getTMatrix(const LauKinematics* kinematics); + void getTMatrix(const LauKinematics* kinematics); - //! Get the unitary transition amplitude matrix for the given kinematics - /*! - \param [in] s The invariant mass squared of the system + //! Get the unitary transition amplitude matrix for the given kinematics + /*! + \param [in] s The invariant mass squared of the system */ - void getTMatrix(Double_t s); + void getTMatrix(const Double_t s); + + //! Get the square root of the phase space matrix + void getSqrtRhoMatrix(); - //! Get the square root of the phase space matrix - void getSqrtRhoMatrix(); - - private: + private: //! Copy constructor (not implemented) - LauKMatrixPropagator(const LauKMatrixPropagator& rhs); + LauKMatrixPropagator(const LauKMatrixPropagator& rhs)=delete; //! Copy assignment operator (not implemented) - LauKMatrixPropagator& operator=(const LauKMatrixPropagator& rhs); + LauKMatrixPropagator& operator=(const LauKMatrixPropagator& rhs)=delete; - //! Create a map for the K-matrix parameters - typedef std::map > KMatrixParamMap; + //! Initialise and set the dimensions for the internal matrices and parameter arrays + void initialiseMatrices(); + //! Store the (phase space) channel indices from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file + */ + void storeChannels(const std::vector& theLine); + + //! Store the pole mass and couplings from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file + */ + void storePole(const std::vector& theLine); - //! Initialise and set the dimensions for the internal matrices and parameter arrays - void initialiseMatrices(); + //! Store the scattering coefficients from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file + */ + void storeScattering(const std::vector& theLine); - //! Store the (phase space) channel indices from a line in the parameter file - /*! - \param [in] theLine Vector of strings corresponding to the line from the parameter file + //! Store the channels' characteristic radii from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file */ - void storeChannels(const std::vector& theLine); - - //! Store the pole mass and couplings from a line in the parameter file - /*! - \param [in] theLine Vector of strings corresponding to the line from the parameter file + void storeRadii(const std::vector& theLine); + + //! Store the channels' angular momenta from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file + \param [in] a Vector of integers corresponding to parameter in the propagator denominator */ - void storePole(const std::vector& theLine); + void storeOrbitalAngularMomenta(const std::vector& theLine, std::vector& a); - //! Store the scattering coefficients from a line in the parameter file - /*! - \param [in] theLine Vector of strings corresponding to the line from the parameter file + //! Store the barrier-factor parameter from a line in the parameter file + /*! + \param [in] theLine Vector of strings corresponding to the line from the parameter file + \param [in] a Vector of integers corresponding to parameter in the propagator denominator */ - void storeScattering(const std::vector& theLine); + void storeBarrierFactorParameter(const std::vector& theLine, std::vector& a); - //! Store miscelleanous parameters from a line in the parameter file - /*! - \param [in] keyword the name of the parameter to be set - \param [in] parString the string containing the value of the parameter + + //! Store miscelleanous parameters from a line in the parameter file + /*! + \param [in] keyword the name of the parameter to be set + \param [in] parString the string containing the value of the parameter */ - void storeParameter(const TString& keyword, const TString& parString); + void storeParameter(const TString& keyword, const TString& parString); //! String to store the propagator name TString name_; //! Name of the input parameter file TString paramFileName_; //! Number to identify the DP axis in question Int_t resPairAmpInt_; //! Row index - 1 Int_t index_; //! s value of the previous pole - Double_t previousS_; + Double_t previousS_{0.0}; //! "slowly-varying part" for the scattering K-matrix - Double_t scattSVP_; + Double_t scattSVP_{0.0}; //! "slowly-varying part" for the production K-matrix - Double_t prodSVP_; + Double_t prodSVP_{0.0}; //! Real part of the propagator matrix TMatrixD realProp_; //! Imaginary part of the propagator matrix TMatrixD negImagProp_; - // Integers to specify the allowed channels for the phase space calculations. - // Please keep Zero at the start and leave TotChannels at the end - // whenever more channels are added to this. - //! Integers to specify the allowed channels for the phase space calculations - enum KMatrixChannels {Zero, PiPi, KK, FourPi, EtaEta, EtaEtaP, - KPi, KEtaP, KThreePi, TotChannels}; - //! Scattering K-matrix TMatrixD ScattKMatrix_; //! Real part of the phase space density diagonal matrix TMatrixD ReRhoMatrix_; //! Imaginary part of the phase space density diagonal matrix TMatrixD ImRhoMatrix_; + //! Gamma angular-momentum barrier matrix + TMatrixD GammaMatrix_; //! Identity matrix TMatrixD IMatrix_; //! Null matrix TMatrixD zeroMatrix_; //! Real part of the square root of the phase space density diagonal matrix TMatrixD ReSqrtRhoMatrix_; //! Imaginary part of the square root of the phase space density diagonal matrix TMatrixD ImSqrtRhoMatrix_; - //! Real part of the unitary T matrix - TMatrixD ReTMatrix_; - //! Imaginary part of the unitary T matrix - TMatrixD ImTMatrix_; + //! Real part of the unitary T matrix + TMatrixD ReTMatrix_; + //! Imaginary part of the unitary T matrix + TMatrixD ImTMatrix_; //! Number of channels Int_t nChannels_; //! Number of poles Int_t nPoles_; + //! Vector of orbital angular momenta + std::vector L_; + //! Boolean to indicate whether storeBarrierFactorParameter has been called + Bool_t haveCalled_storeBarrierFactorParameter{kFALSE}; + //! Boolean to dictate whether to include Blatt-Weisskopf-like denominator in K-matrix centrifugal barrier factor + Bool_t includeBWBarrierFactor_{kTRUE}; //! Vector of squared pole masses - std::vector mSqPoles_; + std::vector mSqPoles_; //! Array of coupling constants LauParArray gCouplings_; //! Array of scattering SVP values LauParArray fScattering_; + //! Vector of characteristic radii + std::vector radii_; + //! Vector of ratio a/R^2 + std::vector gamAInvRadSq_; //! Vector of phase space types - std::vector phaseSpaceTypes_; + std::vector phaseSpaceTypes_; //! Vector of squared masses std::vector mSumSq_; //! Vector of mass differences std::vector mDiffSq_; //! Vector of 1/(m_pole^2 - s) terms for scattering and production K-matrix formulae std::vector poleDenomVect_; //! Constant from input file LauParameter mSq0_; //! Constant from input file LauParameter s0Scatt_; //! Constant from input file LauParameter s0Prod_; //! Constant from input file LauParameter sA_; //! Constant from input file LauParameter sA0_; //! Defined as 0.5*sA*mPi*mPi - Double_t sAConst_; + Double_t sAConst_{0.0}; + //! Defined as 4*mPi*mPi - Double_t m2piSq_; + const Double_t m2piSq_{4.0*LauConstants::mPiSq}; //! Defined as 4*mK*mK - Double_t m2KSq_; + const Double_t m2KSq_{4.0*LauConstants::mKSq}; //! Defined as 4*mEta*mEta - Double_t m2EtaSq_; + const Double_t m2EtaSq_{4.0*LauConstants::mEtaSq}; //! Defined as (mEta+mEta')^2 - Double_t mEtaEtaPSumSq_; + const Double_t mEtaEtaPSumSq_{(LauConstants::mEta + LauConstants::mEtaPrime)*(LauConstants::mEta + LauConstants::mEtaPrime)}; //! Defined as (mEta-mEta')^2 - Double_t mEtaEtaPDiffSq_; + const Double_t mEtaEtaPDiffSq_{(LauConstants::mEta - LauConstants::mEtaPrime)*(LauConstants::mEta - LauConstants::mEtaPrime)}; //! Defined as (mK+mPi)^2 - Double_t mKpiSumSq_; + const Double_t mKpiSumSq_{(LauConstants::mK + LauConstants::mPi)*(LauConstants::mK + LauConstants::mPi)}; //! Defined as (mK-mPi)^2 - Double_t mKpiDiffSq_; + const Double_t mKpiDiffSq_{(LauConstants::mK - LauConstants::mPi)*(LauConstants::mK - LauConstants::mPi)}; //! Defined as (mK+mEta')^2 - Double_t mKEtaPSumSq_; + const Double_t mKEtaPSumSq_{(LauConstants::mK + LauConstants::mEtaPrime)*(LauConstants::mK + LauConstants::mEtaPrime)}; //! Defined as (mK-mEta')^2 - Double_t mKEtaPDiffSq_; + const Double_t mKEtaPDiffSq_{(LauConstants::mK - LauConstants::mEtaPrime)*(LauConstants::mK - LauConstants::mEtaPrime)}; //! Defined as (mK-3*mPi)^2 - Double_t mK3piDiffSq_; + const Double_t mK3piDiffSq_{(LauConstants::mK - 3.0*LauConstants::mPi)*(LauConstants::mK - 3.0*LauConstants::mPi)}; //! Factor used to calculate the Kpipipi phase space term - Double_t k3piFactor_; + const Double_t k3piFactor_{TMath::Power((1.44 - mK3piDiffSq_)/1.44, -2.5)}; //! Factor used to calculate the pipipipi phase space term - Double_t fourPiFactor1_; + const Double_t fourPiFactor1_{16.0*LauConstants::mPiSq}; //! Factor used to calculate the pipipipi phase space term - Double_t fourPiFactor2_; + const Double_t fourPiFactor2_{TMath::Sqrt(1.0 - fourPiFactor1_)}; + //! Defined as (mD0+mK)^2 + const Double_t mD0KSumSq_{(LauConstants::mD0 + LauConstants::mK)*(LauConstants::mD0 + LauConstants::mK)}; + //! Defined as (mD0-mK)^2 + const Double_t mD0KDiffSq_{(LauConstants::mD0 - LauConstants::mK)*(LauConstants::mD0 - LauConstants::mK)}; + //! Defined as (mD*0+mK)^2 + const Double_t mDstar0KSumSq_{(LauResonanceMaker::get().getResInfo("D*0")->getMass()->value() + LauConstants::mK)*(LauResonanceMaker::get().getResInfo("D*0")->getMass()->value() + LauConstants::mK)}; + //! Defined as (mD*0-mK)^2 + const Double_t mDstar0KDiffSq_{(LauResonanceMaker::get().getResInfo("D*0")->getMass()->value() - LauConstants::mK)*(LauResonanceMaker::get().getResInfo("D*0")->getMass()->value() - LauConstants::mK)}; //! Multiplicative factor containing various Adler zero constants - Double_t adlerZeroFactor_; + Double_t adlerZeroFactor_{0.0}; //! Tracks if all params have been set - Bool_t parametersSet_; + Bool_t parametersSet_{kFALSE}; //! Control the output of the functions - Bool_t verbose_; + static constexpr Bool_t verbose_{kFALSE}; //! Control if scattering constants are channel symmetric: f_ji = f_ij - Bool_t scattSymmetry_; + Bool_t scattSymmetry_{kFALSE}; ClassDef(LauKMatrixPropagator,0) // K-matrix amplitude model }; #endif diff --git a/inc/LauResonanceMaker.hh b/inc/LauResonanceMaker.hh index 3f506ad..0f09938 100644 --- a/inc/LauResonanceMaker.hh +++ b/inc/LauResonanceMaker.hh @@ -1,196 +1,199 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauResonanceMaker.hh \brief File containing declaration of LauResonanceMaker class. */ /*! \class LauResonanceMaker \brief Singleton factory class for creating resonances. Singleton factory class for creating resonances. Information records for all known resonances are stored within this class. */ #ifndef LAU_RESONANCE_MAKER #define LAU_RESONANCE_MAKER #include #include #include "TString.h" #include "LauAbsResonance.hh" class LauDaughters; class LauResonanceInfo; class LauResonanceMaker { public: //! Get the factory instance static LauResonanceMaker& get(); //! Set the type of BW factor (for all categories) /*! This must be used before creating any resonances \param [in] bwType the Blatt-Weisskopf barrier type */ void setBWType(const LauBlattWeisskopfFactor::BarrierType bwType); //! Set the rest frame in which the bachelor momentum should be calculated (for all BW categories) /*! This must be used before creating any resonances \param [in] restFrame the rest frame in which the bachelor momentum should be calculated for the Blatt-Weisskopf factors */ void setBWBachelorRestFrame(const LauBlattWeisskopfFactor::RestFrame restFrame); //! Set the spin formalism to be used for all resonances /*! This must be used before creating any resonances \param [in] spinType the spin formalism to be used */ void setSpinFormalism(const LauAbsResonance::LauSpinType spinType); //! Set the BW radius for the given category /*! \param [in] bwCategory the Blatt-Weisskopf barrier factor category \param [in] bwRadius the radius value to be used for the given category */ void setDefaultBWRadius(const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory, const Double_t bwRadius); //! Fix or release the Blatt-Weisskopf barrier radius for the given category /*! \param [in] bwCategory the Blatt-Weisskopf barrier factor category \param [in] fixRadius new status of the radius (kTRUE = fixed, kFALSE = floating) */ void fixBWRadius(const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory, const Bool_t fixRadius); //! Create a resonance /*! \param [in] daughters defines the Dalitz plot in which the resonance should be created \param [in] resName the name of the resonant particle \param [in] resPairAmpInt the index of the daughter not produced by the resonance \param [in] resType the type of the resonance \param [in] bwCategory the Blatt-Weisskopf barrier factor category \return the resonance */ LauAbsResonance* getResonance(const LauDaughters* daughters, const TString& resName, const Int_t resPairAmpInt, const LauAbsResonance::LauResonanceModel resType, const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory = LauBlattWeisskopfFactor::Default); //! Retrieve the integer index for the specified resonance /*! \param [in] name the name of the resonant particle \return the index */ Int_t resTypeInt(const TString& name) const; //! Retrieve the number of defined resonances /*! \return the number of defined resonances */ UInt_t getNResDefMax() const {return nResDefMax_;} //! Print the information records, one per line, to the requested stream /*! \param [in,out] stream the stream to which to print the info */ void printAll( std::ostream& stream ) const; //! Get the information for the given resonance name /*! \param [in] resName the name of the resonant particle \return the LauResonanceInfo pointer if we can find the resonance name */ LauResonanceInfo* getResInfo(const TString& resName) const; + //! Retrieve parent Blatt-Weisskopf factor (for use by K-matrix pole/SVP which doesn't have a `resInfo') + LauBlattWeisskopfFactor* getParentBWFactor(Int_t newSpin, LauBlattWeisskopfFactor::BarrierType barrierType); + protected: //! Create the list of known resonances void createResonanceVector(); //! Retrieve Blatt-Weisskopf factor for the given category LauBlattWeisskopfFactor* getBWFactor(const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory, const LauResonanceInfo* resInfo); private: /*! \struct BlattWeisskopfCategoryInfo \brief Data structure to store information on a given Blatt-Weisskopf category */ struct BlattWeisskopfCategoryInfo { //! The BW factor object LauBlattWeisskopfFactor* bwFactor_; //! The default value for the radius in this category Double_t defaultRadius_; //! Whether or not the radius value for this category should be fixed in the fit Bool_t radiusFixed_; }; //! Define a type to hold information on each BW category typedef std::map BWFactorCategoryMap; //! Constructor LauResonanceMaker(); //! Destructor virtual ~LauResonanceMaker(); //! Copy constructor (not inplemented) LauResonanceMaker( const LauResonanceMaker& other ); //! Copy assignment (not implemented) LauResonanceMaker& operator=( const LauResonanceMaker& other ); //! The singleton instance static LauResonanceMaker* resonanceMaker_; //! The number of known resonances UInt_t nResDefMax_; //! The known resonances std::vector resInfo_; //! The type of the Blatt-Weisskopf barrier to use for all resonances LauBlattWeisskopfFactor::BarrierType bwBarrierType_; //! The rest frame in which the bachelor momentum used in the Blatt-Weisskopf factors should be calculated LauBlattWeisskopfFactor::RestFrame bwRestFrame_; //! The spin formalism that should be used for all resonances LauAbsResonance::LauSpinType spinFormalism_; //! The Blatt-Weisskopf factor objects (and related information) for each category BWFactorCategoryMap bwFactors_; //! The Blatt-Weisskopf factor objects for resonances in the independent category std::vector bwIndepFactors_; //! Boolean flag to control printing a summary of the formalism to be used when the first resonance is created Bool_t summaryPrinted_; ClassDef(LauResonanceMaker,0) // Kinematic routines }; #endif diff --git a/src/LauAbsResonance.cc b/src/LauAbsResonance.cc index c697e08..185e22b 100644 --- a/src/LauAbsResonance.cc +++ b/src/LauAbsResonance.cc @@ -1,681 +1,682 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauAbsResonance.cc \brief File containing implementation of LauAbsResonance class. */ #include #include "TSystem.h" #include "LauAbsResonance.hh" #include "LauConstants.hh" #include "LauDaughters.hh" #include "LauKinematics.hh" #include "LauParameter.hh" #include "LauResonanceInfo.hh" ClassImp(LauAbsResonance) bool LauAbsResonance::isIncoherentModel(LauResonanceModel model) { switch(model) { case BW: case RelBW: case GS: case Flatte: case Sigma: case Kappa: case Dabba: case LASS: case LASS_BW: case LASS_NR: case EFKLLM: case KMatrix: case FlatNR: case NRModel: case BelleNR: case PowerLawNR: case BelleSymNR: case BelleSymNRNoInter: case TaylorNR: case PolNR: case Pole: case PolarFFNR: case PolarFFSymNR: case PolarFFSymNRNoInter: case Rescattering: case Rescattering2: case RescatteringNoInter: case MIPW_MagPhase: case MIPW_RealImag: case RhoOmegaMix_GS: case RhoOmegaMix_RBW: case RhoOmegaMix_GS_1: case RhoOmegaMix_RBW_1: break; case GaussIncoh: return true; } return false; } // Constructor LauAbsResonance::LauAbsResonance(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) : resInfo_(resInfo), daughters_(daughters), resName_( (resInfo!=0) ? resInfo->getName() : "" ), sanitisedName_( (resInfo!=0) ? resInfo->getSanitisedName() : "" ), resMass_( (resInfo!=0) ? resInfo->getMass() : 0 ), resWidth_( (resInfo!=0) ? resInfo->getWidth() : 0 ), resSpin_( (resInfo!=0) ? resInfo->getSpin() : 0 ), resCharge_( (resInfo!=0) ? resInfo->getCharge() : 0 ), resPairAmpInt_(resPairAmpInt) { if ( resInfo == 0 ) { std::cerr << "ERROR in LauAbsResonance constructor : null LauResonanceInfo object provided" << std::endl; gSystem->Exit(EXIT_FAILURE); } if ( daughters_ == 0 ) { std::cerr << "ERROR in LauAbsResonance constructor : null LauDaughters object provided" << std::endl; gSystem->Exit(EXIT_FAILURE); } nameParent_ = this->getNameParent(); nameDaug1_ = this->getNameDaug1(); nameDaug2_ = this->getNameDaug2(); nameBachelor_ = this->getNameBachelor(); massParent_ = this->getMassParent(); massDaug1_ = this->getMassDaug1(); massDaug2_ = this->getMassDaug2(); massBachelor_ = this->getMassBachelor(); chargeParent_ = this->getChargeParent(); chargeDaug1_ = this->getChargeDaug1(); chargeDaug2_ = this->getChargeDaug2(); chargeBachelor_ = this->getChargeBachelor(); // check that the total charge adds up to that of the resonance Int_t totalCharge = chargeDaug1_ + chargeDaug2_; if ( (totalCharge != resCharge_) && (resPairAmpInt_ != 0) ) { std::cerr << "ERROR in LauAbsResonance : Total charge of daughters = " << totalCharge << ". Resonance charge = " << resCharge_ << "." << std::endl; gSystem->Exit(EXIT_FAILURE); } } // Constructor -LauAbsResonance::LauAbsResonance(const TString& resName, const Int_t resPairAmpInt, const LauDaughters* daughters) : +LauAbsResonance::LauAbsResonance(const TString& resName, const Int_t resPairAmpInt, const LauDaughters* daughters, const Int_t resSpin) : daughters_(daughters), resName_(resName), sanitisedName_(resName), + resSpin_(resSpin), resPairAmpInt_(resPairAmpInt) { if ( daughters_ == 0 ) { std::cerr << "ERROR in LauAbsResonance constructor : null LauDaughters object provided" << std::endl; gSystem->Exit(EXIT_FAILURE); } nameParent_ = this->getNameParent(); nameDaug1_ = this->getNameDaug1(); nameDaug2_ = this->getNameDaug2(); nameBachelor_ = this->getNameBachelor(); massParent_ = this->getMassParent(); massDaug1_ = this->getMassDaug1(); massDaug2_ = this->getMassDaug2(); massBachelor_ = this->getMassBachelor(); chargeParent_ = this->getChargeParent(); chargeDaug1_ = this->getChargeDaug1(); chargeDaug2_ = this->getChargeDaug2(); chargeBachelor_ = this->getChargeBachelor(); // Since we haven't been provided with a LauResonanceInfo object we can just // set the change of the resonance to be the sum of the daughter charges resCharge_ = chargeDaug1_ + chargeDaug2_; } // Destructor LauAbsResonance::~LauAbsResonance() { } LauComplex LauAbsResonance::amplitude(const LauKinematics* kinematics) { // Use LauKinematics interface for amplitude // For resonance made from tracks i, j, we need the momenta // of tracks i and k in the i-j rest frame for spin helicity calculations // in the Zemach tensor formalism. // Also need the momentum of track k in the parent rest-frame for // calculation of the Blatt-Weisskopf factors. mass_ = 0.0; cosHel_ = 0.0; q_ = 0.0; p_ = 0.0; pstar_ = 0.0; erm_ = 1.0; covFactor_ = 1.0; if (resPairAmpInt_ == 1) { mass_ = kinematics->getm23(); cosHel_ = kinematics->getc23(); q_ = kinematics->getp2_23(); p_ = kinematics->getp1_23(); pstar_ = kinematics->getp1_Parent(); erm_ = kinematics->getcov23(); } else if (resPairAmpInt_ == 2) { mass_ = kinematics->getm13(); cosHel_ = kinematics->getc13(); q_ = kinematics->getp1_13(); p_ = kinematics->getp2_13(); pstar_ = kinematics->getp2_Parent(); erm_ = kinematics->getcov13(); } else if (resPairAmpInt_ == 3) { mass_ = kinematics->getm12(); cosHel_ = kinematics->getc12(); q_ = kinematics->getp1_12(); p_ = kinematics->getp3_12(); pstar_ = kinematics->getp3_Parent(); erm_ = kinematics->getcov12(); } else { std::cerr << "ERROR in LauAbsResonance::amplitude : Nonsense setup of resPairAmp array." << std::endl; gSystem->Exit(EXIT_FAILURE); } if (this->flipHelicity()) { cosHel_ *= -1.0; } if (this->ignoreMomenta()) { q_ = 1.0; p_ = 1.0; pstar_ = 1.0; erm_ = 1.0; } // Calculate the spin factors Double_t spinTerm(1.0); Double_t pProd(1.0); if (!this->ignoreSpin()) { switch ( this->getSpinType() ) { case Zemach_P: pProd = q_*p_; spinTerm = this->calcZemachSpinFactor( pProd ); break; case Zemach_Pstar: pProd = q_*pstar_; spinTerm = this->calcZemachSpinFactor( pProd ); break; case Covariant: pProd = q_*pstar_; spinTerm = this->calcCovSpinFactor( pProd ); break; case Legendre: spinTerm = this->calcLegendrePoly(); break; } } // Calculate the full amplitude LauComplex resAmplitude = this->resAmp(mass_, spinTerm); return resAmplitude; } void LauAbsResonance::calcCovFactor( const Double_t erm ) { if (resSpin_ == 0) { covFactor_ = 1.0; } else if (resSpin_ == 1) { covFactor_ = erm; } else if (resSpin_ == 2) { covFactor_ = erm*erm + 0.5; } else if (resSpin_ == 3) { covFactor_ = erm*(erm*erm + 1.5); } else if (resSpin_ == 4) { covFactor_ = (8.*erm*erm*erm*erm + 24.*erm*erm + 3.)/35.; } else if (resSpin_ > 4) { std::cerr << "WARNING in LauAbsResonance::calcCovFactor : covariant spin factor cannot (yet) be fully calculated for spin >= 5" << std::endl; std::cerr << " : the function of sqrt(1 + (p/mParent)^2) part will be missing" << std::endl; covFactor_ = 1.0; } } Double_t LauAbsResonance::calcCovSpinFactor( const Double_t pProd ) { if (resSpin_ == 0) { covFactor_ = 1.0; return 1.0; } // Covariant spin factor is (p* q)^L * f_L(erm) * P_L(cosHel) Double_t spinFactor(pProd); for ( Int_t i(1); i < resSpin_; ++i ) { spinFactor *= pProd; } this->calcCovFactor( erm_ ); spinFactor *= covFactor_; spinFactor *= this->calcLegendrePoly(); return spinFactor; } Double_t LauAbsResonance::calcZemachSpinFactor( const Double_t pProd ) const { // Calculate the spin factors // // These are calculated as follows // // -2^j * (q*p)^j * cj * Pj(cosHel) // // where Pj(coshHel) is the jth order Legendre polynomial and // // cj = j! / (2j-1)!! if (resSpin_ == 0) { return 1.0; } Double_t spinFactor(pProd); for ( Int_t i(1); i < resSpin_; ++i ) { spinFactor *= pProd; } spinFactor *= this->calcLegendrePoly(); return spinFactor; } Double_t LauAbsResonance::calcLegendrePoly( const Double_t cosHel ) { cosHel_ = cosHel; return this->calcLegendrePoly(); } Double_t LauAbsResonance::calcLegendrePoly() const { Double_t legPol = 1.0; if (resSpin_ == 1) { // Calculate vector resonance Legendre polynomial legPol = -2.0*cosHel_; } else if (resSpin_ == 2) { // Calculate tensor resonance Legendre polynomial legPol = 4.0*(3.0*cosHel_*cosHel_ - 1.0)/3.0; } else if (resSpin_ == 3) { // Calculate spin 3 resonance Legendre polynomial legPol = -8.0*(5.0*cosHel_*cosHel_*cosHel_ - 3.0*cosHel_)/5.0; } else if (resSpin_ == 4) { // Calculate spin 4 resonance Legendre polynomial legPol = 16.0*(35.0*cosHel_*cosHel_*cosHel_*cosHel_ - 30.0*cosHel_*cosHel_ + 3.0)/35.0; } else if (resSpin_ == 5) { // Calculate spin 5 resonance Legendre polynomial legPol = -32.0*(63.0*cosHel_*cosHel_*cosHel_*cosHel_*cosHel_ - 70.0*cosHel_*cosHel_*cosHel_ + 15.0*cosHel_)/63.0; } else if (resSpin_ > 5) { std::cerr << "WARNING in LauAbsResonance::calcLegendrePoly : Legendre polynomials not (yet) implemented for spin > 5" << std::endl; } return legPol; } void LauAbsResonance::changeResonance(const Double_t newMass, const Double_t newWidth, const Int_t newSpin) { if (newMass > 0.0) { resMass_->valueAndRange(newMass,0.0,3.0*newMass); resMass_->initValue(newMass); resMass_->genValue(newMass); std::cout << "INFO in LauAbsResonance::changeResonance : Setting mass to " << resMass_->value() << std::endl; } if (newWidth > 0.0) { resWidth_->valueAndRange(newWidth,0.0,3.0*newWidth); resWidth_->initValue(newWidth); resWidth_->genValue(newWidth); std::cout << "INFO in LauAbsResonance::changeResonance : Setting width to " << resWidth_->value() << std::endl; } if (newSpin > -1) { resSpin_ = newSpin; std::cout << "INFO in LauAbsResonance::changeResonance : Setting spin to " << resSpin_ << std::endl; } } void LauAbsResonance::changeBWBarrierRadii(const Double_t resRadius, const Double_t parRadius) { if ( resRadius >= 0.0 && resBWFactor_ != 0 ) { LauParameter* resBWRadius = resBWFactor_->getRadiusParameter(); resBWRadius->value(resRadius); resBWRadius->initValue(resRadius); resBWRadius->genValue(resRadius); std::cout << "INFO in LauAbsResonance::changeBWBarrierRadii : Setting resonance factor radius to " << resBWRadius->value() << std::endl; } if ( parRadius >= 0.0 && parBWFactor_ != 0 ) { LauParameter* parBWRadius = parBWFactor_->getRadiusParameter(); parBWRadius->value(parRadius); parBWRadius->initValue(parRadius); parBWRadius->genValue(parRadius); std::cout << "INFO in LauAbsResonance::changeBWBarrierRadii : Setting parent factor radius to " << parBWRadius->value() << std::endl; } } void LauAbsResonance::setResonanceParameter(const TString& name, const Double_t value) { //This function should always be overwritten if needed in classes inheriting from LauAbsResonance. std::cerr << "WARNING in LauAbsResonance::setResonanceParameter : Unable to set parameter \"" << name << "\" to value: " << value << "." << std::endl; } void LauAbsResonance::floatResonanceParameter(const TString& name) { //This function should always be overwritten if needed in classes inheriting from LauAbsResonance. std::cerr << "WARNING in LauAbsResonance::floatResonanceParameter : Unable to release parameter \"" << name << "\"." << std::endl; } LauParameter* LauAbsResonance::getResonanceParameter(const TString& name) { //This function should always be overwritten if needed in classes inheriting from LauAbsResonance. std::cerr << "WARNING in LauAbsResonance::getResonanceParameter : Unable to get parameter \"" << name << "\"." << std::endl; return 0; } void LauAbsResonance::addFloatingParameter( LauParameter* param ) { if ( param == 0 ) { return; } if ( param->clone() ) { resParameters_.push_back( param->parent() ); } else { resParameters_.push_back( param ); } } void LauAbsResonance::fixBarrierRadii(const Bool_t fixResRad, const Bool_t fixParRad) { if ( resBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::fixBarrierRadii : resonance barrier factor not present, cannot fix/float it" << std::endl; return; } if ( parBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::fixBarrierRadii : parent barrier factor not present, cannot fix/float it" << std::endl; return; } LauParameter* resBWRadius = resBWFactor_->getRadiusParameter(); resBWRadius->fixed(fixResRad); LauParameter* parBWRadius = parBWFactor_->getRadiusParameter(); parBWRadius->fixed(fixParRad); } Bool_t LauAbsResonance::fixResRadius() const { if ( resBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::fixResRadius : resonance barrier factor not present" << std::endl; return kTRUE; } LauParameter* bwRadius = resBWFactor_->getRadiusParameter(); return bwRadius->fixed(); } Bool_t LauAbsResonance::fixParRadius() const { if ( parBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::fixParRadius : parent barrier factor not present" << std::endl; return kTRUE; } LauParameter* bwRadius = parBWFactor_->getRadiusParameter(); return bwRadius->fixed(); } Double_t LauAbsResonance::getResRadius() const { if ( resBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::getResRadius : resonance barrier factor not present" << std::endl; return -1.0; } LauParameter* bwRadius = resBWFactor_->getRadiusParameter(); return bwRadius->unblindValue(); } Double_t LauAbsResonance::getParRadius() const { if ( parBWFactor_ == 0 ) { std::cerr << "WARNING in LauAbsResonance::getParRadius : parent barrier factor not present" << std::endl; return -1.0; } LauParameter* bwRadius = parBWFactor_->getRadiusParameter(); return bwRadius->unblindValue(); } Double_t LauAbsResonance::getMassParent() const { // Get the parent mass Double_t mass(LauConstants::mB); if (daughters_) { mass = daughters_->getMassParent(); } return mass; } Double_t LauAbsResonance::getMassDaug1() const { // Get the daughter mass Double_t mass(LauConstants::mPi); if (daughters_) { if (resPairAmpInt_ == 1) { mass = daughters_->getMassDaug2(); } else if (resPairAmpInt_ == 2) { mass = daughters_->getMassDaug1(); } else if (resPairAmpInt_ == 3) { mass = daughters_->getMassDaug1(); } } return mass; } Double_t LauAbsResonance::getMassDaug2() const { // Get the daughter mass Double_t mass(LauConstants::mPi); if (daughters_) { if (resPairAmpInt_ == 1) { mass = daughters_->getMassDaug3(); } else if (resPairAmpInt_ == 2) { mass = daughters_->getMassDaug3(); } else if (resPairAmpInt_ == 3) { mass = daughters_->getMassDaug2(); } } return mass; } Double_t LauAbsResonance::getMassBachelor() const { // Get the bachelor mass Double_t mass(LauConstants::mPi); if (daughters_) { if (resPairAmpInt_ == 1) { mass = daughters_->getMassDaug1(); } else if (resPairAmpInt_ == 2) { mass = daughters_->getMassDaug2(); } else if (resPairAmpInt_ == 3) { mass = daughters_->getMassDaug3(); } } return mass; } Int_t LauAbsResonance::getChargeParent() const { // Get the parent charge Int_t charge(0); if (daughters_) { charge = daughters_->getChargeParent(); } return charge; } Int_t LauAbsResonance::getChargeDaug1() const { // Get the daughter charge Int_t charge(0); if (daughters_) { if (resPairAmpInt_ == 1) { charge = daughters_->getChargeDaug2(); } else if (resPairAmpInt_ == 2) { charge = daughters_->getChargeDaug1(); } else if (resPairAmpInt_ == 3) { charge = daughters_->getChargeDaug1(); } } return charge; } Int_t LauAbsResonance::getChargeDaug2() const { // Get the daughter charge Int_t charge(0); if (daughters_) { if (resPairAmpInt_ == 1) { charge = daughters_->getChargeDaug3(); } else if (resPairAmpInt_ == 2) { charge = daughters_->getChargeDaug3(); } else if (resPairAmpInt_ == 3) { charge = daughters_->getChargeDaug2(); } } return charge; } Int_t LauAbsResonance::getChargeBachelor() const { // Get the bachelor charge Int_t charge(0); if (daughters_) { if (resPairAmpInt_ == 1) { charge = daughters_->getChargeDaug1(); } else if (resPairAmpInt_ == 2) { charge = daughters_->getChargeDaug2(); } else if (resPairAmpInt_ == 3) { charge = daughters_->getChargeDaug3(); } } return charge; } TString LauAbsResonance::getNameParent() const { // Get the parent name TString name(""); if (daughters_) { name = daughters_->getNameParent(); } return name; } TString LauAbsResonance::getNameDaug1() const { // Get the daughter name TString name(""); if (daughters_) { if (resPairAmpInt_ == 1) { name = daughters_->getNameDaug2(); } else if (resPairAmpInt_ == 2) { name = daughters_->getNameDaug1(); } else if (resPairAmpInt_ == 3) { name = daughters_->getNameDaug1(); } } return name; } TString LauAbsResonance::getNameDaug2() const { // Get the daughter name TString name(""); if (daughters_) { if (resPairAmpInt_ == 1) { name = daughters_->getNameDaug3(); } else if (resPairAmpInt_ == 2) { name = daughters_->getNameDaug3(); } else if (resPairAmpInt_ == 3) { name = daughters_->getNameDaug2(); } } return name; } TString LauAbsResonance::getNameBachelor() const { // Get the bachelor name TString name(""); if (daughters_) { if (resPairAmpInt_ == 1) { name = daughters_->getNameDaug1(); } else if (resPairAmpInt_ == 2) { name = daughters_->getNameDaug2(); } else if (resPairAmpInt_ == 3) { name = daughters_->getNameDaug3(); } } return name; } diff --git a/src/LauBlattWeisskopfFactor.cc b/src/LauBlattWeisskopfFactor.cc index d99d384..b1abc0c 100644 --- a/src/LauBlattWeisskopfFactor.cc +++ b/src/LauBlattWeisskopfFactor.cc @@ -1,192 +1,192 @@ /* Copyright 2014 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauBlattWeisskopfFactor.cc \brief File containing implementation of LauBlattWeisskopfFactor class. */ #include #include "TMath.h" #include "LauBlattWeisskopfFactor.hh" #include "LauParameter.hh" #include "LauResonanceInfo.hh" ClassImp(LauBlattWeisskopfFactor) // Constructor LauBlattWeisskopfFactor::LauBlattWeisskopfFactor( const LauResonanceInfo& resInfo, const BarrierType barrierType, const RestFrame restFrame, const BlattWeisskopfCategory category ) : spin_(resInfo.getSpin()), radius_(new LauParameter("NEED_A_GOOD_NAME",resInfo.getBWRadius(),0.0,10.0,kTRUE)), barrierType_(barrierType), restFrame_(restFrame) { TString categoryName = this->setRadiusName( resInfo, category ); std::cout << "INFO in LauBlattWeisskopfFactor constructor : creating radius parameter for category \"" << categoryName << "\", with initial value " << resInfo.getBWRadius() << std::endl; } LauBlattWeisskopfFactor::LauBlattWeisskopfFactor( const LauResonanceInfo& resInfo, const Double_t resRadius, const BarrierType barrierType, const RestFrame restFrame, const BlattWeisskopfCategory category ) : spin_(resInfo.getSpin()), radius_(new LauParameter("NEED_A_GOOD_NAME",resRadius,0.0,10.0,kTRUE)), barrierType_(barrierType), restFrame_(restFrame) { TString categoryName = this->setRadiusName( resInfo, category ); std::cout << "INFO in LauBlattWeisskopfFactor constructor : creating radius parameter for category \"" << categoryName << "\", with initial value " << resRadius << std::endl; } LauBlattWeisskopfFactor::~LauBlattWeisskopfFactor() { } -LauBlattWeisskopfFactor::LauBlattWeisskopfFactor( const LauBlattWeisskopfFactor& other, const UInt_t newSpin ) : +LauBlattWeisskopfFactor::LauBlattWeisskopfFactor( const LauBlattWeisskopfFactor& other, const UInt_t newSpin, const BarrierType newBarrierType ) : spin_(newSpin), radius_(other.radius_->createClone()), - barrierType_(other.barrierType_), + barrierType_(newBarrierType), restFrame_(other.restFrame_) { } TString LauBlattWeisskopfFactor::setRadiusName( const LauResonanceInfo& resInfo, const BlattWeisskopfCategory category ) { TString name = "BarrierRadius_"; TString categoryName; switch (category) { case Parent : categoryName = "Parent"; break; case Indep : categoryName = resInfo.getSanitisedName(); break; case Light : categoryName = "Light"; break; case Kstar : categoryName = "Kstar"; break; case Charm : categoryName = "Charm"; break; case StrangeCharm : categoryName = "StrangeCharm"; break; case Charmonium : categoryName = "Charmonium"; break; case Beauty : categoryName = "Beauty"; break; case StrangeBeauty : categoryName = "StrangeBeauty"; break; case CharmBeauty : categoryName = "CharmBeauty"; break; case Custom1 : categoryName = "Custom1"; break; case Custom2 : categoryName = "Custom2"; break; case Custom3 : categoryName = "Custom3"; break; case Custom4 : categoryName = "Custom4"; break; default : categoryName = "Unknown"; break; } name.Append(categoryName); radius_->name(name); return categoryName; } -LauBlattWeisskopfFactor* LauBlattWeisskopfFactor::createClone( const UInt_t newSpin ) +LauBlattWeisskopfFactor* LauBlattWeisskopfFactor::createClone( const UInt_t newSpin, const BarrierType newBarrierType ) { - LauBlattWeisskopfFactor* clone = new LauBlattWeisskopfFactor( *this, newSpin ); + LauBlattWeisskopfFactor* clone = new LauBlattWeisskopfFactor( *this, newSpin, newBarrierType ); return clone; } Double_t LauBlattWeisskopfFactor::calcFormFactor( const Double_t p ) const { // Calculate the requested form factor for the resonance, given the momentum value Double_t fFactor(1.0); // For scalars the form factor is always unity // TODO: and we currently don't have formulae for spin > 5 if ( (spin_ == 0) || (spin_ > 5) ) { return fFactor; } const Double_t radius = radius_->unblindValue(); const Double_t z = radius*radius*p*p; if ( barrierType_ == BWBarrier ) { if (spin_ == 1) { fFactor = TMath::Sqrt(2.0*z/(z + 1.0)); } else if (spin_ == 2) { fFactor = TMath::Sqrt(13.0*z*z/(z*z + 3.0*z + 9.0)); } else if (spin_ == 3) { fFactor = TMath::Sqrt(277.0*z*z*z/(z*z*z + 6.0*z*z + 45.0*z + 225.0)); } else if (spin_ == 4) { fFactor = TMath::Sqrt(12746.0*z*z*z*z/(z*z*z*z + 10.0*z*z*z + 135.0*z*z + 1575.0*z + 11025.0)); } else if (spin_ == 5) { fFactor = TMath::Sqrt(998881.0*z*z*z*z*z/(z*z*z*z*z + 15.0*z*z*z*z + 315.0*z*z*z + 6300.0*z*z + 99225.0*z + 893025.0)); } } else if ( barrierType_ == BWPrimeBarrier ) { if (spin_ == 1) { fFactor = TMath::Sqrt(1.0/(z + 1.0)); } else if (spin_ == 2) { fFactor = TMath::Sqrt(1.0/(z*z + 3.0*z + 9.0)); } else if (spin_ == 3) { fFactor = TMath::Sqrt(1.0/(z*z*z + 6.0*z*z + 45.0*z + 225.0)); } else if (spin_ == 4) { fFactor = TMath::Sqrt(1.0/(z*z*z*z + 10.0*z*z*z + 135.0*z*z + 1575.0*z + 11025.0)); } else if (spin_ == 5) { fFactor = TMath::Sqrt(1.0/(z*z*z*z*z + 15.0*z*z*z*z + 315.0*z*z*z + 6300.0*z*z + 99225.0*z + 893025.0)); } } else if ( barrierType_ == ExpBarrier ) { if (spin_ == 1) { fFactor = TMath::Exp( -TMath::Sqrt(z) ); } else if (spin_ == 2) { fFactor = TMath::Exp( -z ); } else if (spin_ == 3) { fFactor = TMath::Exp( -TMath::Sqrt(z*z*z) ); } else if (spin_ == 4) { fFactor = TMath::Exp( -z*z ); } else if (spin_ == 5) { fFactor = TMath::Exp( -TMath::Sqrt(z*z*z*z*z) ); } } return fFactor; } diff --git a/src/LauIsobarDynamics.cc b/src/LauIsobarDynamics.cc index 7456e03..91b88b7 100644 --- a/src/LauIsobarDynamics.cc +++ b/src/LauIsobarDynamics.cc @@ -1,2683 +1,2686 @@ /* Copyright 2005 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauIsobarDynamics.cc \brief File containing implementation of LauIsobarDynamics class. */ #include #include #include #include #include #include "TFile.h" #include "TRandom.h" #include "TSystem.h" #include "LauAbsEffModel.hh" #include "LauAbsResonance.hh" #include "LauAbsIncohRes.hh" #include "LauBelleNR.hh" #include "LauBelleSymNR.hh" #include "LauCacheData.hh" #include "LauConstants.hh" #include "LauDaughters.hh" #include "LauDPPartialIntegralInfo.hh" #include "LauFitDataTree.hh" #include "LauIsobarDynamics.hh" #include "LauKinematics.hh" #include "LauKMatrixProdPole.hh" #include "LauKMatrixProdSVP.hh" #include "LauKMatrixPropagator.hh" #include "LauKMatrixPropFactory.hh" #include "LauNRAmplitude.hh" #include "LauPrint.hh" #include "LauRandom.hh" #include "LauResonanceInfo.hh" #include "LauResonanceMaker.hh" #include "LauRhoOmegaMix.hh" ClassImp(LauIsobarDynamics) // for Kpipi: only one scfFraction 2D histogram is needed LauIsobarDynamics::LauIsobarDynamics(LauDaughters* daughters, LauAbsEffModel* effModel, LauAbsEffModel* scfFractionModel) : daughters_(daughters), kinematics_(daughters_ ? daughters_->getKinematics() : 0), effModel_(effModel), nAmp_(0), nIncohAmp_(0), DPNorm_(0.0), DPRate_("DPRate", 0.0, 0.0, 1000.0), meanDPEff_("meanDPEff", 0.0, 0.0, 1.0), currentEvent_(0), symmetricalDP_(kFALSE), fullySymmetricDP_(kFALSE), flavConjDP_(kFALSE), integralsDone_(kFALSE), normalizationSchemeDone_(kFALSE), forceSymmetriseIntegration_(kFALSE), intFileName_("integ.dat"), m13BinWidth_(0.005), m23BinWidth_(0.005), mPrimeBinWidth_(0.001), thPrimeBinWidth_(0.001), narrowWidth_(0.020), binningFactor_(100.0), m13Sq_(0.0), m23Sq_(0.0), mPrime_(0.0), thPrime_(0.0), tagCat_(-1), eff_(1.0), scfFraction_(0.0), jacobian_(0.0), ASq_(0.0), evtLike_(0.0), iterationsMax_(100000), nSigGenLoop_(0), aSqMaxSet_(1.25), aSqMaxVar_(0.0), flipHelicity_(kTRUE), recalcNormalisation_(kFALSE), calculateRhoOmegaFitFractions_(kFALSE) { if (daughters != 0) { symmetricalDP_ = daughters->gotSymmetricalDP(); fullySymmetricDP_ = daughters->gotFullySymmetricDP(); flavConjDP_ = daughters->gotFlavourConjugateDP(); typDaug_.push_back(daughters->getTypeDaug1()); typDaug_.push_back(daughters->getTypeDaug2()); typDaug_.push_back(daughters->getTypeDaug3()); } if (scfFractionModel != 0) { scfFractionModel_[0] = scfFractionModel; } sigResonances_.clear(); sigIncohResonances_.clear(); kMatrixPropagators_.clear(); kMatrixPropSet_.clear(); extraParameters_.clear(); } // for Kspipi, we need a scfFraction 2D histogram for each tagging category. They are provided by the map. // Also, we need to know the place that the tagging category of the current event occupies in the data structure inputFitTree LauIsobarDynamics::LauIsobarDynamics(LauDaughters* daughters, LauAbsEffModel* effModel, LauTagCatScfFractionModelMap scfFractionModel) : daughters_(daughters), kinematics_(daughters_ ? daughters_->getKinematics() : 0), effModel_(effModel), scfFractionModel_(scfFractionModel), nAmp_(0), nIncohAmp_(0), DPNorm_(0.0), DPRate_("DPRate", 0.0, 0.0, 1000.0), meanDPEff_("meanDPEff", 0.0, 0.0, 1.0), currentEvent_(0), symmetricalDP_(kFALSE), fullySymmetricDP_(kFALSE), flavConjDP_(kFALSE), integralsDone_(kFALSE), normalizationSchemeDone_(kFALSE), forceSymmetriseIntegration_(kFALSE), intFileName_("integ.dat"), m13BinWidth_(0.005), m23BinWidth_(0.005), mPrimeBinWidth_(0.001), thPrimeBinWidth_(0.001), narrowWidth_(0.020), binningFactor_(100.0), m13Sq_(0.0), m23Sq_(0.0), mPrime_(0.0), thPrime_(0.0), tagCat_(-1), eff_(1.0), scfFraction_(0.0), jacobian_(0.0), ASq_(0.0), evtLike_(0.0), iterationsMax_(100000), nSigGenLoop_(0), aSqMaxSet_(1.25), aSqMaxVar_(0.0), flipHelicity_(kTRUE), recalcNormalisation_(kFALSE), calculateRhoOmegaFitFractions_(kFALSE) { // Constructor for the isobar signal model if (daughters != 0) { symmetricalDP_ = daughters->gotSymmetricalDP(); fullySymmetricDP_ = daughters->gotFullySymmetricDP(); flavConjDP_ = daughters->gotFlavourConjugateDP(); typDaug_.push_back(daughters->getTypeDaug1()); typDaug_.push_back(daughters->getTypeDaug2()); typDaug_.push_back(daughters->getTypeDaug3()); } sigResonances_.clear(); sigIncohResonances_.clear(); kMatrixPropagators_.clear(); kMatrixPropSet_.clear(); extraParameters_.clear(); } LauIsobarDynamics::~LauIsobarDynamics() { extraParameters_.clear(); for ( std::vector::iterator iter = data_.begin(); iter != data_.end(); ++iter ) { delete (*iter); } data_.clear(); for (std::vector::iterator it = dpPartialIntegralInfo_.begin(); it != dpPartialIntegralInfo_.end(); ++it) { delete (*it); } dpPartialIntegralInfo_.clear(); } void LauIsobarDynamics::resetNormVectors() { for (UInt_t i = 0; i < nAmp_; i++) { fSqSum_[i] = 0.0; fSqEffSum_[i] = 0.0; fNorm_[i] = 0.0; ff_[i].zero(); for (UInt_t j = 0; j < nAmp_; j++) { fifjEffSum_[i][j].zero(); fifjSum_[i][j].zero(); } } for (UInt_t i = 0; i < nIncohAmp_; i++) { fSqSum_[i+nAmp_] = 0.0; fSqEffSum_[i+nAmp_] = 0.0; fNorm_[i+nAmp_] = 0.0; incohInten_[i] = 0.0; } } void LauIsobarDynamics::recalculateNormalisation() { if ( recalcNormalisation_ == kFALSE ) { return; } // We need to calculate the normalisation constants for the // Dalitz plot generation/fitting. integralsDone_ = kFALSE; this->resetNormVectors(); this->findIntegralsToBeRecalculated(); this->calcDPNormalisation(); integralsDone_ = kTRUE; } void LauIsobarDynamics::findIntegralsToBeRecalculated() { // Loop through the resonance parameters and see which ones have changed // For those that have changed mark the corresponding resonance(s) as needing to be re-evaluated integralsToBeCalculated_.clear(); const UInt_t nResPars = resonancePars_.size(); for ( UInt_t iPar(0); iPar < nResPars; ++iPar ) { const Double_t newValue = resonancePars_[iPar]->value(); if ( newValue != resonanceParValues_[iPar] ) { resonanceParValues_[iPar] = newValue; const std::vector& indices = resonanceParResIndex_[iPar]; std::vector::const_iterator indexIter = indices.begin(); const std::vector::const_iterator indexEnd = indices.end(); for( ; indexIter != indexEnd; ++indexIter) { integralsToBeCalculated_.insert(*indexIter); } } } } void LauIsobarDynamics::collateResonanceParameters() { // Initialise all resonance models resonancePars_.clear(); resonanceParValues_.clear(); resonanceParResIndex_.clear(); std::set uniqueResPars; UInt_t resIndex(0); for ( std::vector::iterator resIter = sigResonances_.begin(); resIter != sigResonances_.end(); ++resIter ) { (*resIter)->initialise(); // Check if this resonance has floating parameters // Append all unique parameters to our list const std::vector& resPars = (*resIter)->getFloatingParameters(); for ( std::vector::const_iterator parIter = resPars.begin(); parIter != resPars.end(); ++parIter ) { if ( uniqueResPars.insert( *parIter ).second ) { // This parameter has not already been added to // the list of unique ones. Add it, its value // and its associated resonance ID to the // appropriate lists. resonancePars_.push_back( *parIter ); resonanceParValues_.push_back( (*parIter)->value() ); std::vector resIndices( 1, resIndex ); resonanceParResIndex_.push_back( resIndices ); } else { // This parameter has already been added to the // list of unique ones. However, we still need // to indicate that this resonance should be // associated with it. std::vector::const_iterator uniqueParIter = resonancePars_.begin(); std::vector >::iterator indicesIter = resonanceParResIndex_.begin(); while( (*uniqueParIter) != (*parIter) ) { ++uniqueParIter; ++indicesIter; } ( *indicesIter ).push_back( resIndex ); } } ++resIndex; } for ( std::vector::iterator resIter = sigIncohResonances_.begin(); resIter != sigIncohResonances_.end(); ++resIter ) { (*resIter)->initialise(); // Check if this resonance has floating parameters // Append all unique parameters to our list const std::vector& resPars = (*resIter)->getFloatingParameters(); for ( std::vector::const_iterator parIter = resPars.begin(); parIter != resPars.end(); ++parIter ) { if ( uniqueResPars.insert( *parIter ).second ) { // This parameter has not already been added to // the list of unique ones. Add it, its value // and its associated resonance ID to the // appropriate lists. resonancePars_.push_back( *parIter ); resonanceParValues_.push_back( (*parIter)->value() ); std::vector resIndices( 1, resIndex ); resonanceParResIndex_.push_back( resIndices ); } else { // This parameter has already been added to the // list of unique ones. However, we still need // to indicate that this resonance should be // associated with it. std::vector::const_iterator uniqueParIter = resonancePars_.begin(); std::vector >::iterator indicesIter = resonanceParResIndex_.begin(); while( (*uniqueParIter) != (*parIter) ) { ++uniqueParIter; ++indicesIter; } ( *indicesIter ).push_back( resIndex ); } } ++resIndex; } } void LauIsobarDynamics::initialise(const std::vector& coeffs) { // Check whether we have a valid set of integration constants for // the normalisation of the signal likelihood function. this->initialiseVectors(); // Mark the DP integrals as undetermined integralsDone_ = kFALSE; this->collateResonanceParameters(); if ( resonancePars_.empty() ) { recalcNormalisation_ = kFALSE; } else { recalcNormalisation_ = kTRUE; } // Print summary of what we have so far to screen this->initSummary(); if ( nAmp_+nIncohAmp_ == 0 ) { std::cout << "INFO in LauIsobarDynamics::initialise : No contributions to DP model, not performing normalisation integrals." << std::endl; } else { // We need to calculate the normalisation constants for the Dalitz plot generation/fitting. std::cout<<"INFO in LauIsobarDynamics::initialise : Starting special run to generate the integrals for normalising the PDF..."<calcDPNormalisation(); // Write the integrals to a file (mainly for debugging purposes) this->writeIntegralsFile(); } integralsDone_ = kTRUE; std::cout << std::setprecision(10); std::cout<<"INFO in LauIsobarDynamics::initialise : Summary of the integrals:"<getResonanceModel(); getChar << resModelInt << " "; } getChar << std::endl; // Write out the track pairings for each resonance. This is specified // by the resPairAmpInt integer in the addResonance function. for (i = 0; i < nAmp_; i++) { getChar << resPairAmp_[i] << " "; } getChar << std::endl; // Write out the fSqSum = |ff|^2, where ff = resAmp() for (i = 0; i < nAmp_; i++) { getChar << fSqSum_[i] << " "; } getChar << std::endl; // Similar to fSqSum, but with the efficiency term included. for (i = 0; i < nAmp_; i++) { getChar << fSqEffSum_[i] << " "; } getChar << std::endl; // Write out the f_i*f_j_conj*eff values = resAmp_i*resAmp_j_conj*eff. // Note that only the top half of the i*j "matrix" is required, as it // is symmetric w.r.t i, j. for (i = 0; i < nAmp_; i++) { for (j = i; j < nAmp_; j++) { getChar << fifjEffSum_[i][j] << " "; } } getChar << std::endl; // Similar to fifjEffSum, but without the efficiency term included. for (i = 0; i < nAmp_; i++) { for (j = i; j < nAmp_; j++) { getChar << fifjSum_[i][j] << " "; } } getChar << std::endl; // Write out number of incoherent resonances in the Dalitz plot model getChar << nIncohAmp_ << std::endl; // Write out the incoherent resonances for (i = 0; i < nIncohAmp_; i++) { getChar << incohResTypAmp_[i] << " "; } getChar << std::endl; // Write out the incoherent resonance model types (BW, RelBW etc...) for (i = 0; i < nIncohAmp_; i++) { LauAbsResonance* theResonance = sigIncohResonances_[i]; Int_t resModelInt = theResonance->getResonanceModel(); getChar << resModelInt << " "; } getChar << std::endl; // Write out the track pairings for each incoherent resonance. This is specified // by the resPairAmpInt integer in the addIncohResonance function. for (i = 0; i < nIncohAmp_; i++) { getChar << incohResPairAmp_[i] << " "; } getChar << std::endl; // Write out the fSqSum = |ff|^2, where |ff|^2 = incohResAmp() for (i = nAmp_; i < nAmp_+nIncohAmp_; i++) { getChar << fSqSum_[i] << " "; } getChar << std::endl; // Similar to fSqSum, but with the efficiency term included. for (i = nAmp_; i < nAmp_+nIncohAmp_; i++) { getChar << fSqEffSum_[i] << " "; } getChar << std::endl; } LauAbsResonance* LauIsobarDynamics::addResonance(const TString& resName, const Int_t resPairAmpInt, const LauAbsResonance::LauResonanceModel resType, const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory) { // Function to add a resonance in a Dalitz plot. // No check is made w.r.t flavour and charge conservation rules, and so // the user is responsible for checking the internal consistency of // their function statements with these laws. For example, the program // will not prevent the user from asking for a rho resonance in a K-pi // pair or a K* resonance in a pi-pi pair. // However, to assist the user, a summary of the resonant structure requested // by the user is printed before the program runs. It is important to check this // information when you first define your Dalitz plot model before doing // any fitting/generating. // Arguments are: resonance name, integer to specify the resonance track pairing // (1 => m_23, 2 => m_13, 3 => m_12), i.e. the bachelor track number. // The third argument resType specifies whether the resonance is a Breit-Wigner (BW) // Relativistic Breit-Wigner (RelBW) or Flatte distribution (Flatte), for example. if( LauAbsResonance::isIncoherentModel(resType) == true ) { std::cerr<<"ERROR in LauIsobarDynamics::addResonance : Resonance type \""<getCharge(resPairAmpInt) == 0 && daughters_->getChargeParent() == 0 && daughters_->getTypeParent() > 0 ) { if ( ( resPairAmpInt == 1 && TMath::Abs(daughters_->getTypeDaug2()) == TMath::Abs(daughters_->getTypeDaug3()) ) || ( resPairAmpInt == 2 && TMath::Abs(daughters_->getTypeDaug1()) == TMath::Abs(daughters_->getTypeDaug3()) ) || ( resPairAmpInt == 3 && TMath::Abs(daughters_->getTypeDaug1()) == TMath::Abs(daughters_->getTypeDaug2()) ) ) { theResonance->flipHelicity(kTRUE); } } // Set the resonance name and what track is the bachelor TString resonanceName = theResonance->getResonanceName(); resTypAmp_.push_back(resonanceName); // Always force the non-resonant amplitude pair to have resPairAmp = 0 // in case the user chooses the wrong number. if ( resType == LauAbsResonance::FlatNR || resType == LauAbsResonance::NRModel ) { std::cout<<"INFO in LauIsobarDynamics::addResonance : Setting resPairAmp to 0 for "<( resonanceMaker.getResonance(daughters_, resName, resPairAmpInt, resType) ); if (theResonance == 0) { std::cerr<<"ERROR in LauIsobarDynamics::addIncohResonance : Couldn't create the resonance \""<getResonanceName(); incohResTypAmp_.push_back(resonanceName); incohResPairAmp_.push_back(resPairAmpInt); // Increment the number of resonance amplitudes we have so far ++nIncohAmp_; // Finally, add the resonance object to the internal array sigIncohResonances_.push_back(theResonance); std::cout<<"INFO in LauIsobarDynamics::addIncohResonance : Successfully added incoherent resonance. Total number of incoherent resonances so far = "< nChannels) { std::cerr << "ERROR in LauIsobarDynamics::defineKMatrixPropagator. The rowIndex, which is set to " << rowIndex << ", must be between 1 and the number of channels " << nChannels << std::endl; gSystem->Exit(EXIT_FAILURE); } TString propagatorName(propName), parameterFile(paramFileName); LauKMatrixPropagator* thePropagator = LauKMatrixPropFactory::getInstance()->getPropagator(propagatorName, parameterFile, resPairAmpInt, nChannels, nPoles, rowIndex); kMatrixPropagators_[propagatorName] = thePropagator; + return thePropagator; } void LauIsobarDynamics::addKMatrixProdPole(const TString& poleName, const TString& propName, Int_t poleIndex, Bool_t useProdAdler) { // Add a K-matrix production pole term, using the K-matrix propagator given by the propName. // Here, poleIndex is the integer specifying the pole number. // First, find the K-matrix propagator. KMPropMap::iterator mapIter = kMatrixPropagators_.find(propName); if (mapIter != kMatrixPropagators_.end()) { LauKMatrixPropagator* thePropagator = mapIter->second; // Make sure the pole index is valid Int_t nPoles = thePropagator->getNPoles(); if (poleIndex < 1 || poleIndex > nPoles) { std::cerr<<"ERROR in LauIsobarDynamics::addKMatrixProdPole : The pole index "<getResPairAmpInt(); LauAbsResonance* prodPole = new LauKMatrixProdPole(poleName, poleIndex, resPairAmpInt, thePropagator, daughters_, useProdAdler); + prodPole->setSpinType( LauAbsResonance::Legendre ); resTypAmp_.push_back(poleName); resPairAmp_.push_back(resPairAmpInt); ++nAmp_; sigResonances_.push_back(prodPole); // Also store the propName-poleName pair for calculating total fit fractions later on // (avoiding the need to use dynamic casts to check which resonances are of the K-matrix type) kMatrixPropSet_[poleName] = propName; std::cout<<"INFO in LauIsobarDynamics::addKMatrixProdPole : Successfully added K-matrix production pole term. Total number of resonances so far = "<second; // Make sure the channel index is valid Int_t nChannels = thePropagator->getNChannels(); if (channelIndex < 1 || channelIndex > nChannels) { std::cerr<<"ERROR in LauIsobarDynamics::addKMatrixProdSVP : The channel index "<getResPairAmpInt(); LauAbsResonance* prodSVP = new LauKMatrixProdSVP(SVPName, channelIndex, resPairAmpInt, thePropagator, daughters_, useProdAdler); + prodSVP->setSpinType( LauAbsResonance::Legendre ); resTypAmp_.push_back(SVPName); resPairAmp_.push_back(resPairAmpInt); ++nAmp_; sigResonances_.push_back(prodSVP); // Also store the SVPName-propName pair for calculating total fit fractions later on // (avoiding the need to use dynamic casts to check which resonances are of the K-matrix type) kMatrixPropSet_[SVPName] = propName; std::cout<<"INFO in LauIsobarDynamics::addKMatrixProdSVP : Successfully added K-matrix production slowly-varying (SVP) term. Total number of resonances so far = "<::const_iterator iter=sigResonances_.begin(); iter!=sigResonances_.end(); ++iter) { theResonance = (*iter); if (theResonance != 0) { const TString& resString = theResonance->getResonanceName(); if (resString == resName) { return index; } } ++index; } for (std::vector::const_iterator iter=sigIncohResonances_.begin(); iter!=sigIncohResonances_.end(); ++iter) { theResonance = (*iter); if (theResonance != 0) { const TString& resString = theResonance->getResonanceName(); if (resString == resName) { return index; } } ++index; } return -1; } Bool_t LauIsobarDynamics::hasResonance(const TString& resName) const { const Int_t index = this->resonanceIndex(resName); if (index < 0) { return kFALSE; } else { return kTRUE; } } const LauAbsResonance* LauIsobarDynamics::getResonance(const UInt_t resIndex) const { if ( resIndex < this->getnCohAmp() ) { return sigResonances_[resIndex]; } else if ( resIndex < this->getnTotAmp() ) { return sigIncohResonances_[ resIndex - nAmp_ ]; } else { std::cerr<<"ERROR in LauIsobarDynamics::getResonance : Couldn't find resonance with index \""<getnCohAmp() ) { return sigResonances_[resIndex]; } else if ( resIndex < this->getnTotAmp() ) { return sigIncohResonances_[ resIndex - nAmp_ ]; } else { std::cerr<<"ERROR in LauIsobarDynamics::getResonance : Couldn't find resonance with index \""<resonanceIndex( resName ); if ( index < 0 ) { std::cerr<<"ERROR in LauIsobarDynamics::findResonance : Couldn't find resonance with name \""<getResonance( index ); } } const LauAbsResonance* LauIsobarDynamics::findResonance(const TString& resName) const { const Int_t index = this->resonanceIndex( resName ); if ( index < 0 ) { std::cerr<<"ERROR in LauIsobarDynamics::findResonance : Couldn't find resonance with name \""<getResonance( index ); } } void LauIsobarDynamics::removeCharge(TString& string) const { Ssiz_t index = string.Index("+"); if (index != -1) { string.Remove(index,1); } index = string.Index("-"); if (index != -1) { string.Remove(index,1); } } void LauIsobarDynamics::calcDPNormalisation() { if (!normalizationSchemeDone_) { this->calcDPNormalisationScheme(); } for (std::vector::iterator it = dpPartialIntegralInfo_.begin(); it != dpPartialIntegralInfo_.end(); ++it) { this->calcDPPartialIntegral( *it ); } for (UInt_t i = 0; i < nAmp_+nIncohAmp_; ++i) { fNorm_[i] = 0.0; if (fSqSum_[i] > 0.0) {fNorm_[i] = TMath::Sqrt(1.0/(fSqSum_[i]));} } } std::vector< std::pair > LauIsobarDynamics::formGapsFromRegions( const std::vector< std::pair >& regions, const Double_t min, const Double_t max ) const { std::vector< std::pair > gaps(regions.size() + 1, std::make_pair(0., 0.)); // Given some narrow resonance regions, find the regions that correspond to the gaps between them gaps[0].first = min; for (UInt_t i = 0; i < regions.size(); ++i) { gaps[i].second = regions[i].first; gaps[i + 1].first = regions[i].second; } gaps[gaps.size() - 1].second = max; return gaps; } void LauIsobarDynamics::cullNullRegions( std::vector& regions ) const { LauDPPartialIntegralInfo* tmp(0); regions.erase( std::remove(regions.begin(), regions.end(), tmp), regions.end() ); } void LauIsobarDynamics::correctDPOverlap( std::vector< std::pair >& regions, const std::vector& binnings ) const { if (regions.empty()) { return; } // If the regions overlap, ensure that the one with the finest binning takes precedence (i.e., extends its full width) for (UInt_t i = 0; i < regions.size() - 1; ++i) { if ( regions[i + 1].first <= regions[i].second ) { if ((binnings[i] < binnings[i + 1])) { regions[i + 1] = std::make_pair(regions[i].second, regions[i + 1].second); } else { regions[i] = std::make_pair(regions[i].first, regions[i + 1].first); } } } } std::vector LauIsobarDynamics::m13IntegrationRegions( const std::vector< std::pair >& m13Regions, const std::vector< std::pair >& m23Regions, const std::vector& m13Binnings, const Double_t precision, const Double_t defaultBinning ) const { // Create integration regions for all narrow resonances in m13 except for the overlaps with narrow resonances in m23 std::vector integrationRegions; const Double_t m23Min = kinematics_->getm23Min(); const Double_t m23Max = kinematics_->getm23Max(); // Loop over narrow resonances in m13 for (UInt_t m13i = 0; m13i < m13Regions.size(); ++m13i) { const Double_t m13Binning = m13Binnings[m13i]; const Double_t resMin13 = m13Regions[m13i].first; const Double_t resMax13 = m13Regions[m13i].second; // Initialise to the full height of the DP in case there are no narrow resonances in m23 Double_t lastResMax23 = m23Min; // Loop over narrow resonances in m23 for (UInt_t m23i = 0; m23i < m23Regions.size(); m23i++) { const Double_t resMin23 = m23Regions[m23i].first; const Double_t resMax23 = m23Regions[m23i].second; // For the first entry, add the area between m23 threshold and this first entry if (m23i == 0) { integrationRegions.push_back(this->newDPIntegrationRegion(resMin13, resMax13, m23Min, resMin23, m13Binning, defaultBinning, precision, nAmp_, nIncohAmp_)); } // For all entries except the last one, add the area between this and the next entry if (m23i != (m23Regions.size() - 1)) { const Double_t nextResMin23 = m23Regions[m23i + 1].first; integrationRegions.push_back(this->newDPIntegrationRegion(resMin13, resMax13, resMax23, nextResMin23, m13Binning, defaultBinning, precision, nAmp_, nIncohAmp_)); } else { lastResMax23 = resMax23; } } // Add the area between the last entry and the maximum m23 (which could be the whole strip if there are no entries in m23Regions) integrationRegions.push_back(this->newDPIntegrationRegion(resMin13, resMax13, lastResMax23, m23Max, m13Binning, defaultBinning, precision, nAmp_, nIncohAmp_)); } return integrationRegions; } std::vector LauIsobarDynamics::m23IntegrationRegions( const std::vector >& m13Regions, const std::vector >& m23Regions, const std::vector& m13Binnings, const std::vector& m23Binnings, const Double_t precision, const Double_t defaultBinning ) const { // Create integration regions for all narrow resonances in m23 (including the overlap regions with m13 narrow resonances) std::vector integrationRegions; const Double_t m13Min = kinematics_->getm13Min(); const Double_t m13Max = kinematics_->getm13Max(); // Loop over narrow resonances in m23 for (UInt_t m23i = 0; m23i < m23Regions.size(); m23i++) { const Double_t m23Binning = m23Binnings[m23i]; const Double_t resMin23 = m23Regions[m23i].first; const Double_t resMax23 = m23Regions[m23i].second; // Initialise to the full width of the DP in case there are no narrow resonances in m13 Double_t lastResMax13 = m13Min; // Loop over narrow resonances in m13 for (UInt_t m13i = 0; m13i < m13Regions.size(); m13i++){ const Double_t m13Binning = m13Binnings[m23i]; const Double_t resMin13 = m13Regions[m13i].first; const Double_t resMax13 = m13Regions[m13i].second; // Overlap region (only needed in m23) integrationRegions.push_back(this->newDPIntegrationRegion(resMin13, resMax13, resMin23, resMax23, m13Binning, m23Binning, precision, nAmp_, nIncohAmp_)); // For the first entry, add the area between m13 threshold and this first entry if (m13i == 0) { integrationRegions.push_back(this->newDPIntegrationRegion(m13Min, resMin13, resMin23, resMax23, defaultBinning, m23Binning, precision, nAmp_, nIncohAmp_)); } // For all entries except the last one, add the area between this and the next entry if (m13i != m13Regions.size() - 1) { const Double_t nextResMin13 = m23Regions[m13i + 1].first; integrationRegions.push_back(this->newDPIntegrationRegion(resMax13, nextResMin13, resMin23, resMax23, defaultBinning, m23Binning, precision, nAmp_, nIncohAmp_)); } else { lastResMax13 = resMax13; } } // Add the area between the last entry and the maximum m13 (which could be the whole strip if there are no entries in m13Regions) integrationRegions.push_back(this->newDPIntegrationRegion(lastResMax13, m13Max, resMin23, resMax23, defaultBinning, m23Binning, precision, nAmp_, nIncohAmp_)); } return integrationRegions; } LauDPPartialIntegralInfo* LauIsobarDynamics::newDPIntegrationRegion( const Double_t minm13, const Double_t maxm13, const Double_t minm23, const Double_t maxm23, const Double_t m13BinWidth, const Double_t m23BinWidth, const Double_t precision, const UInt_t nAmp, const UInt_t nIncohAmp ) const { const UInt_t nm13Points = static_cast((maxm13-minm13)/m13BinWidth); const UInt_t nm23Points = static_cast((maxm23-minm23)/m23BinWidth); // If we would create a region with no interior points, just return a null pointer if (nm13Points == 0 || nm23Points == 0) { return 0; } return new LauDPPartialIntegralInfo(minm13, maxm13, minm23, maxm23, m13BinWidth, m23BinWidth, precision, nAmp, nIncohAmp); } void LauIsobarDynamics::calcDPNormalisationScheme() { if ( ! dpPartialIntegralInfo_.empty() ) { std::cerr << "ERROR in LauIsobarDynamics::calcDPNormalisationScheme : Scheme already stored!" << std::endl; return; } // The precision for the Gauss-Legendre weights const Double_t precision(1e-6); // Get the rectangle that encloses the DP const Double_t minm13 = kinematics_->getm13Min(); const Double_t maxm13 = kinematics_->getm13Max(); const Double_t minm23 = kinematics_->getm23Min(); const Double_t maxm23 = kinematics_->getm23Max(); const Double_t minm12 = kinematics_->getm12Min(); const Double_t maxm12 = kinematics_->getm12Max(); // Find out whether we have narrow resonances in the DP (defined here as width < 20 MeV). std::vector< std::pair > m13NarrowRes; std::vector< std::pair > m23NarrowRes; std::vector< std::pair > m12NarrowRes; // Rho-omega mixing models implicitly contains omega(782) model, but width is of rho(770) - handle as a special case LauResonanceMaker& resonanceMaker = LauResonanceMaker::get(); LauResonanceInfo* omega_info = resonanceMaker.getResInfo("omega(782)"); const Double_t omegaMass = (omega_info!=0) ? omega_info->getMass()->unblindValue() : 0.78265; const Double_t omegaWidth = (omega_info!=0) ? omega_info->getWidth()->unblindValue() : 0.00849; for ( std::vector::const_iterator iter = sigResonances_.begin(); iter != sigResonances_.end(); ++iter ) { LauAbsResonance::LauResonanceModel model = (*iter)->getResonanceModel(); const TString& name = (*iter)->getResonanceName(); Int_t pair = (*iter)->getPairInt(); Double_t mass = (*iter)->getMass(); Double_t width = (*iter)->getWidth(); if ( model == LauAbsResonance::RhoOmegaMix_GS || model == LauAbsResonance::RhoOmegaMix_GS_1 || model == LauAbsResonance::RhoOmegaMix_RBW || model == LauAbsResonance::RhoOmegaMix_RBW_1 ) { mass = omegaMass; width = omegaWidth; } - if ( width > narrowWidth_ || width == 0.0 ) { + if ( width > narrowWidth_ || width <= 0.0 ) { continue; } std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : Found narrow resonance: " << name << ", mass = " << mass << ", width = " << width << ", pair int = " << pair << std::endl; if ( pair == 1 ) { if ( mass < minm23 || mass > maxm23 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m23NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } else if ( symmetricalDP_ || ( flavConjDP_ && forceSymmetriseIntegration_ ) ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); } } } else if ( pair == 2 ) { if ( mass < minm13 || mass > maxm13 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m13NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m23NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } else if ( symmetricalDP_ || ( flavConjDP_ && forceSymmetriseIntegration_ ) ) { m23NarrowRes.push_back( std::make_pair(mass,width) ); } } } else if ( pair == 3 ) { if ( mass < minm12 || mass > maxm12 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m12NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } } } else { std::cerr << "WARNING in LauIsobarDynamics::calcDPNormalisationScheme : strange pair integer, " << pair << ", for resonance \"" << (*iter)->getResonanceName() << std::endl; } } for ( std::vector::const_iterator iter = sigIncohResonances_.begin(); iter != sigIncohResonances_.end(); ++iter ) { const TString& name = (*iter)->getResonanceName(); Int_t pair = (*iter)->getPairInt(); Double_t mass = (*iter)->getMass(); Double_t width = (*iter)->getWidth(); if ( width > narrowWidth_ || width == 0.0 ) { continue; } std::cout<<"INFO in LauIsobarDynamics::calcDPNormalisationScheme : Found narrow resonance: " << name << ", mass = " << mass << ", width = " << width << ", pair int = " << pair << std::endl; if ( pair == 1 ) { if ( mass < minm23 || mass > maxm23 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m23NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } else if ( symmetricalDP_ || ( flavConjDP_ && forceSymmetriseIntegration_ ) ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); } } } else if ( pair == 2 ) { if ( mass < minm13 || mass > maxm13 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m13NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m23NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } else if ( symmetricalDP_ || ( flavConjDP_ && forceSymmetriseIntegration_ ) ) { m23NarrowRes.push_back( std::make_pair(mass,width) ); } } } else if ( pair == 3 ) { if ( mass < minm12 || mass > maxm12 ){ std::cout << std::string(53, ' ') << ": But its pole is outside the kinematically allowed range, so will not consider it narrow for the purposes of integration" << std::endl; } else { m12NarrowRes.push_back( std::make_pair(mass,width) ); if ( fullySymmetricDP_ ) { m13NarrowRes.push_back( std::make_pair(mass,width) ); m12NarrowRes.push_back( std::make_pair(mass,width) ); } } } else { std::cerr << "WARNING in LauIsobarDynamics::calcDPNormalisationScheme : strange pair integer, " << pair << ", for resonance \"" << (*iter)->getResonanceName() << std::endl; } } // Depending on how many narrow resonances we have and where they are // we adopt different approaches if ( ! m12NarrowRes.empty() ) { // We have at least one narrow resonance in m12 // Switch to using the square DP for the integration // TODO - for the time being just use a single, reasonably fine by default and tunable, grid // - can later consider whether there's a need to split up the mPrime axis into regions around particularly narrow resonances in m12 // - but it seems that this isn't really needed since even the default tune gives a good resolution for most narrow resonances such as phi / chi_c0 std::cout<<"INFO in LauIsobarDynamics::calcDPNormalisationScheme : One or more narrow resonances found in m12, integrating over whole square Dalitz plot with bin widths of "<squareDP() ) { std::cerr << "WARNING in LauIsobarDynamics::calcDPNormalisationScheme : forcing kinematics to calculate the required square DP co-ordinates" << std::endl; kinematics_->squareDP(kTRUE); } dpPartialIntegralInfo_.push_back(new LauDPPartialIntegralInfo(0.0, 1.0, 0.0, 1.0, mPrimeBinWidth_, thPrimeBinWidth_, precision, nAmp_, nIncohAmp_, kTRUE, kinematics_)); } else if (m13NarrowRes.empty() && m23NarrowRes.empty()) { // There are no narrow resonances, so we just do a single grid over the whole DP std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : No narrow resonances found, integrating over whole Dalitz plot..." << std::endl; dpPartialIntegralInfo_.push_back(new LauDPPartialIntegralInfo(minm13, maxm13, minm23, maxm23, m13BinWidth_, m23BinWidth_, precision, nAmp_, nIncohAmp_)); } else { // Get regions in that correspond to narrow resonances in m13 and m23, and correct for overlaps in each dimension (to use the finest binning) // Sort resonances by ascending mass to calculate regions properly std::sort(m13NarrowRes.begin(), m13NarrowRes.end()); std::sort(m23NarrowRes.begin(), m23NarrowRes.end()); // For each narrow resonance in m13, determine the corresponding window and its binning std::vector > m13Regions; std::vector m13Binnings; for ( std::vector >::const_iterator iter = m13NarrowRes.begin(); iter != m13NarrowRes.end(); ++iter ) { Double_t mass = iter->first; Double_t width = iter->second; Double_t regionBegin = mass - 5.0 * width; Double_t regionEnd = mass + 5.0 * width; Double_t binning = width / binningFactor_; // check if we ought to extend the region to the edge of the phase space (in either direction) if ( regionBegin < (minm13+50.0*m13BinWidth_) ) { std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : Resonance at m13 = " << mass << " is close to threshold, extending integration region" << std::endl; regionBegin = minm13; } if ( regionEnd > (maxm13-50.0*m13BinWidth_) ) { std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : Resonance at m13 = " << mass << " is close to upper edge of phase space, extending integration region" << std::endl; regionEnd = maxm13; } m13Regions.push_back(std::make_pair(regionBegin, regionEnd)); m13Binnings.push_back(binning); } // For each narrow resonance in m23, determine the corresponding window and its binning std::vector > m23Regions; std::vector m23Binnings; for ( std::vector >::const_iterator iter = m23NarrowRes.begin(); iter != m23NarrowRes.end(); ++iter ) { Double_t mass = iter->first; Double_t width = iter->second; Double_t regionBegin = mass - 5.0 * width; Double_t regionEnd = mass + 5.0 * width; Double_t binning = width / binningFactor_; // check if we ought to extend the region to the edge of the phase space (in either direction) if ( regionBegin < (minm23+50.0*m23BinWidth_) ) { std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : Resonance at m23 = " << mass << " is close to threshold, extending integration region" << std::endl; regionBegin = minm23; } if ( regionEnd > (maxm23-50.0*m23BinWidth_) ) { std::cout << "INFO in LauIsobarDynamics::calcDPNormalisationScheme : Resonance at m23 = " << mass << " is close to upper edge of phase space, extending integration region" << std::endl; regionEnd = maxm23; } m23Regions.push_back(std::make_pair(regionBegin, regionEnd)); m23Binnings.push_back(binning); } // Sort out overlaps between regions in the same mass pairing this->correctDPOverlap(m13Regions, m13Binnings); this->correctDPOverlap(m23Regions, m23Binnings); // Get the narrow resonance regions plus any overlap region std::vector fineScheme13 = this->m13IntegrationRegions(m13Regions, m23Regions, m13Binnings, precision, m13BinWidth_); std::vector fineScheme23 = this->m23IntegrationRegions(m13Regions, m23Regions, m13Binnings, m23Binnings, precision, m23BinWidth_); // Get coarse regions by calculating the gaps between the // narrow resonances and using the same functions to create // the integration grid object for each std::vector< std::pair > coarseRegions = this->formGapsFromRegions(m13Regions, minm13, maxm13); std::vector coarseBinning( fineScheme13.size()+1, m13BinWidth_ ); std::vector coarseScheme = this->m13IntegrationRegions(coarseRegions, m23Regions, coarseBinning, precision, m13BinWidth_); dpPartialIntegralInfo_.insert(dpPartialIntegralInfo_.end(), fineScheme13.begin(), fineScheme13.end()); dpPartialIntegralInfo_.insert(dpPartialIntegralInfo_.end(), fineScheme23.begin(), fineScheme23.end()); dpPartialIntegralInfo_.insert(dpPartialIntegralInfo_.end(), coarseScheme.begin(), coarseScheme.end()); // Remove any null pointer entries in the integral list // (that are produced when an integration region with no // interior points is defined) this->cullNullRegions(dpPartialIntegralInfo_); } normalizationSchemeDone_ = kTRUE; } void LauIsobarDynamics::setIntegralBinWidths(const Double_t m13BinWidth, const Double_t m23BinWidth, const Double_t mPrimeBinWidth, const Double_t thPrimeBinWidth) { // Set the bin widths for the m13 vs m23 integration grid m13BinWidth_ = m13BinWidth; m23BinWidth_ = m23BinWidth; // Set the bin widths for the m' vs theta' integration grid mPrimeBinWidth_ = mPrimeBinWidth; thPrimeBinWidth_ = thPrimeBinWidth; } void LauIsobarDynamics::calcDPPartialIntegral(LauDPPartialIntegralInfo* intInfo) { // Calculate the integrals for all parts of the amplitude in the given region of the DP const Bool_t squareDP = intInfo->getSquareDP(); const UInt_t nm13Points = intInfo->getnm13Points(); const UInt_t nm23Points = intInfo->getnm23Points(); //Double_t dpArea(0.0); for (UInt_t i = 0; i < nm13Points; ++i) { const Double_t m13 = intInfo->getM13Value(i); const Double_t m13Sq = m13*m13; for (UInt_t j = 0; j < nm23Points; ++j) { const Double_t m23 = intInfo->getM23Value(j); const Double_t m23Sq = m23*m23; const Double_t weight = intInfo->getWeight(i,j); // Calculate the integral contributions for each resonance. // Only points within the DP area contribute. // This also calculates the total DP area as a check. // NB if squareDP is true, m13 and m23 are actually mPrime and thetaPrime Bool_t withinDP = squareDP ? kinematics_->withinSqDPLimits(m13, m23) : kinematics_->withinDPLimits(m13Sq, m23Sq); if (withinDP == kTRUE) { if ( squareDP ) { // NB m13 and m23 are actually mPrime and thetaPrime kinematics_->updateSqDPKinematics(m13, m23); } else { kinematics_->updateKinematics(m13Sq, m23Sq); } this->calculateAmplitudes(intInfo, i, j); this->addGridPointToIntegrals(weight); // Increment total DP area //dpArea += weight; } } // j weights loop } // i weights loop // Print out DP area to check whether we have a sensible output //std::cout<<" : dpArea = "<::const_iterator intEnd = integralsToBeCalculated_.end(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( integralsToBeCalculated_.find(iAmp) != intEnd ) { // Calculate the dynamics for this resonance ff_[iAmp] = this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } else { // Retrieve the cached value of the amplitude ff_[iAmp] = intInfo->getAmplitude( m13Point, m23Point, iAmp ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd ) { // Calculate the dynamics for this resonance incohInten_[iAmp] = this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } else { // Retrieve the cached value of the amplitude incohInten_[iAmp] = intInfo->getIntensity( m13Point, m23Point, iAmp ); } } // If symmetric, do as above with flipped kinematics and add to amplitude // (No need to retrive the cache if this was done in the first case) if ( symmetricalDP_ == kTRUE ) { kinematics_->flipAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } kinematics_->flipAndUpdateKinematics(); } if (fullySymmetricDP_ == kTRUE) { // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } // rotate, flip and evaluate kinematics_->rotateAndUpdateKinematics(); kinematics_->flipAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for (UInt_t iAmp = 0; iAmp < nAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance ff_[iAmp] += this->resAmp(iAmp); // Store the new value in the integration info object intInfo->storeAmplitude( m13Point, m23Point, iAmp, ff_[iAmp] ); } } for (UInt_t iAmp = 0; iAmp < nIncohAmp_; ++iAmp) { if ( (integralsToBeCalculated_.find(iAmp+nAmp_) != intEnd) && !sigResonances_[iAmp]->preSymmetrised() ) { // Calculate the dynamics for this resonance incohInten_[iAmp] += this->incohResAmp(iAmp); // Store the new value in the integration info object intInfo->storeIntensity( m13Point, m23Point, iAmp, incohInten_[iAmp] ); } } // rotate and flip to get us back to where we started kinematics_->rotateAndUpdateKinematics(); kinematics_->flipAndUpdateKinematics(); } // If we haven't cached the data, then we need to find out the efficiency. eff_ = this->retrieveEfficiency(); intInfo->storeEfficiency( m13Point, m23Point, eff_ ); } void LauIsobarDynamics::calculateAmplitudes() { std::set::const_iterator iter = integralsToBeCalculated_.begin(); const std::set::const_iterator intEnd = integralsToBeCalculated_.end(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { // Calculate the dynamics for this resonance if(*iter < nAmp_) { ff_[*iter] = this->resAmp(*iter); } else { incohInten_[*iter-nAmp_] = this->incohResAmp(*iter-nAmp_); } } if ( symmetricalDP_ == kTRUE ) { kinematics_->flipAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { // Calculate the dynamics for this resonance if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } kinematics_->flipAndUpdateKinematics(); } if ( fullySymmetricDP_ == kTRUE ) { // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } // rotate, flip and evaluate kinematics_->rotateAndUpdateKinematics(); kinematics_->flipAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } // rotate and evaluate kinematics_->rotateAndUpdateKinematics(); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { if(*iter < nAmp_ && !sigResonances_[*iter]->preSymmetrised() ) { ff_[*iter] += this->resAmp(*iter); } else if (*iter >= nAmp_ && !sigResonances_[*iter-nAmp_]->preSymmetrised() ){ incohInten_[*iter-nAmp_] += this->incohResAmp(*iter-nAmp_); } } // rotate and flip to get us back to where we started kinematics_->rotateAndUpdateKinematics(); kinematics_->flipAndUpdateKinematics(); } // If we haven't cached the data, then we need to find out the efficiency. eff_ = this->retrieveEfficiency(); } void LauIsobarDynamics::calcTotalAmp(const Bool_t useEff) { // Reset the total amplitude to zero totAmp_.zero(); // Loop over all signal amplitudes LauComplex ATerm; for (UInt_t i = 0; i < nAmp_; ++i) { // Get the partial complex amplitude - (mag, phase)*(resonance dynamics) ATerm = Amp_[i]*ff_[i]; // Scale this contribution by its relative normalisation w.r.t. the whole dynamics ATerm.rescale(fNorm_[i]); // Add this partial amplitude to the sum totAmp_ += ATerm; } // Loop over amplitudes // |Sum of partial amplitudes|^2 ASq_ = totAmp_.abs2(); for (UInt_t i = 0; i < nIncohAmp_; ++i) { // Get the partial complex amplitude - (mag, phase) ATerm = Amp_[i+nAmp_]; // Scale this contribution by its relative normalisation w.r.t. the whole dynamics ATerm.rescale(fNorm_[i+nAmp_]); // Add this partial amplitude to the sum ASq_ += ATerm.abs2()*incohInten_[i]; } // Apply the efficiency correction for this event. // Multiply the amplitude squared sum by the DP efficiency if ( useEff ) { ASq_ *= eff_; } } void LauIsobarDynamics::addGridPointToIntegrals(const Double_t weight) { // Combine the Gauss-Legendre weight with the efficiency const Double_t effWeight = eff_*weight; LauComplex fifjEffSumTerm; LauComplex fifjSumTerm; // Calculates the half-matrix of amplitude-squared and interference // terms (dynamical part only) // Add the values at this point on the integration grid to the sums // (one weighted only by the integration weights, one also weighted by // the efficiency) for (UInt_t i = 0; i < nAmp_; ++i) { // Add the dynamical amplitude squared for this resonance. Double_t fSqVal = ff_[i].abs2(); fSqSum_[i] += fSqVal*weight; fSqEffSum_[i] += fSqVal*effWeight; for (UInt_t j = i; j < nAmp_; ++j) { fifjEffSumTerm = fifjSumTerm = ff_[i]*ff_[j].conj(); fifjEffSumTerm.rescale(effWeight); fifjEffSum_[i][j] += fifjEffSumTerm; fifjSumTerm.rescale(weight); fifjSum_[i][j] += fifjSumTerm; } } for (UInt_t i = 0; i < nIncohAmp_; ++i) { // Add the dynamical amplitude squared for this resonance. Double_t fSqVal = incohInten_[i]; fSqSum_[i+nAmp_] += fSqVal*weight; fSqEffSum_[i+nAmp_] += fSqVal*effWeight; } } LauComplex LauIsobarDynamics::resAmp(const UInt_t index) { // Routine to calculate the resonance dynamics (amplitude) // using the appropriate Breit-Wigner/Form Factors. LauComplex amp = LauComplex(0.0, 0.0); if ( index >= nAmp_ ) { std::cerr<<"ERROR in LauIsobarDynamics::resAmp : index = "<= nIncohAmp_ ) { std::cerr<<"ERROR in LauIsobarDynamics::setFFTerm : index = "<= nAmp_) { //Set off-diagonal incoherent terms to zero fitFrac_[i][j].value(0.); fitFracEffUnCorr_[i][j].value(0.); continue; } LauComplex AmpjConj = Amp_[j].conj(); LauComplex AmpTerm = Amp_[i]*AmpjConj; Double_t crossTerm = 2.0*(AmpTerm*fifjSum_[i][j]).re()*fNorm_[i]*fNorm_[j]; fifjTot += crossTerm; Double_t crossEffTerm = 2.0*(AmpTerm*fifjEffSum_[i][j]).re()*fNorm_[i]*fNorm_[j]; fifjEffTot += crossEffTerm; fitFrac_[i][j].value(crossTerm); fitFracEffUnCorr_[i][j].value(crossEffTerm); } } for (i = nAmp_; i < nAmp_+nIncohAmp_; i++) { // Calculate the incoherent terms TString name = "A"; name += i; name += "Sq_FitFrac"; fitFrac_[i][i].name(name); name += "EffUnCorr"; fitFracEffUnCorr_[i][i].name(name); Double_t sumTerm = Amp_[i].abs2()*fSqSum_[i]*fNorm_[i]*fNorm_[i]; fifjTot += sumTerm; Double_t sumEffTerm = Amp_[i].abs2()*fSqEffSum_[i]*fNorm_[i]*fNorm_[i]; fifjEffTot += sumEffTerm; fitFrac_[i][i].value(sumTerm); fitFracEffUnCorr_[i][i].value(sumEffTerm); } for (i = nAmp_; i < nAmp_+nIncohAmp_; i++) { for (j = i+1; j < nAmp_+nIncohAmp_; j++) { //Set off-diagonal incoherent terms to zero TString name = "A"; name += i; name += "A"; name += j; name += "_FitFrac"; fitFrac_[i][j].name(name); name += "EffUnCorr"; fitFracEffUnCorr_[i][j].name(name); fitFrac_[i][j].value(0.); fitFracEffUnCorr_[i][j].value(0.); } } if (TMath::Abs(fifjTot) > 1e-10) { meanDPEff_.value(fifjEffTot/fifjTot); if (init) { meanDPEff_.genValue( meanDPEff_.value() ); meanDPEff_.initValue( meanDPEff_.value() ); } } DPRate_.value(fifjTot); if (init) { DPRate_.genValue( DPRate_.value() ); DPRate_.initValue( DPRate_.value() ); } // Now divide the fitFraction sums by the overall integral for (i = 0; i < nAmp_+nIncohAmp_; i++) { for (j = i; j < nAmp_+nIncohAmp_; j++) { // Get the actual fractions by dividing by the total DP rate Double_t fitFracVal = fitFrac_[i][j].value(); fitFracVal /= fifjTot; fitFrac_[i][j].value( fitFracVal ); Double_t fitFracEffUnCorrVal = fitFracEffUnCorr_[i][j].value(); fitFracEffUnCorrVal /= fifjEffTot; fitFracEffUnCorr_[i][j].value( fitFracEffUnCorrVal ); if (init) { fitFrac_[i][j].genValue( fitFrac_[i][j].value() ); fitFrac_[i][j].initValue( fitFrac_[i][j].value() ); fitFracEffUnCorr_[i][j].genValue( fitFracEffUnCorr_[i][j].value() ); fitFracEffUnCorr_[i][j].initValue( fitFracEffUnCorr_[i][j].value() ); } } } // Work out total fit fraction over all K-matrix components (for each propagator) KMPropMap::iterator mapIter; Int_t propInt(0); for (mapIter = kMatrixPropagators_.begin(); mapIter != kMatrixPropagators_.end(); ++mapIter) { LauKMatrixPropagator* thePropagator = mapIter->second; TString propName = thePropagator->getName(); // Now loop over all resonances and find those which are K-matrix components for this propagator Double_t kMatrixTotFitFrac(0.0); for (i = 0; i < nAmp_; i++) { Bool_t gotKMRes1 = this->gotKMatrixMatch(i, propName); if (gotKMRes1 == kFALSE) {continue;} Double_t fifjSumReal = fifjSum_[i][i].re(); Double_t sumTerm = Amp_[i].abs2()*fifjSumReal*fNorm_[i]*fNorm_[i]; //Double_t fifjEffSumReal = fifjEffSum_[i][i].re(); //Double_t sumEffTerm = Amp_[i].abs2()*fifjEffSumReal*fNorm_[i]*fNorm_[i]; kMatrixTotFitFrac += sumTerm; for (j = i+1; j < nAmp_; j++) { Bool_t gotKMRes2 = this->gotKMatrixMatch(j, propName); if (gotKMRes2 == kFALSE) {continue;} LauComplex AmpjConj = Amp_[j].conj(); LauComplex AmpTerm = Amp_[i]*AmpjConj; Double_t crossTerm = 2.0*(AmpTerm*fifjSum_[i][j]).re()*fNorm_[i]*fNorm_[j]; //Double_t crossEffTerm = 2.0*(AmpTerm*fifjEffSum_[i][j]).re()*fNorm_[i]*fNorm_[j]; kMatrixTotFitFrac += crossTerm; } } kMatrixTotFitFrac /= fifjTot; TString parName("KMatrixTotFF_"); parName += propInt; extraParameters_[propInt].name( parName ); extraParameters_[propInt].value(kMatrixTotFitFrac); if (init) { extraParameters_[propInt].genValue(kMatrixTotFitFrac); extraParameters_[propInt].initValue(kMatrixTotFitFrac); } std::cout<<"INFO in LauIsobarDynamics::calcExtraInfo : Total K-matrix fit fraction for propagator "<calculateRhoOmegaFitFractions_ && !init) { int omegaID = 0; int storeID = 1; // Check which B flavour (and therefore which rho_COPY we are) by whether the FF is non-zero // Only for CP fit though - for a 'simple' fit this is more complicated if (fitFrac_[omegaID][omegaID].value() < 1E-4) { omegaID = 1; storeID = 0; } // Check this is really the correct model LauRhoOmegaMix * rhomega = dynamic_cast(getResonance(omegaID)); if (rhomega != NULL) { // Bail out std::cout << "INFO in LauIsobarDynamics::calcExtraInfo : Calculating omega fit fraction from resonance " << omegaID << std::endl; std::cout << "INFO in LauIsobarDynamics::calcExtraInfo : Storing omega fit fraction in resonance " << storeID << std::endl; // Tell the RhoOmegaMix model only to give us the omega amplitude-squared rhomega->setWhichAmpSq(1); // Recalculate the integrals for the omega fit-fraction integralsDone_ = kFALSE; this->resetNormVectors(); for ( UInt_t k(0); k < nAmp_+nIncohAmp_; ++k ) { integralsToBeCalculated_.insert(k); } this->calcDPNormalisation(); integralsDone_ = kTRUE; Double_t fifjSumRealOmega = fifjSum_[omegaID][omegaID].re(); // Recalculate the integrals for the rho fit-fraction rhomega->setWhichAmpSq(2); integralsDone_ = kFALSE; this->resetNormVectors(); for ( UInt_t k(0); k < nAmp_+nIncohAmp_; ++k ) { integralsToBeCalculated_.insert(k); } this->calcDPNormalisation(); integralsDone_ = kTRUE; Double_t fitFracPartRho = Amp_[omegaID].abs2()*fifjSum_[omegaID][omegaID].re(); // Reset the RhoOmegaMix model and the integrals rhomega->setWhichAmpSq(0); integralsDone_ = kFALSE; this->resetNormVectors(); for ( UInt_t k(0); k < nAmp_+nIncohAmp_; ++k ) { integralsToBeCalculated_.insert(k); } this->calcDPNormalisation(); integralsDone_ = kTRUE; // Store the omega fit-fraction in the rho_COPY location (which is otherwise empty) // Store the rho fit-fraction in the rho location (overwriting the combined FF) Double_t omegaFF = fifjSumRealOmega * fitFrac_[omegaID][omegaID].value(); fitFrac_[storeID][storeID].value(omegaFF); fitFrac_[omegaID][omegaID].value(fitFracPartRho * fNorm_[omegaID] * fNorm_[omegaID] / DPRate_.value()); } else { std::cout << "INFO in LauIsobarDynamics::calcExtraInfo : calculateRhoOmegaFitFractions is set, but the RhoOmegaMix model isn't in the right place. Ignoring this option." << std::endl; } } } Bool_t LauIsobarDynamics::gotKMatrixMatch(UInt_t resAmpInt, const TString& propName) const { Bool_t gotMatch(kFALSE); if (resAmpInt >= nAmp_) {return kFALSE;} const LauAbsResonance* theResonance = sigResonances_[resAmpInt]; if (theResonance == 0) {return kFALSE;} Int_t resModelInt = theResonance->getResonanceModel(); if (resModelInt == LauAbsResonance::KMatrix) { TString resName = theResonance->getResonanceName(); KMStringMap::const_iterator kMPropSetIter = kMatrixPropSet_.find(resName); if (kMPropSetIter != kMatrixPropSet_.end()) { TString kmPropString = kMPropSetIter->second; if (kmPropString == propName) {gotMatch = kTRUE;} } } return gotMatch; } Double_t LauIsobarDynamics::calcSigDPNorm() { // Calculate the normalisation for the log-likelihood function. DPNorm_ = 0.0; for (UInt_t i = 0; i < nAmp_; i++) { // fifjEffSum is the contribution from the term involving the resonance // dynamics (f_i for resonance i) and the efficiency term. Double_t fifjEffSumReal = fifjEffSum_[i][i].re(); // We need to normalise this contribution w.r.t. the complete dynamics in the DP. // Hence we scale by the fNorm_i factor (squared), which is calculated by the // initialise() function, when the normalisation integrals are calculated and cached. // We also include the complex amplitude squared to get the total normalisation // contribution from this resonance. DPNorm_ += Amp_[i].abs2()*fifjEffSumReal*fNorm_[i]*fNorm_[i]; } // We now come to the cross-terms (between resonances i and j) in the normalisation. for (UInt_t i = 0; i < nAmp_; i++) { for (UInt_t j = i+1; j < nAmp_; j++) { LauComplex AmpjConj = Amp_[j].conj(); LauComplex AmpTerm = Amp_[i]*AmpjConj; // Again, fifjEffSum is the contribution from the term involving the resonance // dynamics (f_i*f_j_conjugate) and the efficiency cross term. // Also include the relative normalisation between these two resonances w.r.t. the // total DP dynamical structure (fNorm_i and fNorm_j) and the complex // amplitude squared (mag,phase) part. DPNorm_ += 2.0*(AmpTerm*fifjEffSum_[i][j]).re()*fNorm_[i]*fNorm_[j]; } } for (UInt_t i = 0; i < nIncohAmp_; i++) { DPNorm_ += Amp_[i+nAmp_].abs2()*fSqEffSum_[i+nAmp_]*fNorm_[i+nAmp_]*fNorm_[i+nAmp_]; } return DPNorm_; } Bool_t LauIsobarDynamics::generate() { // Routine to generate a signal event according to the Dalitz plot // model we have defined. // We need to make sure to calculate everything for every resonance integralsToBeCalculated_.clear(); for ( UInt_t i(0); i < nAmp_+nIncohAmp_; ++i ) { integralsToBeCalculated_.insert(i); } nSigGenLoop_ = 0; Bool_t generatedSig(kFALSE); while (generatedSig == kFALSE && nSigGenLoop_ < iterationsMax_) { // Generates uniform DP phase-space distribution Double_t m13Sq(0.0), m23Sq(0.0); kinematics_->genFlatPhaseSpace(m13Sq, m23Sq); // If we're in a symmetrical DP then we should only generate events in one half // TODO - what do we do for fully symmetric? if ( symmetricalDP_ && !fullySymmetricDP_ && m13Sq > m23Sq ) { Double_t tmpSq = m13Sq; m13Sq = m23Sq; m23Sq = tmpSq; } // Calculate the amplitudes and total amplitude for the given DP point this->calcLikelihoodInfo(m13Sq, m23Sq); // Throw the random number and check it against the ratio of ASq and the accept/reject ceiling const Double_t randNo = LauRandom::randomFun()->Rndm(); if (randNo > ASq_/aSqMaxSet_) { ++nSigGenLoop_; } else { generatedSig = kTRUE; nSigGenLoop_ = 0; // Keep a note of the maximum ASq that we've found if (ASq_ > aSqMaxVar_) {aSqMaxVar_ = ASq_;} } } // while loop // Check that all is well with the generation Bool_t sigGenOK(kTRUE); if (GenOK != this->checkToyMC(kTRUE,kFALSE)) { sigGenOK = kFALSE; } return sigGenOK; } LauIsobarDynamics::ToyMCStatus LauIsobarDynamics::checkToyMC(Bool_t printErrorMessages, Bool_t printInfoMessages) { // Check whether we have generated the toy MC OK. ToyMCStatus ok(GenOK); if (nSigGenLoop_ >= iterationsMax_) { // Exceeded maximum allowed iterations - the generation is too inefficient if (printErrorMessages) { std::cerr<<"WARNING in LauIsobarDynamics::checkToyMC : More than "< 1.01 * aSqMaxVar_ ) { if (printErrorMessages) { std::cerr<<" : |A|^2 maximum was set to "< aSqMaxSet_) { // Found a value of ASq higher than the accept/reject ceiling - the generation is biased if (printErrorMessages) { std::cerr<<"WARNING in LauIsobarDynamics::checkToyMC : |A|^2 maximum was set to "< "<= "<retrievem13Sq(); m23Sq_ = currentEvent_->retrievem23Sq(); mPrime_ = currentEvent_->retrievemPrime(); thPrime_ = currentEvent_->retrievethPrime(); tagCat_ = currentEvent_->retrieveTagCat(); eff_ = currentEvent_->retrieveEff(); scfFraction_ = currentEvent_->retrieveScfFraction(); // These two are necessary, even though the dynamics don't actually use scfFraction_ or jacobian_, jacobian_ = currentEvent_->retrieveJacobian(); // since this is at the heart of the caching mechanism. } void LauIsobarDynamics::calcLikelihoodInfo(const UInt_t iEvt) { // Calculate the likelihood and associated info // for the given event using cached information evtLike_ = 0.0; // retrieve the cached dynamics from the tree: // realAmp, imagAmp for each resonance plus efficiency, scf fraction and jacobian this->setDataEventNo(iEvt); // use realAmp and imagAmp to create the resonance amplitudes const std::vector& realAmp = currentEvent_->retrieveRealAmp(); const std::vector& imagAmp = currentEvent_->retrieveImagAmp(); const std::vector& incohInten = currentEvent_->retrieveIncohIntensities(); for (UInt_t i = 0; i < nAmp_; i++) { this->setFFTerm(i, realAmp[i], imagAmp[i]); } for (UInt_t i = 0; i < nIncohAmp_; i++) { this->setIncohIntenTerm(i, incohInten[i]); } // Update the dynamics - calculates totAmp_ and then ASq_ = totAmp_.abs2() * eff_ // All calculated using cached information on the individual amplitudes and efficiency. this->calcTotalAmp(kTRUE); // Calculate the normalised matrix element squared value if (DPNorm_ > 1e-10) { evtLike_ = ASq_/DPNorm_; } } void LauIsobarDynamics::calcLikelihoodInfo(const Double_t m13Sq, const Double_t m23Sq) { this->calcLikelihoodInfo(m13Sq, m23Sq, -1); } void LauIsobarDynamics::calcLikelihoodInfo(const Double_t m13Sq, const Double_t m23Sq, const Int_t tagCat) { // Calculate the likelihood and associated info // for the given point in the Dalitz plot // Also retrieves the SCF fraction in the bin where the event lies (done // here to cache it along with the the rest of the DP quantities, like eff) // The jacobian for the square DP is calculated here for the same reason. evtLike_ = 0.0; // update the kinematics for the specified DP point kinematics_->updateKinematics(m13Sq, m23Sq); // calculate the jacobian and the scfFraction to cache them later scfFraction_ = this->retrieveScfFraction(tagCat); if (kinematics_->squareDP() == kTRUE) { jacobian_ = kinematics_->calcSqDPJacobian(); } // calculate the ff_ terms and retrieves eff_ from the efficiency model this->calculateAmplitudes(); // then calculate totAmp_ and finally ASq_ = totAmp_.abs2() * eff_ this->calcTotalAmp(kTRUE); // Calculate the normalised matrix element squared value if (DPNorm_ > 1e-10) { evtLike_ = ASq_/DPNorm_; } } void LauIsobarDynamics::modifyDataTree() { if ( recalcNormalisation_ == kFALSE ) { return; } const UInt_t nEvents = data_.size(); std::set::const_iterator iter = integralsToBeCalculated_.begin(); const std::set::const_iterator intEnd = integralsToBeCalculated_.end(); for (UInt_t iEvt = 0; iEvt < nEvents; ++iEvt) { currentEvent_ = data_[iEvt]; std::vector& realAmp = currentEvent_->retrieveRealAmp(); std::vector& imagAmp = currentEvent_->retrieveImagAmp(); std::vector& incohInten = currentEvent_->retrieveIncohIntensities(); const Double_t m13Sq = currentEvent_->retrievem13Sq(); const Double_t m23Sq = currentEvent_->retrievem23Sq(); const Int_t tagCat = currentEvent_->retrieveTagCat(); this->calcLikelihoodInfo(m13Sq, m23Sq, tagCat); for ( iter = integralsToBeCalculated_.begin(); iter != intEnd; ++iter) { const UInt_t i = *iter; if(*iter < nAmp_) { realAmp[i] = ff_[i].re(); imagAmp[i] = ff_[i].im(); } else { incohInten[i-nAmp_] = incohInten_[i-nAmp_]; } } } } void LauIsobarDynamics::fillDataTree(const LauFitDataTree& inputFitTree) { // In LauFitDataTree, the first two variables should always be m13^2 and m23^2. // Other variables follow thus: charge/flavour tag prob, etc. // Since this is the first caching, we need to make sure to calculate everything for every resonance integralsToBeCalculated_.clear(); for ( UInt_t i(0); i < nAmp_+nIncohAmp_; ++i ) { integralsToBeCalculated_.insert(i); } UInt_t nBranches = inputFitTree.nBranches(); if (nBranches < 2) { std::cerr<<"ERROR in LauIsobarDynamics::fillDataTree : Expecting at least 2 variables " <<"in input data tree, but there are "<Exit(EXIT_FAILURE); } // Data structure that will cache the variables required to // calculate the signal likelihood for this experiment for ( std::vector::iterator iter = data_.begin(); iter != data_.end(); ++iter ) { delete (*iter); } data_.clear(); Double_t m13Sq(0.0), m23Sq(0.0); Double_t mPrime(0.0), thPrime(0.0); Int_t tagCat(-1); std::vector realAmp(nAmp_), imagAmp(nAmp_); Double_t eff(0.0), scfFraction(0.0), jacobian(0.0); UInt_t nEvents = inputFitTree.nEvents() + inputFitTree.nFakeEvents(); data_.reserve(nEvents); for (UInt_t iEvt = 0; iEvt < nEvents; ++iEvt) { const LauFitData& dataValues = inputFitTree.getData(iEvt); LauFitData::const_iterator iter = dataValues.find("m13Sq"); m13Sq = iter->second; iter = dataValues.find("m23Sq"); m23Sq = iter->second; // is there more than one tagging category? // if so then we need to know the category from the data if (scfFractionModel_.size()>1) { iter = dataValues.find("tagCat"); tagCat = static_cast(iter->second); } // calculates the amplitudes and total amplitude for the given DP point // tagging category not needed by dynamics, but to find out the scfFraction this->calcLikelihoodInfo(m13Sq, m23Sq, tagCat); // extract the real and imaginary parts of the ff_ terms for storage for (UInt_t i = 0; i < nAmp_; i++) { realAmp[i] = ff_[i].re(); imagAmp[i] = ff_[i].im(); } if ( kinematics_->squareDP() ) { mPrime = kinematics_->getmPrime(); thPrime = kinematics_->getThetaPrime(); } eff = this->getEvtEff(); scfFraction = this->getEvtScfFraction(); jacobian = this->getEvtJacobian(); // store the data for each event in the list data_.push_back( new LauCacheData() ); data_[iEvt]->storem13Sq(m13Sq); data_[iEvt]->storem23Sq(m23Sq); data_[iEvt]->storemPrime(mPrime); data_[iEvt]->storethPrime(thPrime); data_[iEvt]->storeTagCat(tagCat); data_[iEvt]->storeEff(eff); data_[iEvt]->storeScfFraction(scfFraction); data_[iEvt]->storeJacobian(jacobian); data_[iEvt]->storeRealAmp(realAmp); data_[iEvt]->storeImagAmp(imagAmp); data_[iEvt]->storeIncohIntensities(incohInten_); } } Bool_t LauIsobarDynamics::gotReweightedEvent() { // Select the event (kinematics_) using an accept/reject method based on the // ratio of the current value of ASq to the maximal value. Bool_t accepted(kFALSE); // calculate the ff_ terms and retrieves eff_ from the efficiency model this->calculateAmplitudes(); // then calculate totAmp_ and finally ASq_ = totAmp_.abs2() (without the efficiency correction!) this->calcTotalAmp(kFALSE); // Compare the ASq value with the maximal value (set by the user) if (LauRandom::randomFun()->Rndm() < ASq_/aSqMaxSet_) { accepted = kTRUE; } if (ASq_ > aSqMaxVar_) {aSqMaxVar_ = ASq_;} return accepted; } Double_t LauIsobarDynamics::getEventWeight() { // calculate the ff_ terms and retrieves eff_ from the efficiency model this->calculateAmplitudes(); // then calculate totAmp_ and finally ASq_ = totAmp_.abs2() (without the efficiency correction!) this->calcTotalAmp(kFALSE); // return the event weight = the value of the squared amplitude return ASq_; } void LauIsobarDynamics::updateCoeffs(const std::vector& coeffs) { // Check that the number of coeffs is correct if (coeffs.size() != this->getnTotAmp()) { std::cerr << "ERROR in LauIsobarDynamics::updateCoeffs : Expected " << this->getnTotAmp() << " but got " << coeffs.size() << std::endl; gSystem->Exit(EXIT_FAILURE); } // Now check if the coeffs have changed Bool_t changed = (Amp_ != coeffs); if (changed) { // Copy the coeffs Amp_ = coeffs; } // TODO should perhaps keep track of whether the resonance parameters have changed here and if none of those and none of the coeffs have changed then we don't need to update the norm // Update the total normalisation for the signal likelihood this->calcSigDPNorm(); } TString LauIsobarDynamics::getConjResName(const TString& resName) const { // Get the name of the charge conjugate resonance TString conjName(resName); Ssiz_t index1 = resName.Index("+"); Ssiz_t index2 = resName.Index("-"); if (index1 != -1) { conjName.Replace(index1, 1, "-"); } else if (index2 != -1) { conjName.Replace(index2, 1, "+"); } return conjName; } Double_t LauIsobarDynamics::retrieveEfficiency() { Double_t eff(1.0); if (effModel_ != 0) { eff = effModel_->calcEfficiency(kinematics_); } return eff; } Double_t LauIsobarDynamics::retrieveScfFraction(Int_t tagCat) { Double_t scfFraction(0.0); // scf model and eff model are exactly the same, functionally // so we use an instance of LauAbsEffModel, and the method // calcEfficiency actually calculates the scf fraction if (tagCat == -1) { if (!scfFractionModel_.empty()) { scfFraction = scfFractionModel_[0]->calcEfficiency(kinematics_); } } else { scfFraction = scfFractionModel_[tagCat]->calcEfficiency(kinematics_); } return scfFraction; } diff --git a/src/LauKMatrixProdPole.cc b/src/LauKMatrixProdPole.cc index 5c67a4d..266ff16 100644 --- a/src/LauKMatrixProdPole.cc +++ b/src/LauKMatrixProdPole.cc @@ -1,132 +1,168 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixProdPole.cc \brief File containing implementation of LauKMatrixProdPole class. */ #include "LauKMatrixProdPole.hh" #include "LauKMatrixPropagator.hh" +#include "LauResonanceMaker.hh" #include ClassImp(LauKMatrixProdPole) -LauKMatrixProdPole::LauKMatrixProdPole(const TString& poleName, Int_t poleIndex, Int_t resPairAmpInt, - LauKMatrixPropagator* propagator, const LauDaughters* daughters, - Bool_t useProdAdler) : - LauAbsResonance(poleName, resPairAmpInt, daughters), +LauKMatrixProdPole::LauKMatrixProdPole( const TString& poleName, Int_t poleIndex, Int_t resPairAmpInt, + LauKMatrixPropagator* propagator, const LauDaughters* daughters, + Bool_t useProdAdler) : + LauAbsResonance( poleName, resPairAmpInt, daughters, propagator->getL(propagator->getIndex()) ), thePropagator_(propagator), - poleIndex_(poleIndex - 1), // poleIndex goes from 1 to nPoles - useProdAdler_(useProdAdler) + poleIndex_(poleIndex - 1), // poleIndex goes from 1 to nPoles + useProdAdler_(useProdAdler) { - if (useProdAdler_) { - std::cout<<"Creating K matrix production pole "<setBarrierRadii( nullptr,LauResonanceMaker::get().getParentBWFactor( propagator->getL(propagator->getIndex()), LauBlattWeisskopfFactor::BWBarrier ) ); } LauKMatrixProdPole::~LauKMatrixProdPole() { } -LauComplex LauKMatrixProdPole::resAmp(Double_t mass, Double_t spinTerm) +LauComplex LauKMatrixProdPole::resAmp(const Double_t mass, const Double_t spinTerm) { - std::cerr << "ERROR in LauKMatrixProdPole::resAmp : This method shouldn't get called." << std::endl; - std::cerr << " Returning zero amplitude for mass = " << mass << " and spinTerm = " << spinTerm << "." << std::endl; - return LauComplex(0.0, 0.0); -} - -LauComplex LauKMatrixProdPole::amplitude(const LauKinematics* kinematics) -{ - // Calculate the amplitude for the K-matrix production pole. LauComplex amp(0.0, 0.0); if (thePropagator_ == 0) { std::cerr << "ERROR in LauKMatrixProdPole::amplitude : The propagator is null" << std::endl; return amp; } - thePropagator_->updatePropagator(kinematics); + // Get barrier factors ('resonance' factor is already accounted for internally via propagator 'Gamma' matrix) + Double_t fFactorB(1.0); + + const Int_t resSpin = this->getSpin(); + const Double_t pstar = this->getPstar(); + + if ( resSpin > 0 ) { + const LauBlattWeisskopfFactor* parBWFactor = this->getParBWFactor(); + if ( parBWFactor != nullptr ) { + switch ( parBWFactor->getRestFrame() ) { + case LauBlattWeisskopfFactor::ResonanceFrame: + fFactorB = parBWFactor->calcFormFactor(this->getP()); + break; + case LauBlattWeisskopfFactor::ParentFrame: + fFactorB = parBWFactor->calcFormFactor(pstar); + break; + case LauBlattWeisskopfFactor::Covariant: + { + Double_t covFactor = this->getCovFactor(); + if ( resSpin > 2 ) { + covFactor = TMath::Power( covFactor, 1.0/resSpin ); + } else if ( resSpin == 2 ) { + covFactor = TMath::Sqrt( covFactor ); + } + fFactorB = parBWFactor->calcFormFactor(pstar*covFactor); + break; + } + } + } + } + + // Make sure the K-matrix propagator is up-to-date for + // the given centre-of-mass squared value ("s") + thePropagator_->updatePropagator(mass*mass); // Sum the pole denominator terms over all channels j, multiplying by // the propagator terms. Note that we do not sum over poles, since we // only want one of the production pole terms. Int_t nChannels = thePropagator_->getNChannels(); Int_t jChannel; for (jChannel = 0; jChannel < nChannels; jChannel++) { Double_t gj = thePropagator_->getCouplingConstant(poleIndex_, jChannel); LauComplex prodTerm = thePropagator_->getPropTerm(jChannel); prodTerm.rescale(gj); amp += prodTerm; } Double_t poleDenom = thePropagator_->getPoleDenomTerm(poleIndex_); // Include Adler zero factor if requested Double_t adlerZero(1.0); if (useProdAdler_) {adlerZero = thePropagator_->getAdlerZero();} amp.rescale(poleDenom*adlerZero); + // Scale by the spin term + Double_t scale = spinTerm; + + // Include Blatt-Weisskopf barrier factor for parent + scale *= fFactorB; + + amp.rescale(scale); + return amp; } const std::vector& LauKMatrixProdPole::getFloatingParameters() { this->clearFloatingParameters(); Int_t nChannels = thePropagator_->getNChannels(); for (int jChannel = 0 ; jChannel < nChannels ; jChannel++) { LauParameter& par_gj_ = thePropagator_->getCouplingParameter(poleIndex_, jChannel); if ( !par_gj_.fixed() ) { this->addFloatingParameter( &par_gj_ ); } } LauParameter& par_polemasssq_ = thePropagator_->getPoleMassSqParameter(poleIndex_); if ( !par_polemasssq_.fixed() ) { this->addFloatingParameter( &par_polemasssq_ ); - } + } return this->getParameters(); -} \ No newline at end of file +} diff --git a/src/LauKMatrixProdSVP.cc b/src/LauKMatrixProdSVP.cc index dcad139..1a1fefa 100644 --- a/src/LauKMatrixProdSVP.cc +++ b/src/LauKMatrixProdSVP.cc @@ -1,146 +1,177 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixProdSVP.cc \brief File containing implementation of LauKMatrixProdSVP class. */ #include "LauKMatrixProdSVP.hh" #include "LauKMatrixPropagator.hh" #include ClassImp(LauKMatrixProdSVP) -LauKMatrixProdSVP::LauKMatrixProdSVP(const TString& SVPName, Int_t channelIndex, Int_t resPairAmpInt, - LauKMatrixPropagator* propagator, const LauDaughters* daughters, - Bool_t useProdAdler) : - LauAbsResonance(SVPName, resPairAmpInt, daughters), +LauKMatrixProdSVP::LauKMatrixProdSVP( const TString& SVPName, Int_t channelIndex, Int_t resPairAmpInt, + LauKMatrixPropagator* propagator, const LauDaughters* daughters, + Bool_t useProdAdler) : + LauAbsResonance( SVPName, resPairAmpInt, daughters, propagator->getL(propagator->getIndex()) ), thePropagator_(propagator), - channelIndex_(channelIndex - 1), // channelIndex goes from 1 to nChannels. - useProdAdler_(useProdAdler) + channelIndex_(channelIndex - 1), // channelIndex goes from 1 to nChannels. + useProdAdler_(useProdAdler) { // Constructor - if (useProdAdler_) { - std::cout<<"Creating K matrix production SVP "<updatePropagator(kinematics); + // Get barrier factors ('resonance' factor is already accounted for internally via propagator 'Gamma' matrix) + Double_t fFactorB(1.0); + + const Int_t resSpin = this->getSpin(); + const Double_t pstar = this->getPstar(); + + if ( resSpin > 0 ) { + const LauBlattWeisskopfFactor* parBWFactor = this->getParBWFactor(); + if ( parBWFactor != nullptr ) { + switch ( parBWFactor->getRestFrame() ) { + case LauBlattWeisskopfFactor::ResonanceFrame: + fFactorB = parBWFactor->calcFormFactor(this->getP()); + break; + case LauBlattWeisskopfFactor::ParentFrame: + fFactorB = parBWFactor->calcFormFactor(pstar); + break; + case LauBlattWeisskopfFactor::Covariant: + { + Double_t covFactor = this->getCovFactor(); + if ( resSpin > 2 ) { + covFactor = TMath::Power( covFactor, 1.0/resSpin ); + } else if ( resSpin == 2 ) { + covFactor = TMath::Sqrt( covFactor ); + } + fFactorB = parBWFactor->calcFormFactor(pstar*covFactor); + break; + } + } + } + } + + thePropagator_->updatePropagator(mass*mass); Double_t SVPTerm = thePropagator_->getProdSVPTerm(); amp = thePropagator_->getPropTerm(channelIndex_); // Include Adler zero factor if requested Double_t adlerZero(1.0); if (useProdAdler_) {adlerZero = thePropagator_->getAdlerZero();} amp.rescale(SVPTerm*adlerZero); + // Scale by the spin term + Double_t scale = spinTerm; + + // Include Blatt-Weisskopf barrier factor for parent + scale *= fFactorB; + + amp.rescale(scale); + return amp; } const std::vector& LauKMatrixProdSVP::getFloatingParameters() { this->clearFloatingParameters(); Int_t nChannels = thePropagator_->getNChannels(); for (int jChannel = 0 ; jChannel < nChannels ; jChannel++) { LauParameter& par_f_ = thePropagator_->getScatteringParameter(channelIndex_, jChannel); if ( !par_f_.fixed() ) - { + { this->addFloatingParameter( &par_f_ ); - } + } } LauParameter& par_mSq0_ = thePropagator_->getmSq0(); if ( !par_mSq0_.fixed() ) { this->addFloatingParameter( &par_mSq0_ ); } LauParameter& par_s0Scatt_ = thePropagator_->gets0Scatt(); if ( !par_s0Scatt_.fixed() ) { this->addFloatingParameter( &par_s0Scatt_ ); } LauParameter& par_s0Prod_ = thePropagator_->gets0Prod(); if ( !par_s0Prod_.fixed() ) { this->addFloatingParameter( &par_s0Prod_ ); } LauParameter& par_sA_ = thePropagator_->getsA(); if ( !par_sA_.fixed() ) { this->addFloatingParameter( &par_sA_ ); } LauParameter& par_sA0_ = thePropagator_->getsA0(); if ( !par_sA0_.fixed() ) { this->addFloatingParameter( &par_sA0_ ); } return this->getParameters(); } \ No newline at end of file diff --git a/src/LauKMatrixPropagator.cc b/src/LauKMatrixPropagator.cc index f0e5697..b45d833 100644 --- a/src/LauKMatrixPropagator.cc +++ b/src/LauKMatrixPropagator.cc @@ -1,1166 +1,1425 @@ /* Copyright 2008 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauKMatrixPropagator.cc - \brief File containing implementation of LauKMatrixPropagator class. + \brief File containing implementation of LauKMatrixPropagator class. */ #include "LauKMatrixPropagator.hh" -#include "LauConstants.hh" #include "LauTextFileParser.hh" +#include "LauKinematics.hh" +#include "LauComplex.hh" #include "TMath.h" #include "TSystem.h" #include #include #include #include using std::cout; using std::endl; using std::cerr; ClassImp(LauKMatrixPropagator) LauKMatrixPropagator::LauKMatrixPropagator(const TString& name, const TString& paramFile, - Int_t resPairAmpInt, Int_t nChannels, - Int_t nPoles, Int_t rowIndex) : + Int_t resPairAmpInt, Int_t nChannels, + Int_t nPoles, Int_t rowIndex) : name_(name), paramFileName_(paramFile), resPairAmpInt_(resPairAmpInt), index_(rowIndex - 1), - previousS_(0.0), - scattSVP_(0.0), - prodSVP_(0.0), nChannels_(nChannels), - nPoles_(nPoles), - sAConst_(0.0), - m2piSq_(4.0*LauConstants::mPiSq), - m2KSq_( 4.0*LauConstants::mKSq), - m2EtaSq_(4.0*LauConstants::mEtaSq), - mEtaEtaPSumSq_((LauConstants::mEta + LauConstants::mEtaPrime)*(LauConstants::mEta + LauConstants::mEtaPrime)), - mEtaEtaPDiffSq_((LauConstants::mEta - LauConstants::mEtaPrime)*(LauConstants::mEta - LauConstants::mEtaPrime)), - mKpiSumSq_((LauConstants::mK + LauConstants::mPi)*(LauConstants::mK + LauConstants::mPi)), - mKpiDiffSq_((LauConstants::mK - LauConstants::mPi)*(LauConstants::mK - LauConstants::mPi)), - mKEtaPSumSq_((LauConstants::mK + LauConstants::mEtaPrime)*(LauConstants::mK + LauConstants::mEtaPrime)), - mKEtaPDiffSq_((LauConstants::mK - LauConstants::mEtaPrime)*(LauConstants::mK - LauConstants::mEtaPrime)), - mK3piDiffSq_((LauConstants::mK - 3.0*LauConstants::mPi)*(LauConstants::mK - 3.0*LauConstants::mPi)), - k3piFactor_(TMath::Power((1.44 - mK3piDiffSq_)/1.44, -2.5)), - fourPiFactor1_(16.0*LauConstants::mPiSq), - fourPiFactor2_(TMath::Sqrt(1.0 - fourPiFactor1_)), - adlerZeroFactor_(0.0), - parametersSet_(kFALSE), - verbose_(kFALSE), - scattSymmetry_(kTRUE) + nPoles_(nPoles) { // Constructor - // Check that the index is OK - if (index_ < 0 || index_ >= nChannels_) { - std::cerr << "ERROR in LauKMatrixPropagator constructor. The rowIndex, which is set to " - << rowIndex << ", must be between 1 and the number of channels " - << nChannels_ << std::endl; + // Check that the index is OK + if (index_ < 0 || index_ >= nChannels_) { + std::cerr << "ERROR in LauKMatrixPropagator constructor. The rowIndex, which is set to " + << rowIndex << ", must be between 1 and the number of channels " + << nChannels_ << std::endl; gSystem->Exit(EXIT_FAILURE); } this->setParameters(paramFile); } LauKMatrixPropagator::~LauKMatrixPropagator() { // Destructor realProp_.Clear(); negImagProp_.Clear(); - ScattKMatrix_.Clear(); - ReRhoMatrix_.Clear(); - ImRhoMatrix_.Clear(); + ScattKMatrix_.Clear(); + ReRhoMatrix_.Clear(); + ImRhoMatrix_.Clear(); + GammaMatrix_.Clear(); ReTMatrix_.Clear(); ImTMatrix_.Clear(); IMatrix_.Clear(); zeroMatrix_.Clear(); } -LauComplex LauKMatrixPropagator::getPropTerm(Int_t channel) const +LauComplex LauKMatrixPropagator::getPropTerm(const Int_t channel) const { // Get the (i,j) = (index_, channel) term of the propagator // matrix. This allows us not to return the full propagator matrix. Double_t realTerm = this->getRealPropTerm(channel); Double_t imagTerm = this->getImagPropTerm(channel); LauComplex propTerm(realTerm, imagTerm); return propTerm; } -Double_t LauKMatrixPropagator::getRealPropTerm(Int_t channel) const +Double_t LauKMatrixPropagator::getRealPropTerm(const Int_t channel) const { // Get the real part of the (i,j) = (index_, channel) term of the propagator // matrix. This allows us not to return the full propagator matrix. if (parametersSet_ == kFALSE) {return 0.0;} Double_t propTerm = realProp_[index_][channel]; return propTerm; } -Double_t LauKMatrixPropagator::getImagPropTerm(Int_t channel) const +Double_t LauKMatrixPropagator::getImagPropTerm(const Int_t channel) const { // Get the imaginary part of the (i,j) = (index_, channel) term of the propagator // matrix. This allows us not to return the full propagator matrix. if (parametersSet_ == kFALSE) {return 0.0;} Double_t imagTerm = -1.0*negImagProp_[index_][channel]; return imagTerm; } -void LauKMatrixPropagator::updatePropagator(const LauKinematics* kinematics) -{ - - // Calculate the K-matrix propagator for the given s value. - // The K-matrix amplitude is given by - // T_i = sum_{ij} (I - iK*rho)^-1 * P_j, where P is the production K-matrix. - // i = index for the state (e.g. S-wave index = 0). - // Here, we only find the (I - iK*rho)^-1 matrix part. - - if (!kinematics) {return;} - - // Get the invariant mass squared (s) from the kinematics object. - // Use the resPairAmpInt to find which mass-squared combination to use. - Double_t s(0.0); - - if (resPairAmpInt_ == 1) { - s = kinematics->getm23Sq(); - } else if (resPairAmpInt_ == 2) { - s = kinematics->getm13Sq(); - } else if (resPairAmpInt_ == 3) { - s = kinematics->getm12Sq(); - } - - this->updatePropagator(s); - -} - -void LauKMatrixPropagator::updatePropagator(Double_t s) +void LauKMatrixPropagator::updatePropagator(const Double_t s) { - // Calculate the K-matrix propagator for the given s value. + // Calculate the K-matrix propagator for the given s value. // The K-matrix amplitude is given by // T_i = sum_{ij} (I - iK*rho)^-1 * P_j, where P is the production K-matrix. // i = index for the state (e.g. S-wave index = 0). // Here, we only find the (I - iK*rho)^-1 matrix part. // Check if we have almost the same s value as before. If so, don't re-calculate // the propagator nor any of the pole mass summation terms. if (TMath::Abs(s - previousS_) < 1e-6*s) { //cout<<"Already got propagator for s = "<calcPoleDenomVect(s); this->updateAdlerZeroFactor(s); // Calculate the scattering K-matrix (real and symmetric) this->calcScattKMatrix(s); // Calculate the phase space density matrix, which is diagonal, but can be complex // if the quantity s is below various threshold values (analytic continuation). this->calcRhoMatrix(s); - // Calculate K*rho (real and imaginary parts, since rho can be complex) - TMatrixD K_realRho(ScattKMatrix_); - K_realRho *= ReRhoMatrix_; - TMatrixD K_imagRho(ScattKMatrix_); - K_imagRho *= ImRhoMatrix_; + // Calculate the angular momentum barrier matrix, which is real and diagonal + this->calcGammaMatrix(s); + + // Calculate K*rho*(gamma^2) (real and imaginary parts, since rho can be complex) + TMatrixD GammaMatrixSq = (GammaMatrix_*GammaMatrix_); + TMatrixD K_realRhoGammaSq(ScattKMatrix_); + + K_realRhoGammaSq *= ReRhoMatrix_; + K_realRhoGammaSq *= GammaMatrixSq; + TMatrixD K_imagRhoGammaSq(ScattKMatrix_); + + K_imagRhoGammaSq *= ImRhoMatrix_; + K_imagRhoGammaSq *= GammaMatrixSq; - // A = I + K*Imag(rho), B = -K*Real(Rho) + + // A = I + K*Imag(rho)Gamma^2, B = -K*Real(Rho)Gamma^2 // Calculate C and D matrices such that (A + iB)*(C + iD) = I, - // ie. C + iD = (I - i K*rho)^-1, separated into real and imaginary parts. + // ie. C + iD = (I - i K*rhoGamma^2)^-1, separated into real and imaginary parts. // realProp C = (A + B A^-1 B)^-1, imagProp D = -A^-1 B C TMatrixD A(IMatrix_); - A += K_imagRho; + A += K_imagRhoGammaSq; TMatrixD B(zeroMatrix_); - B -= K_realRho; + B -= K_realRhoGammaSq; TMatrixD invA(TMatrixD::kInverted, A); TMatrixD invA_B(invA); invA_B *= B; TMatrixD B_invA_B(B); B_invA_B *= invA_B; TMatrixD invC(A); invC += B_invA_B; - // Set the real part of the propagator matrix ("C") realProp_ = TMatrixD(TMatrixD::kInverted, invC); // Set the (negative) imaginary part of the propagator matrix ("-D") TMatrixD BC(B); BC *= realProp_; negImagProp_ = TMatrixD(invA); negImagProp_ *= BC; + // Pre-multiply by the Gamma matrix: + realProp_ = GammaMatrix_ * realProp_; + negImagProp_ = GammaMatrix_ * negImagProp_; + + if(verbose_) + { + std::cout << "In LauKMatrixPropagator::updatePropagator(s). D[1-iKrhoD^2]^-1: " << std::endl; + TString realOutput("Real part:"), imagOutput("Imag part:"); + for (int iChannel = 0; iChannel < nChannels_; iChannel++) + { + for (int jChannel = 0; jChannel < nChannels_; jChannel++) + { + realOutput += Form("\t%.6f",realProp_[iChannel][jChannel]); + imagOutput += Form("\t%.6f",-1*negImagProp_[iChannel][jChannel]); + } + realOutput += "\n "; + imagOutput += "\n "; + } + std::cout << realOutput << std::endl; + std::cout << imagOutput << std::endl; + } + + // Also calculate the production SVP term, since this uses Adler-zero parameters // defined in the parameter file. this->updateProdSVPTerm(s); // Finally, keep track of the value of s we just used. previousS_ = s; } void LauKMatrixPropagator::setParameters(const TString& inputFile) { // Read an input file that specifies the values of the coupling constants g_i for // the given number of poles and their (bare) masses. Also provided are the f_{ab} // slow-varying constants. The input file should also provide the Adler zero // constants s_0, s_A and s_A0. parametersSet_ = kFALSE; cout<<"Initialising K-matrix propagator "<Exit(EXIT_FAILURE); + gSystem->Exit(EXIT_FAILURE); } UInt_t iLine(0); for (iLine = 1; iLine <= nTotLines; iLine++) { // Get the line of strings std::vector theLine = readFile.getLine(iLine); // There should always be at least two strings: a keyword and at least 1 value if (theLine.size() < 2) {continue;} TString keyword(theLine[0].c_str()); keyword.ToLower(); // Use lowercase if (!keyword.CompareTo("channels")) { // Channel indices for phase-space factors this->storeChannels(theLine); } else if (!keyword.CompareTo("pole")) { // Pole terms this->storePole(theLine); } else if (!keyword.CompareTo("scatt")) { // Scattering terms this->storeScattering(theLine); + } else if (!keyword.CompareTo("angularmomentum")) { + + // Orbital angular momentum state for each channel & set default a values if called before storeBarrierFactorParameter + this->storeOrbitalAngularMomenta(theLine, a); + + } else if (!keyword.CompareTo("barrierfactorparameter")) { + + // Value of parameter "a" in denominator of centrifugal barrier factor, gamma + this->storeBarrierFactorParameter(theLine, a); + + } else if (!keyword.CompareTo("radii")) { + + // Values of characteristic radius + this->storeRadii(theLine); + } else { // Usually Adler-zero constants TString parString(theLine[1].c_str()); this->storeParameter(keyword, parString); } } sAConst_ = 0.5*sA_.unblindValue()*LauConstants::mPiSq; // Symmetrise scattering parameters if enabled if (scattSymmetry_ == kTRUE) { for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { for (Int_t jChannel = iChannel; jChannel < nChannels_; jChannel++) { LauParameter fPar = fScattering_[iChannel][jChannel]; fScattering_[jChannel][iChannel] = LauParameter(fPar); } } } + // Now that radii and barrier-factor-denominator parameters have been set, cache the value of "a/(R*R)" + for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { + gamAInvRadSq_[iChannel] = a[iChannel]/(radii_[iChannel]*radii_[iChannel]); + } + // All required parameters have been set parametersSet_ = kTRUE; cout<<"Finished initialising K-matrix propagator "< >. // Set their sizes using the number of poles and channels defined in the constructor gCouplings_.clear(); gCouplings_.resize(nPoles_); for (Int_t iPole = 0; iPole < nPoles_; iPole++) { gCouplings_[iPole].resize(nChannels_); } fScattering_.clear(); fScattering_.resize(nChannels_); for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { fScattering_[iChannel].resize(nChannels_); } // Clear other vectors phaseSpaceTypes_.clear(); phaseSpaceTypes_.resize(nChannels_); mSqPoles_.clear(); mSqPoles_.resize(nPoles_); + haveCalled_storeBarrierFactorParameter = kFALSE; } -void LauKMatrixPropagator::storeChannels(const std::vector& theLine) +void LauKMatrixPropagator::storeChannels(const std::vector& theLine) { // Get the list of channel indices to specify what phase space factors should be used // e.g. pipi, Kpi, eta eta', 4pi etc.. // Check that the line has nChannels_+1 strings Int_t nTypes = static_cast(theLine.size()) - 1; if (nTypes != nChannels_) { cerr<<"Error in LauKMatrixPropagator::storeChannels. The input file defines " - <checkPhaseSpaceType(phaseSpaceInt); if (checkChannel == kTRUE) { cout<<"Adding phase space channel index "<(phaseSpaceInt); } else { cerr<<"Phase space channel index "<(LauKMatrixPropagator::KMatrixChannels::TotChannels)-1<& theLine) { // Store the pole mass and its coupling constants for each channel. // Each line will contain: Pole poleNumber poleMass poleCouplingsPerChannel // Check that the line has nChannels_ + 3 strings Int_t nWords = static_cast(theLine.size()); Int_t nExpect = nChannels_ + 3; if (nWords == nExpect) { Int_t poleIndex = std::atoi(theLine[1].c_str()) - 1; if (poleIndex >= 0 && poleIndex < nPoles_) { Double_t poleMass = std::atof(theLine[2].c_str()); Double_t poleMassSq = poleMass*poleMass; LauParameter mPoleParam(Form("KM_%s_poleMassSq_%i",name_.Data(),poleIndex),poleMassSq); mSqPoles_[poleIndex] = mPoleParam; cout<<"Added bare pole mass "<& theLine) { // Store the scattering constants (along one of the channel rows). // Each line will contain: Scatt ScattIndex ScattConstantsPerChannel // Check that the line has nChannels_ + 2 strings Int_t nWords = static_cast(theLine.size()); Int_t nExpect = nChannels_ + 2; if (nWords == nExpect) { Int_t scattIndex = std::atoi(theLine[1].c_str()) - 1; if (scattIndex >= 0 && scattIndex < nChannels_) { for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { Double_t scattConst = std::atof(theLine[iChannel+2].c_str()); - LauParameter scattParam(Form("KM_%s_scattConst_%i_%i",name_.Data(),scattIndex,iChannel),scattConst); + LauParameter scattParam(Form("KM_%s_fScatteringConst_%i_%i",name_.Data(),scattIndex,iChannel),scattConst); fScattering_[scattIndex][iChannel] = scattParam; cout<<"Added scattering parameter f("<& theLine, std::vector& a) +{ + + // Store the orbital angular momentum for each channel + // Each line will contain: angularmomentum OrbitalAngularMomentumPerChannel + + // Check that the line has nChannels_ + 1 strings + Int_t nWords = static_cast(theLine.size()); + Int_t nExpect = nChannels_ + 1; + + if (nWords == nExpect) { + + for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { + + Int_t angularMomentum = std::atoi(theLine[iChannel+1].c_str()); + L_[iChannel] = angularMomentum; + + cout<<"Defined K-matrix orbital angular momentum "<Exit(EXIT_FAILURE); + } + } + } + +} + +void LauKMatrixPropagator::storeRadii(const std::vector& theLine) +{ + + // Store the characteristic radii (measured in GeV^{-1}) + // Each line will contain: Radii RadiusConstantsPerChannel + + // Check that the line has nChannels_ + 1 strings + Int_t nWords = static_cast(theLine.size()); + Int_t nExpect = nChannels_ + 1; + + if (nWords == nExpect) { + + for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { + + Double_t radiusConst = std::atof(theLine[iChannel+1].c_str()); + radii_[iChannel] = radiusConst; + + cout<<"Added K-matrix radius "<& theLine, std::vector& a) +{ + + // Store the parameter of the barrier factor + // Each line will contain: barrierfactorparameter ParameterValuePerchannel + // Check that the line has nChannels_ + 1 strings + Int_t nWords = static_cast(theLine.size()); + Int_t nExpect = nChannels_ + 1; + + if (nWords == nExpect) { + + for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { + + Double_t parameterValue = std::atof(theLine[iChannel+1].c_str()); + a[iChannel] = parameterValue; + + cout<<"Added K-matrix barrier factor parameter value "<updateScattSVPTerm(s); // Now loop over iChannel, jChannel to calculate Kij = Kji. for (iChannel = 0; iChannel < nChannels_; iChannel++) { // Scattering matrix is real and symmetric. Start j loop from i. for (jChannel = iChannel; jChannel < nChannels_; jChannel++) { Double_t Kij(0.0); // Calculate pole mass summation term for (iPole = 0; iPole < nPoles_; iPole++) { Double_t g_i = this->getCouplingConstant(iPole, iChannel); Double_t g_j = this->getCouplingConstant(iPole, jChannel); Kij += poleDenomVect_[iPole]*g_i*g_j; if (verbose_) {cout<<"1: Kij for i = "<getScatteringConstant(iChannel, jChannel); Kij += fij*scattSVP_; Kij *= adlerZeroFactor_; if (verbose_) {cout<<"2: Kij for i = "< 1.0e-6) {invPoleTerm = 1.0/poleTerm;} poleDenomVect_.push_back(invPoleTerm); } - } -Double_t LauKMatrixPropagator::getPoleDenomTerm(Int_t poleIndex) const +Double_t LauKMatrixPropagator::getPoleDenomTerm(const Int_t poleIndex) const { if (parametersSet_ == kFALSE) {return 0.0;} Double_t poleDenom(0.0); poleDenom = poleDenomVect_[poleIndex]; return poleDenom; } -LauParameter& LauKMatrixPropagator::getPoleMassSqParameter(Int_t poleIndex) +LauParameter& LauKMatrixPropagator::getPoleMassSqParameter(const Int_t poleIndex) { if ( (parametersSet_ == kFALSE) || (poleIndex < 0 || poleIndex >= nPoles_) ) { std::cerr << "ERROR from LauKMatrixPropagator::getPoleMassSqParameter(). Invalid pole." << std::endl; gSystem->Exit(EXIT_FAILURE); } return mSqPoles_[poleIndex]; } -Double_t LauKMatrixPropagator::getCouplingConstant(Int_t poleIndex, Int_t channelIndex) const +Double_t LauKMatrixPropagator::getCouplingConstant(const Int_t poleIndex, const Int_t channelIndex) const { if (parametersSet_ == kFALSE) {return 0.0;} if (poleIndex < 0 || poleIndex >= nPoles_) {return 0.0;} if (channelIndex < 0 || channelIndex >= nChannels_) {return 0.0;} Double_t couplingConst = gCouplings_[poleIndex][channelIndex].unblindValue(); return couplingConst; } -LauParameter& LauKMatrixPropagator::getCouplingParameter(Int_t poleIndex, Int_t channelIndex) +LauParameter& LauKMatrixPropagator::getCouplingParameter(const Int_t poleIndex, const Int_t channelIndex) { if ( (parametersSet_ == kFALSE) || (poleIndex < 0 || poleIndex >= nPoles_) || (channelIndex < 0 || channelIndex >= nChannels_) ) { std::cerr << "ERROR from LauKMatrixPropagator::getCouplingParameter(). Invalid coupling." << std::endl; gSystem->Exit(EXIT_FAILURE); } //std::cout << "Minvalue + range for " << poleIndex << ", " << channelIndex << ": " << gCouplings_[poleIndex][channelIndex].minValue() << " => + " << gCouplings_[poleIndex][channelIndex].range() << // " and init value: " << gCouplings_[poleIndex][channelIndex].initValue() << std::endl; return gCouplings_[poleIndex][channelIndex]; } -Double_t LauKMatrixPropagator::getScatteringConstant(Int_t channel1Index, Int_t channel2Index) const +Double_t LauKMatrixPropagator::getScatteringConstant(const Int_t channel1Index, const Int_t channel2Index) const { if (parametersSet_ == kFALSE) {return 0.0;} if (channel1Index < 0 || channel1Index >= nChannels_) {return 0.0;} if (channel2Index < 0 || channel2Index >= nChannels_) {return 0.0;} Double_t scatteringConst = fScattering_[channel1Index][channel2Index].unblindValue(); return scatteringConst; } -LauParameter& LauKMatrixPropagator::getScatteringParameter(Int_t channel1Index, Int_t channel2Index) +LauParameter& LauKMatrixPropagator::getScatteringParameter(const Int_t channel1Index, const Int_t channel2Index) { if ( (parametersSet_ == kFALSE) || (channel1Index < 0 || channel1Index >= nChannels_) || (channel2Index < 0 || channel2Index >= nChannels_) ) { std::cerr << "ERROR from LauKMatrixPropagator::getScatteringParameter(). Invalid chanel index." << std::endl; gSystem->Exit(EXIT_FAILURE); } return fScattering_[channel1Index][channel2Index]; } -Double_t LauKMatrixPropagator::calcSVPTerm(Double_t s, Double_t s0) const +Double_t LauKMatrixPropagator::calcSVPTerm(const Double_t s, const Double_t s0) const { if (parametersSet_ == kFALSE) {return 0.0;} // Calculate the "slowly-varying part" (SVP) Double_t result(0.0); Double_t deltaS = s - s0; if (TMath::Abs(deltaS) > 1.0e-6) { result = (mSq0_.unblindValue() - s0)/deltaS; - } + } return result; } -void LauKMatrixPropagator::updateScattSVPTerm(Double_t s) +void LauKMatrixPropagator::updateScattSVPTerm(const Double_t s) { // Update the scattering "slowly-varying part" (SVP) Double_t s0Scatt = s0Scatt_.unblindValue(); scattSVP_ = this->calcSVPTerm(s, s0Scatt); } -void LauKMatrixPropagator::updateProdSVPTerm(Double_t s) +void LauKMatrixPropagator::updateProdSVPTerm(const Double_t s) { // Update the production "slowly-varying part" (SVP) Double_t s0Prod = s0Prod_.unblindValue(); prodSVP_ = this->calcSVPTerm(s, s0Prod); } -void LauKMatrixPropagator::updateAdlerZeroFactor(Double_t s) +void LauKMatrixPropagator::updateAdlerZeroFactor(const Double_t s) { // Calculate the multiplicative factor containing various Adler zero // constants. adlerZeroFactor_ = 0.0; Double_t sA0Val = sA0_.unblindValue(); Double_t deltaS = s - sA0Val; if (TMath::Abs(deltaS) > 1e-6) { adlerZeroFactor_ = (s - sAConst_)*(1.0 - sA0Val)/deltaS; - } + } + +} + +void LauKMatrixPropagator::calcGammaMatrix(const Double_t s) +{ + // Calculate the gamma angular momentum barrier matrix + // for the given invariant mass squared quantity, s. + + // Initialise all entries to zero + GammaMatrix_.Zero(); + + Double_t gamma(0.0); + + for (Int_t iChannel (0); iChannel < nChannels_; ++iChannel) { + + LauKMatrixPropagator::KMatrixChannels phaseSpaceIndex = phaseSpaceTypes_[iChannel]; + + if ( L_[iChannel] != 0 ) { + gamma = this->calcGamma(iChannel,s,phaseSpaceIndex); + } else { + gamma = 1.0; // S-wave + } + + if (verbose_) { + cout<<"GammaMatrix("<Exit(EXIT_FAILURE); + } + return rho; +} - if (verbose_) { - cout<<"ReRhoMatrix("< 4pi state). - // The normalisation term rho_0 is found by ensuring that the phase space integral - // at s = 1 is equal to sqrt(1.0 - 16*mpiSq/s). Note that the exponent for this - // factor in hep-ph/0204328 is wrong; it should be 0.5, i.e. sqrt, not n = 1 to 5. - // Plotting the value of this double integral as a function of s can then be fitted - // to a 6th-order polynomial (for s < 1), which is the result used below + // parameterisation that approximates the multi-body phase space double integral + // defined in Eq 4 of the A&S paper hep-ph/0204328. This form agrees with the + // BaBar model (another 6th order polynomial from s^4 down to 1/s^2), but avoids the + // exponential increase at small values of s (~< 0.1) arising from 1/s and 1/s^2. + // Eq 4 is evaluated for each value of s by assuming incremental steps of 1e-3 GeV^2 + // for s1 and s2, the invariant energy squared of each of the di-pion states, + // with the integration limits of s1 = (2*mpi)^2 to (sqrt(s) - 2*mpi)^2 and + // s2 = (2*mpi)^2 to (sqrt(s) - sqrt(s1))^2. The mass M of the rho is taken to be + // 0.775 GeV and the energy-dependent width of the 4pi system + // Gamma(s) = gamma_0*rho1^3(s), where rho1 = sqrt(1.0 - 4*mpiSq/s) and gamma_0 is + // the "width" of the 4pi state at s = 1, which is taken to be 0.3 GeV + // (~75% of the total width from PDG estimates of the f0(1370) -> 4pi state). + // The normalisation term rho_0 is found by ensuring that the phase space integral + // at s = 1 is equal to sqrt(1.0 - 16*mpiSq/s). Note that the exponent for this + // factor in hep-ph/0204328 is wrong; it should be 0.5, i.e. sqrt, not n = 1 to 5. + // Plotting the value of this double integral as a function of s can then be fitted + // to a 6th-order polynomial (for s < 1), which is the result used below LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} if (s <= 1.0) { - Double_t rhoTerm = ((1.07885*s + 0.13655)*s - 0.29744)*s - 0.20840; - rhoTerm = ((rhoTerm*s + 0.13851)*s - 0.01933)*s + 0.00051; + Double_t rhoTerm = ((1.07885*s + 0.13655)*s - 0.29744)*s - 0.20840; + rhoTerm = ((rhoTerm*s + 0.13851)*s - 0.01933)*s + 0.00051; // For some values of s (below 2*mpi), this term is a very small // negative number. Check for this and set the rho term to zero. if (rhoTerm < 0.0) {rhoTerm = 0.0;} rho.setRealPart( rhoTerm ); } else { rho.setRealPart( TMath::Sqrt(1.0 - (fourPiFactor1_/s)) ); } return rho; } -LauComplex LauKMatrixPropagator::calcEtaEtaRho(Double_t s) const +LauComplex LauKMatrixPropagator::calcEtaEtaRho(const Double_t s) const { // Calculate the eta-eta phase space factor LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} Double_t sqrtTerm = (-m2EtaSq_/s) + 1.0; if (sqrtTerm < 0.0) { rho.setImagPart( TMath::Sqrt(-sqrtTerm) ); } else { rho.setRealPart( TMath::Sqrt(sqrtTerm) ); } return rho; } -LauComplex LauKMatrixPropagator::calcEtaEtaPRho(Double_t s) const +LauComplex LauKMatrixPropagator::calcEtaEtaPRho(const Double_t s) const { // Calculate the eta-eta' phase space factor. Note that the - // mass difference term m_eta - m_eta' is not included, - // since this corresponds to a "t or u-channel crossing", - // which means that we cannot simply analytically continue - // this part of the phase space factor below threshold, which - // we can do for s-channel contributions. This is actually an - // unsolved problem, e.g. see Guo et al 1409.8652, and - // Danilkin et al 1409.7708. Anisovich and Sarantsev in - // hep-ph/0204328 "solve" this issue by setting the mass - // difference term to unity, which is what we do here... + // mass difference term m_eta - m_eta' is not included, + // since this corresponds to a "t or u-channel crossing", + // which means that we cannot simply analytically continue + // this part of the phase space factor below threshold, which + // we can do for s-channel contributions. This is actually an + // unsolved problem, e.g. see Guo et al 1409.8652, and + // Danilkin et al 1409.7708. Anisovich and Sarantsev in + // hep-ph/0204328 "solve" this issue by setting the mass + // difference term to unity, which is what we do here... LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} Double_t sqrtTerm = (-mEtaEtaPSumSq_/s) + 1.0; if (sqrtTerm < 0.0) { rho.setImagPart( TMath::Sqrt(-sqrtTerm) ); } else { - rho.setRealPart( TMath::Sqrt(sqrtTerm) ); + rho.setRealPart( TMath::Sqrt(sqrtTerm) ); } return rho; } -LauComplex LauKMatrixPropagator::calcKPiRho(Double_t s) const +LauComplex LauKMatrixPropagator::calcKPiRho(const Double_t s) const { // Calculate the K-pi phase space factor LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} Double_t sqrtTerm1 = (-mKpiSumSq_/s) + 1.0; Double_t sqrtTerm2 = (-mKpiDiffSq_/s) + 1.0; Double_t sqrtTerm = sqrtTerm1*sqrtTerm2; if (sqrtTerm < 0.0) { rho.setImagPart( TMath::Sqrt(-sqrtTerm) ); } else { rho.setRealPart( TMath::Sqrt(sqrtTerm) ); } return rho; } -LauComplex LauKMatrixPropagator::calcKEtaPRho(Double_t s) const +LauComplex LauKMatrixPropagator::calcKEtaPRho(const Double_t s) const { // Calculate the K-eta' phase space factor LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} Double_t sqrtTerm1 = (-mKEtaPSumSq_/s) + 1.0; Double_t sqrtTerm2 = (-mKEtaPDiffSq_/s) + 1.0; Double_t sqrtTerm = sqrtTerm1*sqrtTerm2; if (sqrtTerm < 0.0) { rho.setImagPart( TMath::Sqrt(-sqrtTerm) ); } else { rho.setRealPart( TMath::Sqrt(sqrtTerm) ); } return rho; } -LauComplex LauKMatrixPropagator::calcKThreePiRho(Double_t s) const +LauComplex LauKMatrixPropagator::calcKThreePiRho(const Double_t s) const { // Calculate the Kpipipi + multimeson phase space factor. // Use the simplest definition in hep-ph/9705401 (Eq 14), which is the form // used for the rest of that paper (thankfully, the amplitude does not depend // significantly on the form used for the K3pi phase space factor). LauComplex rho(0.0, 0.0); if (TMath::Abs(s) < 1e-10) {return rho;} if (s < 1.44) { Double_t powerTerm = (-mK3piDiffSq_/s) + 1.0; if (powerTerm < 0.0) { rho.setImagPart( k3piFactor_*TMath::Power(-powerTerm, 2.5) ); } else { rho.setRealPart( k3piFactor_*TMath::Power(powerTerm, 2.5) ); } } else { rho.setRealPart( 1.0 ); } return rho; } -Bool_t LauKMatrixPropagator::checkPhaseSpaceType(Int_t phaseSpaceInt) const +Bool_t LauKMatrixPropagator::checkPhaseSpaceType(const Int_t phaseSpaceInt) const { Bool_t passed(kFALSE); - if (phaseSpaceInt >= 1 && phaseSpaceInt < LauKMatrixPropagator::TotChannels) { + if (phaseSpaceInt >= 1 && phaseSpaceInt < static_cast(LauKMatrixPropagator::KMatrixChannels::TotChannels)) { passed = kTRUE; } return passed; } -LauComplex LauKMatrixPropagator::getTransitionAmp(Double_t s, Int_t channel) +LauComplex LauKMatrixPropagator::getTransitionAmp(const Double_t s, const Int_t channel) { - // Get the complex (unitary) transition amplitude T for the given channel + // Get the complex (unitary) transition amplitude T for the given channel LauComplex TAmp(0.0, 0.0); - channel -= 1; - if (channel < 0 || channel >= nChannels_) {return TAmp;} + if (channel <= 0 || channel > nChannels_) {return TAmp;} - this->getTMatrix(s); + this->getTMatrix(s); - TAmp.setRealPart(ReTMatrix_[index_][channel]); - TAmp.setImagPart(ImTMatrix_[index_][channel]); + TAmp.setRealPart(ReTMatrix_[index_][channel-1]); + TAmp.setImagPart(ImTMatrix_[index_][channel-1]); return TAmp; } -LauComplex LauKMatrixPropagator::getPhaseSpaceTerm(Double_t s, Int_t channel) +LauComplex LauKMatrixPropagator::getPhaseSpaceTerm(const Double_t s, const Int_t channel) { - // Get the complex (unitary) transition amplitude T for the given channel + // Get the complex (unitary) transition amplitude T for the given channel LauComplex rho(0.0, 0.0); - channel -= 1; - if (channel < 0 || channel >= nChannels_) {return rho;} + if (channel <= 0 || channel > nChannels_) {return rho;} // If s has changed from the previous value, recalculate rho if (TMath::Abs(s - previousS_) > 1e-6*s) { - this->calcRhoMatrix(s); + this->calcRhoMatrix(s); } - rho.setRealPart(ReRhoMatrix_[channel][channel]); - rho.setImagPart(ImRhoMatrix_[channel][channel]); + rho.setRealPart(ReRhoMatrix_[channel][channel-1]); + rho.setImagPart(ImRhoMatrix_[channel][channel-1]); return rho; } void LauKMatrixPropagator::getTMatrix(const LauKinematics* kinematics) { - // Find the unitary T matrix, where T = [sqrt(rho)]^{*} T_hat sqrt(rho), - // and T_hat = (I - i K rho)^-1 * K is the Lorentz-invariant T matrix, - // which has phase-space factors included (rho). This function is not - // needed to calculate the K-matrix amplitudes, but allows us - // to check the variation of T as a function of s (kinematics) + // Find the unitary T matrix, where T = [sqrt(rho)]^{*} T_hat sqrt(rho), + // and T_hat = (I - i K rho)^-1 * K is the Lorentz-invariant T matrix, + // which has phase-space factors included (rho). This function is not + // needed to calculate the K-matrix amplitudes, but allows us + // to check the variation of T as a function of s (kinematics) if (!kinematics) {return;} // Get the invariant mass squared (s) from the kinematics object. // Use the resPairAmpInt to find which mass-squared combination to use. Double_t s(0.0); if (resPairAmpInt_ == 1) { s = kinematics->getm23Sq(); } else if (resPairAmpInt_ == 2) { s = kinematics->getm13Sq(); } else if (resPairAmpInt_ == 3) { s = kinematics->getm12Sq(); } this->getTMatrix(s); } -void LauKMatrixPropagator::getTMatrix(Double_t s) +void LauKMatrixPropagator::getTMatrix(const Double_t s) { - // Find the unitary transition T matrix, where - // T = [sqrt(rho)]^{*} T_hat sqrt(rho), and - // T_hat = (I - i K rho)^-1 * K is the Lorentz-invariant T matrix, - // which has phase-space factors included (rho). Note that the first - // sqrt of the rho matrix is complex conjugated. + // Find the unitary transition T matrix, where + // T = [sqrt(rho)]^{*} T_hat sqrt(rho), and + // T_hat = (I - i K rho)^-1 * K is the Lorentz-invariant T matrix, + // which has phase-space factors included (rho). Note that the first + // sqrt of the rho matrix is complex conjugated. - // This function is not needed to calculate the K-matrix amplitudes, but - // allows us to check the variation of T as a function of s (kinematics) + // This function is not needed to calculate the K-matrix amplitudes, but + // allows us to check the variation of T as a function of s (kinematics) - // Initialse the real and imaginary parts of the T matrix to zero - ReTMatrix_.Zero(); ImTMatrix_.Zero(); + // Initialse the real and imaginary parts of the T matrix to zero + ReTMatrix_.Zero(); ImTMatrix_.Zero(); - if (parametersSet_ == kFALSE) {return;} + if (parametersSet_ == kFALSE) {return;} - // Update K, rho and the propagator (I - i K rho)^-1 - this->updatePropagator(s); + // Update K, rho and the propagator (I - i K rho)^-1 + this->updatePropagator(s); // Find the real and imaginary T_hat matrices TMatrixD THatReal = realProp_*ScattKMatrix_; TMatrixD THatImag(zeroMatrix_); THatImag -= negImagProp_*ScattKMatrix_; // Find the square-root of the phase space matrix this->getSqrtRhoMatrix(); // Let sqrt(rho) = A + iB and T_hat = C + iD // => T = A(CA-DB) + B(DA+CB) + i[A(DA+CB) + B(DB-CA)] TMatrixD CA(THatReal); CA *= ReSqrtRhoMatrix_; TMatrixD DA(THatImag); DA *= ReSqrtRhoMatrix_; TMatrixD CB(THatReal); CB *= ImSqrtRhoMatrix_; TMatrixD DB(THatImag); DB *= ImSqrtRhoMatrix_; TMatrixD CAmDB(CA); CAmDB -= DB; TMatrixD DApCB(DA); DApCB += CB; TMatrixD DBmCA(DB); DBmCA -= CA; // Find the real and imaginary parts of the transition matrix T ReTMatrix_ = ReSqrtRhoMatrix_*CAmDB + ImSqrtRhoMatrix_*DApCB; ImTMatrix_ = ReSqrtRhoMatrix_*DApCB + ImSqrtRhoMatrix_*DBmCA; } void LauKMatrixPropagator::getSqrtRhoMatrix() { - // Find the square root of the (current) phase space matrix so that - // we can find T = [sqrt(rho)}^{*} T_hat sqrt(rho), where T_hat is the - // Lorentz-invariant T matrix = (I - i K rho)^-1 * K; note that the first - // sqrt of rho matrix is complex conjugated + // Find the square root of the (current) phase space matrix so that + // we can find T = [sqrt(rho)}^{*} T_hat sqrt(rho), where T_hat is the + // Lorentz-invariant T matrix = (I - i K rho)^-1 * K; note that the first + // sqrt of rho matrix is complex conjugated - // If rho = rho_i + i rho_r = a + i b, then sqrt(rho) = c + i d, where - // c = sqrt(0.5*(r+a)) and d = sqrt(0.5(r-a)), where r = sqrt(a^2 + b^2). - // Since rho is diagonal, then the square root of rho will also be diagonal, - // with its real and imaginary matrix elements equal to c and d, respectively + // If rho = rho_i + i rho_r = a + i b, then sqrt(rho) = c + i d, where + // c = sqrt(0.5*(r+a)) and d = sqrt(0.5(r-a)), where r = sqrt(a^2 + b^2). + // Since rho is diagonal, then the square root of rho will also be diagonal, + // with its real and imaginary matrix elements equal to c and d, respectively - // Initialise the real and imaginary parts of the square root of - // the rho matrix to zero - ReSqrtRhoMatrix_.Zero(); ImSqrtRhoMatrix_.Zero(); + // Initialise the real and imaginary parts of the square root of + // the rho matrix to zero + ReSqrtRhoMatrix_.Zero(); ImSqrtRhoMatrix_.Zero(); - for (Int_t iChannel (0); iChannel < nChannels_; ++iChannel) { + for (Int_t iChannel (0); iChannel < nChannels_; ++iChannel) { - Double_t realRho = ReRhoMatrix_[iChannel][iChannel]; - Double_t imagRho = ImRhoMatrix_[iChannel][iChannel]; + Double_t realRho = ReRhoMatrix_[iChannel][iChannel]; + Double_t imagRho = ImRhoMatrix_[iChannel][iChannel]; Double_t rhoMag = sqrt(realRho*realRho + imagRho*imagRho); - Double_t rhoSum = rhoMag + realRho; - Double_t rhoDiff = rhoMag - realRho; + Double_t rhoSum = rhoMag + realRho; + Double_t rhoDiff = rhoMag - realRho; - Double_t reSqrtRho(0.0), imSqrtRho(0.0); - if (rhoSum > 0.0) {reSqrtRho = sqrt(0.5*rhoSum);} + Double_t reSqrtRho(0.0), imSqrtRho(0.0); + if (rhoSum > 0.0) {reSqrtRho = sqrt(0.5*rhoSum);} if (rhoDiff > 0.0) {imSqrtRho = sqrt(0.5*rhoDiff);} - ReSqrtRhoMatrix_[iChannel][iChannel] = reSqrtRho; - ImSqrtRhoMatrix_[iChannel][iChannel] = imSqrtRho; - - } + ReSqrtRhoMatrix_[iChannel][iChannel] = reSqrtRho; + ImSqrtRhoMatrix_[iChannel][iChannel] = imSqrtRho; + } } -LauComplex LauKMatrixPropagator::getTHat(Double_t s, Int_t channel) { +LauComplex LauKMatrixPropagator::getTHat(const Double_t s, const Int_t channel) { + + LauComplex THat(0.0, 0.0); - LauComplex THat(0.0, 0.0); - channel -= 1; - if (channel < 0 || channel >= nChannels_) {return THat;} + if (channel <= 0 || channel > nChannels_) {return THat;} this->updatePropagator(s); // Find the real and imaginary T_hat matrices TMatrixD THatReal = realProp_*ScattKMatrix_; TMatrixD THatImag(zeroMatrix_); THatImag -= negImagProp_*ScattKMatrix_; // Return the specific THat component - THat.setRealPart(THatReal[index_][channel]); - THat.setImagPart(THatImag[index_][channel]); + THat.setRealPart(THatReal[index_][channel-1]); + THat.setImagPart(THatImag[index_][channel-1]); return THat; } diff --git a/src/LauResonanceMaker.cc b/src/LauResonanceMaker.cc index bbf5cbd..b854f39 100644 --- a/src/LauResonanceMaker.cc +++ b/src/LauResonanceMaker.cc @@ -1,996 +1,1019 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauResonanceMaker.cc \brief File containing implementation of LauResonanceMaker class. */ #include #include "LauAbsResonance.hh" #include "LauBelleNR.hh" #include "LauBelleSymNR.hh" #include "LauBreitWignerRes.hh" #include "LauDabbaRes.hh" #include "LauDaughters.hh" #include "LauEFKLLMRes.hh" #include "LauFlatteRes.hh" #include "LauFlatNR.hh" #include "LauGaussIncohRes.hh" #include "LauGounarisSakuraiRes.hh" #include "LauKappaRes.hh" #include "LauLASSRes.hh" #include "LauLASSBWRes.hh" #include "LauLASSNRRes.hh" #include "LauModIndPartWaveMagPhase.hh" #include "LauModIndPartWaveRealImag.hh" #include "LauNRAmplitude.hh" #include "LauRescatteringRes.hh" #include "LauRescattering2Res.hh" #include "LauPolNR.hh" #include "LauPoleRes.hh" #include "LauPolarFormFactorNR.hh" #include "LauPolarFormFactorSymNR.hh" #include "LauRelBreitWignerRes.hh" #include "LauResonanceInfo.hh" #include "LauResonanceMaker.hh" #include "LauRhoOmegaMix.hh" #include "LauSigmaRes.hh" ClassImp(LauResonanceMaker); LauResonanceMaker* LauResonanceMaker::resonanceMaker_ = 0; LauResonanceMaker::LauResonanceMaker() : nResDefMax_(0), bwBarrierType_(LauBlattWeisskopfFactor::BWPrimeBarrier), bwRestFrame_(LauBlattWeisskopfFactor::ResonanceFrame), spinFormalism_(LauAbsResonance::Zemach_P), summaryPrinted_(kFALSE) { this->createResonanceVector(); this->setDefaultBWRadius( LauBlattWeisskopfFactor::Parent, 4.0 ); } LauResonanceMaker::~LauResonanceMaker() { for ( std::vector::iterator iter = bwIndepFactors_.begin(); iter != bwIndepFactors_.end(); ++iter ) { delete *iter; } bwIndepFactors_.clear(); for ( BWFactorCategoryMap::iterator iter = bwFactors_.begin(); iter != bwFactors_.end(); ++iter ) { delete iter->second.bwFactor_; } bwFactors_.clear(); } LauResonanceMaker& LauResonanceMaker::get() { if ( resonanceMaker_ == 0 ) { resonanceMaker_ = new LauResonanceMaker(); } return *resonanceMaker_; } void LauResonanceMaker::createResonanceVector() { // Function to create all possible resonances that this class supports. // Also add in the sigma and kappa - but a special paramterisation is used // instead of the PDG "pole mass and width" values. std::cout << "INFO in LauResonanceMaker::createResonanceVector : Setting up possible resonance states..." << std::endl; LauResonanceInfo* neutral(0); LauResonanceInfo* positve(0); LauResonanceInfo* negatve(0); // Define the resonance names and store them in the array resInfo_.clear(); resInfo_.reserve(100); // rho resonances name, mass, width, spin, charge, default BW category, BW radius parameter (defaults to 4.0) // rho(770) neutral = new LauResonanceInfo("rho0(770)", 0.77526, 0.1478, 1, 0, LauBlattWeisskopfFactor::Light, 5.3); positve = new LauResonanceInfo("rho+(770)", 0.77511, 0.1491, 1, 1, LauBlattWeisskopfFactor::Light, 5.3); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // The following two lines of code are placed here in order to allow the following, rather niche, scenario: // The LauRhoOmegaMix code permits (through the use of the optional independentPar argument of LauResonanceInfo::addExtraParameter) the magnitude and phase of the rho/omega mixing to potentially differ between the decay of the parent particle to rho0 X and the parent antiparticle to rho0 Xbar. // This can be acheived by using the rho0(770) record in one case and the rho0(770)_COPY record in the other. neutral = neutral->createSharedParameterRecord("rho0(770)_COPY"); resInfo_.push_back( neutral ); // rho(1450) neutral = new LauResonanceInfo("rho0(1450)", 1.465, 0.400, 1, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("rho+(1450)", 1.465, 0.400, 1, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // rho_3(1690) neutral = new LauResonanceInfo("rho0_3(1690)", 1.686, 0.186, 3, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("rho+_3(1690)", 1.686, 0.186, 3, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // rho(1700) neutral = new LauResonanceInfo("rho0(1700)", 1.720, 0.250, 1, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("rho+(1700)", 1.720, 0.250, 1, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // rho(1900) neutral = new LauResonanceInfo("rho0(1900)", 1.909, 0.130, 1, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("rho+(1900)", 1.909, 0.130, 1, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // rho_3(1990) neutral = new LauResonanceInfo("rho0_3(1990)", 1.982, 0.188, 3, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("rho+_3(1990)", 1.982, 0.188, 3, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K* resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // K*(892) neutral = new LauResonanceInfo("K*0(892)", 0.89581, 0.0474, 1, 0, LauBlattWeisskopfFactor::Kstar, 3.0); positve = new LauResonanceInfo("K*+(892)", 0.89166, 0.0508, 1, 1, LauBlattWeisskopfFactor::Kstar, 3.0); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K*(1410) neutral = new LauResonanceInfo("K*0(1410)", 1.414, 0.232, 1, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("K*+(1410)", 1.414, 0.232, 1, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K*_0(1430) neutral = new LauResonanceInfo("K*0_0(1430)", 1.425, 0.270, 0, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("K*+_0(1430)", 1.425, 0.270, 0, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // LASS nonresonant model neutral = neutral->createSharedParameterRecord("LASSNR0"); positve = positve->createSharedParameterRecord("LASSNR+"); negatve = negatve->createSharedParameterRecord("LASSNR-"); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K*_2(1430) neutral = new LauResonanceInfo("K*0_2(1430)", 1.4324, 0.109, 2, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("K*+_2(1430)", 1.4256, 0.0985, 2, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K*(1680) neutral = new LauResonanceInfo("K*0(1680)", 1.717, 0.322, 1, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("K*+(1680)", 1.717, 0.322, 1, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // K*(1950) neutral = new LauResonanceInfo("K*0_0(1950)", 1.945, 0.201, 0, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("K*+_0(1950)", 1.945, 0.201, 0, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // phi resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // phi(1020) neutral = new LauResonanceInfo("phi(1020)", 1.019461, 0.004266, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // phi(1680) neutral = new LauResonanceInfo("phi(1680)", 1.680, 0.150, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // f_0(980) neutral = new LauResonanceInfo("f_0(980)", 0.990, 0.070, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1270) neutral = new LauResonanceInfo("f_2(1270)", 1.2751, 0.1851, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_0(1370) neutral = new LauResonanceInfo("f_0(1370)", 1.370, 0.350, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f'_0(1300), from Belle's Kspipi paper neutral = new LauResonanceInfo("f'_0(1300)", 1.449, 0.126, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1430) neutral = new LauResonanceInfo("f_2(1430)", 1.430, 0.150, 2, 0, LauBlattWeisskopfFactor::Light ); // PDG width in the range 13 - 150 resInfo_.push_back( neutral ); // f_0(1500) neutral = new LauResonanceInfo("f_0(1500)", 1.505, 0.109, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f'_2(1525) neutral = new LauResonanceInfo("f'_2(1525)", 1.525, 0.073, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1565) neutral = new LauResonanceInfo("f_2(1565)", 1.562, 0.134, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1640) neutral = new LauResonanceInfo("f_2(1640)", 1.639, 0.099, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_0(1710) neutral = new LauResonanceInfo("f_0(1710)", 1.722, 0.135, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1810) neutral = new LauResonanceInfo("f_2(1810)", 1.816, 0.197, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1910) neutral = new LauResonanceInfo("f_2(1910)", 1.903, 0.196, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(1950) neutral = new LauResonanceInfo("f_2(1950)", 1.944, 0.472, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_2(2010) neutral = new LauResonanceInfo("f_2(2010)", 2.011, 0.202, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_0(2020) neutral = new LauResonanceInfo("f_0(2020)", 1.992, 0.442, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_4(2050) neutral = new LauResonanceInfo("f_4(2050)", 2.018, 0.237, 4, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // f_0(2100) neutral = new LauResonanceInfo("f_0(2100)", 2.101, 0.224, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // omega resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // omega(782) neutral = new LauResonanceInfo("omega(782)", 0.78265, 0.00849, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // a resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // a_0(980) neutral = new LauResonanceInfo("a0_0(980)", 0.980, 0.092, 0, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("a+_0(980)", 0.980, 0.092, 0, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // a_0(1450) neutral = new LauResonanceInfo("a0_0(1450)", 1.474, 0.265, 0, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("a+_0(1450)", 1.474, 0.265, 0, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // a_2(1320) neutral = new LauResonanceInfo("a0_2(1320)", 1.3190, 0.1050, 2, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("a+_2(1320)", 1.3190, 0.1050, 2, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // charmonium resonances name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // chi_c0 neutral = new LauResonanceInfo("chi_c0", 3.41475, 0.0105, 0, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // chi_c1 neutral = new LauResonanceInfo("chi_c1", 3.51066, 0.00084, 0, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // chi_c2 neutral = new LauResonanceInfo("chi_c2", 3.55620, 0.00193, 2, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // psi(3770) neutral = new LauResonanceInfo("psi(3770)", 3.77313, 0.0272, 1, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // X(3872) neutral = new LauResonanceInfo("X(3872)", 3.87169, 0.0012, 1, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // chi_c2(2P) neutral = new LauResonanceInfo("chi_c2(2P)", 3.9272, 0.024, 2, 0, LauBlattWeisskopfFactor::Charmonium ); resInfo_.push_back( neutral ); // unknown scalars name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // sigma neutral = new LauResonanceInfo("sigma0", 0.475, 0.550, 0, 0, LauBlattWeisskopfFactor::Light ); positve = new LauResonanceInfo("sigma+", 0.475, 0.550, 0, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // kappa neutral = new LauResonanceInfo("kappa0", 0.682, 0.547, 0, 0, LauBlattWeisskopfFactor::Kstar ); positve = new LauResonanceInfo("kappa+", 0.682, 0.547, 0, 1, LauBlattWeisskopfFactor::Kstar ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // dabba neutral = new LauResonanceInfo("dabba0", 2.098, 0.520, 0, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("dabba+", 2.098, 0.520, 0, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // excited charm states name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // D* neutral = new LauResonanceInfo("D*0", 2.00696, 0.0021, 1, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D*+", 2.01026, 83.4e-6, 1, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D*_0 neutral = new LauResonanceInfo("D*0_0", 2.318, 0.267, 0, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D*+_0", 2.403, 0.283, 0, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D*_2 //AVERAGE--neutral = new LauResonanceInfo("D*0_2", 2.4618, 0.049, 2, 0 ); neutral = new LauResonanceInfo("D*0_2", 2.4626, 0.049, 2, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D*+_2", 2.4643, 0.037, 2, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D1(2420) neutral = new LauResonanceInfo("D0_1(2420)", 2.4214, 0.0274, 1, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D+_1(2420)", 2.4232, 0.025, 1, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D(2600) //OLD--neutral = new LauResonanceInfo("D0(2600)", 2.6087, 0.093, 0, 0 ); //OLD--positve = new LauResonanceInfo("D+(2600)", 2.6213, 0.093, 0, 1 ); neutral = new LauResonanceInfo("D0(2600)", 2.612, 0.093, 0, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D+(2600)", 2.612, 0.093, 0, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D(2760) //OLD-- neutral = new LauResonanceInfo("D0(2760)", 2.7633, 0.061, 1, 0 ); //OLD-- positve = new LauResonanceInfo("D+(2760)", 2.7697, 0.061, 1, 1 ); neutral = new LauResonanceInfo("D0(2760)", 2.761, 0.063, 1, 0, LauBlattWeisskopfFactor::Charm ); positve = new LauResonanceInfo("D+(2760)", 2.761, 0.063, 1, 1, LauBlattWeisskopfFactor::Charm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // D(2900) neutral = new LauResonanceInfo("D0(3000)", 3.0, 0.15, 0, 0, LauBlattWeisskopfFactor::Charm ); resInfo_.push_back( neutral ); // D(3400) neutral = new LauResonanceInfo("D0(3400)", 3.4, 0.15, 0, 0, LauBlattWeisskopfFactor::Charm ); resInfo_.push_back( neutral ); // excited strange charm name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // Ds* positve = new LauResonanceInfo("Ds*+", 2.1121, 0.0019, 1, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Ds0*(2317) positve = new LauResonanceInfo("Ds*+_0(2317)", 2.3177, 0.0038, 0, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Ds2*(2573) positve = new LauResonanceInfo("Ds*+_2(2573)", 2.5719, 0.017, 2, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Ds1*(2700) positve = new LauResonanceInfo("Ds*+_1(2700)", 2.709, 0.117, 1, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Ds1*(2860) positve = new LauResonanceInfo("Ds*+_1(2860)", 2.862, 0.180, 1, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Ds3*(2860) positve = new LauResonanceInfo("Ds*+_3(2860)", 2.862, 0.058, 3, 1, LauBlattWeisskopfFactor::StrangeCharm ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // excited bottom states name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // B* neutral = new LauResonanceInfo("B*0", 5.3252, 0.00, 1, 0, LauBlattWeisskopfFactor::Beauty, 6.0); positve = new LauResonanceInfo("B*+", 5.3252, 0.00, 1, 1, LauBlattWeisskopfFactor::Beauty, 6.0); negatve = positve->createChargeConjugate(); resInfo_.push_back( neutral ); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // excited strange bottom name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // Bs* neutral = new LauResonanceInfo("Bs*0", 5.4154, 0.00, 1, 0, LauBlattWeisskopfFactor::StrangeBeauty, 6.0); resInfo_.push_back( neutral ); // nonresonant models name, mass, width, spin, charge, BW category, BW radius parameter (defaults to 4.0) // Phase-space nonresonant model neutral = new LauResonanceInfo("NonReson", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // Theory-based nonresonant model neutral = new LauResonanceInfo("NRModel", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // Belle nonresonant models neutral = new LauResonanceInfo("BelleSymNR", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("BelleNR", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); positve = new LauResonanceInfo("BelleNR+", 0.0, 0.0, 0, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); neutral = new LauResonanceInfo("BelleNR_Swave", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); positve = new LauResonanceInfo("BelleNR_Swave+",0.0, 0.0, 0, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); neutral = new LauResonanceInfo("BelleNR_Pwave", 0.0, 0.0, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); positve = new LauResonanceInfo("BelleNR_Pwave+",0.0, 0.0, 1, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); neutral = new LauResonanceInfo("BelleNR_Dwave", 0.0, 0.0, 2, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); positve = new LauResonanceInfo("BelleNR_Dwave+",0.0, 0.0, 2, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); neutral = new LauResonanceInfo("BelleNR_Fwave", 0.0, 0.0, 3, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); positve = new LauResonanceInfo("BelleNR_Fwave+",0.0, 0.0, 3, 1, LauBlattWeisskopfFactor::Light ); negatve = positve->createChargeConjugate(); resInfo_.push_back( positve ); resInfo_.push_back( negatve ); // Taylor expansion nonresonant model neutral = new LauResonanceInfo("NRTaylor", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // Polynomial nonresonant models neutral = new LauResonanceInfo("PolNR_S0", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolNR_S1", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolNR_S2", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolNR_P0", 0.0, 0.0, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolNR_P1", 0.0, 0.0, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolNR_P2", 0.0, 0.0, 1, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // Fake resonances for S-Wave splines neutral = new LauResonanceInfo("Spline_S0", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("Spline_S0_Bar", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // Polar Form Factor nonresonant model neutral = new LauResonanceInfo("PolarFFSymNR", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); neutral = new LauResonanceInfo("PolarFFNR", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); // PiPi-KK Inelastic Scattering neutral = new LauResonanceInfo("Rescattering", 0.0, 0.0, 0, 0, LauBlattWeisskopfFactor::Light ); resInfo_.push_back( neutral ); nResDefMax_ = resInfo_.size(); } void LauResonanceMaker::setBWType(const LauBlattWeisskopfFactor::BarrierType bwType) { // Check whether any BW factors have been created and bail out if so if ( ! bwIndepFactors_.empty() ) { std::cerr << "ERROR in LauResonanceMaker::setBWType : some barrier factors have already been created - cannot change the barrier type now!" << std::endl; return; } for ( BWFactorCategoryMap::const_iterator iter = bwFactors_.begin(); iter != bwFactors_.end(); ++iter ) { if ( iter->second.bwFactor_ != 0 ) { std::cerr << "ERROR in LauResonanceMaker::setBWType : some barrier factors have already been created - cannot change the barrier type now!" << std::endl; return; } } bwBarrierType_ = bwType; } void LauResonanceMaker::setBWBachelorRestFrame(const LauBlattWeisskopfFactor::RestFrame restFrame) { // Check whether any BW factors have been created and bail out if so if ( ! bwIndepFactors_.empty() ) { std::cerr << "ERROR in LauResonanceMaker::setBWBachelorRestFrame : some barrier factors have already been created - cannot change the rest frame now!" << std::endl; return; } for ( BWFactorCategoryMap::const_iterator iter = bwFactors_.begin(); iter != bwFactors_.end(); ++iter ) { if ( iter->second.bwFactor_ != 0 ) { std::cerr << "ERROR in LauResonanceMaker::setBWBachelorRestFrame : some barrier factors have already been created - cannot change the rest frame now!" << std::endl; return; } } bwRestFrame_ = restFrame; } void LauResonanceMaker::setSpinFormalism(const LauAbsResonance::LauSpinType spinType) { if ( summaryPrinted_ ) { std::cerr << "ERROR in LauResonanceMaker::setSpinFormalism : cannot redefine the spin formalism after creating one or more resonances" << std::endl; return; } spinFormalism_ = spinType; } void LauResonanceMaker::setDefaultBWRadius(const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory, const Double_t bwRadius) { if ( bwCategory == LauBlattWeisskopfFactor::Default || bwCategory == LauBlattWeisskopfFactor::Indep ) { std::cerr << "WARNING in LauResonanceMaker::setDefaultBWRadius : cannot set radius values for Default or Indep categories" << std::endl; return; } // Check if we have an information object for this category BWFactorCategoryMap::iterator factor_iter = bwFactors_.find( bwCategory ); if ( factor_iter != bwFactors_.end() ) { // If so, we can set the value in the information object BlattWeisskopfCategoryInfo& categoryInfo = factor_iter->second; categoryInfo.defaultRadius_ = bwRadius; // Then we can check if a LauBlattWeisskopfFactor object has been created for this category LauBlattWeisskopfFactor* bwFactor = categoryInfo.bwFactor_; if ( bwFactor != 0 ) { // If it has then we can also set its radius value directly LauParameter* radius = bwFactor->getRadiusParameter(); radius->value(bwRadius); radius->initValue(bwRadius); radius->genValue(bwRadius); } } else { // If not then we just store the value to be used later BlattWeisskopfCategoryInfo& categoryInfo = bwFactors_[bwCategory]; categoryInfo.bwFactor_ = 0; categoryInfo.defaultRadius_ = bwRadius; categoryInfo.radiusFixed_ = kTRUE; } } void LauResonanceMaker::fixBWRadius(const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory, const Bool_t fixRadius) { if ( bwCategory == LauBlattWeisskopfFactor::Default || bwCategory == LauBlattWeisskopfFactor::Indep ) { std::cerr << "WARNING in LauResonanceMaker::fixBWRadius : cannot fix/float radius values for Default or Indep categories" << std::endl; return; } // Check if we have an information object for this category BWFactorCategoryMap::iterator factor_iter = bwFactors_.find( bwCategory ); if ( factor_iter != bwFactors_.end() ) { // If so, we can set the value in the information object BlattWeisskopfCategoryInfo& categoryInfo = factor_iter->second; categoryInfo.radiusFixed_ = fixRadius; // Then we can check if a LauBlattWeisskopfFactor object has been created for this category LauBlattWeisskopfFactor* bwFactor = categoryInfo.bwFactor_; if ( bwFactor != 0 ) { // If it has then we can also fix/float its radius value directly LauParameter* radius = bwFactor->getRadiusParameter(); radius->fixed(fixRadius); } } else { // If not then we just store the value to be used later BlattWeisskopfCategoryInfo& categoryInfo = bwFactors_[bwCategory]; categoryInfo.bwFactor_ = 0; categoryInfo.defaultRadius_ = -1.0; categoryInfo.radiusFixed_ = fixRadius; } } +LauBlattWeisskopfFactor* LauResonanceMaker::getParentBWFactor(Int_t resSpin, LauBlattWeisskopfFactor::BarrierType barrierType) +{ + LauBlattWeisskopfFactor* bwFactor(0); + + // Look up the category in the category information map + BWFactorCategoryMap::iterator factor_iter = bwFactors_.find( LauBlattWeisskopfFactor::Parent ); + + if ( factor_iter != bwFactors_.end() ) { + // If it exists, we can check if the factor object has been created + BlattWeisskopfCategoryInfo& categoryInfo = factor_iter->second; + + if ( categoryInfo.bwFactor_ != 0 ) { + // If so, simply clone it + bwFactor = categoryInfo.bwFactor_->createClone( resSpin, barrierType ); + } + } + + if ( bwFactor==0 ) { + std::cerr<<"ERROR in LauResonanceMaker::getParentBWFactor : No parent Blatt-Weisskopf factor found to be cloned for K-matrix."<getRadiusParameter()->value(); categoryInfo.radiusFixed_ = kTRUE; } else { // If it exists, we can check if the factor object has been created BlattWeisskopfCategoryInfo& categoryInfo = factor_iter->second; if ( categoryInfo.bwFactor_ != 0 ) { // If so, simply clone it const UInt_t resSpin = resInfo->getSpin(); - bwFactor = categoryInfo.bwFactor_->createClone( resSpin ); + bwFactor = categoryInfo.bwFactor_->createClone( resSpin, categoryInfo.bwFactor_->getBarrierType() ); } else { // Otherwise we need to create it, using the default value if it has been set if ( categoryInfo.defaultRadius_ >= 0.0 ) { bwFactor = new LauBlattWeisskopfFactor( *resInfo, categoryInfo.defaultRadius_, bwBarrierType_, bwRestFrame_, bwCategory ); } else { bwFactor = new LauBlattWeisskopfFactor( *resInfo, bwBarrierType_, bwRestFrame_, bwCategory ); } categoryInfo.bwFactor_ = bwFactor; // Set whether the radius should be fixed/floated LauParameter* radius = bwFactor->getRadiusParameter(); radius->fixed( categoryInfo.radiusFixed_ ); } } return bwFactor; } LauAbsResonance* LauResonanceMaker::getResonance(const LauDaughters* daughters, const TString& resName, const Int_t resPairAmpInt, const LauAbsResonance::LauResonanceModel resType, const LauBlattWeisskopfFactor::BlattWeisskopfCategory bwCategory) { // Routine to return the appropriate LauAbsResonance object given the resonance // name (resName), which daughter is the bachelor track (resPairAmpInt = 1,2 or 3), // and the resonance type ("BW" = Breit-Wigner, "Flatte" = Flatte distribution). // If this is the first resonance we are making, first print a summary of the formalism if ( ! summaryPrinted_ ) { std::cout << "INFO in LauResonanceMaker::getResonance : Freezing amplitude formalism:" << std::endl; switch ( spinFormalism_ ) { case LauAbsResonance::Zemach_P : std::cout << " : Spin factors use Zemach spin tensors, with bachelor momentum in resonance rest frame" << std::endl; break; case LauAbsResonance::Zemach_Pstar : std::cout << " : Spin factors use Zemach spin tensors, with bachelor momentum in parent rest frame" << std::endl; break; case LauAbsResonance::Covariant : std::cout << " : Spin factors use Covariant spin tensors" << std::endl; break; case LauAbsResonance::Legendre : std::cout << " : Spin factors are just Legendre polynomials" << std::endl; break; } switch ( bwBarrierType_ ) { case LauBlattWeisskopfFactor::BWBarrier : std::cout << " : Blatt-Weisskopf barrier factors are the 'non-primed' form" << std::endl; break; case LauBlattWeisskopfFactor::BWPrimeBarrier : std::cout << " : Blatt-Weisskopf barrier factors are the 'primed' form" << std::endl; break; case LauBlattWeisskopfFactor::ExpBarrier : std::cout << " : Blatt-Weisskopf barrier factors are the exponential form" << std::endl; break; } switch ( bwRestFrame_ ) { case LauBlattWeisskopfFactor::ParentFrame : std::cout << " : Blatt-Weisskopf barrier factors use bachelor momentum in parent rest frame" << std::endl; break; case LauBlattWeisskopfFactor::ResonanceFrame : std::cout << " : Blatt-Weisskopf barrier factors use bachelor momentum in resonance rest frame" << std::endl; break; case LauBlattWeisskopfFactor::Covariant : std::cout << " : Blatt-Weisskopf barrier factors use covariant expression" << std::endl; break; } summaryPrinted_ = kTRUE; } // Loop over all possible resonance states we have defined in // createResonanceVector() until we get a match with the name of the resonance LauResonanceInfo* resInfo(0); for (std::vector::const_iterator iter=resInfo_.begin(); iter!=resInfo_.end(); ++iter) { if (resName == (*iter)->getName()) { // We have recognised the resonance name. std::cout<<"INFO in LauResonanceMaker::getResonance : Creating resonance: "<getBWCategory(); } LauBlattWeisskopfFactor* resBWFactor = this->getBWFactor( resCategory, resInfo ); LauBlattWeisskopfFactor* parBWFactor = this->getBWFactor( parCategory, resInfo ); theResonance->setBarrierRadii( resBWFactor, parBWFactor ); break; } case LauAbsResonance::GS : { // Gounaris-Sakurai function to try and model the rho(770) better std::cout<<" : Using Gounaris-Sakurai lineshape. "<getBWCategory(); } LauBlattWeisskopfFactor* resBWFactor = this->getBWFactor( resCategory, resInfo ); LauBlattWeisskopfFactor* parBWFactor = this->getBWFactor( parCategory, resInfo ); theResonance->setBarrierRadii( resBWFactor, parBWFactor ); break; } case LauAbsResonance::Flatte : // Flatte distribution - coupled channel Breit-Wigner std::cout<<" : Using Flatte lineshape. "<getBWCategory(); } LauBlattWeisskopfFactor* resBWFactor = this->getBWFactor( resCategory, resInfo ); LauBlattWeisskopfFactor* parBWFactor = this->getBWFactor( parCategory, resInfo ); theResonance->setBarrierRadii( resBWFactor, parBWFactor ); break; } // Set the spin formalism choice theResonance->setSpinType( spinFormalism_ ); return theResonance; } Int_t LauResonanceMaker::resTypeInt(const TString& name) const { // Internal function that returns the resonance integer, specified by the // order of the resonance vector defined in createResonanceVector(), // for a given resonance name. Int_t resTypInt(-99); Int_t i(0); for (std::vector::const_iterator iter=resInfo_.begin(); iter!=resInfo_.end(); ++iter) { if (name.BeginsWith((*iter)->getName(), TString::kExact) == kTRUE) { // We have recognised the resonance from those that are available resTypInt = i; return resTypInt; } ++i; } return resTypInt; } void LauResonanceMaker::printAll( std::ostream& stream ) const { for ( std::vector::const_iterator iter = resInfo_.begin(); iter != resInfo_.end(); ++iter ) { stream << (**iter) << std::endl; } } LauResonanceInfo* LauResonanceMaker::getResInfo(const TString& resName) const { LauResonanceInfo* resInfo(0); for (std::vector::const_iterator iter=resInfo_.begin(); iter!=resInfo_.end(); ++iter) { if (resName == (*iter)->getName()) { // We have recognised the resonance name. resInfo = (*iter); // stop looping break; } } return resInfo; }