Changeset 9308 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 02/09/09 11:30:54 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r9303 r9308 159 159 if (!fTitle.Contains(";")) 160 160 fSum->SetYTitle("a.u."); 161 fSum->SetBit(MHCamera::kProfile); 161 if (fUseThreshold!=kCollectMin && fUseThreshold!=kCollectMax) 162 fSum->SetBit(MHCamera::kProfile); 162 163 if (!fErrorSpread) 163 164 fSum->SetBit(MHCamera::kErrorMean); … … 178 179 return kERROR; 179 180 } 180 if (fUseThreshold) 181 182 switch (fUseThreshold) 183 { 184 case kNoBound: 185 fSum->AddCamContent(*evt, fType); 186 break; 187 188 case kIsLowerBound: 189 case kIsUpperBound: 181 190 fSum->CntCamContent(*evt, fThreshold, fType, fUseThreshold>0); 182 else 183 fSum->AddCamContent(*evt, fType); 191 break; 192 193 case kCollectMin: 194 fSum->SetMinCamContent(*evt, /*fThreshold,*/ fType); 195 break; 196 197 case kCollectMax: 198 fSum->SetMaxCamContent(*evt, /*fThreshold,*/ fType); 199 break; 200 201 default: 202 *fLog << err << "ERROR - MHCamEvent::Fill: Unknown type." << endl; 203 return kERROR; 204 } 205 184 206 return kTRUE; 185 207 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r9153 r9308 35 35 36 36 public: 37 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 };37 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0, kCollectMin=-2, kCollectMax=2 }; 38 38 39 39 MHCamEvent(const char *name=NULL, const char *title=NULL); … … 57 57 58 58 void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 59 void SetCollectMin() { fUseThreshold=kCollectMin; } 60 void SetCollectMax() { fUseThreshold=kCollectMax; } 59 61 void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; } 60 62 void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; } -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r9303 r9308 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.11 3 2009-02-07 20:47:41tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.114 2009-02-09 11:30:53 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1591 1591 // 1592 1592 // Call this function to add a MCamEvent on top of the present contents. 1593 // 1 is added to each pixel if the contents of MCamEvent>threshold (in case isabove is set to kTRUE == default) 1594 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1593 // 1 is added to each pixel if the contents of MCamEvent>threshold 1594 // (in case isabove is set to kTRUE == default) 1595 // 1 is added to each pixel if the contents of MCamEvent<threshold 1596 // (in case isabove is set to kFALSE) 1595 1597 // 1596 1598 // in unused pixel is not counted if it didn't fullfill the condition. … … 1658 1660 // 1659 1661 // Call this function to add a MCamEvent on top of the present contents. 1660 // 1 is added to each pixel if the contents of MCamEvent>threshold (in case isabove is set to kTRUE == default) 1661 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1662 // 1 is added to each pixel if the contents of MCamEvent>threshold 1663 // (in case isabove is set to kTRUE == default) 1664 // 1 is added to each pixel if the contents of MCamEvent<threshold 1665 // (in case isabove is set to kFALSE) 1662 1666 // 1663 1667 // in unused pixel is not counted if it didn't fullfill the condition. … … 1702 1706 if (!ispos || fArray[idx+1]>0) 1703 1707 SetUsed(idx); 1708 } 1709 fEntries++; 1710 } 1711 1712 // ------------------------------------------------------------------------ 1713 // 1714 // Call this function to add a MCamEvent on top of the present contents. 1715 // 1 is added to each pixel if the contents of MCamEvent>threshold 1716 // (in case isabove is set to kTRUE == default) 1717 // 1 is added to each pixel if the contents of MCamEvent<threshold 1718 // (in case isabove is set to kFALSE) 1719 // 1720 // in unused pixel is not counted if it didn't fullfill the condition. 1721 // 1722 void MHCamera::SetMaxCamContent(const MCamEvent &event, Int_t type) 1723 { 1724 if (fNcells<=1 || IsFreezed()) 1725 return; 1726 1727 // FIXME: Security check missing! 1728 for (Int_t idx=0; idx<fNcells-2; idx++) 1729 { 1730 Double_t val=0; 1731 const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type); 1732 if (!rc) 1733 continue; 1734 1735 if (!IsUsed(idx)) 1736 { 1737 fArray[idx+1] = val; 1738 SetUsed(idx); 1739 fBinEntries.fArray[idx+1]=1; 1740 } 1741 else 1742 if (val>fArray[idx+1]) 1743 fArray[idx+1] = val; 1744 } 1745 fEntries++; 1746 } 1747 1748 // ------------------------------------------------------------------------ 1749 // 1750 // Call this function to add a MCamEvent on top of the present contents. 1751 // 1 is added to each pixel if the contents of MCamEvent>threshold 1752 // (in case isabove is set to kTRUE == default) 1753 // 1 is added to each pixel if the contents of MCamEvent<threshold 1754 // (in case isabove is set to kFALSE) 1755 // 1756 // in unused pixel is not counted if it didn't fullfill the condition. 1757 // 1758 void MHCamera::SetMinCamContent(const MCamEvent &event, Int_t type) 1759 { 1760 if (fNcells<=1 || IsFreezed()) 1761 return; 1762 1763 // FIXME: Security check missing! 1764 for (Int_t idx=0; idx<fNcells-2; idx++) 1765 { 1766 Double_t val=0; 1767 const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type); 1768 if (!rc) 1769 continue; 1770 1771 if (!IsUsed(idx)) 1772 { 1773 fArray[idx+1] = val; 1774 SetUsed(idx); 1775 fBinEntries.fArray[idx+1]=1; 1776 } 1777 else 1778 if (val<fArray[idx+1]) 1779 fArray[idx+1] = val; 1704 1780 } 1705 1781 fEntries++; -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r9186 r9308 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.6 6 2008-12-02 11:22:19tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.67 2009-02-09 11:30:53 tbretz Exp $ 3 3 \* ======================================================================== */ 4 4 #ifndef MARS_MHCamera … … 180 180 virtual void CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE); 181 181 virtual void CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove); 182 183 virtual void SetMaxCamContent(const MCamEvent &evt, Int_t type=0); 184 virtual void SetMinCamContent(const MCamEvent &evt, Int_t type=0); 182 185 183 186 Stat_t GetBinContent(Int_t bin) const;
Note:
See TracChangeset
for help on using the changeset viewer.