41{
43
44
45
46 if (shapem == shape) {
47 if (shape == "BOX" || shape == "TRD1" || shape == "TRD2" ||
48 shape == "ELTU") {
49 for (
G4int i=0;i<npar;i++) {
50 if (rpar[i] < 0) {
51 if (rparm != 0) rpar[i] = rparm[i];
52 if (rpar[i] < 0) NegPresent =
TRUE;
53 }
54 }
55 }
56 if (shape == "TRAP") {
57 for (
G4int i=0;i<11;i++) {
58 if (i != 1 && i != 2 && i != 6 && i != 10) {
59 if (rpar[i]<0) {
60 if (rparm != 0) rpar[i] = rparm[i];
61 if (rpar[i] < 0) NegPresent =
TRUE;
62 }
63 }
64 }
65 }
66 if (shape == "TUBE" || shape == "TUBS" || shape == "PARA") {
67 for (
G4int i=0;i<3;i++) {
68 if (rpar[i] < 0) {
69 if (rparm != 0) rpar[i] = rparm[i];
70 if (rpar[i] < 0) NegPresent =
TRUE;
71 }
72 }
73 }
74 if (shape == "CONE" || shape == "CONS") {
75 for (
G4int i=0;i<5;i++) {
76 if (rpar[i] < 0) {
77 if (rparm != 0) rpar[i] = rparm[i];
78 if (rpar[i] < 0) NegPresent =
TRUE;
79 }
80 }
81 }
82 if (shape == "SPHE") {
83 for (
G4int i=0;i<2;i++) {
84 if (rpar[i] < 0) {
85 if (rparm != 0) rpar[i] = rparm[i];
86 if (rpar[i] < 0) NegPresent =
TRUE;
87 }
88 }
89 }
90 if (shape == "PGON") {
93 for (
G4int i=0;i<nz;i++) {
94 ipl = 5 + i*3;
95 if (rpar[ipl] < 0) {
96 if (rparm != 0) rpar[ipl] = rparm[ipl];
97 if (rpar[ipl] < 0) NegPresent =
TRUE;
98 }
99 if (rpar[ipl+1] < 0) {
100 if (rparm != 0) rpar[ipl] = rparm[ipl];
101 if (rpar[ipl] < 0) NegPresent =
TRUE;
102 }
103 }
104 }
105 if (shape == "PCON") {
108 for (
G4int i=0;i<nz;i++) {
109 ipl = 4 + i*3;
110 if (rpar[ipl] < 0) {
111 if (rparm != 0) rpar[ipl] = rparm[ipl];
112 if (rpar[ipl] < 0) NegPresent =
TRUE;
113 }
114 if (rpar[ipl+1] < 0) {
115
116
117 if (rparm != 0) rpar[ipl] = rparm[ipl];
118 if (rpar[ipl] < 0) NegPresent =
TRUE;
119 }
120 }
121 }
122 }
123
124 if (shape == "BOX") {
125 if (shapem == "TRD1") {
126 if (rpar[1] < 0) {
127 if (rparm != 0) rpar[1] = rparm[2];
128 if (rpar[1] < 0) NegPresent =
TRUE;
129 }
130 if (rpar[2] < 0) {
131 if (rparm != 0) rpar[2] = rparm[3];
132 if (rpar[2] < 0) NegPresent =
TRUE;
133 }
134 if (rpar[0] < 0) {
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;
138 }
139 }
140 if (shapem == "TRD2") {
141 if (rpar[2] < 0) {
142 if (rparm != 0) rpar[2] = rparm[4];
143 if (rpar[2]<0) NegPresent =
TRUE;
144 }
145 if (rpar[0] < 0) {
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;
149 }
150 if (rpar[1] < 0) {
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;
154 }
155 }
156 if (shapem == "TRAP") {
157 if (rpar[2] < 0) {
158 if (rparm != 0) rpar[2] = rparm[0];
159 if (rpar[2] < 0) NegPresent =
TRUE;
160 }
161 if (rpar[0] < 0) {
162 if (rparm != 0) {
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);
168 }
169 if (rpar[0] < 0) NegPresent =
TRUE;
170 }
171 if (rpar[1] < 0) {
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;
175 }
176 }
177 }
178 return NegPresent;
179}