Changeset 8528 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 05/21/07 11:02:49 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MSignalCam.cc
r8489 r8528 68 68 // -------------------------------------------------------------------------- 69 69 // 70 // Copy contants of obj into this instance. 71 // 72 void MSignalCam::Copy(TObject &obj) const 73 { 74 MSignalCam &cam = static_cast<MSignalCam&>(obj); 75 76 cam.fNumIslands = fNumIslands; 77 cam.fNumSinglePixels = fNumSinglePixels; 78 cam.fSizeSinglePixels = fSizeSinglePixels; 79 cam.fSizeSubIslands = fSizeSubIslands; 80 cam.fSizeMainIsland = fSizeMainIsland; 81 82 cam.fNumPixelsSaturatedHiGain = fNumPixelsSaturatedHiGain; 83 cam.fNumPixelsSaturatedLoGain = fNumPixelsSaturatedLoGain; 84 85 cam.fPixels->Delete(); 86 87 const UInt_t n = GetNumPixels(); 88 89 cam.InitSize(n); 90 91 for (UInt_t i=0; i<n; i++) 92 new ((*cam.fPixels)[i]) MSignalPix((*this)[i]); 93 } 94 95 // -------------------------------------------------------------------------- 96 // 70 97 // reset counter and delete netries in list. 71 98 // … … 463 490 // -------------------------------------------------------------------------- 464 491 // 492 // Compares the cleaning (fRing and fIsCore) of this object and the 493 // argument. Return the result (kFALSE if different). 494 // 495 // If differences are found the pixels (the pixel from this object first) 496 // is printed. 497 // 498 Bool_t MSignalCam::CompareCleaning(const MSignalCam &cam) const 499 { 500 const UInt_t n = GetNumPixels(); 501 502 if (n != cam.GetNumPixels()) 503 { 504 *fLog << warn << "MSignalCam::CompareCleaning - Number of pixels mismatch." << endl; 505 return kFALSE; 506 } 507 508 for (UInt_t i=0; i<n; i++) 509 { 510 const MSignalPix &p = (*this)[i]; 511 const MSignalPix &q = cam[i]; 512 513 if (p.GetRing()==q.GetRing() && p.IsPixelCore()==q.IsPixelCore()) 514 continue; 515 516 *fLog << warn << "MSignalCam::CompareCleaning - Pixel #" << i << " mismatch." << endl; 517 p.Print(); 518 q.Print(); 519 return kFALSE; 520 } 521 return kTRUE; 522 } 523 524 // -------------------------------------------------------------------------- 525 // 526 // Compares the islands (fIdxIsland) of this object and the 527 // argument. Return the result (kFALSE if different). 528 // 529 // If differences are found the pixels (the pixel from this object first) 530 // is printed. 531 // 532 Bool_t MSignalCam::CompareIslands(const MSignalCam &cam) const 533 { 534 const UInt_t n = GetNumPixels(); 535 536 if (n != cam.GetNumPixels()) 537 { 538 *fLog << warn << "MSignalCam::CompareIslands - Number of pixels mismatch." << endl; 539 return kFALSE; 540 } 541 542 for (UInt_t i=0; i<n; i++) 543 { 544 const MSignalPix &p = (*this)[i]; 545 const MSignalPix &q = cam[i]; 546 547 if (p.GetIdxIsland()==q.GetIdxIsland()) 548 continue; 549 550 *fLog << warn << "MSignalCam::CompareIslands - Pixel #" << i << " mismatch." << endl; 551 p.Print(); 552 q.Print(); 553 return kFALSE; 554 } 555 556 return kTRUE; 557 } 558 559 // -------------------------------------------------------------------------- 560 // 465 561 // Returns, depending on the type flag: 466 562 // -
trunk/MagicSoft/Mars/msignal/MSignalCam.h
r8489 r8528 75 75 Int_t CalcIslands(const MGeomCam &geom); 76 76 77 // Functions for easy comparisons 78 Bool_t CompareCleaning(const MSignalCam &cam) const; 79 Bool_t CompareIslands(const MSignalCam &cam) const; 80 77 81 // class MParContainer 78 82 void Reset(); 79 83 80 84 // class TObject 85 void Copy(TObject &obj) const; 81 86 void Print(Option_t *opt=NULL) const; 82 87 void Clear(Option_t *opt=NULL) { Reset(); } -
trunk/MagicSoft/Mars/msignal/MSignalPix.h
r8391 r8528 22 22 public: 23 23 MSignalPix(Float_t phot=0, Float_t errphot=0); 24 MSignalPix(const MSignalPix &pix) 25 : fIsCore(pix.fIsCore), fRing(pix.fRing), fIdxIsland(pix.fIdxIsland), 26 fPhot(pix.fPhot), fErrPhot(pix.fErrPhot), fArrivalTime(pix.fArrivalTime) 27 { 28 } 24 29 30 // TObject 25 31 void Clear(Option_t *o=0); 26 32 void Copy(TObject &obj) const 27 33 { 28 34 MSignalPix &pix = (MSignalPix&)obj; 29 pix.fIsCore = fIsCore; 30 pix.fRing = fRing; 31 pix.fIdxIsland = fIdxIsland; 32 pix.fPhot = fPhot; 33 pix.fErrPhot = fErrPhot; 35 pix.fIsCore = fIsCore; 36 pix.fRing = fRing; 37 pix.fIdxIsland = fIdxIsland; 38 pix.fPhot = fPhot; 39 pix.fErrPhot = fErrPhot; 40 pix.fArrivalTime = fArrivalTime; 34 41 } 42 void Print(Option_t *opt = NULL) const; 35 43 44 // MSignalPix 36 45 Float_t GetNumPhotons() const { return fPhot; } 37 46 Float_t GetErrorPhot() const { return fErrPhot; } … … 60 69 //void Scale(Float_t f) { fPhot /= f; } 61 70 62 void Print(Option_t *opt = NULL) const;63 64 71 ClassDef(MSignalPix, 7) // class containing information about the Cerenkov Photons in a pixel 65 72 };
Note:
See TracChangeset
for help on using the changeset viewer.