Changeset 7459 for trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C
- Timestamp:
- 01/10/06 13:44:29 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C
r7457 r7459 28 28 // ================ 29 29 // 30 // check the availability of the files of one sequence: 31 // the script filesondisk has inserted the information (which files are on 32 // disk into the database) and with this macro this information is checked 33 // for the runs of one sequence 34 // 35 // executing the macro: 36 // .x checkfileavail.C+("sequencefile") 37 // the sequencefile (including path) has to be given, as the macro retrieves 38 // from there the runnumbers 39 // 40 // the macro returns 0, if a file is missing, and 1 if all files are there 41 // the return value is checked by the script, that executes the macro 42 // 43 // this macro is very similar to the macro checkstardone.C 44 // 30 45 ///////////////////////////////////////////////////////////////////////////// 31 46 … … 43 58 44 59 60 //check the value of a column for a run 61 //if a file is not available, the column contains nothing (NULL) - this value is returned 45 62 TString GetStatus(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column) 46 63 { … … 89 106 TEnv rc("steps.rc"); 90 107 108 //reading runnumbers from Sequencefile 91 109 TEnv sequ(sequencefile); 92 110 cout << "sequ file: " << sequencefile.Data() << endl; 93 111 TString runs; 94 112 runs = sequ.GetValue("Runs", ""); … … 100 118 } 101 119 102 cout << "sequ file: " << sequencefile.Data() << endl; 120 //getting runnumbers from database 121 //(not neccessary anymore -> can be changed) 103 122 TString query(Form("SELECT fRunNumber FROM RunData WHERE fRunNumber in (%s)", 104 123 runs.Data())); … … 108 127 cout << "Error - no run to check" << endl; 109 128 129 //check for each run the availability of files from the table RunProcessStatus 130 //the following columns have to be checked: 131 //fCCFileAvail, fCaCoFileAvail, fCaCoFileFound, fRawFileAvail, fTimingCorrection 132 //fTimingCorrection has to be checked, as only rawfiles with correct timing should be calibrated 110 133 TSQLRow *row=0; 111 134 while ((row = res->Next())) … … 113 136 TString runno=(*row)[0]; 114 137 cout << "run#: " << runno << endl; 138 //if one value returns "" (i.e. column is NULL), 0 is returned 115 139 if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail")=="" 116 140 || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail")=="" … … 121 145 return 0; 122 146 } 147 //if all values are okay (i.e. files are availabel), 1 is returned 123 148 return 1; 124 149
Note:
See TracChangeset
for help on using the changeset viewer.