Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New lineshapes and spin factors #17

Open
wants to merge 270 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
8a81a46
Update doxyfile
tevans1260 Mar 27, 2019
46491bb
Update build_docs.sh
tevans1260 Mar 27, 2019
6cabf4d
Update .travis.yml
tevans1260 Mar 27, 2019
e68f62c
Update .travis.yml
tevans1260 Mar 27, 2019
e62caf8
add travis CI build
tevans1260 Mar 27, 2019
5a97e04
add travis CI build
tevans1260 Mar 27, 2019
3afd36a
add travis CI build
tevans1260 Mar 27, 2019
bec2bba
Update .travis.yml
tevans1260 Mar 27, 2019
2de0ec7
Add DEPS_DIR to travis.yml
tevans1260 Mar 27, 2019
8612399
Flag to remove OpenMP for travis CI builds
tevans1260 Mar 27, 2019
bcff46a
Flag to remove OpenMP for travis CI builds
tevans1260 Mar 27, 2019
f47cfed
minor fix to RecursivePhaseSpace for gcc5.4
tevans1260 Mar 27, 2019
41da25d
add libtbb to .travis.yml
Mar 27, 2019
acbfa0a
add libtbb to .travis.yml
Mar 27, 2019
16d05fd
Add libtbb to link options
Mar 27, 2019
eb7733a
Update build_root.sh
tevans1260 Mar 27, 2019
3587b91
Add generator test to travis.sh
Mar 27, 2019
15ab4d0
Add verbose flag to test
Mar 27, 2019
64d096c
change abs -> std::abs so compiler phase works on g++5
Mar 27, 2019
3473ac1
Big improvements in CUDA code generation
Mar 28, 2019
dfbf367
Remove LaTeX from README.md
Mar 28, 2019
2da0b64
Uncomment .travis.yml
Mar 28, 2019
7592f34
Update README.md
tevans1260 Mar 28, 2019
c206d8d
Update README.md
tevans1260 Mar 28, 2019
cc7fc62
Update README.md
tevans1260 Mar 28, 2019
498c2c5
Fix UseCUDA flag in src/CompiledExpressionBase
Mar 28, 2019
dc3ee1c
Merge branch 'master' of github.com:GooFit/AmpGen
Mar 28, 2019
85d9517
Remove unnecessary statics in utilities
Mar 28, 2019
3cefae9
Update .travis.yml
tevans1260 Mar 28, 2019
4fc8ffa
Add LASS documentation
Mar 29, 2019
b7d711d
Merge branch 'master' of github.com:GooFit/AmpGen
Mar 29, 2019
44a6053
Add code to perform pade approximations, minor improvements in some i…
Apr 1, 2019
306bec4
Remove explicit linking of tbb
Apr 2, 2019
7b6cd27
Synchronise version numbering system with Gaudi version, remove unuse…
Apr 3, 2019
705a6f1
Fix AMPGEN_MAJOR/MINOR_VERSION and include fix for gaudi builds
Apr 3, 2019
c4fe59b
Fixed problems with spin-one polarisation vectors, improved LASS inst…
Apr 10, 2019
4b0d388
Remove NBins option that doesn't seem to play nicely with travis ..
Apr 10, 2019
8295397
Reduce EDM precision, various patches for c++11 compatibility mode
Apr 23, 2019
d1f7e1c
Make quasistable & quasiparticle work together, add GLASS and photon …
Apr 29, 2019
963b862
Fix GLASS so it compiles, but it still doesn't work :(
Apr 29, 2019
a221a64
Improved CP conjugation in Particle, improved threading in CoherentSum
May 15, 2019
eb15951
Add quantum-correlated generator example
May 16, 2019
33f3257
Start adding improvements from cppcheck, removal of unused code
May 22, 2019
1ebb9d7
Greatly improved parser for expression parameters, added unit tests f…
May 23, 2019
d827df1
Remove c++17 only code in ArgumentPack, minor tweaks to MinuitExpress…
May 23, 2019
2c47751
Fix mixing object in EventType
May 23, 2019
d8b31d5
add optional OPENMP off switch to QcGenerator
May 23, 2019
ae9aca7
properly flag OPENMP in QcGenerator..
May 23, 2019
e0d02d8
Add more of the recommendations for cppcheck, some unit tests for Qua…
May 24, 2019
7124f9b
Fix associativity in ExpressionParser, add more tests to test_Express…
May 27, 2019
d56fb88
Fix example in Particle.h, improve README.md to reflect improvements …
May 27, 2019
6a00706
Changes from code review
May 28, 2019
5f90229
Merge CR changes
tevans1260 May 28, 2019
71aec76
Some minor changes from the GAUSS version
tevans1260 May 29, 2019
be236bb
Fix missing definition in QuarkContent, change default number of comp…
tevans1260 May 29, 2019
2c7a6d9
Add progress bar, BELLE2018 GLASS model for D0->Kspipi
Jun 9, 2019
13a871d
add FixedLibPdf models (for D0->KsPiPi) to QcGenerator, fixes in doxgen
Jun 10, 2019
6f2efe1
Add examples/SimFit, some bug fixes in README and minor clang warning…
Jun 18, 2019
08dd370
Minor fix in poly, add generic shapes in quasiparticles, improvements…
Jun 21, 2019
6caa622
Add prerendered formulae to the Markdown, minor fixes to Particle
Jun 21, 2019
18d936a
Make doxygen variant of markdown work correctly for intro
Jun 22, 2019
1daecdb
Fix quantum numbers of the X(3872), add generators of SU(3) for begi…
Jul 8, 2019
acfa0b3
fix PolarisedSum::densityMatrix for scalar case, neaten formatting in…
Jul 8, 2019
f10eb29
Fix unit tests under boost 1.70.0
tevans1260 Jul 8, 2019
b97e16a
Added some debugging for production polarisation
Jul 8, 2019
ed3a6a9
Merge branch 'master' of https://github.com/GooFit/AmpGen
Jul 8, 2019
9c000c5
Fix instructions for lxplus usage
Jul 9, 2019
5936ae9
Fix in python bindings, add linear time-dependent amplitude
Aug 7, 2019
fb06e0c
Add pretty new enums, some cleanup of the variable flagging code
Aug 13, 2019
d2d0e3b
Add release notes
Aug 13, 2019
f23dd6b
fix SFINAE snafu
Aug 13, 2019
0d4045c
Add faster integrator <experimental>, improvements in documentation a…
Aug 22, 2019
f5f1edc
Fix missing headers in Pade
Aug 23, 2019
01d869a
fixed in pade...
Aug 23, 2019
49fcc6f
Fix binned integrator to match CoherentSum, fix tests in ExpressionPa…
Aug 27, 2019
0a99fb2
Update mass_width.csv
tevans1260 Aug 29, 2019
4478134
Update mass_width.csv
tevans1260 Aug 29, 2019
68767c7
Cache some coordinates transforms in order to make deeper decay proce…
Sep 2, 2019
650cd2b
Merge branch 'master' of https://github.com/GooFit/AmpGen
Sep 2, 2019
78d0182
Add PolyNR for backgrounds
Sep 9, 2019
1c7f4d6
changing names in output tree
marianstahl Aug 22, 2019
a255de1
added option to choose different naming in output tree
marianstahl Sep 11, 2019
de5f3b1
Merge pull request #1 from marianstahl/mstahl_variable_naming
tevans1260 Sep 12, 2019
16d81fc
Minor fixes to enum, allow direct use with NamedParameters, switched …
Sep 12, 2019
dab084c
fix clang warnings
Sep 12, 2019
44ca302
once more for luck
Sep 12, 2019
f9d1a7f
Fixes to the stricter type checking of enums
Sep 12, 2019
80be0f5
various code changes from cppcheck
Sep 12, 2019
a12c300
fix double-free in ASTResolver
Sep 13, 2019
cf5c401
changes from cppcheck, many size_t -> unsigned's
Sep 24, 2019
8852016
remove example that depends on functional pdfs
Sep 24, 2019
fdbe135
fixed compilation when omp is not available
Sep 24, 2019
9a27071
fix printing in AmplitudeRules to deal with radians vs degrees, warni…
Sep 25, 2019
0de6006
Add TreePhaseSpace generator
Nov 12, 2019
de722a1
improve CP conjugation logic, add a couple of additional vertices
Nov 24, 2019
212f548
Changed CP conjugation behaviour to give expressions, rather than new…
Nov 25, 2019
abc8773
Remove some noise from AddCPConjugate + AmplitudeRules
Nov 25, 2019
042c2e4
Fix mising thing that was broken, add unstable initial states to tree…
Nov 28, 2019
2fdbcf1
Add states of ill-defined initial flavour to PolarisedSum
Jan 7, 2020
5827262
Remove compile flag for warnings of depreciated copy constructors
Jan 9, 2020
ecfb7a4
Change default cxx standard to 17
Jan 9, 2020
871d59f
Add gcc8 to .travis.yml
Jan 9, 2020
998e603
Add gcc8 to .travis.yml
Jan 9, 2020
6618b99
Downgrade cxx standard to make travis happy
Jan 9, 2020
b91e8a6
Add polarisation vector as argument to PolarisedSum, clean up of weig…
Jan 23, 2020
b510b32
Add proper destructor for MinuitParameterSet
Jan 23, 2020
ab9483e
Merge pull request #2 from cpviolation/master
tevans1260 Jan 25, 2020
2a3ab30
Add export to CMakeLists such that AmpGen can be used with find_package
Jan 26, 2020
65d48ea
Merge branch 'master' of https://github.com/GooFit/AmpGen
Jan 26, 2020
60668b6
Fix AMPGEN_CXX being added to CMakeLists.txt
Jan 26, 2020
f41b7d9
Update masses and widths of D*(2300) and D*(2460) match PDG2020
Jan 28, 2020
39fc83e
Add Chew-Mandelstam parameterisation of self-energy for K-matrix
Jan 31, 2020
e20488e
Add OSX travis configuration
Feb 4, 2020
a8587c1
dumb down build_root for osx
Feb 4, 2020
4f4d2f6
trying to fix travis.yml for osx
Feb 4, 2020
6b24c3d
skip building root for osx
Feb 4, 2020
a588f0d
Fix to have parameter expressions of complex parameters in complex co…
Feb 4, 2020
e28a417
Minor changes to CompilerWrapper to help with troubleshooting.
Feb 4, 2020
d75272d
Improve file I/O for osx, and add error messages for invalid vertices…
Feb 5, 2020
eb43c98
remove brew install commands from .travis.yml for osx
Feb 5, 2020
d0d45cd
still debugging osx travis configuration
Feb 5, 2020
a6c2751
split travis job for osx/linus
Feb 5, 2020
2a1801f
add actual build root options for osx
Feb 5, 2020
8a1ed0d
still fixing osx ci
Feb 5, 2020
397ce7d
Update gcc -> gcc8 in .travis.yml
Feb 5, 2020
b084063
Update gcc -> gcc8 in .travis.yml
Feb 5, 2020
1a28981
set cxx compiler explicitly for travis build
Feb 5, 2020
42599fa
set cxx compiler explicitly for travis build
Feb 5, 2020
40afbba
update ROOT version in ci
Feb 5, 2020
fc29d33
try to use conda for ROOT
Feb 5, 2020
0b37c44
ahhhh
Feb 5, 2020
020ca65
fix miniconda
Feb 5, 2020
c63717d
Try to use conda install of cxx
Feb 5, 2020
a6dd2c3
fix for std::optional bug is osx
Feb 5, 2020
993cd27
trying to fix AppleClang build ...
Feb 5, 2020
d22efbf
Add pragma to fix libstdc++ problem on apple
Feb 5, 2020
d5d7402
explicitly select clang for apple build
Feb 5, 2020
03fba6e
Merge branch 'master' into pnaik-20200204
tevans1260 Feb 5, 2020
11f7960
Update CompilerWrapper.cpp
tevans1260 Feb 5, 2020
11c5eba
Merge pull request #5 from GooFit/pnaik-20200204
tevans1260 Feb 5, 2020
9088457
Fix vectorFromFile that was broken by last commit
Feb 6, 2020
6e7557e
Merge branch 'master' of https://github.com/GooFit/AmpGen
Feb 6, 2020
5f9272a
Add OpenMP using conda to the osx build
Feb 6, 2020
b701de1
Add OpenMP using conda to the osx build
Feb 6, 2020
a2805fa
still trying to add openmp to osx ci..
Feb 6, 2020
460c7cc
still trying to add openmp to osx ci..
Feb 6, 2020
03709dc
still trying to add openmp to osx ci..
Feb 6, 2020
050d647
fixing osx ci
Feb 7, 2020
c3a581d
Explicitly link applications against ROOT libraries
Feb 7, 2020
6c9b7d2
still fix osx ci
Feb 7, 2020
b4ca3c3
Remove CXX use as global variable for c++ compiler
Feb 7, 2020
e01cef7
Add RapidSim as an optional external packages, fixes to unit tests
Feb 27, 2020
286698a
Update mass_width.csv
tevans1260 Mar 5, 2020
7598997
commit with speed up integration / partially modernised caching
Mar 17, 2020
6595276
Begin vectorising the code
Apr 9, 2020
7d22858
add simd headers
Apr 9, 2020
a46c0ff
Consolidate SIMD integration / caching code with scalar version, remo…
Apr 14, 2020
e074da9
fixes for travis build
Apr 14, 2020
a04a7b2
Fix if number of events % simd_size != 0 and Chi2 calculation
Apr 14, 2020
53a3917
fixes for array / splines for avx2d
Apr 15, 2020
7ad8e91
fix for OSX
Apr 15, 2020
462ae54
Fix simd'ed integration and plotting
Apr 19, 2020
33121a5
fix travis...
Apr 19, 2020
b97eceb
fix travis...
Apr 19, 2020
f1b1591
fix travis...
Apr 19, 2020
e1f26c8
fix travis...
Apr 19, 2020
194f473
fix travis...
Apr 19, 2020
6403a29
fix travis...
Apr 19, 2020
1c7d80f
fix travis...
Apr 19, 2020
7b9816d
fix travis...
Apr 19, 2020
9c7e191
fix travis...
Apr 19, 2020
77339ca
fix travis build
Apr 20, 2020
9b38caa
fix control predicate for CompiledExpression batch
Apr 20, 2020
b18d048
remove debug_norm for src/PolarisedSum
Apr 20, 2020
5c10f20
try to fix osx ci
Apr 20, 2020
df71985
fix travis ci
Apr 20, 2020
5e3fe48
fix travis ci
Apr 20, 2020
c5d3906
fix travis ci
Apr 20, 2020
3f193e8
increase verbosity of ci
Apr 21, 2020
14e6db1
remove --quiet from conda options
Apr 21, 2020
804603f
chris's fix to build_root
Apr 22, 2020
a5a2e68
A few random fixes for clang
Apr 22, 2020
14937c4
fixes for osx
Apr 22, 2020
d34fd54
add -fma flag
Apr 22, 2020
324b896
remove std::fabs from unary expression
Apr 22, 2020
94ae640
still applying fixes for osx
Apr 22, 2020
2f14291
cleanup of AVX code, add AVX512, fixes to spline shapes
Apr 28, 2020
e8180a0
fix avx512d types, units for OSX
Apr 28, 2020
c0c7f1c
fix units for osx
Apr 28, 2020
867cf2a
Progress towards SIMD compatible generation, various fixes
May 16, 2020
fb6a9a0
Fix OpenMP predicates
May 16, 2020
958c379
Options to switch of mvec
May 17, 2020
934860e
cleanup mvec code
May 17, 2020
064296d
fix scalar build
May 17, 2020
0ddc4eb
Fixes for canonical formulation with deeper decay topologies
May 19, 2020
c3e827e
fix fitting in scalar build
May 28, 2020
87d3838
fix fitting in scalar build
May 28, 2020
07c4773
improve customised particles, improve compiler threading
Jun 7, 2020
9a16468
fix polarisedSum issue for clang
Jun 8, 2020
614a5a1
fix isPhoton flag
Jun 9, 2020
b4863e3
add some sanity checks for photons
Jun 9, 2020
d5e981b
fix cuts in DataConvertor
Jun 29, 2020
e527eb0
Fix complex logarithm for AVX, Weyl spinors for neutrinos
Jul 27, 2020
08d32d0
fix debugging of |T|^2 in PolarisedSum
Jul 29, 2020
f88f7f6
hopefully scalar builds don't accidentally include some AVX instructions
Jul 30, 2020
7374dcd
Merge branch 'experimental_integrator2' of https://github.com/GooFit/…
Jul 30, 2020
76fa62a
change the way constants are encoded into strings to allow very large…
tevans1260 Aug 5, 2020
5365228
possible fix in CompilerWrapper
tevans1260 Aug 5, 2020
e83679b
disable openmp for osx by default
tevans1260 Aug 5, 2020
559e8ea
fix openmp silliness
tevans1260 Aug 5, 2020
d39508a
disable openmp in the travis job
tevans1260 Aug 5, 2020
754298a
[Lineshapes] Add production (P-)vector approach to GenericKmatrix and…
marianstahl Aug 10, 2020
dde1671
fix custom helicity couplings + cleanup of evaluation of PDFs to arbi…
tevans1260 Aug 10, 2020
fa24e34
[example apps] add BaryonFitter and fit_hyperon_parameters.cpp
marianstahl Aug 10, 2020
d50abb1
[SumPDF] use event weight in fit
marianstahl Aug 10, 2020
8982ae8
[BaryonFitter] throw error when adding branches and using AVX; [Minim…
marianstahl Aug 10, 2020
da730a7
fix enum parser
tevans1260 Aug 11, 2020
14a8c12
fix enum
tevans1260 Aug 11, 2020
43c9096
Merge pull request #10 from marianstahl/marianstahl_additions_to_v2
tevans1260 Aug 11, 2020
d26f957
fix enum... again ... and add unit tests this time
tevans1260 Aug 12, 2020
24d7015
[Particle tables] update particle tables to be compatible with Gauss
marianstahl Aug 12, 2020
ed09fac
Merge pull request #11 from marianstahl/marianstahl_particle_tables_G…
tevans1260 Aug 12, 2020
7b5d15a
add automated testing against released models
tevans1260 Aug 13, 2020
91867fa
Merge pull request #12 from GooFit/experimental_integrator2
tevans1260 Aug 13, 2020
c845a5f
added spin factors for V[S,P]->V V decays
phdargen Aug 20, 2020
a966f9e
Merge pull request #13 from phdargen/v2vv_spinFactors
tevans1260 Aug 31, 2020
d2ff830
Add LambdaExpression for expressions that dynamically depend on the v…
tevans1260 Sep 22, 2020
1e296a4
Fix plotting in SimFit
tevans1260 Sep 25, 2020
7d10d6d
add flag to include conjugate amplitude
tevans1260 Sep 28, 2020
4d39f63
Add some logical operators + improved safety for splines using vector…
tevans1260 Oct 6, 2020
e77543c
Modified simultaneous fit to be able to describe multiple types of ev…
Oct 16, 2020
992f2e2
fixed a compilation errore in systems where OMP is not available
Oct 26, 2020
11bc9ec
Changes for 2.1 to improve Gauss integration
tevans1260 Oct 28, 2020
7c51eb6
Merge pull request #15 from cpviolation/master
tevans1260 Oct 28, 2020
63a43fe
fixes for CI
tevans1260 Oct 28, 2020
095e9c4
Merge branch 'master' of https://github.com/goofit/AmpGen
tevans1260 Oct 28, 2020
aba144e
Remove export of includes from cmakelists to fix ROOT error
tevans1260 Oct 28, 2020
fd9c60d
yahh traviiss
tevans1260 Oct 29, 2020
ca20c5d
maybe this time ...
tevans1260 Oct 29, 2020
99625c3
fix ci
tevans1260 Oct 29, 2020
3be90cc
cleanup of CMakeLists
tevans1260 Oct 29, 2020
0dffdf0
Add fallback option to take AMPGENROOT from build if undefined
tevans1260 Oct 30, 2020
0d40406
Update README.md
tevans1260 Oct 30, 2020
0a35a14
Update README.md
tevans1260 Oct 30, 2020
57c9a48
improve store for functions that return multiple values
tevans1260 Jan 14, 2021
18cb987
Merge branch 'master' of https://github.com/goofit/AmpGen
tevans1260 Jan 14, 2021
8fc07f9
fix mistaken error message in TreePhaseSpace (scalar builds only)
tevans1260 Jan 15, 2021
5f3cb40
added new lineshapes,spin factors
phdargen Jan 20, 2021
eb3e0fb
clean-up
phdargen Jan 20, 2021
83c736e
small fix
phdargen Jan 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add examples/SimFit, some bug fixes in README and minor clang warning…
…s fixed
tevans1260 committed Jun 18, 2019
commit 6f2efe18faaf81f0d198f1a02a8a806c59f5a8c2
4 changes: 2 additions & 2 deletions AmpGen/EventList.h
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ namespace AmpGen
return size;
}
}

template <class FUNCTOR>
unsigned int extendEvent( const std::string& name, FUNCTOR func )
{
@@ -126,7 +126,7 @@ namespace AmpGen
( *this )[i].setCache(fcn(getEvent(i)), index);
}
}

void reserveCache(const size_t& index);
TH2D* makeProjection( const Projection2D& projection, const ArgumentPack& args );
std::vector<TH1D*> makeProjections( const std::vector<Projection>& projections, const ArgumentPack& args );

7 changes: 4 additions & 3 deletions AmpGen/Integrator.h
Original file line number Diff line number Diff line change
@@ -85,9 +85,10 @@ namespace AmpGen
public:
Integrator( EventList* events = nullptr ) : m_events( events ){}

double sampleNorm() { return m_events->norm(); }
bool isReady() const { return m_events != nullptr ; }
const EventList& events() const { return *m_events ; }
double sampleNorm() { return m_events->norm(); }
bool isReady() const { return m_events != nullptr; }
EventList& events() { return *m_events; }
const EventList& events() const { return *m_events; }
template <class T1, class T2>
void addIntegral( const T1& f1, const T2& f2, const TransferFCN& tFunc )
{
2 changes: 2 additions & 0 deletions AmpGen/Minimiser.h
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@

#include "TMatrixTSym.h"

/** @cond PRIVATE */
namespace ROOT
{
namespace Math
@@ -18,6 +19,7 @@ namespace ROOT
}
}
class TGraph;
/** @endcode */

namespace AmpGen
{
1 change: 1 addition & 0 deletions AmpGen/PolarisedSum.h
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ namespace AmpGen
class PolarisedSum
{
public:
PolarisedSum() = default;
PolarisedSum( const EventType& eventType, AmpGen::MinuitParameterSet& mps, const std::string& prefix="" );
void prepare();
void setEvents( AmpGen::EventList& events );
1 change: 1 addition & 0 deletions AmpGen/SumPDF.h
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ namespace AmpGen
class SumPDF
{
public:
SumPDF() = default;
SumPDF( const TYPES&... _pdfs ) : m_pdfs( std::tuple<TYPES...>( _pdfs... ) ) {}
std::tuple<TYPES...> m_pdfs;
EventList* m_events;
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,13 +69,15 @@ is to specifically specify the location of the build tool for AmpGen's JIT:
-DAMPGEN_CXX=$(which c++)
```

##### CentOS7
##### LXPLUS

In order to build stand-alone on CentOS7, you will need a valid development environment; the following line will work:
In order to build stand-alone on LXPLUS, you will need a valid development environment; the following line will work:

```shell
lb-run ROOT $SHELL
lb-run -c x86_64-centos7-gcc62-opt ROOT $SHELL
```
Additionally, the ROOT versions installed on cvfms generally require C++17 support when building.

Several examples of usages of the library are included in the apps directory and are
built alongside the library.
All standalone programs can accept both options files and command line arguments.
@@ -105,7 +107,7 @@ The decay products of a particle are enclosed within curly braces, for example
K*(892)0{K+,pi-}
```
describes an excited vector kaon decaying into a charged kaon and pion.
For more details about the API for describing particle decays, see [AmpGen::Particle](https://tevans1260.gitlab.io/AmpGen/de/dd7/class_amp_gen_1_1_particle.html).
For more details about the API for describing particle decays, see [AmpGen::Particle](https://goofit.github.io/AmpGen/de/dd7/class_amp_gen_1_1_particle.html)
The other numbers on the lines that describe the decays parameterise the coupling to this channel,
either in terms of real and imaginary parts or an amplitude and a phase.
Each parameter is specified in terms of three numbers: the _fix_ flag, the initial value, and the step size.
@@ -131,6 +133,7 @@ Configuration can be split over multiple files by the using _Import_ keyword, fo
```
Import $AMPGENROOT/options/kMatrix.opt
```

can be added to options file. Multiple user configuration files can also be specified by including multiple files on the command line.

## Applications
@@ -171,6 +174,8 @@ activated by
```
which produces a large number of intermediate steps in the calculation of each amplitude, which are added to the calculation using the
ADD_DEBUG and ADD_DEBUG_TENSOR macros in the code generation. For example, in src/Lineshapes/BW.cpp.
(n.b), if the model is a PolarisedSum, i.e. handles spin in the initial/final state, the flag PolarisedSum::Debug should be used instead of CoherentSum::Debug, in order
to generate all of the intermediate calculations of the amplitude.

### ConvertToSourceCode

@@ -183,7 +188,6 @@ This can then be a compiled to a shared library using
g++ -Ofast -shared -rdynamic --std=c++14 -fPIC MyFile.cpp -o MyFile.so
```


## Examples

### SignalOnlyFitter
2 changes: 1 addition & 1 deletion doc/doxyfile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ DOXYFILE_ENCODING = UTF-8
# The default value is: My Project.

PROJECT_NAME = "AmpGen"
PROJECT_NUMBER = 1.1
PROJECT_NUMBER = 1.2
PROJECT_BRIEF =
PROJECT_LOGO = "figs/logo_small.png"
LAYOUT_FILE = "DoxygenLayout.xml"
1 change: 0 additions & 1 deletion examples/QcGenerator.cpp
Original file line number Diff line number Diff line change
@@ -42,7 +42,6 @@ class FixedLibPdf
size_t size() { return 0; }
void reset( const bool& flag = false ){};
private:
void* lib;
AmpGen::DynamicFCN<complex_t( const double*, const int& )> amp;
};

99 changes: 99 additions & 0 deletions examples/SimFit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#include "AmpGen/Particle.h"
#include "AmpGen/CoherentSum.h"
#include "AmpGen/MsgService.h"
#include "AmpGen/SumPDF.h"
#include "AmpGen/FitResult.h"
#include "AmpGen/IExtendLikelihood.h"
#include "AmpGen/Minimiser.h"
#include "AmpGen/NamedParameter.h"
#include "AmpGen/Utilities.h"
#include "AmpGen/MinuitParameterSet.h"
#include "AmpGen/SimPDF.h"
#include "AmpGen/Kinematics.h"
#include "AmpGen/Generator.h"
#include "AmpGen/PolarisedSum.h"
#include <omp.h>

#include "TRandom3.h"
#include "TFile.h"
#include "TTree.h"

using namespace AmpGen;

int main(int argc , char* argv[] ){
OptionsParser::setArgs( argc, argv );

const auto pEventType = NamedParameter<std::string>("EventType", std::vector<std::string>(),
"EventType to fit, in the format: \033[3m parent daughter1 daughter2 ... \033[0m" ).getVector();

const auto datasets = NamedParameter<std::string>("Datasets","",
"List of data/simulated samples to fit, in the format \
\033[3m data[0] sim[0] data[1] sim[1] ... \033[0m. \nIf a simulated sample is specified FLAT, uniformly generated phase-space events are used for integrals ").getVector();

const std::string logFile = NamedParameter<std::string>("LogFile" , "Fitter.log",
"Name of the output log file");

const std::string plotFile = NamedParameter<std::string>("Plots" , "plots.root",
"Name of the output plot file");

std::vector<EventList> data;
std::vector<EventList> mcs;

#ifdef _OPENMP
size_t hwThreads = std::thread::hardware_concurrency();
size_t usThreads = NamedParameter<size_t>( "nCores", hwThreads, "Number of cores to use (OpenMP only)" );
INFO("Using: " << usThreads << " / " << hwThreads << " threads" );
omp_set_num_threads(usThreads);
omp_set_dynamic(0);
#endif

INFO("Output : " << logFile << " plots = " << plotFile );

if( pEventType.size() == 0 ) FATAL("Must specify event format as EventType \033[3m parent daughter1 daughter2 ... \033[0m in options");

const EventType eventType = EventType( pEventType );

for(size_t i=0;i < datasets.size() ; i+=2 ){
data.emplace_back( datasets[i], eventType );
if( datasets[i+1] == "FLAT" ) mcs.emplace_back(Generator<>(eventType).generate(1e6));
else mcs.emplace_back( datasets[i+1], eventType, GetGenPdf(true) );
}

std::vector<PolarisedSum> fcs(data.size());
std::vector<SumPDF<PolarisedSum&>> pdfs;

pdfs.reserve(data.size());

SimFit totalLL;
MinuitParameterSet mps;
mps.loadFromStream();
for(size_t i = 0; i < data.size(); ++i){
fcs[i] = PolarisedSum(eventType, mps);
pdfs.emplace_back( make_pdf(fcs[i] ) );
pdfs[i].setEvents(data[i]);
auto& mc = mcs[i];
pdfs[i].forEach([&mc](auto& pdf){pdf.setMC(mc);});
totalLL.add( pdfs[i] );
}
Minimiser mini( totalLL, &mps );
mini.doFit();
FitResult(mini).writeToFile("Fitter.log");
TFile* output_plots = TFile::Open( plotFile.c_str(), "RECREATE");
for( size_t i = 0 ; i < data.size(); ++i )
{
INFO("Making figures for sample: " << i << " ...");
auto dataPlots = data[i].makeDefaultProjections( Prefix("Data_"+std::to_string(i)));
for( auto& p : dataPlots ) p->Write();
size_t counter = 0;
for_each(pdfs[i].m_pdfs, [&]( auto& f ){
auto mc_plots = mcs[i].makeDefaultProjections(WeightFunction(f), Prefix("Model_sample_"+std::to_string(i)+"_cat"+std::to_string(counter)));
for( auto& plot : mc_plots )
{
plot->Scale( ( data[i].integral() * f.getWeight() ) / plot->Integral() );
plot->Write();
}
counter++;
} );
}
output_plots->Close();
}
2 changes: 1 addition & 1 deletion src/AmplitudeRules.cpp
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ std::complex<double> CouplingConstant::operator()() const
{
return isCartesian ?
std::accumulate( couplings.begin(), couplings.end(), complex_t(1,0),
[this](auto& prod, auto& coupling){ return prod * complex_t( coupling.first->mean(), coupling.second->mean() ) ; } )
[](auto& prod, auto& coupling){ return prod * complex_t( coupling.first->mean(), coupling.second->mean() ) ; } )
: std::accumulate( couplings.begin(), couplings.end(), complex_t(1,0),
[this](auto& prod, auto& coupling){ return prod * coupling.first->mean() * exp( 1i* this->sf * coupling.second->mean() ) ; } );
}
14 changes: 12 additions & 2 deletions src/EventList.cpp
Original file line number Diff line number Diff line change
@@ -246,9 +246,19 @@ double EventList::norm()
return m_norm;
}

void EventList::clear()
{
m_data.clear();
}

void EventList::clear() { m_data.clear(); }
void EventList::erase( const std::vector<Event>::iterator& begin, const std::vector<Event>::iterator& end )
void EventList::erase(const std::vector<Event>::iterator& begin,
const std::vector<Event>::iterator& end)
{
m_data.erase( begin, end );
}

void EventList::reserveCache(const size_t& size)
{
if ( size >= at(0).cacheSize() )
for (auto& evt : *this) evt.resizeCache(evt.cacheSize() + size);
}
4 changes: 4 additions & 0 deletions src/PolarisedSum.cpp
Original file line number Diff line number Diff line change
@@ -126,6 +126,10 @@ void PolarisedSum::prepare()
size_t nChanges = 0;
ProfileClock tEval;
size_t size_of = size() / m_matrixElements.size();

if( m_events != nullptr ) m_events->reserveCache( size() );
if( m_integrator.isReady() ) m_integrator.events().reserveCache( size() );

for( size_t i = 0; i < m_matrixElements.size(); ++i ){
ProfileClock tMEval;
auto& t = m_matrixElements[i];
2 changes: 0 additions & 2 deletions src/Wigner.cpp
Original file line number Diff line number Diff line change
@@ -168,8 +168,6 @@ std::vector<LS> AmpGen::calculate_recoupling_constants(
f.factor = sqrt( (2.*L + 1. )/( 2.*J + 1. ) );
f.cg1 = CG(L ,0 ,S ,m1-m2,J,m1-m2);
f.cg2 = CG(j1,m1,j2,-m2 ,S,m1-m2);
// f.cg1 = CG(L ,0 ,S ,m1-m2,J,M);
// f.cg2 = CG(j1,m1,j2,-m2 ,S,M);
f.p = sqrt( (2*L + 1 )/(2*J+1) );
f.factor *= f.cg1 * f.cg2;
if( f.factor != 0 ) rt.push_back(f);