Changeset 4748
- Timestamp:
- 08/26/04 16:40:23 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4746 r4748 71 71 * mfileio/MReadReports.h: 72 72 - overwrote GetFileName - otherwise CINT refuses to create an object 73 74 * mbadpixels/MBadPixelsTreat.[h,cc]: 75 - added an primitive interpolation of arrival times which 76 tries to keep the random arrival time for pixels without 77 signal 73 78 74 79 -
trunk/MagicSoft/Mars/callisto.cc
r4746 r4748 119 119 120 120 const TString kInpathD = arg.GetStringAndRemove("--ind=", ""); 121 TString kInpathY = arg.GetStringAndRemove("--iny=", " .");122 TString kOutpathY = arg.GetStringAndRemove("--outy=", " .");123 TString kOutpathC = arg.GetStringAndRemove("--outc=", " .");121 TString kInpathY = arg.GetStringAndRemove("--iny=", ""); 122 TString kOutpathY = arg.GetStringAndRemove("--outy=", ""); 123 TString kOutpathC = arg.GetStringAndRemove("--outc=", ""); 124 124 const TString kOutpath = arg.GetStringAndRemove("--out=", ""); 125 125 const TString kPath = arg.GetStringAndRemove("--path=", ""); … … 139 139 return 0; 140 140 } 141 142 if (kModeC && kOutpathC.IsNull()) 143 kOutpathC = "."; 144 if (kModeY) 145 { 146 if (kInpathY.IsNull()) 147 kInpathY = "."; 148 if (kOutpathY.IsNull()) 149 kOutpathY = "."; 150 } 141 151 if (!kOutpath.IsNull()) 142 152 { … … 232 242 else 233 243 gLog << err << "ERROR"; 234 gLog << " - " << n1 << " files in sequence defined, but " << n0 << " found in ";244 gLog << " - " << n1 << " files in sequence defined, but " << n0 << " found in "; 235 245 gLog << (kInpathD.IsNull() ? "<defaultpath>" : kInpathD.Data()) << endl; 236 246 if (!kForceExec) … … 316 326 } 317 327 318 gLog << all << endl << endl;328 gLog << flush << all << endl << endl; 319 329 } 320 330 … … 371 381 } 372 382 373 gLog << all << endl << endl;383 gLog << flush << all << endl << endl; 374 384 } 375 385 -
trunk/MagicSoft/Mars/callisto.rc
r4732 r4748 202 202 MJCalibrateSignal.MBadPixelsTreat.UseInterpolation: yes 203 203 MJCalibrateSignal.MBadPixelsTreat.ProcessPedestal: yes 204 MJCalibrateSignal.MBadPixelsTreat.ProcessTimes: yes 204 205 #MJCalibrateSignal.MBadPixelsTreat.UseCentralPixel: no 205 206 #MJCalibrateSignal.MBadPixelsTreat.HardTreatment: no -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
r4698 r4748 57 57 58 58 #include <TEnv.h> 59 #include <TArrayD.h> 59 60 #include "MArrayD.h" // Used instead of TArrayD because operator[] has no range check 60 61 61 62 #include "MLog.h" … … 76 77 #include "MBadPixelsCam.h" 77 78 79 #include "MArrivalTime.h" 80 78 81 ClassImp(MBadPixelsTreat); 79 82 … … 88 91 // 89 92 MBadPixelsTreat::MBadPixelsTreat(const char *name, const char *title) 90 : fFlags(0), fNumMinNeighbors(3), fNamePedPhotC ontainer("MPedPhotCam")93 : fFlags(0), fNumMinNeighbors(3), fNamePedPhotCam("MPedPhotCam") 91 94 { 92 95 fName = name ? name : gsDefName.Data(); … … 118 121 if (!fBadPixels) 119 122 { 120 *fLog << err << "MBadPixelsCamnot found... aborting." << endl;123 *fLog << err << AddSerialNumber("MBadPixelsCam") << " not found... aborting." << endl; 121 124 return kFALSE; 122 125 } 123 126 124 fPedPhot = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotContainer), "MPedPhotCam");125 if (!fPedPhot)126 {127 *fLog << err << "MPedPhotCam not found... aborting." << endl;128 return kFALSE;129 }130 131 127 fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); 132 128 if (!fEvt) 133 129 { 134 *fLog << err << "MCerPhotEvtnot found... aborting." << endl;130 *fLog << err << AddSerialNumber("MCerPhotEvt") << " not found... aborting." << endl; 135 131 return kFALSE; 136 132 } … … 139 135 if (!fGeomCam && TESTBIT(fFlags, kUseInterpolation)) 140 136 { 141 *fLog << err << "MGeomCam not found... can't use interpolation." << endl;137 *fLog << err << AddSerialNumber("MGeomCam") << " not found - can't use interpolation... abort." << endl; 142 138 return kFALSE; 139 } 140 141 fPedPhot = 0; 142 if (IsProcessPedestal()) 143 { 144 fPedPhot = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam"); 145 if (!fPedPhot) 146 { 147 *fLog << err << AddSerialNumber("MPedPhotCam") << " not found... aborting." << endl; 148 return kFALSE; 149 } 150 *fLog << inf << "Processing Pedestals..." << endl; 151 } 152 153 fTimes = 0; 154 if (IsProcessTimes()) 155 { 156 fTimes = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime")); 157 if (!fTimes) 158 { 159 *fLog << err << AddSerialNumber("MArrivalTime") << " not found... aborting." << endl; 160 return kFALSE; 161 } 162 *fLog << inf << "Processing Times..." << endl; 143 163 } 144 164 … … 160 180 // Create arrays (FIXME: Check if its possible to create it only once) 161 181 // 162 TArrayD nphot(entries);163 TArrayD perr(entries);182 MArrayD nphot(entries); 183 MArrayD perr(entries); 164 184 165 185 // … … 269 289 270 290 // Create arrays (FIXME: Check if its possible to create it only once) 271 TArrayD ped(entries);272 TArrayD rms(entries);291 MArrayD ped(entries); 292 MArrayD rms(entries); 273 293 274 294 // … … 354 374 355 375 (*fPedPhot)[i].Set(ped[i], rms[i]); 376 } 377 } 378 379 // -------------------------------------------------------------------------- 380 // 381 void MBadPixelsTreat::InterpolateTimes() const 382 { 383 Int_t n = fTimes->GetSize(); 384 385 for (int i=0; i<n; i++) 386 { 387 // 388 // Check whether pixel with idx i is blind 389 // 390 if (!IsPixelBad(i)) 391 continue; 392 393 // 394 // Get the corresponding geometry and pedestal 395 // 396 const MGeomPix &gpix = (*fGeomCam)[i]; 397 398 const Int_t n0 = gpix.GetNumNeighbors(); 399 400 MArrayD time(6); 401 for (int j=0; j<n0; j++) 402 time[j] = (*fTimes)[gpix.GetNeighbor(j)]; 403 404 Int_t p0=0; 405 Int_t p1=0; 406 407 Double_t min=FLT_MAX; 408 for (int j=0; j<n0; j++) 409 for (int k=1; k<j+1; k++) 410 { 411 const Double_t diff = TMath::Abs(time[n0-k] - time[n0-k-j]); 412 413 if (diff>=min && diff<250) 414 continue; 415 416 p0 = n0-k; 417 p1 = n0-k-j; 418 min = diff; 419 } 420 421 if (TMath::Abs(time[p0] - time[p1])<250) 422 fTimes->SetTime(i, (time[p0]+time[p1])/2); 356 423 } 357 424 } … … 557 624 if (TESTBIT(fFlags, kProcessPedestal)) 558 625 InterpolatePedestals(); 626 if (TESTBIT(fFlags, kProcessTimes)) 627 InterpolateTimes(); 559 628 } 560 629 else … … 582 651 if (TESTBIT(fFlags, kProcessPedestal)) 583 652 out << " " << GetUniqueName() << ".SetProcessPedestal();" << endl; 653 if (TESTBIT(fFlags, kProcessTimes)) 654 out << " " << GetUniqueName() << ".SetProcessTimes();" << endl; 584 655 if (TESTBIT(fFlags, kHardTreatment)) 585 656 out << " " << GetUniqueName() << ".SetHardTreatment();" << endl; … … 620 691 SetProcessPedestal(GetEnvValue(env, prefix, "ProcessPedestal", IsProcessPedestal())); 621 692 } 693 if (IsEnvDefined(env, prefix, "ProcessTimes", print)) 694 { 695 rc = kTRUE; 696 SetProcessTimes(GetEnvValue(env, prefix, "ProcessTimes", IsProcessTimes())); 697 } 622 698 if (IsEnvDefined(env, prefix, "NumMinNeighbors", print)) 623 699 { -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
r4698 r4748 9 9 class MCerPhotEvt; 10 10 class MPedPhotCam; 11 class MArrivalTime; 11 12 class MBadPixelsCam; 12 13 … … 17 18 MPedPhotCam *fPedPhot; //! 18 19 MCerPhotEvt *fEvt; //! 20 MArrivalTime *fTimes; //! 19 21 MBadPixelsCam *fBadPixels; //! 20 22 21 23 Byte_t fFlags; // flag for the method which is used 22 24 Byte_t fNumMinNeighbors; 23 TString fNamePedPhotContainer; // name of the 'MPedPhotCam' container 25 26 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container 24 27 25 28 enum … … 28 31 kUseCentralPixel = 2, 29 32 kProcessPedestal = 3, 30 kHardTreatment = 4 33 kProcessTimes = 4, 34 kHardTreatment = 5 31 35 }; 32 36 33 37 static Double_t Pow2(Double_t x) { return x*x; } 34 38 39 void InterpolateTimes() const; 35 40 void InterpolateSignal() const; 36 41 void InterpolatePedestals() const; … … 60 65 b ? SETBIT(fFlags, kProcessPedestal) : CLRBIT(fFlags, kProcessPedestal); 61 66 } 67 void SetProcessTimes(Bool_t b=kTRUE) 68 { 69 b ? SETBIT(fFlags, kProcessTimes) : CLRBIT(fFlags, kProcessTimes); 70 } 62 71 void SetHardTreatment(Bool_t b=kTRUE) 63 72 { … … 67 76 Bool_t IsHardTreatment() const { return TESTBIT(fFlags, kHardTreatment); } 68 77 Bool_t IsProcessPedestal() const { return TESTBIT(fFlags, kProcessPedestal); } 78 Bool_t IsProcessTimes() const { return TESTBIT(fFlags, kProcessTimes); } 69 79 Bool_t IsUseCentralPixel() const { return TESTBIT(fFlags, kUseCentralPixel); } 70 80 Bool_t IsUseInterpolation() const { return TESTBIT(fFlags, kUseInterpolation); } 71 81 72 82 void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; } 73 void SetNamePedPhotContainer(const char *name) { fNamePedPhotContainer = name; } 74 83 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 75 84 76 85 ClassDef(MBadPixelsTreat, 1) // Task to treat bad pixels (interpolation, unmapping) -
trunk/MagicSoft/Mars/mbase/MArrayB.cc
r1080 r4748 15 15 ! * 16 16 ! 17 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)17 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 18 18 ! 19 ! Copyright: MAGIC Software Development, 2000-200 119 ! Copyright: MAGIC Software Development, 2000-2004 20 20 ! 21 21 \* ======================================================================== */ … … 23 23 24 24 ////////////////////////////////////////////////////////////////////////////// 25 // // 26 // MArrayB // 27 // // 28 // Array of Byte_t. It is almost the same than TArrayC, but it containes // 29 // Byte_t instead of Char_t and it can be stored with splitlevel=1 to a // 30 // a root-file because of it's derivement from MArray (TObject) // // 31 // // 25 // 26 // MArrayB 27 // 28 // Array of Byte_t. It is almost the same than TArrayC, but it containes 29 // Byte_t instead of Char_t and it can be stored with splitlevel=1 to a 30 // a root-file because of it's derivement from MArray (TObject) // 31 // 32 // Another advantage is: operator[] has no range check! 33 // 32 34 ////////////////////////////////////////////////////////////////////////////// 33 35 #include "MArrayB.h" -
trunk/MagicSoft/Mars/mbase/MArrayS.cc
r1080 r4748 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 25 25 26 26 ////////////////////////////////////////////////////////////////////////////// 27 // // 28 // MArrayS // 29 // // 30 // Array of UShort_t. It is almost the same than TArrayS, but it containes // 31 // UShort_t instead of Short_t and it can be stored with splitlevel=1 to a // 32 // a root-file because of it's derivement from MArray (TObject) // // 33 // // 27 // 28 // MArrayS 29 // 30 // Array of UShort_t. It is almost the same than TArrayS, but it containes 31 // UShort_t instead of Short_t and it can be stored with splitlevel=1 to a 32 // a root-file because of it's derivement from MArray (TObject) // 33 // 34 // Another advantage is: operator[] has no range check! 35 // 34 36 ////////////////////////////////////////////////////////////////////////////// 35 37 #include "MArrayS.h" -
trunk/MagicSoft/Mars/mbase/MGMap.cc
r4108 r4748 135 135 MGMap::~MGMap() 136 136 { 137 // fToolTip->Hide();138 // delete fToolTip;139 140 137 if (TestBit(kIsOwner)) 141 138 Delete(); … … 164 161 { 165 162 delete (TObject*)(key); 166 if (!val) 167 continue; 168 169 delete (TString*)(val); 163 if (val) 164 delete (TString*)(val); 170 165 /* 171 166 Long_t key2, val2;
Note:
See TracChangeset
for help on using the changeset viewer.