898 G4double chose, totArea=0., Achose1, Achose2,
899 rad1, rad2, sinphi1, sinphi2, cosphi1, cosphi2;
901 area, aTop=0., aBottom=0., zVal=0.;
904 std::vector<G4double> aVector1;
905 std::vector<G4double> aVector2;
906 std::vector<G4double> aVector3;
914 for(j=0; j<numPlanes-1; j++)
920 area = std::sqrt(l2-
sqr((a-b)*cosksi))*(a+
b)*cosksi;
921 aVector1.push_back(area);
924 for(j=0; j<numPlanes-1; j++)
930 area = std::sqrt(l2-
sqr((a-b)*cosksi))*(a+
b)*cosksi;
931 aVector2.push_back(area);
934 for(j=0; j<numPlanes-1; j++)
945 else { aVector3.push_back(0.); }
948 for(j=0; j<numPlanes-1; j++)
950 totArea +=
numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
960 aTop = std::sqrt(l2-
sqr((a-b)*cosksi))*(a+
b)*cosksi;
968 aBottom = std::sqrt(l2-
sqr((a-b)*cosksi))*(a+
b)*cosksi;
972 Achose2 =
numSide*(aVector1[0]+aVector2[0])+2.*aVector3[0];
975 if( (chose >= 0.) && (chose < aTop + aBottom) )
978 rang = std::floor((chose-
startPhi)/ksi-0.01);
979 if(rang<0) { rang=0; }
980 rang = std::fabs(rang);
981 sinphi1 = std::sin(
startPhi+rang*ksi);
982 sinphi2 = std::sin(
startPhi+(rang+1)*ksi);
983 cosphi1 = std::cos(
startPhi+rang*ksi);
984 cosphi2 = std::cos(
startPhi+(rang+1)*ksi);
986 if(chose>=0. && chose<aTop)
1006 for (j=0; j<numPlanes-1; j++)
1008 if( ((chose >= Achose1) && (chose < Achose2)) || (j == numPlanes-2) )
1012 Achose1 +=
numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
1013 Achose2 = Achose1 +
numSide*(aVector1[j+1]+aVector2[j+1])
1023 totArea =
numSide*(aVector1[j]+aVector2[j])+2.*aVector3[j];
1026 if( (chose>=0.) && (chose<
numSide*aVector1[j]) )
1029 rang = std::floor((chose-
startPhi)/ksi-0.01);
1030 if(rang<0) { rang=0; }
1031 rang = std::fabs(rang);
1034 sinphi1 = std::sin(
startPhi+rang*ksi);
1035 sinphi2 = std::sin(
startPhi+(rang+1)*ksi);
1036 cosphi1 = std::cos(
startPhi+rang*ksi);
1037 cosphi2 = std::cos(
startPhi+(rang+1)*ksi);
1049 else if ( (chose >=
numSide*aVector1[j])
1050 && (chose <=
numSide*(aVector1[j]+aVector2[j])) )
1053 rang = std::floor((chose-
startPhi)/ksi-0.01);
1054 if(rang<0) { rang=0; }
1055 rang = std::fabs(rang);
1058 sinphi1 = std::sin(
startPhi+rang*ksi);
1059 sinphi2 = std::sin(
startPhi+(rang+1)*ksi);
1060 cosphi1 = std::cos(
startPhi+rang*ksi);
1061 cosphi2 = std::cos(
startPhi+(rang+1)*ksi);
1075 if( (chose>=0.) && (chose < 1.) )
ThreeVector shoot(const G4int Ap, const G4int Af)
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
G4PolyhedraHistorical * original_parameters
G4ThreeVector GetPointOnPlane(G4ThreeVector p0, G4ThreeVector p1, G4ThreeVector p2, G4ThreeVector p3) const
static constexpr double twopi
G4ThreeVector GetPointOnSurfaceGeneric() const