Changeset 3892 for trunk/MagicSoft


Ignore:
Timestamp:
04/29/04 16:44:48 (20 years ago)
Author:
tonello
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3889 r3892  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2004/04/29: Nadia Tonello
     21
     22   * mbadpixels/MBadPixelsTreat.h
     23     - changed enums {.. BIT(1), ... BIT(2), ... BIT(3) } in {1,2,3}
     24       to have the right behaviour of the flags (and of SetProcessRMS)
     25
     26   * manalysis/MCT1PointingCorrCalc.[h,cc]
     27     - added pointing correction for 1ES1959
     28
    2029 2004/04/29: Markus Gaug
    2130
  • trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc

    r2206 r3892  
    1717!
    1818!   Author(s): Wolfgang Wittek  03/2003 <mailto:wittek@mppmu.mpg.de>
    19 !
     19!              Nadia Tonello    05/2003 <mailto:tonello@mppmu.mpg.de>
    2020!   Copyright: MAGIC Software Development, 2000-2003
    2121!
     
    2727//  MCT1PointingCorrCalc                                                   //
    2828//                                                                         //
    29 //  This is a task to do the CT1 pointing correction                       //
    30 //                                                                         //
     29//  This is a task to do the CT1 pointing correction.                      //
     30//                                                                         //
     31//  NT: You can correct the Mkn421 data (default setting), or the 1ES1959  //
     32//      data.                                                              //
     33//      To change to the correction needed for 1ES1959,  you have to call  //
     34//      the member funcion: SetPointedSource                               //
     35//                                                                         //
     36//  Example:                                                               //
     37//      MCT1PointingCorrCalc correct;                                      //
     38//      correct.SetPointedSource(MCT1PointingCorrectionCalc::K1959)        //
     39//                                                                         //
    3140/////////////////////////////////////////////////////////////////////////////
    3241
     
    4554
    4655using namespace std;
    47 
    4856// --------------------------------------------------------------------------
    4957//
     
    5260MCT1PointingCorrCalc::MCT1PointingCorrCalc(const char *srcname,
    5361                                           const char *name, const char *title)
    54     : fSrcName(srcname)
     62  : fSrcName(srcname), fPoiSource(k421)
    5563{
    5664    fName  = name  ? name  : "MCT1PointingCorrCalc";
     
    7078    }
    7179
    72     fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
     80   fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
    7381    if (!fHourAngle)
    7482    {
     
    8997}
    9098
     99
     100// --------------------------------------------------------------------------
     101//
     102//Implemented Daniel Kranich's pointing correction for Mkn421 (2001 data)
     103//
     104
     105void MCT1PointingCorrCalc::PointCorr421()
     106{
     107   //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = "
     108   //      << fhourangle << endl;
     109
     110   Float_t fhourangle = fHourAngle->GetVal();
     111
     112   Float_t cx = -0.05132 - 0.001064 * fhourangle
     113                         - 3.530e-6 * fhourangle * fhourangle;
     114   cx /= fMm2Deg;
     115
     116   Float_t cy = -0.04883 - 0.0003175* fhourangle
     117                         - 2.165e-5 * fhourangle * fhourangle;
     118   cy /= fMm2Deg;
     119
     120   fSrcPos->SetXY(cx, cy);
     121
     122   //*fLog << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
     123   //      << fhourangle << ",  " << cx << ",  " << cy << ",  "
     124   //      << fMm2Deg << endl;
     125
     126   fSrcPos->SetReadyToSave();
     127   return;
     128}
     129
     130
     131// --------------------------------------------------------------------------
     132//
     133// NT :Implemente Daniel Kranich's pointing correction for 1ES1959 (2002 data)
     134
     135void MCT1PointingCorrCalc::PointCorr1959()
     136{
     137   //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = "
     138   //      << fhourangle << endl;
     139
     140   Float_t fhourangle = fHourAngle->GetVal();
     141
     142   Float_t cx = -0.086 - 0.00091 * fhourangle ;
     143   cx /= fMm2Deg;
     144
     145   Float_t cy = -0.083 - 0.001 * fhourangle ;
     146   cy /= fMm2Deg;
     147
     148   fSrcPos->SetXY(cx, cy);
     149
     150   //*fLog << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
     151   //      << fhourangle << ",  " << cx << ",  " << cy << ",  "
     152   //      << fMm2Deg << endl;
     153
     154   fSrcPos->SetReadyToSave();
     155   return;
     156
     157}
    91158// --------------------------------------------------------------------------
    92159//
    93160// Do the pointing correction
    94161//
    95 // the parametrization is for Mkn421 2001 data (Daniel Kranich)
    96 //
    97162Int_t MCT1PointingCorrCalc::Process()
    98163{
     
    100165   // (cx, cy) is the source position in the camera [mm]
    101166   //
    102    Float_t fhourangle = fHourAngle->GetVal();
    103 
    104    //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = "
    105    //      << fhourangle << endl;
    106 
    107    Float_t cx = -0.05132 - 0.001064 * fhourangle
    108                          - 3.530e-6 * fhourangle * fhourangle;
    109    cx /= fMm2Deg;
    110 
    111    Float_t cy = -0.04883 - 0.0003175* fhourangle
    112                          - 2.165e-5 * fhourangle * fhourangle;
    113    cy /= fMm2Deg;
    114 
    115    fSrcPos->SetXY(cx, cy);
    116 
    117    //*fLog << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
    118    //      << fhourangle << ",  " << cx << ",  " << cy << ",  "
    119    //      << fMm2Deg << endl;
    120 
    121    fSrcPos->SetReadyToSave();
    122 
     167   switch (fPoiSource)
     168    {
     169    case k421:
     170        PointCorr421();
     171    case k1959:
     172        PointCorr1959();
     173    } 
    123174   return kTRUE;
    124175}
     
    126177
    127178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
  • trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h

    r2206 r3892  
    2020class MCT1PointingCorrCalc : public MTask
    2121{
     22public:
     23    typedef enum {
     24        k421,
     25        k1959
     26    } PointedSource_t;
     27
    2228private:
    2329
     
    2632    MParameterD  *fHourAngle;
    2733
     34    PointedSource_t fPoiSource;
    2835    Float_t       fMm2Deg;
    2936
     37    void PointCorr421();
     38    void PointCorr1959();
     39
    3040public:
     41
    3142    MCT1PointingCorrCalc(const char *srcname="MSrcPosCam",
    3243                         const char *name=NULL, const char *title=NULL);
     
    3546    Int_t Process();
    3647
    37     ClassDef(MCT1PointingCorrCalc, 0)   // Task to do the CT1 pointing correction for Mkn421 2001 data
     48    void SetPointedSource(PointedSource_t s) { fPoiSource = s; }
     49 
     50    ClassDef(MCT1PointingCorrCalc, 0)   // Task to do the CT1 pointing correction for Mkn421 2001 data or 1ES1959 2002 data
    3851};
    3952
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h

    r3802 r3892  
    2424    enum
    2525    {
    26         kUseInterpolation = BIT(1),
    27         kUseCentralPixel  = BIT(2),
    28         kProcessRMS       = BIT(3)
     26        kUseInterpolation = 1,
     27        kUseCentralPixel  = 2,
     28        kProcessRMS       = 3
    2929    };
    3030
     
    3434    void InterpolatePedestals() const;
    3535
    36     //void  Interpolate() const;
    3736    void   Unmap() const;
    3837    void   StreamPrimitive(ofstream &out) const;
Note: See TracChangeset for help on using the changeset viewer.