Ignore:
Timestamp:
02/15/05 16:18:28 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mimage
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mimage/MHImagePar.cc

    r5994 r6489  
    6666    fHistSatHi.SetDirectory(NULL);
    6767    fHistSatHi.UseCurrentStyle();
     68    fHistSatHi.SetLineColor(kBlue);
    6869    fHistSatHi.SetFillStyle(4000);
    6970
     
    7273    fHistSatLo.SetXTitle("Pixels");
    7374    fHistSatLo.SetYTitle("Counts");
    74     fHistSatLo.SetLineColor(kBlue);
    7575    fHistSatLo.SetDirectory(NULL);
    7676    fHistSatLo.UseCurrentStyle();
     
    8383    fHistIslands.SetDirectory(NULL);
    8484    fHistIslands.UseCurrentStyle();
    85     fHistIslands.SetLineColor(kBlue);
     85    //fHistIslands.SetLineColor(kBlue);
    8686    fHistIslands.SetFillStyle(4000);
    8787
     88    fHistSizeSubIslands.SetName("SizeSub");
     89    fHistSizeSubIslands.SetTitle("Size of Sub Islands");
     90    fHistSizeSubIslands.SetXTitle("S [phe]");
     91    fHistSizeSubIslands.SetYTitle("Counts");
     92    fHistSizeSubIslands.SetDirectory(NULL);
     93    fHistSizeSubIslands.UseCurrentStyle();
     94    fHistSizeSubIslands.SetLineColor(kBlue);
     95    fHistSizeSubIslands.SetFillStyle(4000);
     96
     97    fHistSizeMainIsland.SetName("SizeMain");
     98    fHistSizeMainIsland.SetTitle("Size of Main Island");
     99    fHistSizeMainIsland.SetXTitle("S [phe]");
     100    fHistSizeMainIsland.SetYTitle("Counts");
     101    fHistSizeMainIsland.SetDirectory(NULL);
     102    fHistSizeMainIsland.UseCurrentStyle();
     103    fHistSizeMainIsland.SetFillStyle(4000);
     104
     105    fHistNumSP.SetName("NumSP");
     106    fHistNumSP.SetTitle("Number of single core pixels");
     107    fHistNumSP.SetXTitle("N");
     108    fHistNumSP.SetYTitle("Counts");
     109    fHistNumSP.SetDirectory(NULL);
     110    fHistNumSP.UseCurrentStyle();
     111    //fHistNumSP.SetLineColor(kBlue);
     112    fHistNumSP.SetFillStyle(4000);
     113
     114    fHistSizeSP.SetName("SizeSP");
     115    fHistSizeSP.SetTitle("Size of single core pixels");
     116    fHistSizeSP.SetXTitle("S [phe]");
     117    fHistSizeSP.SetYTitle("Counts");
     118    fHistSizeSP.SetDirectory(NULL);
     119    fHistSizeSP.UseCurrentStyle();
     120    //fHistSizeSP.SetLineColor(kBlue);
     121    fHistSizeSP.SetFillStyle(4000);
     122
     123
    88124    MBinning bins;
    89125
    90126    bins.SetEdges(60, -0.5, 59.5);
     127    bins.Apply(fHistSatLo);
    91128    bins.Apply(fHistSatHi);
    92     bins.Apply(fHistSatHi);
     129    bins.Apply(fHistNumSP);
     130
     131    bins.SetEdgesLog(50, 1, 1e7);
     132    bins.Apply(fHistSizeSubIslands);
     133    bins.Apply(fHistSizeMainIsland);
     134    bins.Apply(fHistSizeSP);
    93135
    94136    bins.SetEdges(15, 0.5, 15.5);
     
    103145Bool_t MHImagePar::SetupFill(const MParList *plist)
    104146{
     147    ApplyBinning(*plist, "Pixels",  &fHistSatLo);
    105148    ApplyBinning(*plist, "Pixels",  &fHistSatHi);
    106     ApplyBinning(*plist, "Pixels",  &fHistSatHi);
     149    ApplyBinning(*plist, "Pixels",  &fHistNumSP);
    107150
    108151    ApplyBinning(*plist, "Islands", &fHistIslands);
     152
     153    ApplyBinning(*plist, "Size",    &fHistSizeSubIslands);
     154    ApplyBinning(*plist, "Size",    &fHistSizeMainIsland);
     155    ApplyBinning(*plist, "Size",    &fHistSizeSP);
    109156
    110157    return kTRUE;
     
    126173    const MImagePar &h = *(MImagePar*)par;
    127174
    128     fHistSatHi.Fill(h.GetNumSatPixelsHG(), w);
    129     fHistSatLo.Fill(h.GetNumSatPixelsLG(), w);
    130 
    131     fHistIslands.Fill(h.GetNumIslands(),   w);
     175    fHistSatHi.Fill(h.GetNumSatPixelsHG(),    w);
     176    fHistSatLo.Fill(h.GetNumSatPixelsLG(),    w);
     177    fHistNumSP.Fill(h.GetNumSinglePixels(),   w);
     178    fHistSizeSP.Fill(h.GetSizeSinglePixels(), w);
     179    fHistSizeSubIslands.Fill(h.GetSizeSubIslands(), w);
     180    fHistSizeMainIsland.Fill(h.GetSizeMainIsland(), w);
     181    fHistIslands.Fill(h.GetNumIslands(),      w);
    132182
    133183    return kTRUE;
     
    136186void MHImagePar::Paint(Option_t *o)
    137187{
    138     /*
    139      if (TString(o)==(TString)"log1" && fHistSatHi.GetMaximum()>0)
    140      gPad->SetLogy();
    141      if (TString(o)==(TString)"log2" && fHistIslands.GetMaximum()>0)
    142      gPad->SetLogy();
    143      */
    144188     if (fHistSatHi.GetMaximum()>0 && gPad->GetPad(1))
    145189         gPad->GetPad(1)->SetLogy();
    146      if (fHistIslands.GetMaximum()>0 && gPad->GetPad(2))
    147          gPad->GetPad(2)->SetLogy();
     190     if (fHistIslands.GetMaximum()>0 && gPad->GetPad(3))
     191         gPad->GetPad(3)->SetLogy();
     192
     193     TVirtualPad *pad = gPad->GetPad(2);
     194     if (pad)
     195     {
     196         if (fHistNumSP.GetMaximum()>0 && pad->GetPad(1))
     197             pad->GetPad(1)->SetLogy();
     198         if (fHistSizeSP.GetMaximum()>0 && pad->GetPad(2))
     199         {
     200             pad->GetPad(2)->SetLogx();
     201             pad->GetPad(2)->SetLogy();
     202         }
     203     }
     204     if (fHistSizeMainIsland.GetMaximum()>0 && gPad->GetPad(4))
     205     {
     206         gPad->GetPad(4)->SetLogx();
     207         gPad->GetPad(4)->SetLogy();
     208     }
    148209}
    149210
     
    168229
    169230    if (!same)
    170         pad->Divide(1,2);
     231        pad->Divide(2,2);
    171232    else
    172233        fHistIslands.SetLineColor(kGreen);
     
    177238        gPad->SetBorderMode(0);
    178239        MH::DrawSame(fHistSatHi, fHistSatLo, "Saturating Pixels");
    179         fHistSatHi.SetMinimum(); // switch off to allow log-scale
    180         fHistSatLo.SetMinimum(); // switch off to allow log-scale
    181         fHistSatLo.SetMaximum(0.1);   // dummy value to allow log-scale
    182         //AppendPad("log1");
     240        fHistSatHi.SetMinimum();    // switch off to allow log-scale
     241        fHistSatLo.SetMinimum();    // switch off to allow log-scale
     242        fHistSatLo.SetMaximum(0.1); // dummy value to allow log-scale
     243
     244        pad->cd(4);
     245        gPad->SetBorderMode(0);
     246        MH::DrawSame(fHistSizeMainIsland, fHistSizeSubIslands, "Sizes...");
     247        fHistSizeMainIsland.SetMinimum();    // switch off to allow log-scale
     248        fHistSizeSubIslands.SetMinimum();    // switch off to allow log-scale
     249        fHistSizeSubIslands.SetMaximum(0.1); // dummy value to allow log-scale
    183250    }
    184251
    185252    pad->cd(2);
    186253    gPad->SetBorderMode(0);
     254    pad->GetPad(2)->Divide(1,2,0,0);
     255    pad->GetPad(2)->cd(1);
     256    gPad->SetBorderMode(0);
     257    fHistNumSP.Draw(same?"same":"");
     258    pad->GetPad(2)->cd(2);
     259    gPad->SetBorderMode(0);
     260    fHistSizeSP.Draw(same?"same":"");
     261
     262    pad->cd(3);
     263    gPad->SetBorderMode(0);
    187264    fHistIslands.Draw(same?"same":"");
    188     //AppendPad("log2");
    189265}
    190266
  • trunk/MagicSoft/Mars/mimage/MHImagePar.h

    r4834 r6489  
    1414{
    1515private:
    16     TH1F fHistSatHi;   // Number of pixels with sat hi-gain
    17     TH1F fHistSatLo;   // Number of pixels with sat lo-gain
     16    TH1F fHistSatHi;          // Number of pixels with sat hi-gain
     17    TH1F fHistSatLo;          // Number of pixels with sat lo-gain
    1818
    19     TH1F fHistIslands; // Number of islands per event
     19    TH1F fHistIslands;        // Number of islands per event
     20    TH1F fHistSizeSubIslands; // Size of sub islands
     21    TH1F fHistSizeMainIsland; // Size of main island
     22
     23    TH1F fHistNumSP;          // Number of single core pixels
     24    TH1F fHistSizeSP;         // size of single core pixels
     25
     26    Short_t fNumSatPixelsHG; // number of pixels with saturating hi-gains
     27    Short_t fNumSatPixelsLG; // number of pixels with saturating lo-gains
    2028
    2129public:
     
    3947
    4048#endif
    41 
    42 
  • trunk/MagicSoft/Mars/mimage/MImagePar.cc

    r4826 r6489  
    2929// Storage Container for new image parameters
    3030//
     31//  Class Version 2:
     32//  ----------------
     33//    - added Short_t fNumSinglePixels;
     34//    - added Float_t fSizeSinglePixels;
     35//    - added Float_t fSizeSubIslands;
     36//
     37//  Class Version 1:
     38//  ----------------
    3139//    Short_t fNumIslands;           // number of islands found
    3240//
     
    6371void MImagePar::Reset()
    6472{
    65     fNumIslands = -1;
     73    fNumIslands       = -1;
     74    fNumSinglePixels  = -1;
    6675
    67     fNumSatPixelsHG = -1;
    68     fNumSatPixelsLG = -1;
     76    fNumSatPixelsHG   = -1;
     77    fNumSatPixelsLG   = -1;
     78
     79    fSizeSinglePixels = -1;
     80    fSizeSubIslands   = -1;
     81    fSizeMainIsland   = -1;
    6982}
    7083
     
    91104
    92105    // Get number of islands
    93     fNumIslands = evt.GetNumIslands();
     106    fNumIslands       = evt.GetNumIslands();
     107    fNumSinglePixels  = evt.GetNumSinglePixels();
     108    fSizeSinglePixels = evt.GetSizeSinglePixels();
     109    fSizeSubIslands   = evt.GetSizeSubIslands();
     110    fSizeMainIsland   = evt.GetSizeMainIsland();
    94111
    95112    SetReadyToSave();
     
    102119    *fLog << all;
    103120    *fLog << "Image Parameters (" << GetName() << ")" << endl;
    104     *fLog << " - Num Islands    [#]   = " << fNumIslands << " Islands" << endl;
    105     *fLog << " - Sat.Pixels/HG  [#]   = " << fNumSatPixelsHG << " Pixels" << endl;
    106     *fLog << " - Sat.Pixels/LG  [#]   = " << fNumSatPixelsLG << " Pixels" << endl;
     121    *fLog << " - Num Islands      [#] = " << fNumIslands       << " Islands" << endl;
     122    *fLog << " - Sat.Pixels (HG)  [#] = " << fNumSatPixelsHG   << " Pixels" << endl;
     123    *fLog << " - Sat.Pixels (LG)  [#] = " << fNumSatPixelsLG   << " Pixels" << endl;
     124    *fLog << " - Num rmvd CorePix [#] = " << fNumSinglePixels  << " Pixels" << endl;
     125    *fLog << " - Sz  rmvd CorePix [#] = " << fSizeSinglePixels << " CerPhot" << endl;
     126    *fLog << " - Size Sub Islands [#] = " << fSizeSubIslands   << " CerPhot" << endl;
     127    *fLog << " - Size Main Island [#] = " << fSizeMainIsland   << " CerPhot" << endl;
    107128}
  • trunk/MagicSoft/Mars/mimage/MImagePar.h

    r4710 r6489  
    1414private:
    1515    Short_t fNumIslands;     // Number of islands found
     16    Short_t fNumSinglePixels;
     17
     18    Float_t fSizeSinglePixels;
     19    Float_t fSizeSubIslands;
     20    Float_t fSizeMainIsland;
    1621
    1722    Short_t fNumSatPixelsHG; // number of pixels with saturating hi-gains
     
    2732    Short_t GetNumSatPixelsHG() const { return fNumSatPixelsHG; }
    2833    Short_t GetNumSatPixelsLG() const { return fNumSatPixelsLG; }
     34    Short_t GetNumSinglePixels() const { return fNumSinglePixels; }
     35    Float_t GetSizeSinglePixels() const { return fSizeSinglePixels; }
     36    Float_t GetSizeSubIslands() const { return fSizeSubIslands; }
     37    Float_t GetSizeMainIsland() const { return fSizeMainIsland; }
    2938
    3039    void Print(Option_t *opt=NULL) const;
     
    3241    void Calc(const MCerPhotEvt &evt);
    3342
    34     ClassDef(MImagePar, 1) // Container to hold (geometry and island independant) image parameters
     43    ClassDef(MImagePar, 2) // Container to hold (geometry and island independant) image parameters
    3544};
    3645
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r5690 r6489  
    339339                           const char *name, const char *title)
    340340    : fCleaningMethod(kStandard), fCleanLvl1(lvl1),
    341     fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotCam(gsNamePedPhotCam),
    342     fNameGeomCam(gsNameGeomCam), fNameCerPhotEvt(gsNameCerPhotEvt)
    343 
     341    fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE),
     342    fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam),
     343    fNameCerPhotEvt(gsNameCerPhotEvt)
    344344{
    345345    fName  = name  ? name  : gsDefName.Data();
     
    386386//
    387387//  Check if the survived pixel have a neighbor, that also
    388 //  survived, otherwise set pixel to unused (removes pixels without
    389 //  neighbors).
    390 //
    391 void MImgCleanStd::CleanStep2()
    392 {
     388//  survived. Set all single pixels Unused if !fKeepSinglePixels. Now we
     389//  declare all pixels that survived previous CleanSteps as CorePixels.
     390//  Return number of single pixels, and there cumulative size in size.
     391//
     392Short_t MImgCleanStd::CleanStep2(Float_t &size)
     393{
     394    Short_t n=0;
     395    size = 0;
     396
    393397    MCerPhotPix *pix;
    394398
     
    420424        }
    421425
    422         if (hasNeighbor == kFALSE)
    423             pix->SetPixelUnused();
    424     }
    425 
    426     //
    427     // now we declare all pixels that survive as CorePixels
    428     //
     426        if (hasNeighbor == kFALSE)
     427        {
     428            if (!fKeepSinglePixels)
     429                pix->SetPixelUnused();
     430            size += pix->GetNumPhotons();
     431            n++;
     432        }
     433    }
    429434
    430435    Next.Reset();
     
    434439            pix->SetPixelCore();
    435440    }
     441
     442    return n;
    436443}
    437444
     
    613620    *fLog << all << "CleanStep 2" << endl;
    614621#endif
    615     CleanStep2();
     622    Float_t size;
     623    const Short_t n = CleanStep2(size);
     624    fEvt->SetSinglePixels(n, size);
    616625
    617626    // For speed reasons skip the rest of the cleaning if no
     
    812821    if (gsNameCerPhotEvt!=fNameCerPhotEvt)
    813822        out << "   " << GetUniqueName() << ".SetNameCerPhotEvt(\"" << fNameCerPhotEvt << "\");" << endl;
     823    if (fKeepSinglePixels)
     824        out << "   " << GetUniqueName() << ".SetKeepSinglePixels();" << endl;
     825
    814826}
    815827
     
    821833//   MImgCleanStd.CleanMethod: Standard, Scaled, Democratic, Probability, Absolute
    822834//   MImgCleanStd.CleanRings:  1
     835//   MImgCleanStd.KeepSinglePixels: yes, no
    823836//
    824837Int_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    839852        rc = kTRUE;
    840853        fCleanLvl2 = GetEnvValue(env, prefix, "CleanLevel2", fCleanLvl2);
     854    }
     855    if (IsEnvDefined(env, prefix, "KeepSinglePixels", print))
     856    {
     857        rc = kTRUE;
     858        fKeepSinglePixels = GetEnvValue(env, prefix, "KeepSinglePixels", fKeepSinglePixels);
    841859    }
    842860
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r5690 r6489  
    4444
    4545    UShort_t fCleanRings;
     46    Bool_t   fKeepSinglePixels;
    4647
    4748    TString  fNamePedPhotCam; // name of the 'MPedPhotCam' container
     
    4950    TString  fNameCerPhotEvt; // name of the 'MCerPhotEvt' container
    5051
     52    // MImgCleanStd
     53    void    CleanStep1();
     54    Short_t CleanStep2(Float_t &size);
     55    void    CleanStep3();
     56    void    CleanStep3b(MCerPhotPix &pix);
     57    void    CleanStep4(UShort_t r, MCerPhotPix &pix);
    5158
    52     void  CreateGuiElements(MGGroupFrame *f);
    53     void  StreamPrimitive(ofstream &out) const;
    54     Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    55 
    56     void  CleanStep3b(MCerPhotPix &pix);
    57     void  CleanStep4(UShort_t r, MCerPhotPix &pix);
    58 
    59     void  CleanStep1();
    60     void  CleanStep2();
    61     void  CleanStep3();
     59    // MGTask, MTask, MParContainer
     60    void    CreateGuiElements(MGGroupFrame *f);
     61    void    StreamPrimitive(ofstream &out) const;
     62    Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    6263
    6364    Int_t PreProcess(MParList *pList);
     
    7576    void SetCleanRings(UShort_t r) { if(r==0) r=1; fCleanRings=r; }
    7677    void SetMethod(CleaningMethod_t m) { fCleaningMethod = m; }
     78    void SetKeepSinglePixels(Bool_t b=kTRUE) { fKeepSinglePixels=b; }
    7779
    7880    Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
Note: See TracChangeset for help on using the changeset viewer.