18#ifndef SAMPLERANALYSIS_H
19#define SAMPLERANALYSIS_H
21#include "BDSOutputROOTEventSampler.hh"
37 bool debugIn =
false);
40 bool debugIn =
false);
50 void Process(
bool firstTime =
false);
53 std::vector<double>
Terminate(std::vector<double> emittance,
54 bool useEmittanceFromFirstSampler =
true);
63 static void UpdateMass(
const std::string& particleName);
73 static double particleMass;
80 std::vector<double> coordinates;
83 std::vector<double> offsets;
85 typedef std::vector<std::vector<double>> twoDArray;
86 typedef std::vector<std::vector<std::vector<double>>> threeDArray;
87 typedef std::vector<std::vector<std::vector<std::vector<double>>>> fourDArray;
92 fourDArray powSumsFirst;
93 fourDArray cenMomsFirst;
96 threeDArray derivMats;
109 long long int npartIn,
122 long long int npartIn,
139 void printBeamCorrelationMatrix(fourDArray& centMoms);
Information stored per sampler per event.
Analysis routines for an individual sampler.
twoDArray optical
emt, alf, bta, gma, eta, etapr, mean, sigma
twoDArray varOptical
variances of optical functions
double centMomToDerivative(fourDArray ¢Moms, int k, int t, int i)
void Initialise()
Initialise variables.
static void UpdateMass(SamplerAnalysis *s)
Set primary particle mass for optical functions from sampler data.
std::vector< std::vector< double > > GetOpticalFunctions()
Accessor for optical functions.
void CommonCtor()
Initialisation of arrays for optical function calculations.
void Process(bool firstTime=false)
Loop over all entries in the sampler and accumulate power sums over variuos moments.
double centMomToCovariance(fourDArray ¢Moms, long long int npartIn, int k, int i, int j)
double powSumToCentralMoment(fourDArray &powSum, long long int npartIn, int i, int j, int m, int n)
std::vector< double > Terminate(std::vector< double > emittance, bool useEmittanceFromFirstSampler=true)
Calculate optical functions based on combinations of moments already accumulated.