Changeset 2488


Ignore:
Timestamp:
11/07/03 19:03:41 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2487 r2488  
    4747   * mraw/MRawEvtPixelIter.[h,cc]:
    4848     - added a fixes for the case that fData->fLoGainPixId->GetArray()=NULL
     49
     50   * manalysis/Makefile, manalysis/AnalysisLinkDef.h:
     51     - added MCameraData
     52
     53   * manalysis/MCameraData.[h,cc]:
     54     - added
     55     
     56   * mhist/MHEvent.[h,cc]:
     57     - fixed display of levels
     58     - fixed unallowed characters
     59     
     60   * mimage/MImgCleanStd.[h,cc]:
     61     - moved the calculation for signal/noise to MCameraData
     62     
     63   * mmain/MEventDisplay.cc:
     64     - added display for cleaning data and levels
    4965
    5066
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r2440 r2488  
    1111#pragma link C++ class MCerPhotCalc+;
    1212
    13 //#pragma link C++ class MRelSignal+;
     13#pragma link C++ class MCameraData+;
    1414
    1515#pragma link C++ class MBlindPixels+;
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r2440 r2488  
    3737           MGeomApply.cc \
    3838           MCurrents.cc \
     39           MCameraData.cc \
    3940           MEnergyEst.cc \
    4041           MEnergyEstimate.cc \
     
    6970           MCT1PadONOFF.cc
    7071
    71 #           MRelSignal.cc \
    7272
    7373SRCS    = $(SRCFILES)
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2484 r2488  
    11441144         TIter Next(gPad->GetListOfPrimitives());
    11451145         TObject *o;
    1146          while (o=Next()) cout << o->GetName() << " " << o->IsA()->GetName() << endl;
     1146         while (o=Next()) cout << o << ": " << o->GetName() << " " << o->IsA()->GetName() << endl;
    11471147         */
    11481148
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r2482 r2488  
    6464#include "MRawRunHeader.h"
    6565#include "MRawEvtData.h"
     66#include "MImgCleanStd.h"
    6667
    6768ClassImp(MHEvent);
     
    140141        break;
    141142    case kEvtCleaningLevels:
     143        if (!fImgCleanStd)
     144        {
     145            *fLog << err << "MImgCleanStd not found... aborting." << endl;
     146            return kFALSE;
     147        }
    142148        fHist->SetName("CleanLevels");
    143149        fHist->SetYTitle("L");
    144         if (!fImgCleanStd)
    145             return kFALSE;
    146150        break;
    147151    }
     
    171175        break;
    172176    case kEvtRelativeSignal:
     177        fHist->SetCamContent(*(MCamEvent*)par, 0);
     178        break;
    173179    case kEvtCleaningLevels:
    174         fHist->SetCamContent(*(MCamEvent*)par, 0);
     180        {
     181            TArrayF lvl(2);
     182            lvl[0] = fImgCleanStd->GetCleanLvl2();
     183            lvl[1] = fImgCleanStd->GetCleanLvl1();
     184            fHist->SetCamContent(*(MCamEvent*)par, 0);
     185            fHist->SetLevels(lvl);
     186        }
    175187        break;
    176188    }
     
    193205    if (fMcEvt)
    194206    {
    195         TString txt;// = "#splitline{";
     207        TString txt("#splitline{");
    196208
    197209        switch (fMcEvt->GetPartId())
     
    214226        s.Insert(0, txt);
    215227
    216         //s += "}{";
     228        s += "}{";
    217229        s += "  E=";
    218230        if (fMcEvt->GetEnergy()>1000)
     
    224236        s += "m ZA=";
    225237        s += (int)(fMcEvt->GetTheta()*180/TMath::Pi()+.5);
    226         s += "° ";
     238        s += "\xb0 ";
    227239        s += fMcEvt->GetPhotElfromShower();
    228240        s += "PhEl";
    229         //s += "}";
     241        s += "}";
    230242    }
    231243
  • trunk/MagicSoft/Mars/mhist/MHEvent.h

    r2482 r2488  
    1515class MPedestalCam;
    1616class MImgCleanStd;
    17 class MRelSignal;
     17class MCameraSignal;
    1818
    1919class MHEvent : public MH
     
    3434    MPedestalCam  *fPedestalCam;   //!
    3535    MImgCleanStd  *fImgCleanStd;   //!
     36    MCameraSignal *fCamSignal;     //!
    3637
    3738    MRawEvtData   *fClone;         //->
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r2470 r2488  
    266266#include "MParList.h"
    267267#include "MSigmabar.h"
     268#include "MCameraData.h"
    268269
    269270#include "MGeomPix.h"
     
    312313// --------------------------------------------------------------------------
    313314//
    314 //  NT 28/04/2003: now the option to use the standard method or the
     315// The first step of cleaning defines the CORE pixels. All the other pixels
     316// are set as UNUSED and belong to RING 0.
     317// After this point, only the CORE pixels are set as USED, with RING
     318// number 1.
     319//
     320//  NT 28/04/2003: now the option to use the standard method or the
    315321//  democratic method is implemented:
    316322//
    317 //  KStandard: This method looks for all pixels with an entry (photons)
    318 //             that is three times bigger than the noise of the pixel
    319 //             (default: 3 sigma, clean level 1)
    320 //
    321 // --------------------------------------------------------------------------
    322 //
    323 //  Returns the maximum Pixel Id (used for ispixused in CleanStep2)
    324 //
    325 void MImgCleanStd::CleanStep1Std()
     323//  kStandard:   This method looks for all pixels with an entry (photons)
     324//               that is three times bigger than the noise of the pixel
     325//               (default: 3 sigma, clean level 1)
     326//
     327//  kDemocratic: this method looks for all pixels with an entry (photons)
     328//               that is n times bigger than the noise of the mean of the
     329//               inner pixels (default: 3 sigmabar, clean level 1)
     330//
     331//
     332void MImgCleanStd::CleanStep1()
    326333{
    327334    const Int_t entries = fEvt->GetNumPixels();
    328 
    329     //
    330     // check the number of all pixels against the noise level and
    331     // set them to 'unused' state if necessary
    332     //
    333 
    334     for (Int_t i=0; i<entries; i++ )
    335     {
    336         MCerPhotPix &pix = (*fEvt)[i];
    337 
    338         const Int_t idx = pix.GetPixId();
    339 
    340         const Float_t entry = pix.GetNumPhotons();
    341         const Float_t noise = (*fPed)[idx].GetPedestalRms();
    342 
    343         //
    344         // We calculate a correction factor which accounts for the
    345         // fact that pixels have different size (see TDAS 02-14).
    346         //
    347         const Double_t factor = fCam->GetPixRatioSqrt(idx);
    348 
    349         // COBB: '<=' to skip entry=noise=0
    350         if (entry * factor <= fCleanLvl1 * noise)
    351             pix.SetPixelUnused();
    352     }
    353 }
    354 
    355 // --------------------------------------------------------------------------
    356 //
    357 //  NT 28/04/2003: now the option to use the standard method or the
    358 //  democratic method is implemented:
    359 //
    360 //  "KDemocratic": this method looks for all pixels with an entry (photons)
    361 //                 that is n times bigger than the noise of the mean of the
    362 //                 inner pixels (default: 3 sigmabar, clean level 1)
    363 //
    364 //  Returns the maximum Pixel Id (used for ispixused in CleanStep2)
    365 //
    366 void MImgCleanStd::CleanStep1Dem()
    367 {
    368     const Int_t entries = fEvt->GetNumPixels();
     335    const TArrayD &data = fData->GetData();
    369336
    370337    //
     
    376343        MCerPhotPix &pix = (*fEvt)[i];
    377344
    378         const Int_t idx = pix.GetPixId();
    379 
    380         const Float_t  entry = pix.GetNumPhotons();
    381         const Double_t ratio = fCam->GetPixRatio(idx);
    382 
    383         // COBB: '<=' to skip entry=noise=0
    384         if (entry * ratio <= fCleanLvl1 * fInnerNoise)
     345        if (data[pix.GetPixId()] <= fCleanLvl1)
    385346            pix.SetPixelUnused();
    386     }
    387 }
    388 
    389 // --------------------------------------------------------------------------
    390 // The first step of cleaning defines the CORE pixels. All the other pixels
    391 // are set as UNUSED and belong to RING 0.               
    392 // After this point, only the CORE pixels are set as USED, with RING     
    393 // number 1.                                                             
    394 // Returns the maximum Pixel Id (used for ispixused in CleanStep2)
    395 //
    396 void MImgCleanStd::CleanStep1()
    397 {
    398    switch (fCleaningMethod)
    399     {
    400     case kStandard:
    401         CleanStep1Std();
    402         return;
    403     case kDemocratic:
    404         CleanStep1Dem();
    405         return;
    406347    }
    407348}
     
    487428}
    488429
    489 
    490 // --------------------------------------------------------------------------
    491 //
    492 //   Look for the boundary pixels around the core pixels
    493 //   if a pixel has more than 2.5 (clean level 2.5) sigma, and
    494 //   a core neigbor it is declared as used.
    495 //
    496 Bool_t MImgCleanStd::CleanStep3Std(const MCerPhotPix &pix)
    497 {
    498     //
    499     // get pixel id of this entry
    500     //
    501     const Int_t idx = pix.GetPixId();
    502 
    503     //
    504     // check the num of photons against the noise level
    505     //
    506     const Float_t entry = pix.GetNumPhotons();
    507     const Float_t noise = (*fPed)[idx].GetPedestalRms();
    508 
    509     //
    510     // We calculate a correction factor which accounts for the
    511     // fact that pixels have different size (see TDAS 02-14).
    512     //
    513     const Double_t factor = fCam->GetPixRatioSqrt(idx);
    514 
    515     return (entry * factor <= fCleanLvl2 * noise);
    516 }
    517 
    518 // --------------------------------------------------------------------------
    519 //
    520 //   Look for the boundary pixels around the core pixels
    521 //   if a pixel has more than 2.5 (clean level 2.5) sigmabar and
    522 //   a core neighbor, it is declared as used.
    523 //
    524 Bool_t MImgCleanStd::CleanStep3Dem(const MCerPhotPix &pix)
    525 {
    526     //
    527     // get pixel id of this entry
    528     //
    529     const Int_t idx = pix.GetPixId();
    530 
    531     //
    532     // check the num of photons against the noise level
    533     //
    534     const Float_t  entry = pix.GetNumPhotons();
    535     const Double_t ratio = fCam->GetPixRatio(idx);
    536 
    537     return (entry * ratio <= fCleanLvl2 * fInnerNoise);
    538 }
    539 
    540430void MImgCleanStd::CleanStep3b(MCerPhotPix &pix)
    541431{
     
    598488// --------------------------------------------------------------------------
    599489//
    600 //   Look for the boundary pixels around the core pixels
    601 //   if a pixel has more than 2.5 (clean level 2.5) sigma, and
    602 //   a core neigbor, it is declared as used.
     490//  Look for the boundary pixels around the core pixels
     491//  if a pixel has more than 2.5 (clean level 2.5) sigma, and
     492//  a core neigbor, it is declared as used.
    603493//
    604494void MImgCleanStd::CleanStep3()
    605495{
    606496    const Int_t entries = fEvt->GetNumPixels();
     497    const TArrayD &data = fData->GetData();
    607498
    608499    for (UShort_t r=1; r<fCleanRings+1; r++)
     
    621512                continue;
    622513
    623             switch (fCleaningMethod)
    624             {
    625             case kStandard:
    626                 if (CleanStep3Std(pix))
    627                     continue;
    628                 break;
    629             case kDemocratic:
    630                 if (CleanStep3Dem(pix))
    631                     continue;
    632                 break;
    633             }
     514            if (data[pix.GetPixId()] <= fCleanLvl2)
     515                continue;
    634516
    635517            if (r==1)
     
    681563    }
    682564
     565    fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData"));
     566    if (!fData)
     567        return kFALSE;
     568
    683569    return kTRUE;
    684570}
     
    691577{
    692578    if (fSgb)
    693         fInnerNoise = fSgb->GetSigmabarInner();
     579        fData->Calc(*fEvt, *fSgb, *fCam);
     580    else
     581        fData->Calc(*fEvt, *fPed, *fCam);
     582
    694583#ifdef DEBUG
    695584    *fLog << all << "CleanStep 1" << endl;
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r2237 r2488  
    1111class MCerPhotEvt;
    1212class MPedestalCam;
     13class MCameraData;
    1314
    1415class MGGroupFrame;
     
    2728          MSigmabar    *fSgb;  //!
    2829          MPedestalCam *fPed;  //!
     30          MCameraData  *fData; //!
    2931
    3032    CleaningMethod_t fCleaningMethod;
     
    4042    void StreamPrimitive(ofstream &out) const;
    4143
    42     void   CleanStep1Dem();
    43     void   CleanStep1Std();
    44     Bool_t CleanStep3Dem(const MCerPhotPix &pix);
    45     Bool_t CleanStep3Std(const MCerPhotPix &pix);
    4644    void   CleanStep3b(MCerPhotPix &pix);
    4745    void   CleanStep4(UShort_t r, MCerPhotPix &pix);
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r2484 r2488  
    187187    MFillH            *fill3 = new MFillH(evt3, "MPedestalCam", "MFillH3");
    188188    MFillH            *fill4 = new MFillH(evt4, "MPedestalCam", "MFillH4");
    189     MFillH            *fill5 = new MFillH(evt5, "MRelSignal",   "MFillH5");
    190     MFillH            *fill6 = new MFillH(evt6, "MRelSignal",   "MFillH6");
     189    MFillH            *fill5 = new MFillH(evt5, "MCameraData",  "MFillH5");
     190    MFillH            *fill6 = new MFillH(evt6, "MCameraData",  "MFillH6");
    191191    MBlindPixelCalc   *blind = new MBlindPixelCalc;
    192192    MHillasCalc       *hcalc = new MHillasCalc;
     
    201201    tlist->AddToList(fill3);
    202202    tlist->AddToList(fill4);
    203 //    tlist->AddToList(fill5);
    204 //    tlist->AddToList(fill6);
     203    tlist->AddToList(fill5);
     204    tlist->AddToList(fill6);
    205205    tlist->AddToList(blind);
    206206    tlist->AddToList(hcalc);
     
    469469    //
    470470    TObject *hillas = plist->FindObject("MHillas");
    471     for (int i=1; i<5;i++)
     471    for (int i=1; i<7;i++)
    472472    {
    473473        TCanvas *c = GetCanvas(i);
Note: See TracChangeset for help on using the changeset viewer.