Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
//   COCOA class implementation file
//Id:  ALIRmDataFromFile.cc
//CAT: Model
//
//   History: v1.0
//   Pedro Arce

#include "Alignment/CocoaModel/interface/ALIRmDataFromFile.h"

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ALIRmDataFromFile::ALIRmDataFromFile() {}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ALIbool ALIRmDataFromFile::setAngle(const ALIstring& coord, const ALIdouble val) {
  if (coord == "X") {
    return setAngleX(val);
  } else if (coord == "Y") {
    return setAngleY(val);
  } else if (coord == "Z") {
    return setAngleZ(val);
  } else {
    std::cerr << "!!! FATAL ERROR ALIRmDataFromFile::setAngle. Coordinate must be X, Y or Z, it ii " << coord
              << std::endl;
    std::exception();
  }
  return false;
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ALIbool ALIRmDataFromFile::setAngleX(const ALIdouble val) {
  theAngleX = val;
  theDataFilled += "X";
  return true;
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ALIbool ALIRmDataFromFile::setAngleY(const ALIdouble val) {
  theAngleY = val;
  theDataFilled += "Y";
  return true;
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ALIbool ALIRmDataFromFile::setAngleZ(const ALIdouble val) {
  theAngleZ = val;
  theDataFilled += "Z";
  return true;
}

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void ALIRmDataFromFile::constructRm() {
  if (theDataFilled.find('X') == std::string::npos || theDataFilled.find('Y') == std::string::npos ||
      theDataFilled.find('Z') == std::string::npos) {
    std::cerr << "!!!  ALIRmDataFromFile::constructRm. FATAL ERROR: building rm while one angle is missing: "
              << theDataFilled << std::endl;
  } else {
    theRm = CLHEP::HepRotation();
    theRm.rotateX(theAngleX);
    theRm.rotateY(theAngleY);
    theRm.rotateZ(theAngleZ);
  }
}