Changeset 8657 for trunk/MagicSoft


Ignore:
Timestamp:
08/06/07 15:44:16 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8655 r8657  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2007/08/06 Thomas Bretz
     22
     23   * mcalib/CalibLinkDef.h, mcalib/Makefile:
     24     - removed obsolete MMcCalibrationCalc
     25
     26   * mhbase/MH.[h,cc]:
     27     - adde ApplyBinning member functions for two- and three-dim hists
     28
     29   * mimage/MHHillasExt.[h,cc]:
     30     - removed plot for max dist
     31     - added plot for SlopeL
     32     - increased class version number
     33
     34   * mjobs/MJCut.cc:
     35     - added BinningSlope to list of binnings
     36     - added BinningM3Trans to list of binnings
     37     - added BinningM3Asym to list of binnings
     38     - removed BinningMaxDist from list of binnings
     39
     40   * mjtrain/MJTrainDisp.cc:
     41     - renamed TrainDist to Train
     42
     43   * mpointing/MHSrcPosCam.cc:
     44     - changed default palette from glow1 to pretty
     45
     46   * mpointing/MSrcPosCam.h:
     47     - added a function to return the distance to the camera center
     48
     49
    2050
    2151 2007/08/02 Thomas Bretz
  • trunk/MagicSoft/Mars/mcalib/CalibLinkDef.h

    r8504 r8657  
    3939#pragma link C++ class MCalibrationChargePINDiode+;
    4040
    41 #pragma link C++ class MMcCalibrationCalc+;
    42 
    4341#endif
  • trunk/MagicSoft/Mars/mcalib/Makefile

    r8504 r8657  
    5959           MCalibrationBlindCamTwoNewStyle.cc  \
    6060           MCalibrationBlindCamThreeNewStyle.cc  \
    61            MCalibrationChargePINDiode.cc  \
    62            MMcCalibrationCalc.cc
     61           MCalibrationChargePINDiode.cc
    6362
    6463############################################################
  • trunk/MagicSoft/Mars/mhbase/MH.cc

    r8238 r8657  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.32 2007-01-10 12:58:25 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.33 2007-08-06 14:44:13 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    619619}
    620620
     621Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h)
     622{
     623    const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x);
     624    if (!binsx)
     625    {
     626        gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl;
     627        return kFALSE;
     628    }
     629    const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y);
     630    if (!binsy)
     631    {
     632        gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl;
     633        return kFALSE;
     634    }
     635
     636    if (binsx->IsDefault() && binsy->IsDefault())
     637        return kTRUE;
     638
     639    // -------------------------
     640    /*
     641     MBinning binsx, binsy, binsz;
     642     binsx.SetEdges(fHist, 'x');
     643     binsy.SetEdges(fHist, 'y');
     644     binsz.SetEdges(fHist, 'z');
     645     */
     646    // -------------------------
     647
     648    SetBinning(h, binsx, binsy);
     649
     650    return kTRUE;
     651}
     652
     653Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h)
     654{
     655    const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x);
     656    if (!binsx)
     657    {
     658        gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl;
     659        return kFALSE;
     660    }
     661    const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y);
     662    if (!binsy)
     663    {
     664        gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl;
     665        return kFALSE;
     666    }
     667    const MBinning *binsz = (MBinning*)plist.FindObject("Binning"+z);
     668    if (!binsz)
     669    {
     670        gLog << inf << "Object 'Binning" << z << "' [MBinning] not found... no binning applied." << endl;
     671        return kFALSE;
     672    }
     673
     674    if (binsx->IsDefault() && binsy->IsDefault() && binsz->IsDefault())
     675        return kTRUE;
     676
     677    SetBinning(h, binsx, binsy, binsz);
     678    return kTRUE;
     679}
     680
    621681void MH::FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
    622682{
  • trunk/MagicSoft/Mars/mhbase/MH.h

    r8047 r8657  
    8080    static void RemoveFirstBin(TH1 &h);
    8181
    82     static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
     82    static Bool_t ApplyBinning(const MParList &plist, TString x, TH1 *h);
     83    static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h);
     84    static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h);
    8385
    8486    static void    ScaleArray(TArrayD &bins, Double_t f);
  • trunk/MagicSoft/Mars/mimage/MHHillasExt.cc

    r8256 r8657  
    1818!   Author(s): Thomas Bretz, 2001 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    2828//
    2929// This class contains histograms for every Hillas parameter
     30//
     31// Class Version 2:
     32// ----------------
     33//  - fHMaxDist
     34//  + fHSlopeL
    3035//
    3136/////////////////////////////////////////////////////////////////////////////
     
    3439#include <math.h>
    3540
    36 #include <TH1.h>
    3741#include <TPad.h>
    3842#include <TLegend.h>
     
    4751
    4852#include "MBinning.h"
     53
     54#include "MHillas.h"
    4955#include "MHillasExt.h"
    5056#include "MHillasSrc.h"
     
    5965//
    6066MHHillasExt::MHHillasExt(const char *name, const char *title)
    61     : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillasExt")
     67    : fHillas(0), fHillasExt(0), fMm2Deg(1),
     68    fUseMmScale(kTRUE), fHilName("MHillasExt")
    6269{
    6370    //
     
    7582    fHM3Long.UseCurrentStyle();
    7683    fHM3Trans.UseCurrentStyle();
    77     fHMaxDist.UseCurrentStyle();
     84    fHSlopeL.UseCurrentStyle();
    7885
    7986    fHAsym.SetName("Asymmetry");
    8087    fHM3Long.SetName("M3l");
    8188    fHM3Trans.SetName("M3t");
    82     fHMaxDist.SetName("MaxDist");
     89    fHSlopeL.SetName("SlopeL");
    8390
    8491    fHAsym.SetTitle("Asymmetry");
    8592    fHM3Long.SetTitle("3^{rd} Moment Longitudinal");
    8693    fHM3Trans.SetTitle("3^{rd} Moment Transverse");
    87     fHMaxDist.SetTitle("Distance of max distant pixel");
     94    fHSlopeL.SetTitle("Longitudinal time-slope vs. Dist");
    8895
    8996    fHAsym.SetXTitle("Asym [mm]");
    9097    fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
    9198    fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
    92     fHMaxDist.SetXTitle("D_{max} [mm]");
     99    fHSlopeL.SetXTitle("D [mm]");
    93100
    94101    fHAsym.SetYTitle("Counts");
    95102    fHM3Long.SetYTitle("Counts");
    96103    fHM3Trans.SetYTitle("Counts");
    97     fHMaxDist.SetYTitle("Counts");
     104    fHSlopeL.SetYTitle("S_{l} [ns/mm]");
    98105
    99106    fHAsym.SetFillStyle(4000);
    100107    fHM3Long.SetFillStyle(4000);
    101108    fHM3Trans.SetFillStyle(4000);
    102     fHMaxDist.SetFillStyle(4000);
     109    //fHSlopeL.SetFillStyle(4000);
    103110
    104111    fHAsym.SetDirectory(NULL);
    105112    fHM3Long.SetDirectory(NULL);
    106113    fHM3Trans.SetDirectory(NULL);
    107     fHMaxDist.SetDirectory(NULL);
     114    fHSlopeL.SetDirectory(NULL);
    108115
    109116    fHM3Trans.SetLineColor(kBlue);
    110117
    111     MBinning bins;
    112 
    113     bins.SetEdges(51, -326, 326);
    114     bins.Apply(fHM3Long);
    115     bins.Apply(fHM3Trans);
    116 
    117     bins.SetEdges(51, -593, 593);
    118     bins.Apply(fHAsym);
    119 
    120     bins.SetEdges(100, 0, 593);
    121     bins.Apply(fHMaxDist);
     118    MBinning binsx, binsy;
     119
     120    binsx.SetEdges(51, -326, 326);
     121    binsx.Apply(fHM3Long);
     122    binsx.Apply(fHM3Trans);
     123
     124    binsx.SetEdges(51, -593, 593);
     125    binsx.Apply(fHAsym);
     126
     127    binsx.SetEdges(100,     0,  445);
     128    binsy.SetEdges(100, -0.04, 0.04);
     129    MH::SetBinning(&fHSlopeL, &binsx, &binsy);
    122130}
    123131
     
    141149    }
    142150
     151    fHillas = (MHillas*)plist->FindObject("MHillas");
     152    if (!fHillas)
     153    {
     154        *fLog << err << "MHillas not found in parameter list... aborting." << endl;
     155        return kFALSE;
     156    }
     157
    143158    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
    144159    if (!geom)
     
    150165    }
    151166
    152     ApplyBinning(*plist, "Asym",    &fHAsym);
    153     ApplyBinning(*plist, "M3Long",  &fHM3Long);
     167    ApplyBinning(*plist, "Asym", &fHAsym);
     168    ApplyBinning(*plist, "M3Long", &fHM3Long);
    154169    ApplyBinning(*plist, "M3Trans", &fHM3Trans);
    155     ApplyBinning(*plist, "MaxDist", &fHMaxDist);
     170    ApplyBinning(*plist, "Dist", "Slope", &fHSlopeL);
    156171
    157172    return kTRUE;
     
    168183
    169184    const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1));
     185    const Double_t dist  = src ? src->GetDist() : fHillas->GetDist0();
    170186
    171187    fHAsym.Fill(scale*fHillasExt->GetAsym(), w);
    172188    fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w);
    173189    fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w);
    174     fHMaxDist.Fill(TMath::Abs(scale*fHillasExt->GetMaxDist()), w);
     190    fHSlopeL.Fill(scale*dist, fHillasExt->GetSlopeLong()/scale, w);
    175191
    176192    return kTRUE;
     
    197213    MH::ScaleAxis(&fHM3Long,  scale);
    198214    MH::ScaleAxis(&fHM3Trans, scale);
    199     MH::ScaleAxis(&fHMaxDist, scale);
     215    MH::ScaleAxis(&fHSlopeL,  scale, 1./scale);
    200216
    201217    if (mmscale)
     
    204220        fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
    205221        fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
    206         fHMaxDist.SetXTitle("D_{max} [mm]");
     222        fHSlopeL.SetXTitle("D [mm]");
     223        fHSlopeL.SetYTitle("S_{l} [ns/mm]");
    207224    }
    208225    else
     
    211228        fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
    212229        fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
    213         fHMaxDist.SetXTitle("D_{max} [\\circ]");
     230        fHSlopeL.SetXTitle("D [\\circ]");
     231        fHSlopeL.SetYTitle("S_{l} [ns/\\circ]");
    214232    }
    215233
     
    262280        fHM3Long.SetName("M3lSame");
    263281        fHM3Trans.SetName("M3tSame");
    264         fHMaxDist.SetName("MaxDistSame");
     282        fHSlopeL.SetName("SlopeLSame");
    265283
    266284        fHAsym.SetDirectory(0);
    267285        fHM3Long.SetDirectory(0);
    268286        fHM3Trans.SetDirectory(0);
    269         fHMaxDist.SetDirectory(0);
     287        fHSlopeL.SetDirectory(0);
    270288
    271289        fHM3Long.SetLineColor(kMagenta);
    272290        fHM3Trans.SetLineColor(kCyan);
    273291        fHAsym.SetLineColor(kBlue);
    274         fHMaxDist.SetLineColor(kBlue);
     292        fHSlopeL.SetMarkerColor(kBlue);
    275293    }
    276294
     
    288306    pad->cd(2);
    289307    gPad->SetBorderMode(0);
    290     RemoveFromPad("MaxDistSame");
    291     fHMaxDist.Draw(same?"same":"");
     308    //RemoveFromPad("SlopeLSame");
     309    //fHSlopeL.Draw(same?"same":"");
     310    if (same)
     311    {
     312        TH2 *h=dynamic_cast<TH2*>(gPad->FindObject("SlopeL"));
     313        if (h)
     314        {
     315            // This causes crashes in THistPainter::PaintTable
     316            // if the z-axis is not kept. No idea why...
     317            h->SetDrawOption("z");
     318            h->SetMarkerColor(kBlack);
     319        }
     320
     321        RemoveFromPad("SlopeLSame");
     322        fHSlopeL.SetMarkerColor(kGreen);
     323        fHSlopeL.Draw("same");
     324    }
     325    else
     326        fHSlopeL.Draw("colz");
    292327
    293328    delete pad->GetPad(4);
     
    302337    if (name.Contains("M3T", TString::kIgnoreCase))
    303338        return const_cast<TH1F*>(&fHM3Trans);
    304     if (name.Contains("MaxDist", TString::kIgnoreCase))
    305         return const_cast<TH1F*>(&fHMaxDist);
     339    if (name.Contains("SlopeL", TString::kIgnoreCase))
     340        return const_cast<TH2F*>(&fHSlopeL);
    306341
    307342    return NULL;
  • trunk/MagicSoft/Mars/mimage/MHHillasExt.h

    r6977 r8657  
    22#define MARS_MHHillasExt
    33
    4 #ifndef ROOT_TH1
    5 #include <TH1.h>
     4#ifndef ROOT_TH2
     5#include <TH2.h>
    66#endif
    77#ifndef MARS_MH
     
    99#endif
    1010
     11class MHillas;
    1112class MHillasExt;
    1213
     
    1415{
    1516private:
     17    MHillas    *fHillas;    //! Pointer to the MHillas container
    1618    MHillasExt *fHillasExt; //! Pointer to the MHillasExt container
    1719
     
    1921    TH1F fHM3Long;  // [mm]    3rd moment (e-weighted) along major axis
    2022    TH1F fHM3Trans; // [mm]    3rd moment (e-weighted) along minor axis
    21     TH1F fHMaxDist; // [mm]    Distance between shower center maximum distant pixel
     23    TH2F fHSlopeL;  //
    2224
    2325    Float_t fMm2Deg;
     
    4648    void Draw(Option_t *opt=NULL);
    4749
    48     ClassDef(MHHillasExt, 1) // Container which holds histograms for the extended hillas parameters
     50    ClassDef(MHHillasExt, 2) // Container which holds histograms for the extended hillas parameters
    4951};
    5052
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r8646 r8657  
    618618    MBinning bins6("BinningLength");
    619619    MBinning bins7("BinningDist");
    620     MBinning bins8("BinningMaxDist");
     620    MBinning bins8("BinningSlope");
    621621    MBinning bins9("BinningM3Long");
    622     MBinning bins0("BinningConc1");
     622    MBinning bins0("BinningM3Trans");
     623    MBinning binsa("BinningAsym");
     624    MBinning binsb("BinningConc1");
    623625    plist.AddToList(&bins1);
    624626    plist.AddToList(&bins2);
     
    631633    plist.AddToList(&bins9);
    632634    plist.AddToList(&bins0);
     635    plist.AddToList(&binsa);
     636    plist.AddToList(&binsb);
    633637    //plist.AddToList(&binsT);
    634638
  • trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc

    r8656 r8657  
    189189// Run Disp optimization
    190190//
    191 Bool_t MJTrainDisp::TrainDisp(const char *out, const MDataSet &set, Int_t num)
     191Bool_t MJTrainDisp::Train(const char *out, const MDataSet &set, Int_t num)
    192192{
    193193    SetTitle(Form("TrainDisp: %s", out));
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.cc

    r8383 r8657  
    167167void MHSrcPosCam::Paint(Option_t *)
    168168{
    169     MH::SetPalette("glow1", 99);
     169    MH::SetPalette("pretty", 99);
    170170}
    171171
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h

    r7804 r8657  
    2727    void Add(const TVector2 &v);
    2828
     29    Float_t GetDist() const { return TMath::Hypot(fX, fY); }
     30
    2931    Float_t GetX() const             { return fX; }
    3032    Float_t GetY() const             { return fY; }
Note: See TracChangeset for help on using the changeset viewer.