Changeset 3682 for trunk/MagicSoft


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3681 r3682  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2004/04/08: Thomas Bretz
     21
     22   * mfbase/MF.cc:
     23     - optimized output
     24
     25   * mfbase/MFilterList.cc:
     26     - added some comments
     27
     28   * mfileio/MReadMarsFile.[h,cc], mfileio/MReadTree.[h,cc]:
     29     - added SortFiled-option -- RAQUEL, this is for you!
     30
     31   * mfileio/MWriteRootFile.cc:
     32     - class AddSerialNumber in AddContainer
     33
     34   * mhist/MHFalseSource.[h,cc]:
     35     - optimized setting of hist maximum
     36     - added more source dependant cuts
     37     - changed display layout
     38     - scale number of entries to correct for different acceptance
     39       (not perfect, but the best I can currently do)
     40
     41   * mimage/MHHillasExt.[h,cc]:
     42     - added new histogram for fMaxDist
     43
     44   * mimage/MHNewImagePar.[h,cc]:
     45     - added new histograms for Used/CoreArea
     46
     47   * mimage/MHillasCalc.cc:
     48     - optimized output
     49
     50   * mimage/MHillasExt.cc:
     51     - fMaxDist got a sign
     52
     53   * mimage/MNewImagePar.[h,cc]:
     54     - enhanced comments
     55     - added new Print() member function
     56
     57   * macros/readCT1.C, macros/readMagic.C, mmain/MEventDisplay.cc:
     58     - forward geomcam to newimgepar.Print()
     59
     60
    2061
    2162 2004/04/08: Markus Gaug
     
    4081     - removed warning about low-gain saturation of Blind pixel
    4182
     83
     84
    4285 2004/04/07: Markus Gaug
     86
    4387   * mcalib/MHGausEvents.[h,cc]
    4488     - added fBlackout events
     89
    4590
    4691
  • trunk/MagicSoft/Mars/macros/readCT1.C

    r2624 r3682  
    125125        hillas.Print(*geomcam);
    126126        hillasext.Print(*geomcam);
    127         newimgpar.Print();
     127        newimgpar.Print(*geomcam);
    128128
    129129        if (!HandleInput())
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r3141 r3682  
    100100    ((MHillas*)fParList->FindObject("MHillas"))->Print(*geom);
    101101    ((MHillasExt*)fParList->FindObject("MHillasExt"))->Print(*geom);
    102     fParList->FindObject("MNewImagePar")->Print();
     102    ((MNewImagePar*)fParList->FindObject("MNewImagePar"))->Print(*geom);
    103103
    104104    return HandleInput();
  • trunk/MagicSoft/Mars/mfbase/MF.cc

    r3573 r3682  
    4141//   "MHillas.fWidth<0.5 && MHillas.fLength<0.6"
    4242//
    43 // You can also use brackets:
     43// You can also use parantheses:
    4444//   "MHillas.fSize>200 || (MHillas.fWidth<0.5 && MHillas.fLength<0.6)"
    4545//
    4646// If you want to use mathematic expressions (as defined in MDataChain)
    47 // you must encapsulate it in {}-Brackets, eg:
     47// you must encapsulate it in {}-parantheses, eg:
    4848//   "{log10(MHillas.fSize)}>3"
    4949//
     
    6060//
    6161//
    62 // Warning: There is no priority rule build in. So better use brackets
     62// Warning: There is no priority rule build in. So better use parantheses
    6363//   to get correct results. The rule is parsed/evaluated from the left
    6464//   to the right, which means:
     
    120120    fTitle = title ? title : gsDefTitle.Data();
    121121
    122     *fLog << inf << "Trying to resolve filter rule..." << endl;
     122    *fLog << inf << "Trying to resolve filter rule... " << flush;
    123123    if (!(fF=ParseString(text, 1)))
    124124    {
     
    127127    }
    128128
    129     *fLog << inf << endl;
    130     *fLog << "Using Filter rule " << fF->GetName();
    131     *fLog << " for " << fName << ":" << endl;
     129    *fLog << inf << "found: ";
    132130    fF->Print();
    133     *fLog << endl << endl;
     131    *fLog << endl;
    134132}
    135133
     
    178176    {
    179177        *fLog << err << dbginf << "Syntax Error: Two coditional signs found in " << txt << endl;
    180         *fLog << "Currently you have to enclose all conditions in brackets, like: \"(x<y) && (z<5)\"" << endl;
     178        *fLog << "Currently you have to enclose all conditions in parantheses, like: \"(x<y) && (z<5)\"" << endl;
    181179        return NULL;
    182180    }
     
    226224            {
    227225                //
    228                 // Search for the corresponding bracket
     226                // Search for the corresponding parantheses
    229227                //
    230228                Int_t first=1;
     
    250248                //
    251249                // Make a copy of the 'interieur' and delete the substringä
    252                 // including the brackets
     250                // including the parantheses
    253251                //
    254252                TString sub = txt(1, first-1);
  • trunk/MagicSoft/Mars/mfbase/MFilterList.cc

    r3666 r3682  
    7979//
    8080//   Options:
    81 //      and, &   : is a bitwise and
    82 //      or,   : is a bitwise or
    83 //      xor, ^   : is a bitwise exclusive or
     81//      and,  &  : is a bitwise and
     82//      or,   |  : is a bitwise or
     83//      xor,  ^  : is a bitwise exclusive or
    8484//      land, && : is a logical and
    85 //      lor, ||  : is a logical or
     85//      lor,  || : is a logical or
     86//
     87//   The bitwise operators are implemented for convinience. They may not
     88//   make much sense. Maybe IsExpressionTrue should change its return
     89//   type from Bool_t to Int_t.
    8690//
    8791MFilterList::MFilterList(const char *type, const char *name, const char *title)
  • trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc

    r2984 r3682  
    116116// --------------------------------------------------------------------------
    117117//
     118//  Sort the files by their file-names
     119//
     120void MReadMarsFile::SortFiles()
     121{
     122    fRun->SortFiles();
     123    MReadTree::SortFiles();
     124}
     125
     126// --------------------------------------------------------------------------
     127//
    118128//  This overload MReadTree::Notify. Before the MReadTree Notify
    119129//  TObjects are called the RunHeaders of the next files are read.
  • trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h

    r2206 r3682  
    2424    ~MReadMarsFile();
    2525
     26    void SortFiles();
     27
    2628    Int_t AddFile(const char *fname, Int_t entries=-1);
    2729
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r3585 r3682  
    358358// --------------------------------------------------------------------------
    359359//
     360//  Sort the files by their file-names
     361//
     362void MReadTree::SortFiles()
     363{
     364    fChain->GetListOfFiles()->Sort();
     365}
     366
     367// --------------------------------------------------------------------------
     368//
    360369//  This function is called if Branch choosing method should get enabled.
    361370//  Branch choosing means, that only the enabled branches are read into
  • trunk/MagicSoft/Mars/mfileio/MReadTree.h

    r2556 r3682  
    4848    ~MReadTree();
    4949
     50    virtual void SortFiles();
     51
    5052    void   DisableAutoScheme() { fAutoEnable = kFALSE; }
    5153    void   EnableBranch(const char *name);
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r3336 r3682  
    198198    // add the entry to the list.
    199199    //
    200     MRootFileBranch *entry = new MRootFileBranch(cname, tname, must);
     200    MRootFileBranch *entry = new MRootFileBranch(AddSerialNumber(cname), tname, must);
    201201    fBranches.AddLast(entry);
    202202
    203203    if (tname && tname[0])
    204         AddToBranchList(Form("%s.%s", cname, tname));
     204        AddToBranchList(Form("%s.%s", AddSerialNumber(cname), tname));
    205205}
    206206
  • trunk/MagicSoft/Mars/mhist/MHFalseSource.cc

    r3666 r3682  
    4646// pads) you can change the AlphaCut 'online'
    4747//
     48// Each Z-Projection (Alpha-histogram) is scaled such, that the number
     49// of entries fits the maximum number of entries in all Z-Projections.
     50// This should correct for the different acceptance in the center
     51// and at the vorder of the camera. This, however, produces more noise
     52// at the border.
     53//
    4854// Here is a slightly simplified version of the algorithm:
    4955// ------------------------------------------------------
     
    139145//
    140146MHFalseSource::MHFalseSource(const char *name, const char *title)
    141     : fTime(0), fPointPos(0), fObservatory(0), fMm2Deg(-1),
    142       fAlphaCut(12.5), fBgMean(55), fDistMin(-1), fDistMax(-1)
     147    : fTime(0), fPointPos(0), fObservatory(0), fMm2Deg(-1), fAlphaCut(12.5),
     148    fBgMean(55), fMinDist(-1), fMaxDist(-1), fMinLD(-1), fMaxLD(-1)
    143149{
    144150    //
     
    155161    fHist.SetYTitle("y [\\circ]");
    156162    fHist.SetZTitle("\\alpha [\\circ]");
     163}
     164
     165void MHFalseSource::MakeSymmetric(TH1 *h)
     166{
     167    const Float_t min = TMath::Abs(h->GetMinimum());
     168    const Float_t max = TMath::Abs(h->GetMaximum());
     169
     170    const Float_t absmax = TMath::Max(min, max)*1.002;
     171
     172    h->SetMaximum( absmax);
     173    h->SetMinimum(-absmax);
    157174}
    158175
     
    337354            //        and/or MTaskList
    338355            // Source dependant distance cut
    339             if (fDistMin>0 && hsrc.GetDist()*fMm2Deg<fDistMin)
     356            if (fMinDist>0 && hsrc.GetDist()*fMm2Deg<fMinDist)
    340357                continue;
    341 
    342             if (fDistMax>0 && hil->GetLength()>fDistMax*hsrc.GetDist())
     358            if (fMaxDist>0 && hsrc.GetDist()*fMm2Deg>fMaxDist)
     359                continue;
     360
     361            if (fMaxLD>0 && hil->GetLength()>fMaxLD*hsrc.GetDist())
     362                continue;
     363            if (fMinLD>0 && hil->GetLength()<fMinLD*hsrc.GetDist())
    343364                continue;
    344365
     
    358379// the same number of bins than for on-data
    359380//
    360 void MHFalseSource::ProjectOff(TH2D *h2)
     381void MHFalseSource::ProjectOff(TH2D *h2, TH2D *all)
    361382{
    362383    TAxis &axe = *fHist.GetZaxis();
     
    379400    // Move contents from projection to h2
    380401    h2->Reset();
    381     h2->Add(p);
     402    h2->Add(p, all->GetMaximum());
     403    h2->Divide(all);
    382404
    383405    // Delete p
     
    393415// range (0, fAlphaCut)
    394416//
    395 void MHFalseSource::ProjectOn(TH2D *h3)
     417void MHFalseSource::ProjectOn(TH2D *h3, TH2D *all)
    396418{
    397419    TAxis &axe = *fHist.GetZaxis();
     
    410432    // Move contents from projection to h3
    411433    h3->Reset();
    412     h3->Add(p);
     434    h3->Add(p, all->GetMaximum());
     435    h3->Divide(all);
     436
     437    // Delete p
    413438    delete p;
    414439
     
    454479    TH2D* h3;
    455480    TH2D* h4;
     481    TH2D* h5;
    456482
    457483    // Update projection of all-events
    458     padsave->GetPad(1)->cd(3);
     484    padsave->GetPad(2)->cd(3);
    459485    if ((h0 = (TH2D*)gPad->FindObject("Alpha_yx_all")))
    460486        ProjectAll(h0);
    461487
     488    // Update projection of on-events
     489    padsave->GetPad(1)->cd(1);
     490    if ((h3 = (TH2D*)gPad->FindObject("Alpha_yx_on")))
     491        ProjectOn(h3, h0);
     492
    462493    // Update projection of off-events
    463     padsave->GetPad(2)->cd(1);
     494    padsave->GetPad(1)->cd(3);
    464495    if ((h2 = (TH2D*)gPad->FindObject("Alpha_yx_off")))
    465         ProjectOff(h2);
    466 
    467     // Update projection of on-events
     496        ProjectOff(h2, h0);
     497
    468498    padsave->GetPad(2)->cd(2);
    469     if ((h3 = (TH2D*)gPad->FindObject("Alpha_yx_on")))
    470         ProjectOn(h3);
     499    if ((h5 = (TH2D*)gPad->FindObject("Alpha_yx_diff")))
     500    {
     501        h5->Add(h3, h2, -1);
     502        MakeSymmetric(h5);
     503    }
    471504
    472505    // Update projection of significance
    473     padsave->GetPad(2)->cd(3);
     506    padsave->GetPad(1)->cd(2);
    474507    if (h2 && h3 && (h4 = (TH2D*)gPad->FindObject("Alpha_yx_sig")))
    475508    {
     
    483516        Int_t max = h4->GetBin(nx, ny);
    484517
    485         for (int ix=0; ix<nx; ix++)
    486             for (int iy=0; iy<ny; iy++)
     518        for (int ix=1; ix<=nx; ix++)
     519            for (int iy=1; iy<=ny; iy++)
    487520            {
    488                 const Int_t n = h4->GetBin(ix+1, iy+1);
     521                const Int_t n = h4->GetBin(ix, iy);
    489522
    490523                const Double_t s = h3->GetBinContent(n);
     
    503536            }
    504537
     538        MakeSymmetric(h4);
     539
    505540        // Update projection of 'the best alpha-plot'
    506         padsave->GetPad(1)->cd(1);
     541        padsave->GetPad(2)->cd(1);
    507542        if ((h1 = (TH1D*)gPad->FindObject("Alpha")) && max>0)
    508543        {
     
    560595    TObject *catalog = GetCatalog();
    561596
    562     // draw the 2D histogram Sigmabar versus Theta
     597    // Initialize upper part
    563598    pad->cd(1);
    564599    gPad->SetBorderMode(0);
    565600    gPad->Divide(3, 1);
    566     delete pad->GetPad(1)->GetPad(2);
    567 
    568     pad->GetPad(1)->cd(3);
    569     gPad->SetBorderMode(0);
    570     TH1 *h0 = fHist.Project3D("yx_all");
    571     h0->SetDirectory(NULL);
    572     h0->SetXTitle(fHist.GetXaxis()->GetTitle());
    573     h0->SetYTitle(fHist.GetYaxis()->GetTitle());
    574     h0->Draw("colz");
    575     h0->SetBit(kCanDelete);
    576     catalog->Draw("mirror same");
    577 
     601
     602    // PAD #1
    578603    pad->GetPad(1)->cd(1);
    579     gPad->SetBorderMode(0);
    580 
    581     TH1 *h1 = fHist.ProjectionZ("Alpha");
    582     h1->SetDirectory(NULL);
    583     h1->SetTitle("Distribution of \\alpha");
    584     h1->SetXTitle(fHist.GetZaxis()->GetTitle());
    585     h1->SetYTitle("Counts");
    586     h1->Draw(opt);
    587     h1->SetBit(kCanDelete);
    588 
    589     pad->cd(2);
    590     gPad->SetBorderMode(0);
    591     gPad->Divide(3, 1);
    592 
    593     pad = gPad;
    594 
    595     pad->cd(1);
    596     gPad->SetBorderMode(0);
    597     fHist.GetZaxis()->SetRangeUser(fBgMean-fAlphaCut/2, fBgMean+fAlphaCut/2);
    598     TH1 *h2 = fHist.Project3D("yx_off");
    599     h2->SetDirectory(NULL);
    600     h2->SetXTitle(fHist.GetXaxis()->GetTitle());
    601     h2->SetYTitle(fHist.GetYaxis()->GetTitle());
    602     h2->Draw("colz");
    603     h2->SetBit(kCanDelete);
    604     catalog->Draw("mirror same");
    605 
    606     pad->cd(2);
    607604    gPad->SetBorderMode(0);
    608605    fHist.GetZaxis()->SetRangeUser(0,fAlphaCut);
     
    616613    catalog->Draw("mirror same");
    617614
    618     pad->cd(3);
     615    // PAD #2
     616    pad->GetPad(1)->cd(2);
    619617    gPad->SetBorderMode(0);
    620618    fHist.GetZaxis()->SetRange(0,0);
     
    627625    h4->Draw("colz");
    628626    h4->SetBit(kCanDelete);
     627    catalog->Draw("mirror same");
     628
     629    // PAD #3
     630    pad->GetPad(1)->cd(3);
     631    gPad->SetBorderMode(0);
     632    fHist.GetZaxis()->SetRangeUser(fBgMean-fAlphaCut/2, fBgMean+fAlphaCut/2);
     633    TH1 *h2 = fHist.Project3D("yx_off");
     634    h2->SetDirectory(NULL);
     635    h2->SetXTitle(fHist.GetXaxis()->GetTitle());
     636    h2->SetYTitle(fHist.GetYaxis()->GetTitle());
     637    h2->Draw("colz");
     638    h2->SetBit(kCanDelete);
     639    catalog->Draw("mirror same");
     640
     641    // Initialize lower part
     642    pad->cd(2);
     643    gPad->SetBorderMode(0);
     644    gPad->Divide(3, 1);
     645
     646    // PAD #4
     647    pad->GetPad(2)->cd(1);
     648    gPad->SetBorderMode(0);
     649    TH1 *h1 = fHist.ProjectionZ("Alpha");
     650    h1->SetDirectory(NULL);
     651    h1->SetTitle("Distribution of \\alpha");
     652    h1->SetXTitle(fHist.GetZaxis()->GetTitle());
     653    h1->SetYTitle("Counts");
     654    h1->Draw(opt);
     655    h1->SetBit(kCanDelete);
     656
     657    // PAD #5
     658    pad->GetPad(2)->cd(2);
     659    gPad->SetBorderMode(0);
     660    TH1 *h5 = (TH1*)h3->Clone("Alpha_yx_diff");
     661    h5->Add(h2, -1);
     662    h5->SetTitle("Difference of on- and off-distribution");
     663    h5->SetDirectory(NULL);
     664    h5->Draw("colz");
     665    h5->SetBit(kCanDelete);
     666    catalog->Draw("mirror same");
     667
     668    // PAD #6
     669    pad->GetPad(2)->cd(3);
     670    gPad->SetBorderMode(0);
     671    TH1 *h0 = fHist.Project3D("yx_all");
     672    h0->SetDirectory(NULL);
     673    h0->SetXTitle(fHist.GetXaxis()->GetTitle());
     674    h0->SetYTitle(fHist.GetYaxis()->GetTitle());
     675    h0->Draw("colz");
     676    h0->SetBit(kCanDelete);
    629677    catalog->Draw("mirror same");
    630678}
     
    729777                       Form("Fit Region: Signal<%.1f\\circ, %.1f\\circ<Bg<%.1f\\circ",
    730778                            sigmax, bgmin, bgmax));
    731     hists->SetNameTitle("Excess",     Form("Number of excess events for \\alpha<%.0f\\circ", sigint));
    732     histb->SetNameTitle("Background", Form("Number of background events for \\alpha<%.0f\\circ", sigint));
     779    hists->SetName("Excess");
     780    histb->SetName("Background");
    733781    hist->SetXTitle(fHist.GetXaxis()->GetTitle());
    734782    hists->SetXTitle(fHist.GetXaxis()->GetTitle());
     
    776824    *fLog << "Polynom order:  " << (int)polynom << endl;
    777825    *fLog << "Fitting False Source Plot..." << flush;
     826
     827    TH1 *h0 = fHist.Project3D("yx_entries");
     828    Float_t entries = h0->GetMaximum();
     829    delete h0;
    778830
    779831    TH1 *h=0;
     
    790842            if (alpha0==0)
    791843                continue;
     844
     845            h->Scale(entries/h->GetEntries());
    792846
    793847            if (alpha0>maxalpha0)
     
    887941    h0b.GetXaxis()->SetRangeUser(0, maxalpha0*1.5);
    888942
     943    hists->SetTitle(Form("Excess events for \\alpha<%.0f\\circ (N_{max}=%d)", sigint, (int)hists->GetMaximum()));
     944    histb->SetTitle(Form("Background events for \\alpha<%.0f\\circ", sigint));
     945
    889946    //hists->SetMinimum(GetMinimumGT(*hists));
    890947    histb->SetMinimum(GetMinimumGT(*histb));
     948
     949    MakeSymmetric(hists);
     950    MakeSymmetric(hist);
    891951
    892952    clk.Stop();
     
    9501010
    9511011        TH1 *result = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy);
     1012        result->Scale(entries/h->GetEntries());
     1013
    9521014        result->SetDirectory(NULL);
    9531015        result->SetNameTitle("Result \\alpha", title);
  • trunk/MagicSoft/Mars/mhist/MHFalseSource.h

    r3666 r3682  
    2929    Float_t fBgMean;             // Background mean
    3030
    31     Float_t fDistMin;            // Min dist
    32     Float_t fDistMax;            // Maximum distance in percent of dist
     31    Float_t fMinDist;            // Min dist
     32    Float_t fMaxDist;            // Max dist
     33
     34    Float_t fMinLD;              // Minimum distance in percent of dist
     35    Float_t fMaxLD;              // Maximum distance in percent of dist
    3336
    3437    TH3D    fHist;               // Alpha vs. x and y
     
    4043    void Modified();
    4144
    42     void ProjectOff(TH2D *h);
    43     void ProjectOn(TH2D *h);
    4445    void ProjectAll(TH2D *h);
     46    void ProjectOff(TH2D *h, TH2D *all);
     47    void ProjectOn(TH2D *h, TH2D *all);
    4548
    4649    TObject *GetCatalog();
     50
     51    void MakeSymmetric(TH1 *h);
    4752
    4853public:
     
    5762    void FitSignificanceStd() { FitSignificance(); } //*MENU*
    5863
    59     void SetDistMin(Float_t dist)  { fDistMin = dist;  } // Absolute minimum distance
    60     void SetDistMax(Float_t ratio) { fDistMax = ratio; } // Maximum ratio between length/dist
     64    void SetMinDist(Float_t dist) { fMinDist = dist; } // Absolute minimum distance
     65    void SetMaxDist(Float_t dist) { fMaxDist = dist; } // Absolute maximum distance
     66    void SetMinLD(Float_t ratio)  { fMinLD = ratio; }  // Minimum ratio between length/dist
     67    void SetMaxLD(Float_t ratio)  { fMaxLD = ratio; }  // Maximum ratio between length/dist
    6168
    6269    void SetAlphaCut(Float_t alpha); //*MENU*
  • 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,
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r3503 r3682  
    8282#include "MHillasExt.h"            // MHillasExt::Print(const MGeomCam&)
    8383#include "MHillasSrc.h"            // MHillasSrc::Print(const MGeomCam&)
     84#include "MNewImagePar.h"          // MNewImagePar::Print(const MGeomCam&)
    8485#include "MHEvent.h"               // MHEvent
    8586#include "MHCamera.h"              // MHCamera
     
    511512    // Print parameters
    512513    //
    513     ((MHillas*)   plist->FindObject("MHillas"))->Print(*geom);
    514     ((MHillasExt*)plist->FindObject("MHillasExt"))->Print(*geom);
    515     ((MHillasSrc*)plist->FindObject("MHillasSrc"))->Print(*geom);
    516     plist->FindObject("MNewImagePar")->Print();
     514    ((MHillas*)     plist->FindObject("MHillas"))->Print(*geom);
     515    ((MHillasExt*)  plist->FindObject("MHillasExt"))->Print(*geom);
     516    ((MHillasSrc*)  plist->FindObject("MHillasSrc"))->Print(*geom);
     517    ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom);
    517518
    518519    //
Note: See TracChangeset for help on using the changeset viewer.