File indexing completed on 2024-04-06 11:56:01
0001
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/CocoaModel/interface/ALIRmDataFromFile.h"
0009
0010
0011 ALIRmDataFromFile::ALIRmDataFromFile() {}
0012
0013
0014 ALIbool ALIRmDataFromFile::setAngle(const ALIstring& coord, const ALIdouble val) {
0015 if (coord == "X") {
0016 return setAngleX(val);
0017 } else if (coord == "Y") {
0018 return setAngleY(val);
0019 } else if (coord == "Z") {
0020 return setAngleZ(val);
0021 } else {
0022 std::cerr << "!!! FATAL ERROR ALIRmDataFromFile::setAngle. Coordinate must be X, Y or Z, it ii " << coord
0023 << std::endl;
0024 std::exception();
0025 }
0026 return false;
0027 }
0028
0029
0030 ALIbool ALIRmDataFromFile::setAngleX(const ALIdouble val) {
0031 theAngleX = val;
0032 theDataFilled += "X";
0033 return true;
0034 }
0035
0036
0037 ALIbool ALIRmDataFromFile::setAngleY(const ALIdouble val) {
0038 theAngleY = val;
0039 theDataFilled += "Y";
0040 return true;
0041 }
0042
0043
0044 ALIbool ALIRmDataFromFile::setAngleZ(const ALIdouble val) {
0045 theAngleZ = val;
0046 theDataFilled += "Z";
0047 return true;
0048 }
0049
0050
0051 void ALIRmDataFromFile::constructRm() {
0052 if (theDataFilled.find('X') == std::string::npos || theDataFilled.find('Y') == std::string::npos ||
0053 theDataFilled.find('Z') == std::string::npos) {
0054 std::cerr << "!!! ALIRmDataFromFile::constructRm. FATAL ERROR: building rm while one angle is missing: "
0055 << theDataFilled << std::endl;
0056 } else {
0057 theRm = CLHEP::HepRotation();
0058 theRm.rotateX(theAngleX);
0059 theRm.rotateY(theAngleY);
0060 theRm.rotateZ(theAngleZ);
0061 }
0062 }