47 if (rotfile==
"" || rotfile==
file)
53 G4cerr <<
"ERROR: Trying to get Rotation Matrices from " << rotfile
54 <<
" when previously were retrieved from " <<
file <<
"." <<
G4endl;
62 G4cerr <<
"ERROR: You haven't defined which file to use for materials in "
63 <<
"CCalRotationMatrixFactory::getInstance(G4String)" <<
G4endl;
77 G4cerr <<
"ERROR: Trying to change Rotation Matrices file name to "
78 << rotfile <<
"." <<
G4endl;
99 retrot = (*it).second;
112 G4double sinth1, sinth2, sinth3, costh1, costh2, costh3;
113 G4double sinph1, sinph2, sinph3, cosph1, cosph2, cosph3;
117 if (TH1 == 0.0 || TH1 == 360) {
118 sinth1 = 0.0; costh1 = 1.0;
119 }
else if (TH1 == 90.0 || TH1 == -270) {
120 sinth1 = 1.0; costh1 = 0.0;
121 }
else if (TH1 == 180.0 || TH1 == -180.0) {
122 sinth1 = 0.0; costh1 = -1.0;
123 }
else if (TH1 == 270.0 || TH1 == -90.0) {
124 sinth1 = -1.0; costh1 = 0.0;
126 sinth1 = std::sin(th1); costh1 = std::cos(th1);
129 if (TH2 == 0.0 || TH2 == 360) {
130 sinth2 = 0.0; costh2 = 1.0;
131 }
else if (TH2 == 90.0 || TH2 == -270) {
132 sinth2 = 1.0; costh2 = 0.0;
133 }
else if (TH2 == 180.0 || TH2 == -180.0) {
134 sinth2 = 0.0; costh2 = -1.0;
135 }
else if (TH2 == 270.0 || TH2 == -90.0) {
136 sinth2 = -1.0; costh2 = 0.0;
138 sinth2 = std::sin(th2); costh2 = std::cos(th2);
141 if (TH3 == 0.0 || TH3 == 360) {
142 sinth3 = 0.0; costh3 = 1.0;
143 }
else if (TH3 == 90.0 || TH2 == -270) {
144 sinth3 = 1.0; costh3 = 0.0;
145 }
else if (TH3 == 180.0 || TH3 == -180.0) {
146 sinth3 = 0.0; costh3 = -1.0;
147 }
else if (TH3 == 270.0 || TH3 == -90.0) {
148 sinth3 = -1.0; costh3 = 0.0;
150 sinth3 = std::sin(th3); costh3 = std::cos(th3);
153 if (PH1 == 0.0 || PH1 == 360) {
154 sinph1 = 0.0; cosph1 = 1.0;
155 }
else if (PH1 == 90.0 || PH1 == -270) {
156 sinph1 = 1.0; cosph1 = 0.0;
157 }
else if (PH1 == 180.0 || PH1 == -180.0) {
158 sinph1 = 0.0; cosph1 = -1.0;
159 }
else if (PH1 == 270.0 || PH1 == -90.0) {
160 sinph1 = -1.0; cosph1 = 0.0;
162 sinph1 = std::sin(phi1); cosph1 = std::cos(phi1);
165 if (PH2 == 0.0 || PH2 == 360) {
166 sinph2 = 0.0; cosph2 = 1.0;
167 }
else if (PH2 == 90.0 || PH2 == -270) {
168 sinph2 = 1.0; cosph2 = 0.0;
169 }
else if (PH2 == 180.0 || PH2 == -180.0) {
170 sinph2 = 0.0; cosph2 = -1.0;
171 }
else if (PH2 == 270.0 || PH2 == -90.0) {
172 sinph2 = -1.0; cosph2 = 0.0;
174 sinph2 = std::sin(phi2); cosph2 = std::cos(phi2);
177 if (PH3 == 0.0 || PH3 == 360) {
178 sinph3 = 0.0; cosph3 = 1.0;
179 }
else if (PH3 == 90.0 || PH3 == -270) {
180 sinph3 = 1.0; cosph3 = 0.0;
181 }
else if (PH3 == 180.0 || PH3 == -180.0) {
182 sinph3 = 0.0; cosph3 = -1.0;
183 }
else if (PH3 == 270.0 || PH3 == -90.0) {
184 sinph3 = -1.0; cosph3 = 0.0;
186 sinph3 = std::sin(phi3); cosph3 = std::cos(phi3);
220 if (std::getenv(
"CCAL_GLOBALPATH"))
221 path = std::getenv(
"CCAL_GLOBALPATH");
228 ed <<
"Could not open file " <<
file <<
" ... Exiting!" <<
G4endl;
229 G4Exception(
"CCalRotationMatrixFactory::CCalRotationMatrixFactory()",
242 G4cout <<
" ==> Reading Rotation Matrices... " <<
G4endl;
243 G4cout <<
" Name\tTheta1\tPhi1\tTheta2\tPhi2\tTheta3\tPhi3"<<
G4endl;
247 while(name!=
"*ENDDO") {
248 if (name.index(
"#.")==0) {
249 is.getline(rubish,256,
'\n');
252 G4cout <<
" " << name <<
'\t';
254 G4double th1, phi1, th2, phi2, th3, phi3;
258 G4cout << th1 <<
'\t' << phi1 <<
'\t';
263 G4cout << th2 <<
'\t' << phi2 <<
'\t';
268 G4cout << th3 <<
'\t' << phi3 <<
'\t';
271 is.getline(rubish,256,
'\n');
276 AddMatrix(name, th1*
deg, phi1*deg, th2*deg, phi2*deg, th3*deg, phi3*deg);