Ignore:
Timestamp:
04/08/04 19:52:13 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mimage
Files:
8 edited

Legend:

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

    r2414 r3682  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  2001 <mailto:tbretz@uni-sw.gwdg.de>
    19 !
    20 !   Copyright: MAGIC Software Development, 2000-2002
     18!   Author(s): Thomas Bretz, 2001 <mailto:tbretz@astro.uni-wuerzburg.de>
     19!
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    7575    fHM3Long.SetDirectory(NULL);
    7676    fHM3Trans.SetDirectory(NULL);
     77    fHMaxDist.SetDirectory(NULL);
    7778
    7879    fHAsym.UseCurrentStyle();
    7980    fHM3Long.UseCurrentStyle();
    8081    fHM3Trans.UseCurrentStyle();
     82    fHMaxDist.UseCurrentStyle();
    8183
    8284    fHAsym.SetName("Asymmetry");
    8385    fHM3Long.SetName("3rd Mom Long");
    8486    fHM3Trans.SetName("3rd Mom Trans");
     87    fHMaxDist.SetName("Max Dist");
    8588
    8689    fHAsym.SetTitle("Asymmetry");
    8790    fHM3Long.SetTitle("3^{rd} Moment Longitudinal");
    8891    fHM3Trans.SetTitle("3^{rd} Moment Transverse");
     92    fHMaxDist.SetTitle("Distance of max distant pixel");
    8993
    9094    fHAsym.SetXTitle("Asym [mm]");
    9195    fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
    9296    fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
     97    fHMaxDist.SetXTitle("D_{max} [mm]");
    9398
    9499    fHAsym.SetYTitle("Counts");
    95100    fHM3Long.SetYTitle("Counts");
    96101    fHM3Trans.SetYTitle("Counts");
     102    fHMaxDist.SetYTitle("Counts");
    97103
    98104    fHAsym.SetFillStyle(4000);
    99105    fHM3Long.SetFillStyle(4000);
    100106    fHM3Trans.SetFillStyle(4000);
     107    fHMaxDist.SetFillStyle(4000);
    101108
    102109    fHM3Trans.SetLineColor(kBlue);
     
    104111    MBinning bins;
    105112
    106     bins.SetEdges(101, -326, 326);
     113    bins.SetEdges(51, -326, 326);
    107114    bins.Apply(fHM3Long);
    108115    bins.Apply(fHM3Trans);
    109116
    110     bins.SetEdges(101, -593, 593);
     117    bins.SetEdges(51, -593, 593);
    111118    bins.Apply(fHAsym);
     119
     120    bins.SetEdges(101, 0, 593);
     121    bins.Apply(fHMaxDist);
    112122}
    113123
     
    143153    ApplyBinning(*plist, "M3Long",  &fHM3Long);
    144154    ApplyBinning(*plist, "M3Trans", &fHM3Trans);
     155    ApplyBinning(*plist, "MaxDist", &fHMaxDist);
    145156
    146157    return kTRUE;
     
    161172    fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w);
    162173    fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w);
    163     //fHAsymna.Fill(scale*ext.GetAsymna());
    164     //fHAsym0.Fill(scale*ext.GetAsym0());
     174    fHMaxDist.Fill(TMath::Abs(scale*fHillasExt->GetMaxDist()), w);
    165175
    166176    return kTRUE;
     
    187197    MH::ScaleAxis(&fHM3Long,  scale);
    188198    MH::ScaleAxis(&fHM3Trans, scale);
     199    MH::ScaleAxis(&fHMaxDist, scale);
    189200
    190201    if (mmscale)
     
    193204        fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
    194205        fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
     206        fHMaxDist.SetXTitle("D_{max} [mm]");
    195207    }
    196208    else
     
    199211        fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
    200212        fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
     213        fHMaxDist.SetXTitle("D_{max} [\\circ]");
    201214    }
    202215
     
    238251    AppendPad("");
    239252
    240     pad->Divide(2, 1);
     253    pad->Divide(2, 2);
    241254
    242255    pad->cd(1);
     
    244257    MH::DrawSame(fHM3Long, fHM3Trans, "3^{rd} Moments");
    245258
     259    pad->cd(3);
     260    gPad->SetBorderMode(0);
     261    fHAsym.Draw();
     262
    246263    pad->cd(2);
    247264    gPad->SetBorderMode(0);
    248     fHAsym.Draw();
     265    fHMaxDist.Draw();
     266
     267    delete pad->GetPad(4);
    249268
    250269    pad->Modified();
     
    260279    if (name.Contains("M3Trans", TString::kIgnoreCase))
    261280        return &fHM3Trans;
     281    if (name.Contains("MaxDist", TString::kIgnoreCase))
     282        return &fHMaxDist;
    262283
    263284    return NULL;
  • trunk/MagicSoft/Mars/mimage/MHHillasExt.h

    r2043 r3682  
    1919    TH1F fHM3Long;  // [mm]    3rd moment (e-weighted) along major axis
    2020    TH1F fHM3Trans; // [mm]    3rd moment (e-weighted) along minor axis
     21    TH1F fHMaxDist; // [mm]    Distance between shower center maximum distant pixel
    2122
    2223    Float_t fMm2Deg;
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc

    r3568 r3682  
    1919!   Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2003
     21!   Copyright: MAGIC Software Development, 2000-2004
    2222!
    2323!
     
    9595    fHistCorePix.SetFillStyle(4000);
    9696
     97    fHistUsedArea.SetName("UsedArea");
     98    fHistUsedArea.SetTitle("Area of used pixels");
     99    fHistUsedArea.SetXTitle("Area [m^2]");
     100    fHistUsedArea.SetYTitle("Counts");
     101    fHistUsedArea.SetDirectory(NULL);
     102    fHistUsedArea.UseCurrentStyle();
     103    fHistUsedArea.SetLineColor(kBlue);
     104    fHistUsedArea.SetFillStyle(4000);
     105
     106    fHistCoreArea.SetName("CoreArea");
     107    fHistCoreArea.SetTitle("Area of core pixels");
     108    fHistCoreArea.SetXTitle("Area [m^2]");
     109    fHistCoreArea.SetYTitle("Counts");
     110    fHistCoreArea.SetDirectory(NULL);
     111    fHistCoreArea.UseCurrentStyle();
     112    fHistCoreArea.SetLineColor(kBlack);
     113    fHistCoreArea.SetFillStyle(4000);
     114
    97115    fHistConc.SetDirectory(NULL);
    98116    fHistConc1.SetDirectory(NULL);
     
    121139    bins.Apply(fHistConc1);
    122140
    123     bins.SetEdges(150, 0, 150);
     141    bins.SetEdges(75, 0, 150);
    124142    bins.Apply(fHistUsedPix);
    125143    bins.Apply(fHistCorePix);
     144
     145    bins.SetEdges(75, 0, 0.249);
     146    bins.Apply(fHistUsedArea);
     147    bins.Apply(fHistCoreArea);
    126148}
    127149
     
    136158    ApplyBinning(*plist, "Leakage", &fHistLeakage2);
    137159
    138     ApplyBinning(*plist, "Pixels", &fHistUsedPix);
    139     ApplyBinning(*plist, "Pixels", &fHistCorePix);
    140 
    141     ApplyBinning(*plist, "Conc",   &fHistConc);
    142     ApplyBinning(*plist, "Conc1",  &fHistConc1);
     160    ApplyBinning(*plist, "Pixels",  &fHistUsedPix);
     161    ApplyBinning(*plist, "Pixels",  &fHistCorePix);
     162
     163    ApplyBinning(*plist, "Area",    &fHistUsedArea);
     164    ApplyBinning(*plist, "Area",    &fHistCoreArea);
     165
     166    ApplyBinning(*plist, "Conc",    &fHistConc);
     167    ApplyBinning(*plist, "Conc1",   &fHistConc1);
    143168
    144169    return kTRUE;
     
    166191    fHistCorePix.Fill(h.GetNumCorePixels(), w);
    167192
     193    fHistUsedArea.Fill(h.GetUsedArea()/1000000, w);
     194    fHistCoreArea.Fill(h.GetCoreArea()/1000000, w);
     195
    168196    fHistConc.Fill(h.GetConc(), w);
    169197    fHistConc1.Fill(h.GetConc1(), w);
     
    203231    pad->cd(4);
    204232    gPad->SetBorderMode(0);
     233    MH::DrawSame(fHistCoreArea, fHistUsedArea, "Area of core/used Pixels");
    205234
    206235    pad->Modified();
     
    222251    if (name.Contains("CorePix", TString::kIgnoreCase))
    223252        return &fHistCorePix;
     253    if (name.Contains("UsedArea", TString::kIgnoreCase))
     254        return &fHistUsedArea;
     255    if (name.Contains("CoreArea", TString::kIgnoreCase))
     256        return &fHistCoreArea;
    224257
    225258    return NULL;
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar.h

    r2043 r3682  
    1414{
    1515private:
    16     TH1F fHistLeakage1; //
    17     TH1F fHistLeakage2; //
     16    TH1F fHistLeakage1;  //
     17    TH1F fHistLeakage2;  //
    1818
    19     TH1F fHistUsedPix;  // Number of used pixels
    20     TH1F fHistCorePix;  // Number of core pixels
     19    TH1F fHistUsedPix;   // Number of used pixels
     20    TH1F fHistCorePix;   // Number of core pixels
    2121
    22     TH1F fHistConc;     // [ratio] concentration ratio: sum of the two highest pixels / fSize
    23     TH1F fHistConc1;    // [ratio] concentration ratio: sum of the highest pixel / fSize
     22    TH1F fHistUsedArea;  // Area of used pixels
     23    TH1F fHistCoreArea;  // Area of core pixels
     24
     25    TH1F fHistConc;      // [ratio] concentration ratio: sum of the two highest pixels / fSize
     26    TH1F fHistConc1;     // [ratio] concentration ratio: sum of the highest pixel / fSize
    2427
    2528public:
     
    3134    TH1 *GetHistByName(const TString name);
    3235
    33     TH1F &GetHistLeakage1() { return fHistLeakage1; }
    34     TH1F &GetHistLeakage2() { return fHistLeakage2; }
     36    TH1F &GetHistLeakage1()  { return fHistLeakage1; }
     37    TH1F &GetHistLeakage2()  { return fHistLeakage2; }
    3538
    36     TH1F &GetHistUsedPix()  { return fHistUsedPix; }
    37     TH1F &GetHistCorePix()  { return fHistCorePix; }
     39    TH1F &GetHistUsedPix()   { return fHistUsedPix; }
     40    TH1F &GetHistCorePix()   { return fHistCorePix; }
    3841
    39     TH1F &GetHistConc()     { return fHistConc; }
    40     TH1F &GetHistConc1()    { return fHistConc1; }
     42    TH1F &GetHistUsedArea()  { return fHistUsedArea; }
     43    TH1F &GetHistCoreArea()  { return fHistCoreArea; }
     44
     45    TH1F &GetHistConc()      { return fHistConc; }
     46    TH1F &GetHistConc1()     { return fHistConc1; }
    4147
    4248    void Draw(Option_t *opt=NULL);
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.cc

    r3526 r3682  
    196196    *fLog << " " << setw(7) << fErrors[i] << " (";
    197197    *fLog << setw(3) << (int)(100.*fErrors[i]/GetNumExecutions());
    198     *fLog << "%) Evts skipped due to: " << str << endl;
     198    *fLog << "%) Evts skipped: " << str << endl;
    199199}
    200200
     
    212212    *fLog << GetDescriptor() << " execution statistics:" << endl;
    213213    *fLog << dec << setfill(' ');
    214     PrintSkipped(1, "Event has less than 3 pixels\n                                     (before image cleaning)");
    215     PrintSkipped(2, "Calculated Size == 0\n                                     (no pixels survived image cleaning)");
     214    PrintSkipped(1, "Less than 3 pixels (before cleaning)");
     215    PrintSkipped(2, "Calculated Size == 0 (after cleaning)");
    216216    PrintSkipped(3, "Number of used pixels < 3");
    217217    PrintSkipped(4, "CorrXY==0");
  • trunk/MagicSoft/Mars/mimage/MHillasExt.cc

    r3666 r3682  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
    2020!   Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de>
    2121!
    22 !   Copyright: MAGIC Software Development, 2000-2002
     22!   Copyright: MAGIC Software Development, 2000-2004
    2323!
    2424!
     
    101101    fM3Trans =  0;
    102102
    103     fMaxDist = -1;
     103    fMaxDist =  0;
    104104}
    105105
     
    170170        const Double_t dy = gpix.GetY() - hil.GetMeanY();      // [mm]
    171171
    172         const Double_t dist = dx*dx+dy*dy;
    173         if (dist>maxdist)
    174             maxdist=dist;                                      // [mm^2]
    175 
    176172        Double_t nphot = pix.GetNumPhotons();                  // [1]
    177173
    178174        const Double_t dzx =  hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm]
    179175        const Double_t dzy = -hil.GetSinDelta()*dx + hil.GetCosDelta()*dy; // [mm]
     176
     177        const Double_t dist = dx*dx+dy*dy;
     178        if (TMath::Abs(dist)>TMath::Abs(maxdist))
     179            maxdist = dzx<0 ? -dist : dist;                    // [mm^2]
    180180
    181181        m3x += nphot * dzx*dzx*dzx;                            // [mm^3]
     
    210210    fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3);      // [mm]
    211211
    212     fMaxDist = TMath::Sqrt(maxdist);                           // [mm]
     212    const Double_t md = TMath::Sqrt(TMath::Abs(maxdist));
     213    fMaxDist = maxdist<0 ? -md : md;                           // [mm]
    213214
    214215    SetReadyToSave();
     
    224225void MHillasExt::Set(const TArrayF &arr)
    225226{
    226     if (arr.GetSize() != 3)
     227    if (arr.GetSize() != 4)
    227228        return;
    228229
    229     fAsym    = arr.At(0); // [mm] fDist minus dist: center of ellipse, highest pixel
    230     fM3Long  = arr.At(1); // [mm] 3rd moment (e-weighted) along major axis
    231     fM3Trans = arr.At(2); // [mm] 3rd moment (e-weighted) along minor axis
    232 }
     230    fAsym    = arr.At(0);
     231    fM3Long  = arr.At(1);
     232    fM3Trans = arr.At(2);
     233    fMaxDist = arr.At(3);
     234}
  • trunk/MagicSoft/Mars/mimage/MNewImagePar.cc

    r3666 r3682  
    1717!
    1818!   Author(s): Wolfgang Wittek 03/2003 <mailto:wittek@mppmu.mpg.de>
     19!   Author(s): Thomas Bretz            <mailto:tbretz@astro.uni-wuerzburg.de>
    1920!
    2021!   Copyright: MAGIC Software Development, 2000-2004
     
    2930// Storage Container for new image parameters
    3031//
    31 // fLeakage1 ratio: (photons in most outer ring of pixels) over fSize
    32 // fLeakage2 ratio: (photons in the 2 outer rings of pixels) over fSize
    33 // fNumSaturatedPixels: number of pixels in which at least one slice
    34 //                      of the low gain FADC was saturated.
     32//    Float_t fLeakage1;             // (photons in most outer ring of pixels) over fSize
     33//    Float_t fLeakage2;             // (photons in the 2 outer rings of pixels) over fSize
     34//    Float_t fInnerLeakage1;        // (photons in most outer rings of inner pixels) over fInnerSize
     35//    Float_t fInnerLeakage2;        // (photons in the 2 outer rings of inner pixels) over fInnerSize
     36//    Float_t fInnerSize;            //
     37//
     38//    Float_t fConc;                 // [ratio] concentration ratio: sum of the two highest pixels / fSize
     39//    Float_t fConc1;                // [ratio] concentration ratio: sum of the highest pixel / fSize
     40//
     41//    Float_t fUsedArea;             // Area of pixels which survived the image cleaning
     42//    Float_t fCoreArea;             // Area of core pixels
     43//    Short_t fNumUsedPixels;        // Number of pixels which survived the image cleaning
     44//    Short_t fNumCorePixels;        // number of core pixels
     45//    Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains
     46//    Short_t fNumSaturatedPixels;   // number of pixels with saturating lo-gains
    3547//
    3648// Version 2:
     
    4658//  - added fUsedArea
    4759//  - added fCoreArea
    48 // 
    49 // 
     60//
     61//
    5062/////////////////////////////////////////////////////////////////////////////
    5163#include "MNewImagePar.h"
     
    187199        }
    188200
    189         // Compute Concetration 1 -2
    190 
     201        // Compute Concentration 1-2
    191202        if (nphot>maxpix1)
    192203        {
     
    217228    *fLog << all;
    218229    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
    219     *fLog << " - Leakage1       [1]   = " << fLeakage1      << endl;
    220     *fLog << " - Leakage2       [1]   = " << fLeakage2      << endl;
    221     *fLog << " - Conc           [1]   = " << fConc          << " (ratio)" << endl;
    222     *fLog << " - Conc1          [1]   = " << fConc1         << " (ratio)" << endl;
    223     *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels << " Pixels" << endl;
    224     *fLog << " - Core Pixels    [#]   = " << fNumCorePixels << " Pixels" << endl;
    225     *fLog << " - Sat. Pixels (HG) [#]  = " << fNumHGSaturatedPixels << " Pixels" << endl;
    226     *fLog << " - Sat. Pixels (LG) [#]  = " << fNumSaturatedPixels << " Pixels" << endl;
    227 }
     230    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
     231    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
     232    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
     233    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
     234    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
     235    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
     236    *fLog << " - Used Area     [mm^2] = " << fUsedArea             << endl;
     237    *fLog << " - Core Area     [mm^2] = " << fCoreArea             << endl;
     238    *fLog << " - Sat.Pixels/HG  [#]   = " << fNumHGSaturatedPixels << " Pixels" << endl;
     239    *fLog << " - Sat.Pixels/LG  [#]   = " << fNumSaturatedPixels   << " Pixels" << endl;
     240}
     241
     242// -------------------------------------------------------------------------
     243//
     244// Print contents of MNewImagePar to *fLog, depending on the geometry in
     245// units of deg.
     246//
     247void MNewImagePar::Print(const MGeomCam &geom) const
     248{
     249    *fLog << all;
     250    *fLog << "New Image Parameters (" << GetName() << ")" << endl;
     251    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
     252    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
     253    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
     254    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
     255    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
     256    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
     257    *fLog << " - Used Area    [deg^2] = " << fUsedArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
     258    *fLog << " - Core Area    [deg^2] = " << fCoreArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
     259    *fLog << " - Sat.Pixels/HG  [#]   = " << fNumHGSaturatedPixels << " Pixels" << endl;
     260    *fLog << " - Sat.Pixels/LG  [#]   = " << fNumSaturatedPixels   << " Pixels" << endl;
     261}
  • trunk/MagicSoft/Mars/mimage/MNewImagePar.h

    r3666 r3682  
    4343    Short_t GetNumCorePixels() const { return fNumCorePixels; }
    4444
    45     Float_t GetNumUsedArea() const { return fUsedArea; }
    46     Float_t GetNumCoreArea() const { return fCoreArea; }
     45    Float_t GetUsedArea() const { return fUsedArea; }
     46    Float_t GetCoreArea() const { return fCoreArea; }
    4747
    4848    Short_t GetNumSaturatedPixels() const { return fNumSaturatedPixels; }
     
    5050
    5151    void Print(Option_t *opt=NULL) const;
     52    void Print(const MGeomCam &geom) const;
    5253
    5354    void Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
Note: See TracChangeset for help on using the changeset viewer.