Changeset 7181 for trunk/MagicSoft


Ignore:
Timestamp:
07/12/05 14:31:02 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7180 r7181  
    2626   * mhist/MHEvent.[h,cc]:
    2727     - added MTime to output
     28
     29   * mastro/MAstroCatalog.cc:
     30     - added a fix which avoided reproducing the gui elements after
     31       reading from file
     32
     33   * mbase/BaseIncl.h:
     34     - added TVector3
     35
     36   * mbase/MMath.[h,cc]:
     37     - added Sgn function
     38     - moved include of TVector3 to source file
     39
     40   * mimage/MHillasExt.cc:
     41     - included TVector2
     42
     43   * mjobs/MJCut.cc:
     44     - write Disp to output
     45     - write MTime to output
     46     - changed handling of source position (MSrcPosCalc)
     47
     48   * mpointing/MSrcPosCalc.[h,cc]:
     49     - allow to switch off source pos calculation
    2850
    2951
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r7179 r7181  
    168168    fList.SetOwner();
    169169    fMapG.SetOwner();
     170
    170171    fToolTip = gROOT->IsBatch() || !gClient ? 0 : new TGToolTip(0, "", 0);
    171172}
     
    659660    SetRangePad(o);
    660661
    661     if (TestBit(kHasChanged))
     662    // In the case MAstroCatalog has been loaded from a file
     663    // kHasChanged is not set, but fMapG.GetSize() is ==0
     664    if (TestBit(kHasChanged) || fMapG.GetSize()==0)
    662665        DrawPrimitives(o);
    663666
  • trunk/MagicSoft/Mars/mbase/BaseIncl.h

    r1382 r7181  
    11#ifndef __CINT__
     2
     3#include <TVector3.h>
    24
    35/*
  • trunk/MagicSoft/Mars/mbase/MMath.cc

    r7176 r7181  
    1818!   Author(s): Thomas Bretz  3/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2005
    2121!
    2222!
     
    2626//
    2727// MMath
     28//
     29// Mars - Math package (eg Significances, etc)
    2830//
    2931/////////////////////////////////////////////////////////////////////////////
    3032#include "MMath.h"
     33
     34#ifndef ROOT_TVector3
     35#include <TVector3.h>
     36#endif
    3137
    3238// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MMath.h

    r6078 r7181  
    33
    44#ifndef ROOT_TMath
    5 #include <TMath.h>
     5#include <TMath.h> // TMath is included here for convinience
    66#endif
    7 #ifndef ROOT_TVector3
    8 #include <TVector3.h>
    9 #endif
     7
     8class TVector3;
    109
    1110namespace MMath
     
    2423    Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
    2524    Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
     25
     26    Double_t Sgn(Double_t d);
    2627}
    2728
     29inline Double_t MMath::Sgn(Double_t d) { return d<0 ? -1 : 1; }
     30
    2831#endif
  • trunk/MagicSoft/Mars/mimage/MHillasExt.cc

    r7176 r7181  
    6565#include <TArrayF.h>
    6666#include <TMarker.h>
     67#include <TVector2.h>
    6768#include <TVirtualPad.h>
    6869
     
    9596
    9697// -------------------------------------------------------------------------
     98//
     99// Reset values to:
     100//    fAsym    =  0;
     101//    fM3Long  =  0;
     102//    fM3Trans =  0;
     103//    fMaxDist =  0;
    97104//
    98105void MHillasExt::Reset()
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r7178 r7181  
    337337    write->AddContainer("MEnergyEst",     "Events", kFALSE);
    338338    write->AddContainer("ThetaSquared",   "Events", kFALSE);
     339    write->AddContainer("Disp",           "Events", kFALSE);
     340    write->AddContainer("MTime",          "Events", kFALSE);
    339341    write->AddContainer("MMcEvt",         "Events", kFALSE);
    340342    write->AddContainer("DataType",       "Events");
     
    545547    // How to get source position from off- and on-data?
    546548    MSrcPosCalc scalc;
    547     if (fIsWobble)
    548         scalc.SetWobbleMode(); /********************/
     549    scalc.SetMode(fIsWobble?MSrcPosCalc::kWobble:MSrcPosCalc::kOffData); /********************/
     550
    549551    MHillasCalc hcalc;
    550552    MHillasCalc hcalc2("MHillasCalcAnti");
     
    589591
    590592    tlist.AddToList(&readoff);
    591     tlist.AddToList(&print2, "EffectiveOnTime");
     593    if (gLog.GetDebugLevel()>4)
     594        tlist.AddToList(&print2, "EffectiveOnTime");
    592595    tlist.AddToList(&tlist2, "Events");
    593596 
     
    645648    set.AddFilesOn(readon);
    646649
    647     if (fIsWobble)
    648         scalc.SetWobbleMode(kFALSE); /********************/
     650    scalc.SetMode(MSrcPosCalc::kDefault);
    649651
    650652    MFillH fill1b("MHHillasOnPre  [MHHillas]",      "MHillas",      "FillHillasPre");
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r7179 r7181  
    9393MSrcPosCalc::MSrcPosCalc(const char *name, const char *title)
    9494    : fObservatory(NULL), fPointPos(NULL), fSourcePos(NULL), fSrcPosCam(NULL),
    95     fSrcPosAnti(NULL), fGeom(NULL), fTime(NULL), fIsWobbleMode(kFALSE)
     95    fSrcPosAnti(NULL), fGeom(NULL), fTime(NULL), fMode(kDefault)
    9696{
    9797    fName  = name  ? name  : "MSrcPosCalc";
     
    209209void MSrcPosCalc::SetSrcPos(TVector2 v) const
    210210{
    211     if (fIsWobbleMode)
     211    if (fMode==kWobble)
    212212    {
    213213        fSrcPosAnti->SetXY(v);
     
    230230Bool_t MSrcPosCalc::ReInit(MParList *plist)
    231231{
     232    if (fMode==kOffData)
     233    {
     234        SetSrcPos(TVector2());
     235        return kTRUE;
     236    }
     237
    232238    MRawRunHeader *run = (MRawRunHeader*)plist->FindObject("MRawRunHeader");
    233239    if (!run)
     
    328334Int_t MSrcPosCalc::Process()
    329335{
    330     if (fRunType==MRawRunHeader::kRTMonteCarlo || !fSourcePos || !fTime || !fObservatory)
     336    if (fRunType==MRawRunHeader::kRTMonteCarlo || !fSourcePos || !fTime || !fObservatory || fMode==kOffData)
    331337        return kTRUE;
    332338
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h

    r6912 r7181  
    1919class MSrcPosCalc : public MTask
    2020{
     21public:
     22    enum Mode_t {
     23        kDefault = 0,
     24        kOffData = 1,
     25        kWobble  = 2
     26    };
    2127private:
    2228    enum {
     
    3440    UShort_t fRunType;            //! Run Type to decide where to get pointing position from
    3541
    36     Bool_t fIsWobbleMode;
     42    Int_t fMode;
    3743
    3844    // MSrcPosCalc
     
    5965    void SetSourcePos(Double_t ra, Double_t dec);
    6066    void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); } // Make MSrcPosCalc owner of fSourcePos
    61     void SetWobbleMode(Bool_t b=kTRUE) { fIsWobbleMode = b; }
     67    void SetMode(Mode_t m=kDefault) { fMode = m; }
    6268
    6369    ClassDef(MSrcPosCalc, 0) // Calculates the source position in the camera
Note: See TracChangeset for help on using the changeset viewer.