Changeset 6906
- Timestamp:
- 04/04/05 10:11:18 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6905 r6906 21 21 22 22 -*-*- END OF LINE -*-*- 23 24 2005/04/04 Thomas Bretz 25 26 * callisto.cc, sinope.cc, mjobs/MDataSet.[h,cc], mjobs/MJCalibTest.cc, 27 mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc, 28 mjobs/MSequence.[h,cc] 29 - changed setup procedure for paths to allow using standard 30 paths everywhere 31 - fixed to use new correct datacenter standard paths 32 33 * mhflux/MHAlpha.cc: 34 - display correct error (excess/significance) 35 36 * mjobs/MJCalibrateSignal.cc, mjobs/MJPedestal.cc: 37 - removed MPointingPosCalc from Tasklist 38 39 * mjobs/MJStar.cc: 40 - added MPointingPosCalc to tasklist for "Events" in case of MC 41 42 23 43 24 44 2005/04/01 Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r6905 r6906 27 27 - switched on bad pixel detection for a pedestal level 28 28 which is more than 5 times the variance 29 30 - Fixed default paths to be correct for the new data center 31 32 - Fixed handling of drive data. The pointing position in now 33 copied to MPointingPos inside star for real and MC events 29 34 30 35 -
trunk/MagicSoft/Mars/callisto.cc
r6888 r6906 124 124 125 125 MDirIter Next1, Next2, Next3; 126 seq.SetupPedRuns(Next1, kInpathD, "P",raw);127 seq.SetupCalRuns(Next2, kInpathD, "C",raw);128 seq.SetupDatRuns(Next3, kInpathD, "D",raw);126 seq.SetupPedRuns(Next1, kInpathD, raw); 127 seq.SetupCalRuns(Next2, kInpathD, raw); 128 seq.SetupDatRuns(Next3, kInpathD, raw); 129 129 130 130 gLog << all; -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r6905 r6906 197 197 if (fit.FitEnergy(fHAlpha, fOffData, i)) 198 198 { 199 fHEnergy.SetBinContent(i, fit.GetEventsExcess()); 199 200 if (fit.GetSignificance()>1) 200 {201 fHEnergy.SetBinContent(i, fit.GetEventsExcess());202 201 fHEnergy.SetBinError(i, fit.GetEventsExcess()/fit.GetSignificance()); 203 } 202 else 203 fHEnergy.SetBinError(i, fit.GetEventsExcess()); 204 204 } 205 205 } … … 219 219 if (fit.FitTheta(fHAlpha, fOffData, i)) 220 220 { 221 fHTheta.SetBinContent(i, fit.GetEventsExcess()); 221 222 if (fit.GetSignificance()>1) 222 {223 fHTheta.SetBinContent(i, fit.GetEventsExcess());224 223 fHTheta.SetBinError(i, fit.GetEventsExcess()/fit.GetSignificance()); 225 } 224 else 225 fHTheta.SetBinError(i, fit.GetEventsExcess()); 226 226 } 227 227 } … … 431 431 // 432 432 fHTime.SetBinContent(n+1, fit.GetEventsExcess()); 433 fHTime.SetBinError(n+1, fit.GetEventsExcess()/fit.GetSignificance()); 433 if (fit.GetSignificance()>1) 434 fHTime.SetBinError(n+1, fit.GetEventsExcess()/fit.GetSignificance()); 435 else 436 fHTime.SetBinError(n+1, fit.GetEventsExcess()); 434 437 435 438 *fLog << all << *fTimeEffOn << ": " << fit.GetEventsExcess() << endl; -
trunk/MagicSoft/Mars/mjobs/MDataSet.cc
r6891 r6906 120 120 gSystem->ExpandPathName(dir); 121 121 122 // Set default sequence file and dir name 122 123 if (name.IsNull()) 123 { 124 // Replace with correct default name 125 name = Form("/data2/wuerzburg/sequences/sequence%08d.txt", num[i]); 126 } 127 /* 124 name = Form("/magic/sequences/%04d/sequence%08d.txt", num[i]/1000, num[i]); 128 125 if (dir.IsNull()) 129 { 130 // Replace with default dir 131 } 132 */ 126 name = Form("/magic/data/star/%04d/%08d", num[i]/1000, num[i]); 133 127 134 128 if (gSystem->AccessPathName(name, kFileExists)) … … 140 134 list.Add(new TNamed(name, dir)); 141 135 } 136 137 // For the synchronization we must make sure, that all sequences are 138 // in the correct order... 139 list.Sort(); 142 140 } 143 141 … … 236 234 } 237 235 238 Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read , char *id, Bool_t raw)236 Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read) 239 237 { 240 238 MDirIter files; … … 252 250 253 251 const TString dir(o->GetTitle()); 254 seq.SetupDatRuns(files, dir.IsNull() ? 0 : dir.Data(), id, raw);252 seq.SetupDatRuns(files, MSequence::kImages, dir.IsNull() ? 0 : dir.Data()); 255 253 } 256 254 … … 264 262 } 265 263 266 Bool_t MDataSet::AddFiles(MRead &read , char *id, Bool_t raw) const267 { 268 const Bool_t rc1 = AddFilesOff(read , id, raw);269 const Bool_t rc2 = AddFilesOn(read , id, raw);264 Bool_t MDataSet::AddFiles(MRead &read) const 265 { 266 const Bool_t rc1 = AddFilesOff(read); 267 const Bool_t rc2 = AddFilesOn(read); 270 268 return rc1 && rc2; 271 269 } 272 270 273 Bool_t MDataSet::AddFilesOn(MRead &read , char *id, Bool_t raw) const274 { 275 return AddSequencesToList(fSequencesOn, read , id, raw);276 } 277 278 Bool_t MDataSet::AddFilesOff(MRead &read , char *id, Bool_t raw) const279 { 280 return AddSequencesToList(fSequencesOff, read , id, raw);271 Bool_t MDataSet::AddFilesOn(MRead &read) const 272 { 273 return AddSequencesToList(fSequencesOn, read); 274 } 275 276 Bool_t MDataSet::AddFilesOff(MRead &read) const 277 { 278 return AddSequencesToList(fSequencesOff, read); 281 279 } 282 280 -
trunk/MagicSoft/Mars/mjobs/MDataSet.h
r6891 r6906 54 54 55 55 // Setter 56 static Bool_t AddSequencesToList(const TList &list, MRead &read , char *id="I", Bool_t raw=kFALSE);56 static Bool_t AddSequencesToList(const TList &list, MRead &read); 57 57 58 Bool_t AddFiles(MRead &read , char *id="I", Bool_t raw=kFALSE) const;59 Bool_t AddFilesOn(MRead &read , char *id="I", Bool_t raw=kFALSE) const;60 Bool_t AddFilesOff(MRead &read , char *id="I", Bool_t raw=kFALSE) const;58 Bool_t AddFiles(MRead &read) const; 59 Bool_t AddFilesOn(MRead &read) const; 60 Bool_t AddFilesOff(MRead &read) const; 61 61 62 62 // TObject -
trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc
r6874 r6906 317 317 if (fSequence.IsValid()) 318 318 { 319 const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C",IsUseRawData());319 const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData()); 320 320 const Int_t n1 = fSequence.GetNumCalRuns(); 321 321 if (n0==0) -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6874 r6906 317 317 if (fSequence.IsValid()) 318 318 { 319 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D",IsUseRawData());319 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, IsUseRawData()); 320 320 const Int_t n1 = fSequence.GetNumDatRuns(); 321 321 if (n0==0) … … 671 671 write.AddContainer("MRawEvtHeader", "Events"); 672 672 //write.AddContainer("MArrivalTime", "Events", kFALSE); 673 write.AddContainer("MPointingPos", "Events", kFALSE);673 //write.AddContainer("MPointingPos", "Events", kFALSE); 674 674 // Slow-Control: Current-tree 675 675 write.AddContainer("MTimeCurrents", "Currents", kFALSE); … … 770 770 771 771 // Setup List for Drive-tree 772 MPointingPosCalc pcalc;772 //MPointingPosCalc pcalc; 773 773 774 774 // Now setup main tasklist … … 782 782 tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All"); 783 783 784 if (IsUseMC())785 tlist.AddToList(&pcalc, "Drive");784 //if (IsUseMC()) 785 // tlist.AddToList(&pcalc, "Drive"); 786 786 787 787 tlist.AddToList(&write); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r6887 r6906 1762 1762 if (fSequence.IsValid()) 1763 1763 { 1764 const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C",IsUseRawData());1764 const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData()); 1765 1765 const Int_t n1 = fSequence.GetNumCalRuns(); 1766 1766 if (n0==0) -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6874 r6906 963 963 { 964 964 const Int_t n0 = IsUseData() 965 ? fSequence.SetupDatRuns(iter, fPathData, "D", IsUseRawData())966 : fSequence.SetupPedRuns(iter, fPathData, "P",IsUseRawData());965 ? fSequence.SetupDatRuns(iter, fPathData, IsUseRawData()) 966 : fSequence.SetupPedRuns(iter, fPathData, IsUseRawData()); 967 967 const Int_t n1 = IsUseData() 968 968 ? fSequence.GetNumDatRuns() -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r6877 r6906 332 332 333 333 MPointingPosCalc pcalc; 334 //MSrcPosFromModel srcpos;335 336 MTaskList tlist3("Drive");337 tlist3.AddToList(&pcalc);338 //tlist3.AddToList(&srcpos);339 334 340 335 tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal); 341 tlist.AddToList(& tlist3,"Drive");336 tlist.AddToList(&pcalc, ismc ? "Events" : "Drive"); 342 337 tlist.AddToList(&tlist2, "Events"); 343 338 tlist.AddToList(&write); -
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 -
trunk/MagicSoft/Mars/mjobs/MSequence.h
r6846 r6906 20 20 public: 21 21 enum LightCondition_t { kNA, kNoMoon, kTwilight, kMoon }; 22 enum FileType_t { 23 kRawDat, kRawPed, kRawCal, kRawAll, 24 kRootDat, kRootPed, kRootCal, kRootAll, 25 kCalibrated, kImages 26 }; 22 27 private: 23 28 UInt_t fSequence; … … 51 56 const char *GetFileName(UInt_t num); 52 57 53 UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const; 58 //UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const; 59 UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path=0) const; 54 60 UInt_t AddRuns(UInt_t first, UInt_t last, TArrayI *runs); 55 61 … … 72 78 Bool_t IsValid() const { return fSequence!=(UInt_t)-1; } 73 79 74 UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, char *id="P", Bool_t raw=kFALSE) const; 75 UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, char *id="D", Bool_t raw=kFALSE) const; 76 UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, char *id="?", Bool_t raw=kFALSE) const; 77 UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, char *id="C", Bool_t raw=kFALSE) const; 78 80 UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 81 UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 82 UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 83 UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 84 UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0) const; 85 /* 86 UInt_t SetupPedRuns(MDirIter &iter, FileType_t type, const char *path=0); 87 UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0); 88 UInt_t SetupAllRuns(MDirIter &iter, FileType_t type, const char *path=0); 89 UInt_t SetupCalRuns(MDirIter &iter, FileType_t type, const char *path=0); 90 */ 79 91 // Getter 80 92 UInt_t GetNumAllRuns() const { return fRuns.GetSize(); } … … 100 112 const TString &GetSource() const { return fSource; } 101 113 102 const TString GetStandardPath( Bool_t raw) const;114 const TString GetStandardPath() const { return "/magic/data/"; } 103 115 104 116 // Setter -
trunk/MagicSoft/Mars/sinope.cc
r6888 r6906 239 239 240 240 MDirIter Next; 241 seq.SetupAllRuns(Next, kInpathD, "[PCD]",kTRUE);241 seq.SetupAllRuns(Next, kInpathD, kTRUE); 242 242 243 243 gLog << all; … … 349 349 350 350 if (kOutpath.IsNull()) 351 kOutpath = seq.GetStandardPath(kTRUE); 351 { 352 kOutpath = seq.GetStandardPath(); 353 kOutpath += "rawfiles/"; 354 } 352 355 if (!kOutpath.EndsWith("/")) 353 356 kOutpath += "/"; … … 392 395 393 396 MDirIter iter; 394 seq.SetupAllRuns(iter, 0, "[DPC]",kTRUE);397 seq.SetupAllRuns(iter, 0, kTRUE); 395 398 396 399 MRawFileRead read;
Note:
See TracChangeset
for help on using the changeset viewer.