{ ifstream fin("SSDpositionsrawV1.txt"); Char_t tmp_str[256]; ofstream fout("SSD_module_report_2.txt"); fout << "> Title: " << endl << "SSD module position measurements. Amsterdam data" << endl << "> Date: " << endl << "07/01/2009" << endl << "> Subdetector: " << endl << "ITS" << endl << "> Report URL: " << endl << "https://edms.cern.ch/document/887877" << endl << "> Version:" << endl << "2" << endl << "> General Observations:" << endl << "Measurements of module fidicial points. Only local X and Z are measured. Using offline convention: local Z, X point opposite global Z,X for top ladder." << endl << "> Coordinate system: " << endl << "LOCAL" << endl << "> Units: " << endl << "micrometer" << endl << "> Nr Columns:" << endl << "8" << endl << "> Column names:" << endl << "Point Name,XLOCAL,YLOCAL,ZLOCAL,Point Type,PrecisionX(),PrecisionY(),PrecisionZ()" << endl << "> Data:" << endl; Int_t iladd = 0; while (fin.good()) { do { fin.getline(tmp_str,256); } while (fin.good() && tmp_str[0]=='#'); if (!fin.good()) continue; Int_t imodule; Float_t x1, z1, x2, z2; //if (sscanf(tmp_str,"%*d %d %*d %d %*f %*f %*f %f %f %f %f",&ladder,&module,&x1,&z1,&x2,&z2) != 6) if (sscanf(tmp_str,"%*d %*d %d %*d %*f %*f %*f %f %f %f %f",&imodule,&x1,&z1,&x2,&z2) != 5) cout << "Error in input file" << endl << "line: " << tmp_str << endl; TString pname="ITS/SSD"; Int_t iLayer, iLadder, iLaddMod; AliITSgeomTGeo::GetModuleId(imodule,iLayer,iLadder,iLaddMod); // returns 1-based numbers pname += iLayer-1; pname += "/Ladder"; pname += iLadder-1; pname += "/Sensor"; pname += iLaddMod-1; fout << (pname+"/Point0 ") << -x1 << " " << 0 << " " << -z1; fout << " M 5 999 5" << endl; fout << (pname+"/Point1 ") << -x2 << " " << 0 << " " << -z2; fout << " M 5 999 5" << endl; } fout.close(); }