Ignore:
Timestamp:
02/09/09 11:30:54 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r9303 r9308  
    159159    if (!fTitle.Contains(";"))
    160160        fSum->SetYTitle("a.u.");
    161     fSum->SetBit(MHCamera::kProfile);
     161    if (fUseThreshold!=kCollectMin && fUseThreshold!=kCollectMax)
     162        fSum->SetBit(MHCamera::kProfile);
    162163    if (!fErrorSpread)
    163164        fSum->SetBit(MHCamera::kErrorMean);
     
    178179        return kERROR;
    179180    }
    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:
    181190        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
    184206    return kTRUE;
    185207}
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r9153 r9308  
    3535
    3636public:
    37     enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 };
     37    enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0, kCollectMin=-2, kCollectMax=2 };
    3838
    3939    MHCamEvent(const char *name=NULL, const char *title=NULL);
     
    5757
    5858    void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
     59    void SetCollectMin() { fUseThreshold=kCollectMin; }
     60    void SetCollectMax() { fUseThreshold=kCollectMax; }
    5961    void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; }
    6062    void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; }
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r9303 r9308  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.113 2009-02-07 20:47:41 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.114 2009-02-09 11:30:53 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    15911591//
    15921592// 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)
    15951597//
    15961598// in unused pixel is not counted if it didn't fullfill the condition.
     
    16581660//
    16591661// 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)
    16621666//
    16631667// in unused pixel is not counted if it didn't fullfill the condition.
     
    17021706        if (!ispos || fArray[idx+1]>0)
    17031707            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//
     1722void 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//
     1758void 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;
    17041780    }
    17051781    fEntries++;
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r9186 r9308  
    11/* ======================================================================== *\
    2 !  $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.66 2008-12-02 11:22:19 tbretz Exp $
     2!  $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.67 2009-02-09 11:30:53 tbretz Exp $
    33\* ======================================================================== */
    44#ifndef MARS_MHCamera
     
    180180    virtual void     CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE);
    181181    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);
    182185
    183186    Stat_t   GetBinContent(Int_t bin) const;
Note: See TracChangeset for help on using the changeset viewer.