File indexing completed on 2024-04-06 12:22:32
0001
0002
0003
0004
0005 #include <iostream>
0006
0007 #include "prepareMagneticFieldGrid.h"
0008
0009 using namespace std;
0010
0011 int main(int argc, char **argv) {
0012 if (argc > 4) {
0013 cout << "SYNOPSIS:" << endl << " prepareFieldTable input.table output.bin [sector]" << endl;
0014 cout << "Example:" << endl
0015 << " prepareFieldTable /afs/cern.ch/cms/OO/mag_field/version_85l_030919/v-xyz-217.table grid.217.bin" << endl;
0016 return 1;
0017 }
0018
0019 string filename1 = argv[1];
0020 string filename2 = argv[2];
0021
0022 int sector = 0;
0023 if (argc == 4) {
0024 sector = atoi(argv[3]);
0025 }
0026
0027 cout << "Using Rotation from sector " << sector << endl;
0028
0029 prepareMagneticFieldGrid MFG001(sector);
0030 MFG001.countTrueNumberOfPoints(filename1);
0031
0032 MFG001.fillFromFile(filename1);
0033 int type = MFG001.gridType();
0034 if (type == 0) {
0035 cout << " standard grid sructure detection failed, retrying with special grid sructure" << endl;
0036 } else {
0037 if (MFG001.isReady())
0038 MFG001.validateAllPoints();
0039 if (MFG001.isReady()) {
0040 MFG001.saveGridToFile(filename2);
0041 cout << " " << endl;
0042 return 0;
0043 }
0044 }
0045
0046
0047 prepareMagneticFieldGrid MFG002(sector);
0048 MFG002.fillFromFileSpecial(filename1);
0049 type = MFG002.gridType();
0050 if (type == 0)
0051 cout << " special grid sructure detection failed " << endl;
0052 if (MFG002.isReady())
0053 MFG002.validateAllPoints();
0054 if (MFG002.isReady()) {
0055 MFG002.saveGridToFile(filename2);
0056 cout << " " << endl;
0057 return 0;
0058 }
0059
0060 return 1;
0061 }