Fixed calculation of currents (included particle weights)
This commit is contained in:
@@ -37,11 +37,14 @@ class CurrentCollector {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void collectRadialMovement(const blitz::TinyVector<int, 3>& bin_old,
|
void collectRadialMovement(const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new);
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight);
|
||||||
void collectLongitudinalMovement(const blitz::TinyVector<int, 3>& bin_old,
|
void collectLongitudinalMovement(const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new);
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight);
|
||||||
void collectAzimuthalMovement(const blitz::TinyVector<int, 3>& bin_old,
|
void collectAzimuthalMovement(const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new);
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight);
|
||||||
|
|
||||||
blitz::Array<double, 3> createAreaLongitudinal(
|
blitz::Array<double, 3> createAreaLongitudinal(
|
||||||
const CylinderBinning& position_binning);
|
const CylinderBinning& position_binning);
|
||||||
|
|||||||
@@ -138,40 +138,45 @@ void CurrentCollector::collect(particle::Particle* particle,
|
|||||||
blitz::TinyVector<int, 3> bin_new =
|
blitz::TinyVector<int, 3> bin_new =
|
||||||
position_binning_.bin(particle->position().cylinderEntries());
|
position_binning_.bin(particle->position().cylinderEntries());
|
||||||
|
|
||||||
collectRadialMovement(bin_old, bin_new);
|
const double weight = particle->weight();
|
||||||
collectLongitudinalMovement(bin_old, bin_new);
|
|
||||||
collectAzimuthalMovement(bin_old, bin_new);
|
collectRadialMovement(bin_old, bin_new, weight);
|
||||||
|
collectLongitudinalMovement(bin_old, bin_new, weight);
|
||||||
|
collectAzimuthalMovement(bin_old, bin_new, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurrentCollector::collectRadialMovement(
|
void CurrentCollector::collectRadialMovement(
|
||||||
const blitz::TinyVector<int, 3>& bin_old,
|
const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new) {
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight) {
|
||||||
if (bin_new(0) < bin_old(0)) {
|
if (bin_new(0) < bin_old(0)) {
|
||||||
r_negative_crossings(bin_new(0), bin_old(1), bin_old(2)) += 1;
|
r_negative_crossings(bin_new(0), bin_old(1), bin_old(2)) += weight;
|
||||||
} else if (bin_new(0) > bin_old(0)) {
|
} else if (bin_new(0) > bin_old(0)) {
|
||||||
r_positive_crossings(bin_new(0) - 1, bin_old(1), bin_old(2)) += 1;
|
r_positive_crossings(bin_new(0) - 1, bin_old(1), bin_old(2)) += weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CurrentCollector::collectLongitudinalMovement(
|
void CurrentCollector::collectLongitudinalMovement(
|
||||||
const blitz::TinyVector<int, 3>& bin_old,
|
const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new) {
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight) {
|
||||||
if (bin_new(2) < bin_old(2)) {
|
if (bin_new(2) < bin_old(2)) {
|
||||||
z_negative_crossings(bin_old(0), bin_old(1), bin_new(2) + 1) += 1;
|
z_negative_crossings(bin_old(0), bin_old(1), bin_new(2) + 1) += weight;
|
||||||
} else if (bin_new(2) > bin_old(2)) {
|
} else if (bin_new(2) > bin_old(2)) {
|
||||||
z_positive_crossings(bin_old(0), bin_old(1), bin_new(2)) += 1;
|
z_positive_crossings(bin_old(0), bin_old(1), bin_new(2)) += weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CurrentCollector::collectAzimuthalMovement(
|
void CurrentCollector::collectAzimuthalMovement(
|
||||||
const blitz::TinyVector<int, 3>& bin_old,
|
const blitz::TinyVector<int, 3>& bin_old,
|
||||||
const blitz::TinyVector<int, 3>& bin_new) {
|
const blitz::TinyVector<int, 3>& bin_new,
|
||||||
|
const double weight) {
|
||||||
if ((bin_new(1) < bin_old(1)) ||
|
if ((bin_new(1) < bin_old(1)) ||
|
||||||
((bin_old(1) == 0) &&
|
((bin_old(1) == 0) &&
|
||||||
(bin_new(1) == position_binning_.binIndexMax()(1)))) {
|
(bin_new(1) == position_binning_.binIndexMax()(1)))) {
|
||||||
phi_negative_crossings(bin_old(0), bin_new(1), bin_old(2)) += 1;
|
phi_negative_crossings(bin_old(0), bin_new(1), bin_old(2)) += weight;
|
||||||
} else if ((bin_new(1) > bin_old(1)) ||
|
} else if ((bin_new(1) > bin_old(1)) ||
|
||||||
((bin_old(1) == position_binning_.binIndexMax()(1)) &&
|
((bin_old(1) == position_binning_.binIndexMax()(1)) &&
|
||||||
(bin_new(1) == 0))) {
|
(bin_new(1) == 0))) {
|
||||||
phi_positive_crossings(bin_old(0), bin_new(1) - 1, bin_old(2)) += 1;
|
phi_positive_crossings(bin_old(0), bin_new(1) - 1, bin_old(2)) += weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user