Changeset 7459 for trunk/MagicSoft/Mars/datacenter/macros/findcacofiles.C
- Timestamp:
- 01/10/06 13:44:29 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/findcacofiles.C
r7232 r7459 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // FindCaCoFiles.C27 // findcacofiles.C 28 28 // =============== 29 // 30 // Macro to get from the database the number of the runs, for which no caco 31 // file is available. 32 // 33 // Sometimes the DAQ aborts a run and starts itself a new one. In this cases 34 // there's the camera controll doesn't start a new file, as the command to 35 // start a new run was not sent by the central control. So the caco 36 // information is stored in the previous caco file, which has a different 37 // runnumber. To be able to merpp the information into the calibrated data 38 // file, the runnumber of the file containing the information has to be found. 39 // This is done by a script. 40 // findcacofiles.C produces the input for this script. It queries from the 41 // database, for which runs no caco file with the same runnumber is available 42 // and writes the runnumbers into an txt file. 43 // 44 // Usage: 45 // .x findcacofiles.C+("date", "logpath") 46 // date and logpath are needed only for the output file 47 // 48 // Make sure, that database and password are corretly set in a resource 49 // file called sql.rc and the resource file is found. 50 // 51 // Returns 0 in case of failure and 1 in case of success. 29 52 // 30 53 ///////////////////////////////////////////////////////////////////////////// … … 60 83 cout << endl; 61 84 85 //get runnumbers from database 62 86 TString query="SELECT RunProcessStatus.fRunNumber FROM RunProcessStatus "; 63 87 query+=" LEFT JOIN RunData on RunData.fRunNumber=RunProcessStatus.fRunNumber "; … … 72 96 } 73 97 98 //create output file 74 99 TString filename(Form("%s/findcacofiles-%s.txt", logpath.Data(), date.Data())); 75 100 ofstream fout(filename, ios::app); … … 80 105 } 81 106 107 //write runnumbers into output file 82 108 TSQLRow *row=0; 83 109 while ((row = res->Next()))
Note:
See TracChangeset
for help on using the changeset viewer.