46 if (shapem == shape) {
47 if (shape ==
"BOX" || shape ==
"TRD1" || shape ==
"TRD2" ||
49 for (
G4int i=0;i<npar;i++) {
51 if (rparm != 0) rpar[i] = rparm[i];
52 if (rpar[i] < 0) NegPresent =
TRUE;
56 if (shape ==
"TRAP") {
57 for (
G4int i=0;i<11;i++) {
58 if (i != 1 && i != 2 && i != 6 && i != 10) {
60 if (rparm != 0) rpar[i] = rparm[i];
61 if (rpar[i] < 0) NegPresent =
TRUE;
66 if (shape ==
"TUBE" || shape ==
"TUBS" || shape ==
"PARA") {
67 for (
G4int i=0;i<3;i++) {
69 if (rparm != 0) rpar[i] = rparm[i];
70 if (rpar[i] < 0) NegPresent =
TRUE;
74 if (shape ==
"CONE" || shape ==
"CONS") {
75 for (
G4int i=0;i<5;i++) {
77 if (rparm != 0) rpar[i] = rparm[i];
78 if (rpar[i] < 0) NegPresent =
TRUE;
82 if (shape ==
"SPHE") {
83 for (
G4int i=0;i<2;i++) {
85 if (rparm != 0) rpar[i] = rparm[i];
86 if (rpar[i] < 0) NegPresent =
TRUE;
90 if (shape ==
"PGON") {
93 for (
G4int i=0;i<nz;i++) {
96 if (rparm != 0) rpar[ipl] = rparm[ipl];
97 if (rpar[ipl] < 0) NegPresent =
TRUE;
99 if (rpar[ipl+1] < 0) {
100 if (rparm != 0) rpar[ipl] = rparm[ipl];
101 if (rpar[ipl] < 0) NegPresent =
TRUE;
105 if (shape ==
"PCON") {
108 for (
G4int i=0;i<nz;i++) {
111 if (rparm != 0) rpar[ipl] = rparm[ipl];
112 if (rpar[ipl] < 0) NegPresent =
TRUE;
114 if (rpar[ipl+1] < 0) {
117 if (rparm != 0) rpar[ipl] = rparm[ipl];
118 if (rpar[ipl] < 0) NegPresent =
TRUE;
124 if (shape ==
"BOX") {
125 if (shapem ==
"TRD1") {
127 if (rparm != 0) rpar[1] = rparm[2];
128 if (rpar[1] < 0) NegPresent =
TRUE;
131 if (rparm != 0) rpar[2] = rparm[3];
132 if (rpar[2] < 0) NegPresent =
TRUE;
135 if (rparm != 0) rpar[0] = std::min(rparm[0],rparm[1]) +
136 std::abs(rparm[0]-rparm[1])*.5*rpar[2]/rparm[3];
137 if (rpar[0] < 0) NegPresent =
TRUE;
140 if (shapem ==
"TRD2") {
142 if (rparm != 0) rpar[2] = rparm[4];
143 if (rpar[2]<0) NegPresent =
TRUE;
146 if (rparm != 0) rpar[0] = std::min(rparm[0],rparm[1]) +
147 std::abs(rparm[0]-rparm[1])*.5*rpar[2]/rparm[4];
148 if (rpar[0]<0) NegPresent =
TRUE;
151 if (rparm != 0) rpar[1] = std::min(rparm[2],rparm[3]) +
152 std::abs(rparm[2]-rparm[3])*.5*rpar[2]/rparm[4];
153 if (rpar[1]<0) NegPresent =
TRUE;
156 if (shapem ==
"TRAP") {
158 if (rparm != 0) rpar[2] = rparm[0];
159 if (rpar[2] < 0) NegPresent =
TRUE;
163 G4double xlo = std::min(rparm[4],rparm[8]) +
164 std::abs(rparm[4]-rparm[8])*.5*rpar[2]/rparm[0];
165 G4double xhi = std::min(rparm[5],rparm[9]) +
166 std::abs(rparm[5]-rparm[9])*.5*rpar[2]/rparm[0];
167 rpar[0] = std::min(xlo,xhi);
169 if (rpar[0] < 0) NegPresent =
TRUE;
172 if (rparm != 0) rpar[1] = std::min(rparm[3],rparm[7]) +
173 std::abs(rparm[3]-rparm[7])*.5*rpar[2]/rparm[0];
174 if (rpar[1] < 0) NegPresent =
TRUE;
209 if (strcmp(routine,
"GSPOS") == 0 || strcmp(routine,
"GSVOLU") == 0) {
212 if (strcmp(routine,
"GSDVN") == 0) {
215 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[])