Changeset 2109 for trunk/MagicSoft


Ignore:
Timestamp:
05/10/03 18:27:17 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2108 r2109  
    11                                                 -*-*- END OF LINE -*-*-
    22
    3  2003/05/10: Abelardo Moralejo
     3 2003/05/10: Thomas Bretz
    44
    55   * Makefile.rules:
  • trunk/MagicSoft/Mars/Makefile.rules

    r2096 r2109  
    6868        @echo $(INCLUDES) $(CXXFLAGS)
    6969
    70 
     70diff:
     71        @cvs diff | grep -v "^? " > mars.diff
  • trunk/MagicSoft/Mars/NEWS

    r2080 r2109  
    5959
    6060   - colors in logging output to screen
     61
     62   - changes to the Image Parameter declaration:
     63       + moved fConc, fConc1 from MHillasSrc to MNewImagePar
     64       + moved fNumUsedPix, fNumCorePix from MHillas to MNewImagePar
     65       + MHillasExt now derives from MParContainer instead of MHillas
     66     --> Files written with the old definition are more or less unreadable
    6167
    6268
  • trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc

    r2105 r2109  
    235235Bool_t MCT1SupercutsCalc::Process()
    236236{
    237     const Double_t dNOMLOGSIZE = 4.1;
    238     const Double_t dNOMCOSZA   = 1.0;
     237    const Double_t kNomLogSize = 4.1;
     238    const Double_t kNomCosZA   = 1.0;
    239239
    240240    const Double_t newdist = fHilSrc->GetDist() * fMm2Deg;
     
    245245    const Double_t dd2     = dist * dist;
    246246
    247     const Double_t dmls    = log(fHil->GetSize()) - dNOMLOGSIZE;
     247    const Double_t dmls    = log(fHil->GetSize()) - kNomLogSize;
    248248    const Double_t dmls2   = dmls * dmls;
    249249
    250     const Double_t dmcza = cos(fMcEvt->GetTelescopeTheta()) - dNOMCOSZA;
     250    const Double_t dmcza   = cos(fMcEvt->GetTelescopeTheta()) - kNomCosZA;
    251251
    252252    const Double_t length  = fHil->GetLength() * fMm2Deg;
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r1965 r2109  
    376376    TMethodCall *call = NULL;
    377377
    378     *fLog << warn << "Trying to find MethodCall '" << IsA()->GetName();
     378    *fLog << warn << "Trying to find MethodCall '" << ClassName();
    379379    *fLog << "::Get" << name << "' instead <LEAKS MEMORY>" << endl;
    380380    call = new TMethodCall(IsA(), (TString)"Get"+name, "");
     
    384384    delete call;
    385385
    386     *fLog << warn << "Trying to find MethodCall '" << IsA()->GetName();
     386    *fLog << warn << "Trying to find MethodCall '" << ClassName();
    387387    *fLog << "::" << name << "' instead <LEAKS MEMORY>" << endl;
    388388    call = new TMethodCall(IsA(), name, "");
     
    482482        return kFALSE;
    483483
    484     *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << IsA()->GetName() << "::ReadEnv." << endl;
     484    *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << ClassName() << "::ReadEnv." << endl;
    485485    return kTRUE;
    486486}
     
    513513        return kFALSE;
    514514
    515     *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but " << IsA()->GetName() << "::WriteEnv not overloaded." << endl;
     515    *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but " << ClassName() << "::WriteEnv not overloaded." << endl;
    516516    return kTRUE;
    517517}
  • trunk/MagicSoft/Mars/mbase/Makefile

    r2063 r2109  
    2020# @endcode
    2121
    22 INCLUDES = -I. -I../mraw -I../MRawFormat -I../mmc -I../mfileio \
    23            -I../mmain -I../mfilter
     22INCLUDES = -I. -I../mmain -I../mfileio -I../mfilter
     23# MStatusDisplay (MTask), MRead (MEvtLoop), MF (MContinue)
    2424
    2525# @code
  • trunk/MagicSoft/Mars/mdata/MDataArray.cc

    r1574 r2109  
    163163}
    164164
     165TString MDataArray::GetRule(int i) const
     166{
     167    return (*this)[i].GetRule();
     168}
     169
    165170// --------------------------------------------------------------------------
    166171//
  • trunk/MagicSoft/Mars/mdata/MDataArray.h

    r1891 r2109  
    3333    Double_t operator()(Int_t i);
    3434
     35    TString GetRule(int i) const;
     36
    3537    Bool_t PreProcess(const MParList *plist);
    3638
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r2010 r2109  
    787787}
    788788
     789// ------------------------------------------------------------------------
     790//
     791// Returns string containing info about the object at position (px,py).
     792// Returned string will be re-used (lock in MT environment).
     793//
     794char *MCamDisplay::GetObjectInfo(Int_t px, Int_t py) const
     795{
     796    static char info[64];
     797
     798    Int_t dist = 999999;
     799    UInt_t i;
     800    for (i=0; i<fNumPixels; i++)
     801    {
     802        if ((*fPixels)[i]->DistancetoPrimitive(px, py)>0)
     803            continue;
     804
     805        sprintf(info, "Pixel Id: %d", i);
     806        return info;
     807    }
     808    return TObject::GetObjectInfo(px, py);
     809}
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r1965 r2109  
    7777    void DrawPixelNumbers();
    7878
    79     void     Paint(Option_t *option="");
    80     void     Reset();
    81     void     Draw(Option_t *option="");
    82     void     SavePrimitive(ofstream &out, Option_t *);
    83     Int_t    DistancetoPrimitive(Int_t px, Int_t py);
     79    void  Paint(Option_t *option="");
     80    void  Reset();
     81    void  Draw(Option_t *option="");
     82    void  SavePrimitive(ofstream &out, Option_t *);
     83    Int_t DistancetoPrimitive(Int_t px, Int_t py);
     84    char *GetObjectInfo(Int_t px, Int_t py) const;
    8485    //virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
    8586
     
    9091    void SetInvDeepBlueSeaPalette(); // *MENU*
    9192
    92     void  SetPix(const Int_t pixnum, const Int_t color, Float_t min, Float_t max);      // New function added by M.Lopez in 31-01-03
     93    void SetPix(const Int_t pixnum, const Int_t color, Float_t min, Float_t max);      // New function added by M.Lopez in 31-01-03
    9394
    9495    ClassDef(MCamDisplay, 0) // Displays the magic camera
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r2098 r2109  
    819819    return kFALSE;
    820820}
     821
     822void MH::ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin, Int_t lastybin)
     823{
     824    //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-*
     825    //*-*      ====================================================
     826    //
     827    //   The projection dest is always of the type TH1D.
     828    //   The projection is made from the channels along the Y axis
     829    //   ranging from firstybin to lastybin included.
     830    //   By default, bins 1 to ny are included
     831    //   When all bins are included, the number of entries in the projection
     832    //   is set to the number of entries of the 2-D histogram, otherwise
     833    //   the number of entries is incremented by 1 for all non empty cells.
     834    //
     835    //   if Sumw2() was called for dest, the errors are computed.
     836    //
     837    TAxis &axex = *((TH2&)src).GetXaxis();
     838    TAxis &axey = *((TH2&)src).GetYaxis();
     839
     840    const Int_t nx = axex.GetNbins();
     841    const Int_t ny = axey.GetNbins();
     842    if (firstybin < 0)
     843        firstybin = 1;
     844    if (lastybin > ny)
     845        lastybin = ny;
     846
     847    dest.Reset();
     848    SetBinning(&dest, &axex);
     849
     850    // Create the projection histogram
     851    const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0;
     852
     853    // Fill the projected histogram
     854    for (Int_t binx=0; binx<=nx+1; binx++)
     855    {
     856        Double_t err2 = 0;
     857        for (Int_t biny=firstybin; biny<=lastybin; biny++)
     858        {
     859            const Double_t cont = src.GetCellContent(binx,biny);
     860            const Double_t err1 = src.GetCellError(binx,biny);
     861            err2 += err1*err1;
     862            if (cont)
     863                dest.Fill(axex.GetBinCenter(binx), cont);
     864        }
     865        if (computeErrors)
     866            dest.SetBinError(binx, TMath::Sqrt(err2));
     867    }
     868    if (firstybin <=1 && lastybin >= ny)
     869        dest.SetEntries(src.GetEntries());
     870}
     871
     872void MH::ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin, Int_t lastxbin)
     873{
     874    //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-*
     875    //*-*      ====================================================
     876    //
     877    //   The projection dest is always of the type TH1D.
     878    //   The projection is made from the channels along the Y axis
     879    //   ranging from firstybin to lastybin included.
     880    //   By default, bins 1 to ny are included
     881    //   When all bins are included, the number of entries in the projection
     882    //   is set to the number of entries of the 2-D histogram, otherwise
     883    //   the number of entries is incremented by 1 for all non empty cells.
     884    //
     885    //   if Sumw2() was called for dest, the errors are computed.
     886    //
     887    TAxis &axex = *((TH2&)src).GetXaxis();
     888    TAxis &axey = *((TH2&)src).GetYaxis();
     889
     890    const Int_t nx = axex.GetNbins();
     891    const Int_t ny = axey.GetNbins();
     892    if (firstxbin < 0)
     893        firstxbin = 1;
     894    if (lastxbin > nx)
     895        lastxbin = nx;
     896
     897    dest.Reset();
     898    SetBinning(&dest, &axey);
     899
     900    // Create the projection histogram
     901    const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0;
     902
     903    // Fill the projected histogram
     904    for (Int_t biny=0; biny<=ny+1; biny++)
     905    {
     906        Double_t err2 = 0;
     907        for (Int_t binx=firstxbin; binx<=lastxbin; binx++)
     908        {
     909            const Double_t cont = src.GetCellContent(binx,biny);
     910            const Double_t err1 = src.GetCellError(binx,biny);
     911            err2 += err1*err1;
     912            if (cont)
     913                dest.Fill(axey.GetBinCenter(biny), cont);
     914        }
     915        if (computeErrors)
     916            dest.SetBinError(biny, TMath::Sqrt(err2));
     917    }
     918    if (firstxbin <=1 && lastxbin >= nx)
     919        dest.SetEntries(src.GetEntries());
     920}
     921
     922// --------------------------------------------------------------------------
     923//
     924// In contradiction to TPad::FindObject this function searches recursively
     925// in a pad for an object. gPad is the default.
     926//
     927TObject *MH::FindObjectInPad(const char *name, TVirtualPad *pad)
     928{
     929    if (!pad)
     930        pad = gPad;
     931
     932    if (!pad)
     933        return NULL;
     934
     935    TObject *o;
     936
     937    TIter Next(pad->GetListOfPrimitives());
     938    while ((o=Next()))
     939    {
     940        if (!strcmp(o->GetName(), name))
     941            return o;
     942
     943        if (o->InheritsFrom("TPad"))
     944            if ((o = FindObjectInPad(name, (TVirtualPad*)o)))
     945                return o;
     946    }
     947    return NULL;
     948}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r2098 r2109  
    77
    88class TH1;
     9class TH1D;
    910class TH2;
    1011class TH3;
     
    7576    static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
    7677
     78    static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
     79    static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
     80
     81    static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
     82
    7783    ClassDef(MH, 0) //A base class for Mars histograms
    7884};
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r2106 r2109  
    223223// --------------------------------------------------------------------------
    224224//
     225// Update the projections and (if possible) set log scales before painting
     226//
     227void MHSigmaTheta::Paint(Option_t *opt)
     228{
     229    TVirtualPad *padsave = gPad;
     230
     231    TH1D* h;
     232
     233    padsave->cd(1);
     234    if ((h = (TH1D*)gPad->FindObject("ProjX-Theta")))
     235    {
     236        ProjectionX(*h, fSigmaTheta);
     237        if (h->GetEntries()!=0)
     238            gPad->SetLogy();
     239    }
     240
     241    padsave->cd(4);
     242    if ((h = (TH1D*)gPad->FindObject("ProjY-sigma")))
     243        ProjectionY(*h, fSigmaTheta);
     244
     245    gPad = padsave;
     246}
     247
     248// --------------------------------------------------------------------------
     249//
    225250// Draw the histogram
    226251//
     
    239264    pad->cd(1);
    240265    gPad->SetBorderMode(0);
    241     // gPad->SetLogy();
    242266    h = fSigmaTheta.ProjectionX("ProjX-Theta", -1, 9999, "E");
    243267    h->SetDirectory(NULL);
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h

    r2106 r2109  
    3737    TH3D fDiffPixTheta;  // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
    3838
     39    void Paint(Option_t *opt="");
    3940
    4041public:
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc

    r2087 r2109  
    7272#include <TDatime.h>              // TDatime
    7373#include <TRandom.h>              // TRandom
     74#include <TBrowser.h>             // TBrowser
    7475#include <TObjArray.h>            // TObjArray
    7576#include <TPostScript.h>          // TPostScript
     
    169170    //
    170171    MGPopupMenu *filemenu = new MGPopupMenu(gClient->GetRoot());
    171     // filemenu->AddEntry("S&ave [F2]", kFileSave);
    172     // filemenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs);
     172    // filemenu->AddEntry("Save &As...", kFileSaveAs);
     173    filemenu->AddEntry("New Can&vas",   kFileCanvas);
     174    filemenu->AddEntry("New &Browser",  kFileBrowser);
     175    filemenu->AddSeparator();
    173176    filemenu->AddEntry("Save As status.&ps",   kFileSaveAsPS);
    174177    filemenu->AddEntry("Save As status.&gif",  kFileSaveAsGIF);
     
    177180    filemenu->AddSeparator();
    178181    filemenu->AddEntry("Print with &lpr",      kFilePrint);
    179     filemenu->AddEntry("Set printer &name",    kFilePrinterName);
     182    //filemenu->AddEntry("Set printer &name",    kFilePrinterName);
    180183    filemenu->AddSeparator();
    181184    filemenu->AddEntry("E&xit", kFileExit);
     
    186189    //
    187190    MGPopupMenu *tabmenu = new MGPopupMenu(gClient->GetRoot());
    188     // tabmenu->AddEntry("S&ave [F2]", kFileSave);
    189     // tabmenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs);
     191    // tabmenu->AddEntry("Save &As...", kFileSaveAs);
    190192    tabmenu->AddEntry("Save As tab-i.&ps",   kTabSaveAsPS);
    191193    tabmenu->AddEntry("Save As tab-i.&gif",  kTabSaveAsGIF);
     
    760762        fStatus = (Status_t)id;
    761763        return kTRUE;
    762 /*
     764
     765    case kFileCanvas:
     766        new TCanvas;
     767        return kTRUE;
     768
     769    case kFileBrowser:
     770        new TBrowser;
     771        return kTRUE;
     772
     773        /*
    763774    case kFileSave:
    764775        cout << "Save..." << endl;
     
    13561367    TPostScript ps(name, 112);
    13571368    ps.SetBit(TPad::kPrintingPS);
     1369
     1370    //%%DocumentPaperSizes: a4
     1371    //%%Orientation: Portrait
     1372
    13581373    ps.PrintFast(13, "/nan {1} def ");
    13591374
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.h

    r2087 r2109  
    3333    typedef enum {
    3434        // KFile
    35         kFileSave, kFileSaveAs, kFileSaveAsPS, kFileSaveAsRoot,
    36         kFileSaveAsGIF, kFileSaveAsC, kFilePrint, kFilePrinterName,
    37         kFileExit,
     35        kFileBrowser, kFileCanvas, kFileSave, kFileSaveAs, kFileSaveAsPS,
     36        kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint,
     37        kFilePrinterName, kFileExit,
    3838        // kLoop
    3939        kLoopNone, kLoopStop,
Note: See TracChangeset for help on using the changeset viewer.