Read given text file.
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;
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)
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
align::Scalars convertToAlignableCoord(const align::Scalars &align_params)