Changeset 6906 for trunk/MagicSoft/Mars/mjobs/MSequence.cc
- Timestamp:
- 04/04/05 10:11:18 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r6858 r6906 172 172 } 173 173 } 174 175 const TString MSequence::GetStandardPath(Bool_t raw) const 176 { 177 TString d("/magic/data/"); 178 d += raw ? "rawfiles/" : "merpp/"; 179 return d; 180 } 181 174 /* 182 175 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const 183 176 { … … 187 180 if (d.IsNull()) 188 181 { 189 d = GetStandardPath(raw); 182 d = GetStandardPath(); 183 d += raw ? "rawfiles/" : "merpp/"; 190 184 d += fNight.GetStringFmt("%Y/%m/%d"); 191 185 } … … 206 200 n += Form(fmt, arr[i], id); 207 201 n += raw ? ".raw" : ".root"; 202 203 // Add Path/File to TIter 204 iter.AddDirectory(d, n, 0); 205 } 206 207 return iter.GetNumEntries(); 208 } 209 */ 210 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const 211 { 212 TString d(path); 213 214 // Setup path 215 if (d.IsNull()) 216 { 217 d = GetStandardPath(); 218 switch (type) 219 { 220 case kRawDat: 221 case kRawPed: 222 case kRawCal: 223 case kRawAll: 224 d += "rawfiles/"; 225 break; 226 case kRootDat: 227 case kRootPed: 228 case kRootCal: 229 case kRootAll: 230 d += "merpp/"; 231 break; 232 case kCalibrated: 233 d += "callisto/"; 234 break; 235 case kImages: 236 d += "star/"; 237 break; 238 } 239 d += fNight.GetStringFmt("%Y/%m/%d"); 240 } 241 else 242 gSystem->ExpandPathName(d); 243 244 for (int i=0; i<arr.GetSize(); i++) 245 { 246 // R. DeLosReyes and T. Bretz 247 // Changes to read the DAQ numbering format. Changes takes place 248 // between runs 35487 and 00035488 (2004_08_30) 249 const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E"; 250 251 TString n; 252 char *id="_"; 253 switch (type) 254 { 255 case kRawDat: 256 case kRootDat: 257 id = "D"; 258 break; 259 case kRawPed: 260 case kRootPed: 261 id = "P"; 262 break; 263 case kRawCal: 264 case kRootCal: 265 id = "C"; 266 break; 267 case kRawAll: 268 case kRootAll: 269 id = "[PCD]"; 270 break; 271 case kCalibrated: 272 id = "Y"; 273 break; 274 case kImages: 275 id = "I"; 276 break; 277 } 278 279 // Create file name 280 n = fNight.GetStringFmt("%Y%m%d_"); 281 n += Form(fmt, arr[i], id); 282 283 switch (type) 284 { 285 case kRawDat: 286 case kRawPed: 287 case kRawCal: 288 case kRawAll: 289 n += ".raw"; 290 break; 291 default: 292 n += ".root"; 293 } 208 294 209 295 // Add Path/File to TIter … … 369 455 // Using raw=kTRUE you get correspodning raw-files setup. 370 456 // Return the number of files added. 371 // 372 UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const 373 { 374 return SetupRuns(iter, fPedRuns, path, id, raw); 457 UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const 458 { 459 return SetupRuns(iter, fPedRuns, raw?kRawPed:kRootPed, path); 375 460 } 376 461 … … 383 468 // Return the number of files added. 384 469 // 385 UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, char *id,Bool_t raw) const386 { 387 return SetupRuns(iter, fDatRuns, path, id, raw);470 UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const 471 { 472 return SetupRuns(iter, fDatRuns, raw?kRawPed:kRootPed, path); 388 473 } 389 474 … … 396 481 // Return the number of files added. 397 482 // 398 UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, char *id,Bool_t raw) const399 { 400 return SetupRuns(iter, fRuns, path, id, raw);483 UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const 484 { 485 return SetupRuns(iter, fRuns, raw?kRawAll:kRootAll, path); 401 486 } 402 487 … … 409 494 // Return the number of files added. 410 495 // 411 UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const 412 { 413 return SetupRuns(iter, fCalRuns, path, id, raw); 496 UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const 497 { 498 return SetupRuns(iter, fCalRuns, raw?kRawCal:kRootCal, path); 499 } 500 501 // -------------------------------------------------------------------------- 502 // 503 // Add all data runs from the sequence to MDirIter. 504 // If path==0 the standard path of the data-center is assumed. 505 // If you have the runs locally use path="." 506 // Using raw=kTRUE you get correspodning raw-files setup. 507 // Return the number of files added. 508 // 509 UInt_t MSequence::SetupDatRuns(MDirIter &iter, FileType_t type, const char *path) const 510 { 511 return SetupRuns(iter, fDatRuns, type, path); 414 512 } 415 513
Note:
See TracChangeset
for help on using the changeset viewer.