1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Test::Test() {
double CrL;
double L,tempL;
double enterPx,enterPy,enterPz;
bool foo;
DistanceToShell A1;
ComptonScattering C1;
CrIntersectionLength C2;
CrIntersectionLength C3; // to keep track of entering point
A1.GetPosition(s,phi,z,theta2,phi2);
A1.ComptonCalculation(get.WalloyCompton(energy-100));
L = A1.ComptonCalculation(get.WalloyCompton(energy-100)); //
Px = A1.PointX();
Py = A1.PointY();
Pz = A1.PointZ();
//Random position inside Rod in cartesian coordinates
pointx = s*cos(phi) + s_1*cos(phi_1);
pointy = s*sin(phi) + s_1*sin(phi_1);
pointz = z + z_1;
// Rod is chosen above
// poin(x,y,z) is Rod position (z = 0)
foo = check(Px,pointx,Py,pointy,Pz,pointz,ChromiumRadius());
if (foo==true) { // gamma compton scattered within initial rod
ComptonScattering_True(); // re-defines s,phi,z,theta2,phi2, and energy.
// go back to beginning
}
else if (foo==false) { // gamma not yet compton scattered within initial rod
AssignToRods(pointx,pointy,pointz); // Sort rods closest - farthest
//C2.GetFirstRandom(s,phi,z);
//C2.GetFirstCylinder(s_1,phi_1,z_1);
//C2.GetSecondCylinder(s_1,phi_1,z_1);
//C2.GetLPoints(Px,Py,Pz);
//C2.Calculations();
C3.GetFirstRandom(s,phi,z);
C3.GetFirstCylinder(Rods[myvector.at(0)].at(0),Rods[myvector.at(0)].at(1),Rods[myvector.at(0)].at(2));
C3.GetSecondCylinder(Rods[myvector.at(0)].at(0),Rods[myvector.at(0)].at(1),Rods[myvector.at(0)].at(2));
C3.GetLPoints(20.,20.,20.); // any number >= 20
C3.Calculations();
CrL = C3.fIntersectionLength();
L = L - CrL;
for (int i=0; i<SortedRods.size(); i++) {
C3.GetFirstRandom(s,phi,z);
C3.GetFirstCylinder(Rods[myvector.at(0)].at(0),Rods[myvector.at(0)].at(1),Rods[myvector.at(0)].at(2));
C3.GetSecondCylinder(Rods[myvector.at(i+1)].at(0),Rods[myvector.at(i+1)].at(1),Rods[myvector.at(i+1)].at(2));
C3.GetLPoints(20.,20.,20.);
C3.Calculations();
if (C3.btClose()==false) {
if (C3.btFar()==false) {
CrL = C3.fIntersectionLength();
L = L - CrL;
if (L==0); // store initial energy and exit Test
double magnitude;
magnitude = sqrt(pow(Px,2)+pow(Px,2)+pow(Px,2));
if (magnitude > 15); // store initial and final energy and exit Test
}
else if (C3.btFar()==true) {
ComptonScattering_True(); // re-defines s,phi,z,theta2,phi2, and energy.
// go back to beginning from here
}
}
else if (C3.btClose()==true); // going into W
}
}
}
|