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") NINPUTS_detId++;
30 std::vector<int> d_inputs;
36 while ( !myfile.eof() && myfile.good() )
42 if (fileType ==
"TIB") {
48 d_inputs.push_back( itmpInput );
50 for (
int i=0;
i<NINPUTS_detId;
i++ )
53 d_inputs.push_back( itmpInput );
60 if (fileType ==
"TID") {
61 TIDDetId myTDI(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
62 m_detId = myTDI.
rawId();
64 else if (fileType ==
"TIB") {
65 TIBDetId myTBI(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
66 m_detId = myTBI.
rawId();
69 if (
abs(
int(m_detId) -
int(d_inputs[1])) > 2) {
70 std::cout <<
"ERROR : DetId - detector position mismatch! Found " << nErrors << std::endl;
76 for (
int j=0;
j<NINPUTS_align;
j++ )
79 a_inputs.push_back( tmpInput );
83 if ( myfile.fail() )
break;
85 a_outputs = convertToAlignableCoord( a_inputs );
87 theOriginalMap.insert(
PairTypeOr( d_inputs, a_inputs ));
88 theMap.insert(
PairType( m_detId, a_outputs ));
104 for (
int ii = 0; ii < 3; ii++) {
105 geomCent[ii] = align_params[ii];
106 surCent[ii] = align_params[ii+15];
110 align_outputs.push_back( surCent[0] );
111 align_outputs.push_back( surCent[1] );
112 align_outputs.push_back( surCent[2] );
115 for (
int ii = 3; ii < 12; ii++) {
116 align_outputs.push_back( align_params[ii] );
118 for (
int ii = 18; ii < 27; ii++) {
119 align_outputs.push_back( align_params[ii] );
122 return align_outputs;
std::pair< align::ID, align::Scalars > PairType
void readFile(const std::string &textFileName, const std::string &fileType)
Read given text file.
uint32_t rawId() const
get the raw id
std::vector< Scalar > Scalars
std::pair< std::vector< int >, align::Scalars > PairTypeOr
CLHEP::HepVector AlgebraicVector
align::Scalars convertToAlignableCoord(const align::Scalars &align_params)