19 std::ifstream myfile( textFileName.c_str() );
20 if ( !myfile.is_open() )
21 throw cms::Exception(
"FileAccess") <<
"Unable to open input text file for " << fileType.c_str();
25 int NINPUTS_align = 30;
26 int NINPUTS_detId = 6;
27 if (fileType ==
"TID") NINPUTS_detId++;
29 std::vector<int> d_inputs;
35 while ( !myfile.eof() && myfile.good() )
41 if (fileType ==
"TIB") {
47 d_inputs.push_back( itmpInput );
49 for (
int i=0;
i<NINPUTS_detId;
i++ )
52 d_inputs.push_back( itmpInput );
59 if (fileType ==
"TID") {
61 m_detId = tTopo->
tidDetId(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
63 else if (fileType ==
"TIB") {
65 m_detId = tTopo->
tibDetId(d_inputs[2], d_inputs[3], d_inputs[4], d_inputs[5], d_inputs[6], ster);
68 if (
abs(
int(m_detId) -
int(d_inputs[1])) > 2) {
69 std::cout <<
"ERROR : DetId - detector position mismatch! Found " << nErrors << std::endl;
75 for (
int j=0; j<NINPUTS_align; j++ )
78 a_inputs.push_back( tmpInput );
82 if ( myfile.fail() )
break;
84 a_outputs = convertToAlignableCoord( a_inputs );
86 theOriginalMap.insert(
PairTypeOr( d_inputs, a_inputs ));
87 theMap.insert(
PairType( m_detId, a_outputs ));
103 for (
int ii = 0;
ii < 3;
ii++) {
104 geomCent[
ii] = align_params[
ii];
105 surCent[
ii] = align_params[
ii+15];
109 align_outputs.push_back( surCent[0] );
110 align_outputs.push_back( surCent[1] );
111 align_outputs.push_back( surCent[2] );
114 for (
int ii = 3;
ii < 12;
ii++) {
115 align_outputs.push_back( align_params[
ii] );
117 for (
int ii = 18;
ii < 27;
ii++) {
118 align_outputs.push_back( align_params[
ii] );
121 return align_outputs;
std::pair< align::ID, align::Scalars > PairType
std::vector< Scalar > Scalars
std::pair< std::vector< int >, align::Scalars > PairTypeOr
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)