Changeset 8725


Ignore:
Timestamp:
09/02/07 14:53:56 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8724 r8725  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2007/09/02 Thomas Bretz
     21
     22   * ganymed.rc:, ganymed_onoff.rc, ganymed_wobble.rc:
     23     - tiny changes
     24
     25   * mastro/MAstroCatalog.cc:
     26     - sanity check in Paint for !fRaDec.IsValid
     27
     28   * mastro/MVector3.h:
     29     - added a getter for validity
     30
     31   * mpointing/MPointing.[h,cc]:
     32     - added fPx/fPy and fDx/fDy
     33     - added enum for adressing the array
     34     - added getter for new variables
     35     - improved output in Load (only print if valid)
     36
     37   * mpointing/MPointingDev.h:
     38     - changed units of fDev* from mm to deg
     39     - added setter for fDevX/Y
     40
     41   * mpointing/MSrcPosCalc.cc:
     42     - convert GetDevXY from deg to mm
     43
     44
     45
    2046 2007/08/31 Thomas Bretz
    2147
  • trunk/MagicSoft/Mars/ganymed.rc

    r8722 r8725  
    5252#MPointingDevCalc.NsbMin:      30
    5353#MPointingDevCalc.NsbMax:      60
    54 #MPointingDevCalc.Dx          -2
    55 #MPointingDevCalc.Dy          -12
     54#MPointingDevCalc.Dx          -0.001
     55#MPointingDevCalc.Dy          -0.004
    5656#MPointingDevCalc.MaxAge       1.0
    5757
     
    127127CutQ.3: log10(MNewImagePar.fConcCOG)<-0.45+0.08*(log10(MHillas.fSize)<3.9)*(log10(MHillas.fSize)-3.9)^2
    128128CutQ.4: log10(MNewImagePar.fConc1)  <-0.75+0.10*(log10(MHillas.fSize)<3.8)*(log10(MHillas.fSize)-3.8)^2
    129 CutQ.5: MHillas.fLength>-(log10(MHillas.fSize)-4.7)^2*5+50
     129CutQ.5: MHillas.fLength>-5*(log10(MHillas.fSize)-4.7)^2+50
    130130
    131131# -------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/ganymed_onoff.rc

    r8722 r8725  
    5252#MPointingDevCalc.NsbMin:      30
    5353#MPointingDevCalc.NsbMax:      60
    54 #MPointingDevCalc.Dx          -2
    55 #MPointingDevCalc.Dy          -12
     54#MPointingDevCalc.Dx          -0.001
     55#MPointingDevCalc.Dy          -0.004
    5656#MPointingDevCalc.MaxAge       1.0
    5757
  • trunk/MagicSoft/Mars/ganymed_wobble.rc

    r8722 r8725  
    5252#MPointingDevCalc.NsbMin:      30
    5353#MPointingDevCalc.NsbMax:      60
    54 #MPointingDevCalc.Dx          -2
    55 #MPointingDevCalc.Dy          -12
     54#MPointingDevCalc.Dx          -0.001
     55#MPointingDevCalc.Dy          -0.004
    5656#MPointingDevCalc.MaxAge       1.0
    5757
     
    108108# There are three cuts:
    109109#   CutQ: Cut after reading file
    110 #   Cut0: After calculation of src dependant parameters, energy estimation
     110#   Cut0: After calculation of src dependent parameters, energy estimation
    111111#         and disp calculation, before writing summary file
    112112#   Cut1: After writing summary file before filling false source plots
     
    128128CutQ.3: log10(MNewImagePar.fConcCOG)<-0.45+0.08*(log10(MHillas.fSize)<3.9)*(log10(MHillas.fSize)-3.9)^2
    129129CutQ.4: log10(MNewImagePar.fConc1)  <-0.75+0.10*(log10(MHillas.fSize)<3.8)*(log10(MHillas.fSize)-3.8)^2
    130 CutQ.5: MHillas.fLength>-(log10(MHillas.fSize)-4.7)^2*5+50
     130CutQ.5: MHillas.fLength>-5*(log10(MHillas.fSize)-4.7)^2+50
    131131
    132132# -------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r8106 r8725  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.28 2006-10-17 17:15:58 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.29 2007-09-02 13:53:55 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    718718void MAstroCatalog::Paint(Option_t *o)
    719719{
     720    if (!fRaDec.IsValid())
     721        return;
     722
    720723    SetRangePad(o);
    721724
  • trunk/MagicSoft/Mars/mastro/MVector3.h

    r4977 r8725  
    3737    Double_t Magnitude() const { return -2.5*TMath::Log10(Mag()); }
    3838
     39    Bool_t IsValid() const { return fType!=kIsInvalid; }
     40
    3941    void SetRaDec(Double_t ra, Double_t dec, Double_t mag=0)
    4042    {
  • trunk/MagicSoft/Mars/mpointing/MPointing.cc

    r8720 r8725  
    1818!   Author(s): Thomas Bretz, 2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    6363//    Double_t fAcec ; // [rad] Azimuth Centering Error (cos)
    6464//
    65 //    Double_t fMagic1;// [rad] ZA Hysteresis
     65//    Double_t fMagic1;// [rad] MAGIC culmination hysteresis
    6666//    Double_t fMagic2;// [rad] undefined
     67//
     68//    Double_t fDx;    // [rad] X-offset in camera (for starguider calibration)
     69//    Double_t fDy;    // [rad] Y-offset in camera (for starguider calibration)
     70//
     71//
     72//  Class Version 2:
     73//  ----------------
     74//    + fPx
     75//    + fPy
     76//    + fDx
     77//    + fDy
     78//
    6779//
    6880////////////////////////////////////////////////////////////////////////////
     
    7082
    7183#include <fstream>
    72 
    73 #include <TVector3.h>
    7484
    7585#include <TMinuit.h>
     
    90100#define DEBUG(txt)
    91101
    92 const Int_t MPointing::fgNumPar=19;
    93 
    94102void MPointing::Init(const char *name, const char *title)
    95103{
     
    97105    fTitle = title ? title : "Pointing correction model for the MAGIC telescope";
    98106
    99     fCoeff = new Double_t*[fgNumPar];
    100     fNames = new TString[fgNumPar];
    101     fDescr = new TString[fgNumPar];
    102 
    103     fCoeff[ 0] = &fIa;      fNames[ 0] = "IA";
    104     fCoeff[ 1] = &fIe;      fNames[ 1] = "IE";
    105     fCoeff[ 2] = &fFlop;    fNames[ 2] = "FLOP";
    106     fCoeff[ 3] = &fAn;      fNames[ 3] = "AN";
    107     fCoeff[ 4] = &fAw;      fNames[ 4] = "AW";
    108     fCoeff[ 5] = &fNpae;    fNames[ 5] = "NPAE";
    109     fCoeff[ 6] = &fCa;      fNames[ 6] = "CA";
    110     fCoeff[ 7] = &fTf;      fNames[ 7] = "TF";
    111     fCoeff[ 8] = &fTx;      fNames[ 8] = "TX";
    112     fCoeff[ 9] = &fEces;    fNames[ 9] = "ECES";
    113     fCoeff[10] = &fAces;    fNames[10] = "ACES";
    114     fCoeff[11] = &fEcec;    fNames[11] = "ECEC";
    115     fCoeff[12] = &fAcec;    fNames[12] = "ACEC";
    116     fCoeff[13] = &fNrx;     fNames[13] = "NRX";
    117     fCoeff[14] = &fNry;     fNames[14] = "NRY";
    118     fCoeff[15] = &fCrx;     fNames[15] = "CRX";
    119     fCoeff[16] = &fCry;     fNames[16] = "CRY";
    120     fCoeff[17] = &fMagic1;  fNames[17] = "MAGIC1";
    121     fCoeff[18] = &fMagic2;  fNames[18] = "MAGIC2";
    122 
    123     fDescr[ 0] =  "Index Error Azimuth";
    124     fDescr[ 1] =  "Index Error Zenith Distance";
    125     fDescr[ 2] =  "Vertical Sag";
    126     fDescr[ 3] =  "Azimuth Axis Misalignment (N-S)";
    127     fDescr[ 4] =  "Azimuth Axis Misalignment (E-W)";
    128     fDescr[ 5] =  "Az-El Nonperpendicularity";
    129     fDescr[ 6] =  "Left-Right Collimation Error";
    130     fDescr[ 7] =  "Tube fluxture (sin)";
    131     fDescr[ 8] =  "Tube fluxture (tan)";
    132     fDescr[ 9] =  "Elevation Centering Error (sin)";
    133     fDescr[10] =  "Azimuth Centering Error (sin)";
    134     fDescr[11] =  "Elevation Centering Error (cos)";
    135     fDescr[12] =  "Azimuth Centering Error (cos)";
    136     fDescr[13] =  "Nasmyth rotator displacement (horizontal)";
    137     fDescr[14] =  "Nasmyth rotator displacement (vertical)";
    138     fDescr[15] =  "Alt/Az Coude Displacement (N-S)";
    139     fDescr[16] =  "Alt/Az Coude Displacement (E-W)";
    140     fDescr[17] =  "n/a <ZA Hysteresis>";
    141     fDescr[18] =  "n/a";
     107    fCoeff = new Double_t*[kNumPar];
     108    fNames = new TString[kNumPar];
     109    fDescr = new TString[kNumPar];
     110
     111    fCoeff[kIA]     = &fIa;      fNames[kIA]     = "IA";
     112    fCoeff[kIE]     = &fIe;      fNames[kIE]     = "IE";
     113    fCoeff[kFLOP]   = &fFlop;    fNames[kFLOP]   = "FLOP";
     114    fCoeff[kAN]     = &fAn;      fNames[kAN]     = "AN";
     115    fCoeff[kAW]     = &fAw;      fNames[kAW]     = "AW";
     116    fCoeff[kNPAE]   = &fNpae;    fNames[kNPAE]   = "NPAE";
     117    fCoeff[kCA]     = &fCa;      fNames[kCA]     = "CA";
     118    fCoeff[kTF]     = &fTf;      fNames[kTF]     = "TF";
     119    fCoeff[kTX]     = &fTx;      fNames[kTX]     = "TX";
     120    fCoeff[kECES]   = &fEces;    fNames[kECES]   = "ECES";
     121    fCoeff[kACES]   = &fAces;    fNames[kACES]   = "ACES";
     122    fCoeff[kECEC]   = &fEcec;    fNames[kECEC]   = "ECEC";
     123    fCoeff[kACEC]   = &fAcec;    fNames[kACEC]   = "ACEC";
     124    fCoeff[kNRX]    = &fNrx;     fNames[kNRX]    = "NRX";
     125    fCoeff[kNRY]    = &fNry;     fNames[kNRY]    = "NRY";
     126    fCoeff[kCRX]    = &fCrx;     fNames[kCRX]    = "CRX";
     127    fCoeff[kCRY]    = &fCry;     fNames[kCRY]    = "CRY";
     128    fCoeff[kMAGIC1] = &fMagic1;  fNames[kMAGIC1] = "MAGIC1";
     129    fCoeff[kMAGIC2] = &fMagic2;  fNames[kMAGIC2] = "MAGIC2";
     130    fCoeff[kPX]     = &fPx;      fNames[kPX]     = "PX";
     131    fCoeff[kPY]     = &fPy;      fNames[kPY]     = "PY";
     132    fCoeff[kDX]     = &fDx;      fNames[kDX]     = "DX";
     133    fCoeff[kDY]     = &fDy;      fNames[kDY]     = "DY";
     134
     135    fDescr[kIA]     =  "Index Error Azimuth";
     136    fDescr[kIE]     =  "Index Error Zenith Distance";
     137    fDescr[kFLOP]   =  "Vertical Sag";
     138    fDescr[kAN]     =  "Azimuth Axis Misalignment (N-S)";
     139    fDescr[kAW]     =  "Azimuth Axis Misalignment (E-W)";
     140    fDescr[kNPAE]   =  "Az-El Nonperpendicularity";
     141    fDescr[kCA]     =  "Left-Right Collimation Error";
     142    fDescr[kTF]     =  "Tube fluxture (sin)";
     143    fDescr[kTX]     =  "Tube fluxture (tan)";
     144    fDescr[kECES]   =  "Elevation Centering Error (sin)";
     145    fDescr[kACES]   =  "Azimuth Centering Error (sin)";
     146    fDescr[kECEC]   =  "Elevation Centering Error (cos)";
     147    fDescr[kACEC]   =  "Azimuth Centering Error (cos)";
     148    fDescr[kNRX]    =  "Nasmyth rotator displacement (horizontal)";
     149    fDescr[kNRY]    =  "Nasmyth rotator displacement (vertical)";
     150    fDescr[kCRX]    =  "Alt/Az Coude Displacement (N-S)";
     151    fDescr[kCRY]    =  "Alt/Az Coude Displacement (E-W)";
     152    fDescr[kMAGIC1] =  "MAGIC culmination hysteresis";
     153    fDescr[kMAGIC2] =  "n/a";
     154    fDescr[kPX]     =  "Starguider calibration fixed offset x";
     155    fDescr[kPY]     =  "Starguider calibration fixed offset y";
     156    fDescr[kDX]     =  "Starguider calibration additional offset dx";
     157    fDescr[kDY]     =  "Starguider calibration additional offset dy";
    142158}
    143159
     
    195211    *fLog << endl;
    196212
    197     *fLog << "  & = Name            Value                  Sigma" << endl;
     213    *fLog << "  & = Name            Value                 Sigma " << endl;
    198214    *fLog << "--------------------------------------------------" << endl;
    199215
     
    213229            break;
    214230
     231        TString sout;
     232
    215233        if (str[0]=='#')
    216234            continue;
     
    218236        if (str[0]=='&')
    219237        {
    220             *fLog << " & ";
     238            sout += " & ";
    221239            str.Remove(0);
    222240        }
    223241        else
    224             *fLog << "   ";
     242            sout += "   ";
    225243
    226244        if (str[1]=='=')
    227245        {
    228             *fLog << "=  ";
     246            sout += "=  ";
    229247            str.Remove(0);
    230248        }
    231249        else
    232             *fLog << "   ";
     250            sout += "   ";
    233251
    234252        fin >> val;
    235         *fLog << str << "\t" << setw(11) << val << "°     \t";
     253
     254        sout += str;
     255        sout += '\t';
     256        sout += Form("%11f", val);
     257        sout += "°     \t";
    236258        val *= TMath::DegToRad();
    237259
    238260        // Find parameter
    239261        Int_t n = -1;
    240         for (int i=0; i<fgNumPar; i++)
     262        for (int i=0; i<kNumPar; i++)
    241263            if (str==fNames[i])
    242264            {
     
    247269
    248270        fin >> val;
    249         *fLog << setw(9) << val << "°" << endl;
     271        sout += Form("%9f°", val);
     272
     273        if (*fCoeff[n]!=0 || val>0)
     274            *fLog << sout << endl;
    250275
    251276        if (!fin)
     
    298323    fout << "S   00   000000   000000  0000000" << endl;
    299324    fout << setprecision(8);
    300     for (int i=0; i<fgNumPar; i++)
     325    for (int i=0; i<kNumPar; i++)
    301326    {
    302327        fout << " " << setw(6) << GetVarName(i) << " ";
     
    684709{
    685710    if (n<0)
    686         n = fgNumPar;
     711        n = kNumPar;
    687712
    688713    Int_t ierflg = 0;
  • trunk/MagicSoft/Mars/mpointing/MPointing.h

    r8593 r8725  
    44#ifndef ROOT_TArrayD
    55#include <TArrayD.h>
     6#endif
     7
     8#ifndef ROOT_TVector2
     9#include <TVector2.h>
    610#endif
    711
     
    1923//#include "coord.h"
    2024//#else
    21 #include <TVector2.h>
    2225class AltAz : public TVector2
    2326{
     
    5154{
    5255private:
    53     static const Int_t fgNumPar;
     56    enum {
     57        kIA,           // [rad] Index Error in Elevation
     58        kIE,           // [rad] Index Error in Azimuth
     59        kFLOP,         // [rad] Vertical Sag
     60        kAN,           // [rad] Az-El Nonperpendicularity
     61        kAW,           // [rad] Left-Right Collimation Error
     62        kNPAE,         // [rad] Azimuth Axis Misalignment (N-S)
     63        kCA,           // [rad] Azimuth Axis Misalignment (E-W)
     64        kTF,           // [rad] Tube fluxture (sin)
     65        kTX,           // [rad] Tube fluxture (tan)
     66        kECES,         // [rad] Nasmyth rotator displacement, horizontal
     67        kACES,         // [rad] Nasmyth rotator displacement, vertical
     68        kECEC,         // [rad] Alt/Az Coude Displacement (N-S)
     69        kACEC,         // [rad] Alt/Az Coude Displacement (E-W)
     70        kNRX,          // [rad] Elevation Centering Error (sin)
     71        kNRY,          // [rad] Azimuth Centering Error (sin)
     72        kCRX,          // [rad] Elevation Centering Error (cos)
     73        kCRY,          // [rad] Azimuth Centering Error (cos)
     74        kMAGIC1,       // [rad] Magic Term (what is it?)
     75        kMAGIC2,       // [rad] Magic Term (what is it?)
     76        kPX,           // [rad] Starguider calibration fixed offset x
     77        kPY,           // [rad] Starguider calibration fixed offset y
     78        kDX,           // [rad] Starguider calibration additional offset dx
     79        kDY,           // [rad] Starguider calibration additional offset dy
     80        kNumPar   // Number of elements
     81    };
     82
    5483
    5584    Double_t fIe   ; // [rad] Index Error in Elevation
     
    73102    Double_t fMagic2; // [rad] Magic Term (what is it?)
    74103
     104    Double_t fPx;    // [rad] Starguider calibration fixed offset x
     105    Double_t fPy;    // [rad] Starguider calibration fixed offset y
     106    Double_t fDx;    // [rad] Starguider calibration additional offset dx
     107    Double_t fDy;    // [rad] Starguider calibration additional offset dy
     108
    75109    Double_t **fCoeff; //!
    76110    TString   *fNames; //!
     
    83117    void Clear(Option_t *o="")
    84118    {
    85         for (int i=0; i<fgNumPar; i++)
     119        for (int i=0; i<kNumPar; i++)
    86120        {
    87121            *fCoeff[i] = 0;
    88             fError[i] = 0;
     122            fError[i] = -1;
    89123        }
    90124    }
     
    94128
    95129public:
    96     MPointing() { fError.Set(fgNumPar); Init(); Clear(); }
    97     MPointing(const char *name) { fError.Set(fgNumPar); Init(); Clear(); Load(name); }
     130    MPointing() : fError(kNumPar) { Init(); Clear(); }
     131    MPointing(const char *name) : fError(kNumPar) { Init(); Clear(); Load(name); }
    98132    virtual ~MPointing() { delete [] fNames; delete [] fCoeff; delete [] fDescr; }
    99133
     
    117151    ZdAz operator()(const ZdAz &zdaz, void (*fcn)(ZdAz &zdaz, Double_t *par)) const
    118152    {
    119         Double_t par[fgNumPar];
     153        Double_t par[kNumPar];
    120154        GetParameters(par);
    121155        ZdAz za = zdaz;
     
    126160    AltAz operator()(const AltAz &aaz, void (*fcn)(AltAz &aaz, Double_t *par)) const
    127161    {
    128         Double_t par[fgNumPar];
     162        Double_t par[kNumPar];
    129163        GetParameters(par);
    130164        AltAz aa = aaz;
     
    135169    TVector3 operator()(const TVector3 &aaz, void (*fcn)(TVector3 &aaz, Double_t *par)) const
    136170    {
    137         Double_t par[fgNumPar];
     171        Double_t par[kNumPar];
    138172        GetParameters(par);
    139173        TVector3 v = aaz;
     
    174208    }
    175209
    176     void SetParameters(const Double_t *par, Int_t n=fgNumPar);
    177     void GetParameters(Double_t *par, Int_t n=fgNumPar) const;
     210    void SetParameters(const Double_t *par, Int_t n=kNumPar);
     211    void GetParameters(Double_t *par, Int_t n=kNumPar) const;
    178212
    179213    void SetParameters(const TArrayD &par)
     
    183217    void GetParameters(TArrayD &par) const
    184218    {
    185         par.Set(fgNumPar);
     219        par.Set(kNumPar);
    186220        GetParameters(par.GetArray());
    187221    }
     
    189223    {
    190224        par = fError;
    191         for (int i=0; i<fgNumPar; i++)
     225        for (int i=0; i<kNumPar; i++)
    192226            par[i] *= TMath::RadToDeg();
    193227    }
     
    217251     */
    218252
    219     static const Int_t GetNumPar() { return fgNumPar; }
    220 
    221     ClassDef(MPointing, 1) // Pointing Model for MAGIC
     253    TVector2 GetDxy() const { return TVector2(fDx, fDy)*TMath::RadToDeg(); }
     254
     255    Double_t GetPx() const { return fPx*TMath::RadToDeg(); }
     256    Double_t GetPy() const { return fPy*TMath::RadToDeg(); }
     257
     258    Bool_t IsPxValid() const { return fError[kPX]>0; }
     259    Bool_t IsPyValid() const { return fError[kPY]>0; }
     260
     261    static const Int_t GetNumPar() { return kNumPar; }
     262
     263    ClassDef(MPointing, 2) // Pointing Model for MAGIC
    222264};
    223265
  • trunk/MagicSoft/Mars/mpointing/MPointingDev.h

    r7600 r8725  
    1515    Double_t fDevAz;  // [deg] Pointing offset azimuth as calculated from starguider dat
    1616
    17     Double_t fDevX;   // [mm]
    18     Double_t fDevY;   // [mm]
     17    Double_t fDevX;   // [deg] Pointing offset in x
     18    Double_t fDevY;   // [deg] Pointing offset in y
    1919
    2020public:
     
    2727    void SetDevZdAz(Double_t devzd, Double_t devaz) { fDevZd=devzd; fDevAz=devaz; }
    2828    void SetDevXY(Double_t dx, Double_t dy) { fDevX=dx; fDevY=dy; }
     29    void SetDevXY(const TVector2 &d) { fDevX=d.X(); fDevY=d.Y(); }
    2930
    3031    Double_t GetDevZd() const  { return fDevZd; }
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r8719 r8725  
    388388
    389389    if (fDeviation)
    390         v -= fDeviation->GetDevXY();
     390        v -= fDeviation->GetDevXY()/fGeom->GetConvMm2Deg();
    391391
    392392    SetSrcPos(v);
Note: See TracChangeset for help on using the changeset viewer.