6 #include <Math/Point3D.h>
7 #include <Math/Vector3D.h>
17 int pclouds =
fHits->size();
26 std::vector<double> Proba;
27 std::vector<AtHit> retVec;
29 for (
int i = 0; i < pclouds; i++)
30 Tcharge +=
fHits->at(i)->GetCharge();
33 for (
int i = 0; i < pclouds; i++)
34 Proba.push_back(
fHits->at(i)->GetCharge());
36 avgCharge = Tcharge / (double)pclouds;
37 p1 = gRandom->Uniform() * pclouds;
38 retVec.push_back(*
fHits->at(p1));
42 p2 = gRandom->Uniform() * pclouds;
45 dist = std::sqrt((
fHits->at(p1)->GetPosition() -
fHits->at(p2)->GetPosition()).Mag2());
46 gauss = 1.0 * exp(-1.0 * pow(dist / sigma, 2));
47 y = gRandom->Uniform();
48 w = gRandom->Uniform() * 4. * avgCharge;
50 retVec.push_back(*
fHits->at(p2));
52 }
while (retVec.size() < N && counter < pclouds && counter < 50);