Changeset 7459 for trunk/MagicSoft/Mars/datacenter/macros/fillsinope.C
- Timestamp:
- 01/10/06 13:44:29 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillsinope.C
r7265 r7459 30 30 // 31 31 // This macro is used to read the sinope output files sinope*.txt 32 // For each run sinope is run twice: once for the data events and once for the 33 // calibration events. The pulse position and height is checked. The output is 34 // stored in a sinope*.root and a sinope*.txt file. The files for data events 35 // are marked with -dat and the ones for calibration events with -cal. 36 // From the txt files the result is extracted and inserted into the database 37 // in the table DataCheck, which stores the datacheck results. 38 // As the column names in the database differ only by the addition 'Interlaced' 39 // which is given to columns corresponding to the calibration events, the 40 // files can be processed with the same function. 32 41 // 33 42 // Usage: … … 87 96 TEnv env(fname); 88 97 98 //build query 89 99 TString query="UPDATE DataCheck SET "; 90 100 101 //array with part of column names 91 102 TString values[9] = { "Events" , "HasSignal" , "HasPedestal" , "PositionSignal" , "PositionFWHM" , "PositionAsym" , "HeightSignal" , "HeightFWHM" , "HeightAsym" }; 92 103 104 //get values from the file add them to query 93 105 TString str; 94 106 for (Int_t i=0 ; i<9 ; i++) … … 118 130 119 131 cout << "Q: " << query << endl; 132 //insert information into db 120 133 TSQLResult *res = serv.Query(query); 121 134 if (!res) … … 146 159 cout << endl; 147 160 161 //get date of run from database 148 162 TString query(Form("SELECT DATE_FORMAT(ADDDATE(fRunStart, Interval 13 HOUR), '%%Y/%%m/%%d') FROM RunData WHERE fRunNumber=%d", 149 163 runno)); … … 162 176 delete res; 163 177 178 //insert entry for the run into the database in the table DataCheck, if it is not yet existing 164 179 if (!ExistStr(serv, "fRunNumber", "DataCheck", Form("%d", runno))) 165 180 { 166 181 query=Form("INSERT DataCheck SET fRunNumber=%d", runno); 167 182 168 cout << "U:" << query << endl;169 183 res = serv.Query(query); 170 184 if (!res) … … 175 189 } 176 190 191 //get filenames of sinope output files 177 192 TString fname(Form("%s/sinope/%s/sinope-dat%08d.txt", 178 193 datapath.Data(), date.Data(), runno)); … … 183 198 184 199 Int_t rc=0; 200 //process dat-file 185 201 rc=Process(serv, fname, runno, kFALSE, dummy); 186 202 if (rc==0) 187 203 return rc; 188 204 205 //process cal-file 189 206 rc=Process(serv, fnamecal, runno, kTRUE, dummy); 190 207 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.