Changeset 7179 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 07/11/05 10:34:49 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MDataSet.cc
r7170 r7179 49 49 // 50 50 // The sequence number are used to concatenate the filenames of the 51 // sequences using the file structure used in the datacenter. 51 // sequences using the file structure used in the datacenter. Each sequence 52 // can be added to the on and off data at the same time but only once. 52 53 // 53 54 // If you have different file names you can overwrite the default file names … … 60 61 // 61 62 // Resource file entries are case sensitive! 63 // 64 // IMPORTANT: 65 // * Run filenames must begin with a string which allows correct 66 // ordering in time, otherwise synchronization might fail. 67 // * Sequence filenames should also have names allowing to order them 68 // in time, but it is not necessary. 62 69 // 63 70 // MISSING (27/01/04): The default name and paths cannot be used yet, because … … 90 97 // -------------------------------------------------------------------------- 91 98 // 92 // Copy the run numbers from the TString runs into the TArrayI data 99 // Copy the sequence numbers from the TString runs into the TArrayI data 100 // Sequences which are twice in the list are only added once. In this case 101 // a warning is emitted. 93 102 // 94 103 void MDataSet::Split(TString &runs, TArrayI &data) const … … 103 112 TString num = runs(regexp); 104 113 105 const Int_t n = data.GetSize(); 114 const Int_t seq = atoi(num.Data()); 115 const Int_t n = data.GetSize(); 116 117 // skip already existing entries 118 int i; 119 for (i=0; i<n; i++) 120 if (data[i] == seq) 121 break; 122 123 if (i<n) 124 { 125 *fLog << warn << "WARNING - Sequence #" << seq << " alraedy in list... skipped." << endl; 126 continue; 127 } 128 129 // set new entry 106 130 data.Set(n+1); 107 data[n] = atoi(num.Data()); 108 131 data[n] = seq; 132 133 // remove entry from string 109 134 runs.Remove(0, runs.First(num)+num.Length()); 110 135 } 111 136 } 112 137 138 // -------------------------------------------------------------------------- 139 // 140 // After resolving the sequence filename and directory either from the 141 // default (/magic/data/sequences/0004/sequence00004000.txt) or from 142 // the corresponding entries in the dataset file. 143 // The entries are sorted by filename. 144 // 113 145 void MDataSet::ResolveSequences(TEnv &env, const TArrayI &num, TList &list) const 114 146 { … … 235 267 } 236 268 269 // -------------------------------------------------------------------------- 270 // 271 // Adds all sequences contained in list to the MDirIter. After adding 272 // everything MDirIter::Sort is called to sort all entries by name. 273 // 237 274 Bool_t MDataSet::AddSequencesFromList(const TList &list, MDirIter &files) 238 275 { … … 251 288 seq.SetupDatRuns(files, MSequence::kImages, dir.IsNull() ? 0 : dir.Data()); 252 289 } 290 291 // This is important in case of synchronisation, because the 292 // files in the sequences can be interleaved (eg W1, W2) 293 // Filenames MUST begin with an appropriate string which allow 294 // to order them correctly in time! 295 files.Sort(); 253 296 254 297 if (gLog.GetDebugLevel()>4) -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r6964 r7179 31 31 // 32 32 // A sequence is a collection of runs which should be used together. 33 // Any run can be contained only once. 33 34 // 34 35 // Here is an example how a file describing a sequence could look like: … … 152 153 // -------------------------------------------------------------------------- 153 154 // 154 // Copy the run numbers from the TString runs into the TArrayI data 155 // Copy the run numbers from the TString runs into the TArrayI data. 156 // Runs which are twice in the list are only added once. In this case 157 // a warning is emitted. 155 158 // 156 159 void MSequence::Split(TString &runs, TArrayI &data) const … … 165 168 TString num = runs(regexp); 166 169 167 const Int_t n = data.GetSize(); 170 const Int_t run = atoi(num.Data()); 171 const Int_t n = data.GetSize(); 172 173 // skip already existing entries 174 int i; 175 for (i=0; i<n; i++) 176 if (data[i] == run) 177 break; 178 179 if (i<n) 180 { 181 *fLog << warn << "WARNING - Run #" << run << " alraedy in list... skipped." << endl; 182 continue; 183 } 184 185 // set new entry 168 186 data.Set(n+1); 169 data[n] = atoi(num.Data());187 data[n] = run; 170 188 171 189 runs.Remove(0, runs.First(num)+num.Length()); 172 190 } 173 191 } 174 /* 175 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const 176 { 177 TString d(path); 178 179 // Setup path 180 if (d.IsNull()) 181 { 182 d = GetStandardPath(); 183 d += raw ? "rawfiles/" : "merpp/"; 184 d += fNight.GetStringFmt("%Y/%m/%d"); 185 } 186 else 187 gSystem->ExpandPathName(d); 188 189 for (int i=0; i<arr.GetSize(); i++) 190 { 191 // R. DeLosReyes and T. Bretz 192 // Changes to read the DAQ numbering format. Changes takes place 193 // between runs 35487 and 00035488 (2004_08_30) 194 const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E"; 195 196 TString n; 197 198 // Create file name 199 n = fNight.GetStringFmt("%Y%m%d_"); 200 n += Form(fmt, arr[i], id); 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 */ 192 210 193 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const 211 194 {
Note:
See TracChangeset
for help on using the changeset viewer.