SetPolarisation method in BalamuthWeight
It could prove useful for future use of sim3a to add a SetPolarisation
method to the BalamuthWeight
class.
Something like this,
void BalamuthWeight::SetPrimary(Level& l, unique_ptr<Channel> c)
{
primLevel = l;
primChannel = std::move(c);
spinCouple();
primSH = std::make_unique<SphericalHarmonic>(primChannel->L());
primSH->prepare_interpolation(100);
polarisation = vector<double>(2 * (int)primLevel.J() + 1, 1.);
}
void BalamuthWeight::SetPolarisation(vector<double> pol)
{
//assert that pol.size() == 2 * (int)primLevel.J() + 1
polarisation = pol;
}
double BalamuthWeight::CalculateWeight(vector<TLorentzVector> &p)
{
double prob = 0.;
auto amplitudes = CalculateAmplitudes(p);
for (int i=0; i<amplitudes.size(); i++) {
auto a = amplitudes[i];
auto pol = polarisation[i];
prob += norm(pol * a); //pol outside or inside norm??
}
return prob;
}