19#ifndef SAMPLERANALYSIS_H
20#define SAMPLERANALYSIS_H
22#include "BDSOutputROOTEventSampler.hh"
38 bool debugIn =
false);
41 bool debugIn =
false);
51 void Process(
bool firstTime =
false);
54 std::vector<double>
Terminate(std::vector<double> emittance,
55 bool useEmittanceFromFirstSampler =
true);
64 static void UpdateMass(
const std::string& particleName);
74 static double particleMass;
81 std::vector<double> coordinates;
84 std::vector<double> offsets;
86 typedef std::vector<std::vector<double>> twoDArray;
87 typedef std::vector<std::vector<std::vector<double>>> threeDArray;
88 typedef std::vector<std::vector<std::vector<std::vector<double>>>> fourDArray;
93 fourDArray powSumsFirst;
94 fourDArray cenMomsFirst;
97 threeDArray derivMats;
110 long long int npartIn,
123 long long int npartIn,
140 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.