Ignore:
Timestamp:
03/04/04 15:46:17 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3324 r3400  
    164164// sector idx matches the sector of the pixel with index idx.
    165165//
    166 Bool_t MHCamera::MatchSector(Int_t idx, Int_t sector) const
    167 {
    168     return sector<0 ? kTRUE : (*fGeomCam)[idx].GetSector()==(UInt_t)sector;
     166Bool_t MHCamera::MatchSector(Int_t idx, const TArrayI &sector, const TArrayI &aidx) const
     167{
     168    const MGeomPix &pix = (*fGeomCam)[idx];
     169    return FindVal(sector, pix.GetSector()) && FindVal(aidx, pix.GetAidx());
    169170}
    170171
     
    270271// entries with match the given sector are taken into account.
    271272//
    272 Stat_t MHCamera::GetMeanSector(Int_t sector, Bool_t all) const
     273Stat_t MHCamera::GetMeanSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t all) const
    273274{
    274275    if (fNcells<=1)
     
    280281    for (int i=0; i<fNcells-2; i++)
    281282    {
    282         if ((all || IsUsed(i)) && MatchSector(i, sector))
     283        if ((all || IsUsed(i)) && MatchSector(i, sector, aidx))
    283284        {
    284285            mean += fArray[i+1];
     
    296297// entries with match the given sector are taken into account.
    297298//
    298 Stat_t MHCamera::GetRmsSector(Int_t sector, Bool_t all) const
     299Stat_t MHCamera::GetRmsSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t all) const
    299300{
    300301    if (fNcells<=1)
     
    307308    for (int i=0; i<fNcells-2; i++)
    308309    {
    309         if ((all || IsUsed(i)) && MatchSector(i, sector))
     310        if ((all || IsUsed(i)) && MatchSector(i, sector, aidx))
    310311        {
    311312            sum += fArray[i+1];
     
    327328// only pixels with matching sector number are taken into account.
    328329//
    329 Double_t MHCamera::GetMinimumSector(Int_t sector, Bool_t all) const
     330Double_t MHCamera::GetMinimumSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t all) const
    330331{
    331332    if (fMinimum != -1111)
     
    338339
    339340    for (Int_t idx=0; idx<fNcells-2; idx++)
    340         if (MatchSector(idx, sector) && (all || IsUsed(idx)) && fArray[idx+1]<minimum)
     341        if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]<minimum)
    341342            minimum = fArray[idx+1];
    342343
     
    350351// only pixels with matching sector number are taken into account.
    351352//
    352 Double_t MHCamera::GetMaximumSector(Int_t sector, Bool_t all) const
     353Double_t MHCamera::GetMaximumSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t all) const
    353354{
    354355    if (fMaximum!=-1111)
     
    360361    Double_t maximum=-FLT_MAX;
    361362    for (Int_t idx=0; idx<fNcells-2; idx++)
    362         if (MatchSector(idx, sector) && (all || IsUsed(idx)) && fArray[idx+1]>maximum)
     363        if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]>maximum)
    363364            maximum = fArray[idx+1];
    364365
     
    496497// into account.
    497498//
    498 TH1D *MHCamera::ProjectionS(Int_t sector, const char *name) const
     499TH1D *MHCamera::ProjectionS(const TArrayI &sector, const TArrayI &aidx, const char *name) const
    499500{
    500501    Int_t nbins = 50;
     
    505506    {
    506507        pname.Prepend(GetName());
    507         if (sector>=0)
    508             pname += sector;
     508        if (sector.GetSize()>0)
     509        {
     510            pname += ";";
     511            for (int i=0; i<sector.GetSize(); i++)
     512                pname += sector[i];
     513        }
     514        if (aidx.GetSize()>0)
     515        {
     516            pname += ";";
     517            for (int i=0; i<aidx.GetSize(); i++)
     518                pname += aidx[i];
     519        }
    509520    }
    510521
     
    520531    if (!h1)
    521532    {
    522         Double_t min = GetMinimumSector(sector);
    523         Double_t max = GetMaximumSector(sector);
     533        Double_t min = GetMinimumSectors(sector, aidx);
     534        Double_t max = GetMaximumSectors(sector, aidx);
    524535
    525536        Int_t newbins=0;
     
    536547    // Fill the projected histogram
    537548    for (Int_t idx=0; idx<fNcells-2; idx++)
    538         if (IsUsed(idx) && MatchSector(idx, sector))
     549        if (IsUsed(idx) && MatchSector(idx, sector, aidx))
    539550            h1->Fill(GetBinContent(idx+1));
    540551
Note: See TracChangeset for help on using the changeset viewer.