45 if (shapem == shape) {
46 if (shape ==
"BOX" || shape ==
"TRD1" || shape ==
"TRD2" ||
48 for (
G4int i=0;i<npar;i++) {
50 if (rparm != 0) rpar[i] = rparm[i];
51 if (rpar[i] < 0) NegPresent =
TRUE;
55 if (shape ==
"TRAP") {
56 for (
G4int i=0;i<11;i++) {
57 if (i != 1 && i != 2 && i != 6 && i != 10) {
59 if (rparm != 0) rpar[i] = rparm[i];
60 if (rpar[i] < 0) NegPresent =
TRUE;
65 if (shape ==
"TUBE" || shape ==
"TUBS" || shape ==
"PARA") {
66 for (
G4int i=0;i<3;i++) {
68 if (rparm != 0) rpar[i] = rparm[i];
69 if (rpar[i] < 0) NegPresent =
TRUE;
73 if (shape ==
"CONE" || shape ==
"CONS") {
74 for (
G4int i=0;i<5;i++) {
76 if (rparm != 0) rpar[i] = rparm[i];
77 if (rpar[i] < 0) NegPresent =
TRUE;
81 if (shape ==
"SPHE") {
82 for (
G4int i=0;i<2;i++) {
84 if (rparm != 0) rpar[i] = rparm[i];
85 if (rpar[i] < 0) NegPresent =
TRUE;
89 if (shape ==
"PGON") {
92 for (
G4int i=0;i<nz;i++) {
95 if (rparm != 0) rpar[ipl] = rparm[ipl];
96 if (rpar[ipl] < 0) NegPresent =
TRUE;
98 if (rpar[ipl+1] < 0) {
99 if (rparm != 0) rpar[ipl] = rparm[ipl];
100 if (rpar[ipl] < 0) NegPresent =
TRUE;
104 if (shape ==
"PCON") {
107 for (
G4int i=0;i<nz;i++) {
110 if (rparm != 0) rpar[ipl] = rparm[ipl];
111 if (rpar[ipl] < 0) NegPresent =
TRUE;
113 if (rpar[ipl+1] < 0) {
116 if (rparm != 0) rpar[ipl] = rparm[ipl];
117 if (rpar[ipl] < 0) NegPresent =
TRUE;
123 if (shape ==
"BOX") {
124 if (shapem ==
"TRD1") {
126 if (rparm != 0) rpar[1] = rparm[2];
127 if (rpar[1] < 0) NegPresent =
TRUE;
130 if (rparm != 0) rpar[2] = rparm[3];
131 if (rpar[2] < 0) NegPresent =
TRUE;
134 if (rparm != 0) rpar[0] = std::min(rparm[0],rparm[1]) +
135 std::abs(rparm[0]-rparm[1])*.5*rpar[2]/rparm[3];
136 if (rpar[0] < 0) NegPresent =
TRUE;
139 if (shapem ==
"TRD2") {
141 if (rparm != 0) rpar[2] = rparm[4];
142 if (rpar[2]<0) NegPresent =
TRUE;
145 if (rparm != 0) rpar[0] = std::min(rparm[0],rparm[1]) +
146 std::abs(rparm[0]-rparm[1])*.5*rpar[2]/rparm[4];
147 if (rpar[0]<0) NegPresent =
TRUE;
150 if (rparm != 0) rpar[1] = std::min(rparm[2],rparm[3]) +
151 std::abs(rparm[2]-rparm[3])*.5*rpar[2]/rparm[4];
152 if (rpar[1]<0) NegPresent =
TRUE;
155 if (shapem ==
"TRAP") {
157 if (rparm != 0) rpar[2] = rparm[0];
158 if (rpar[2] < 0) NegPresent =
TRUE;
162 G4double xlo = std::min(rparm[4],rparm[8]) +
163 std::abs(rparm[4]-rparm[8])*.5*rpar[2]/rparm[0];
164 G4double xhi = std::min(rparm[5],rparm[9]) +
165 std::abs(rparm[5]-rparm[9])*.5*rpar[2]/rparm[0];
166 rpar[0] = std::min(xlo,xhi);
168 if (rpar[0] < 0) NegPresent =
TRUE;
171 if (rparm != 0) rpar[1] = std::min(rparm[3],rparm[7]) +
172 std::abs(rparm[3]-rparm[7])*.5*rpar[2]/rparm[0];
173 if (rpar[1] < 0) NegPresent =
TRUE;
208 if (strcmp(routine,
"GSPOS") == 0 || strcmp(routine,
"GSVOLU") == 0) {
211 if (strcmp(routine,
"GSDVN") == 0) {
214 for (
G4int i=0;i<npar;i++) {
G4bool G3CalcParamsFn(G4double *rpar, G4int npar, G4double *rparm, G4String shape, G4String shapem)
G4bool G3NegVolPars(G4double pars[], G4int *nparpt, G3VolTableEntry *vte, G3VolTableEntry *mvte, const char routine[])