20 std::ifstream myfile(textFileName.c_str());
21 if (!myfile.is_open())
22 throw cms::Exception(
"FileAccess") <<
"Unable to open input text file for " << fileType.c_str();
26 int NINPUTS_align = 30;
27 int NINPUTS_detId = 6;
28 if (fileType ==
"TID")
31 std::vector<int> d_inputs;
37 while (!myfile.eof() && myfile.good()) {
42 if (fileType ==
"TIB") {
48 d_inputs.push_back(itmpInput);
50 for (
int i = 0;
i < NINPUTS_detId;
i++) {
52 d_inputs.push_back(itmpInput);
59 if (fileType ==
"TID") {
60 m_detId = tTopo->
tidDetId(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
61 }
else if (fileType ==
"TIB") {
62 m_detId = tTopo->
tibDetId(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
65 if (
abs(
int(m_detId) -
int(d_inputs[1])) > 2) {
66 std::cout <<
"ERROR : DetId - detector position mismatch! Found " << nErrors << std::endl;
72 for (
int j = 0; j < NINPUTS_align; j++) {
74 a_inputs.push_back(tmpInput);
81 a_outputs = convertToAlignableCoord(a_inputs);
83 theOriginalMap.insert(
PairTypeOr(d_inputs, a_inputs));
84 theMap.insert(
PairType(m_detId, a_outputs));
96 for (
int ii = 0;
ii < 3;
ii++) {
97 geomCent[
ii] = align_params[
ii];
98 surCent[
ii] = align_params[
ii + 15];
102 align_outputs.push_back(surCent[0]);
103 align_outputs.push_back(surCent[1]);
104 align_outputs.push_back(surCent[2]);
107 for (
int ii = 3;
ii < 12;
ii++) {
108 align_outputs.push_back(align_params[
ii]);
110 for (
int ii = 18;
ii < 27;
ii++) {
111 align_outputs.push_back(align_params[
ii]);
114 return align_outputs;
std::pair< align::ID, align::Scalars > PairType
std::pair< std::vector< int >, align::Scalars > PairTypeOr
std::vector< Scalar > Scalars
DetId tidDetId(uint32_t side, uint32_t wheel, uint32_t ring, uint32_t module_fw_bw, uint32_t module, uint32_t ster) const
Abs< T >::type abs(const T &t)
CLHEP::HepVector AlgebraicVector
DetId tibDetId(uint32_t layer, uint32_t str_fw_bw, uint32_t str_int_ext, uint32_t str, uint32_t module, uint32_t ster) const
void readFile(const std::string &textFileName, const std::string &fileType, const TrackerTopology *tTopo)
Read given text file.
align::Scalars convertToAlignableCoord(const align::Scalars &align_params)