// Author: David Lawrence Dec. 20, 2013 // // // hd_ana.cc // #include #include #include using namespace std; void Usage(JApplication &app); //----------- // main //----------- int main(int narg, char *argv[]) { // Instantiate an DApplication object DApplication app(narg, argv); //if(narg<=1)Usage(app); app.Init(); DGeometry *dgeom = app.GetDGeometry(1); if(!dgeom){ jerr << "Couldn't get DGeometry pointer!!" << endl; return -1; } // Get CDC wires vector > cdcwires; dgeom->GetCDCWires(cdcwires); // Get FDC wires vector > fdcwires; dgeom->GetFDCWires(fdcwires); cout << endl; cout << "Writing GlueX wire definitions to gluex_wires.txt ... " << endl; ofstream ofs("gluex_wires.txt"); ofs << "#" << endl; ofs << "# CDC wires" < &wires = cdcwires[i]; for(unsigned int j=0; jL << " "; ofs << w->origin.X() << " "; ofs << w->origin.Y() << " "; ofs << w->origin.Z() << " "; ofs << w->udir.X() << " "; ofs << w->udir.Y() << " "; ofs << w->udir.Z() << " "; ofs << endl; Ncdc++; } } ofs << "#" << endl; ofs << "# ----- FDC ------" << endl; int Nfdc = 0; for(unsigned int i=0; i &wires = fdcwires[i]; for(unsigned int j=0; jL << " "; ofs << w->origin.X() << " "; ofs << w->origin.Y() << " "; ofs << w->origin.Z() << " "; ofs << w->udir.X() << " "; ofs << w->udir.Y() << " "; ofs << w->udir.Z() << " "; ofs << endl; Nfdc++; } } ofs.close(); cout << "Done." << endl; cout << "Num. CDC wires: " << Ncdc << endl; cout << "Num. FDC wires: " << Nfdc << endl; return 0; } //----------- // Usage //----------- void Usage(JApplication &app) { cout<