Changeset 8689 for trunk


Ignore:
Timestamp:
08/21/07 23:20:48 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8688 r8689  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2007/08/21 Thomas Bretz
     22
     23   * mpointing/MHSrcPosCam.[h,cc]:
     24     - we now buffer the events instead of average them. This removes
     25       strange (fake) events near the camera center in wobble mode
     26
     27
     28
    2129 2007/08/21 Markus Meyer
    2230
     
    2533       the large muon sample with time image cleaning and smaller
    2634       integration region (0.8 to 1.2)
    27 
    28 
    29 
    30  2007/08/21 Markus Meyer
    3135
    3236   * mmuon/MHMuonPar.cc
     
    111115     - now the MC distribution from OriginalMC is read only once
    112116     - added new tab showing the basic event distribution
     117
     118   * callisto.cc, star.cc, ganymed.cc, sponde.cc, mars.cc, showplot.cc:
     119     - some improvements in case of wrong number of arguments
    113120
    114121
  • trunk/MagicSoft/Mars/NEWS

    r8680 r8689  
    204204     angle is now shown for off- AND on-data.
    205205
     206   - ganymed: The contents of the source position plot are no longer
     207     averaged, thus a lot of (fake) events between the two wobble
     208     positions have disappeared.
     209
    206210   - optim, sponde: should now properly support three off-regions.
    207211     Just produce your ganymed summary files with three off-regions.
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.cc

    r8657 r8689  
    3333#include "MHSrcPosCam.h"
    3434
     35#include <TVector2.h>
    3536#include <TCanvas.h>
    3637#include <TEllipse.h>
     
    5758//
    5859MHSrcPosCam::MHSrcPosCam(Bool_t wobble, const char *name, const char *title)
    59     : fTimeEffOn(NULL), fEffOnTime(NULL), fSourcePos(NULL)
     60    : fTimeEffOn(NULL), fEffOnTime(NULL), fSourcePos(NULL),
     61    fPositions("TVector2", 50000)
    6062{
    6163    //
     
    119121
    120122    fHist.Reset();
    121     fXY            = TVector2();
    122     fNum           = 0;
    123123    fTimeLastEffOn = MTime();
    124124    fConvMm2Deg    = geom->GetConvMm2Deg();
     125    fNum           = 0;
    125126
    126127    return kTRUE;
     
    129130// --------------------------------------------------------------------------
    130131//
    131 //
    132 //
     132// All source positions are buffered until the time of the effective on
     133// time time stamp changes. Then the observation time is split into
     134// identical parts and the histogram is filled by these events. The
     135// effective on time time stamp is reset and the buffered source positions
     136// deleted.
     137//
    133138Bool_t MHSrcPosCam::Fill(const MParContainer *par, const Stat_t w)
    134139{
     
    140145    }
    141146
    142 //    if (fName=="MHSrcPosCam")
    143 //    {
    144     fXY += cam->GetXY();
    145     fNum++;
    146 
     147    // Increase array size if necessary
     148    if (fNum==fPositions.GetSize())
     149        fPositions.Expand(fNum*2);
     150
     151    // buffer position into array (could be speed up a little bit more
     152    // by using ExpandCreate and memcpy)
     153    new (fPositions[fNum++]) TVector2(cam->GetXY()*fConvMm2Deg);
     154
     155    // Check if there is a new effective on time
    147156    if (fTimeLastEffOn==MTime())
    148157        fTimeLastEffOn=*fTimeEffOn;
     
    151160        return kTRUE;
    152161
    153     fXY *= fConvMm2Deg/fNum;
    154 
    155     fHist.Fill(fXY.X(), fXY.Y(), fEffOnTime->GetVal());
    156 //    }
    157 //    else
    158 //        fHist.Fill(cam->GetX()*fConvMm2Deg, cam->GetY()*fConvMm2Deg);
    159 
    160     fXY            = TVector2();
    161     fNum           = 0;
     162    // Split the observation time to all buffered events
     163    const Double_t scale = fEffOnTime->GetVal()/fNum;
     164
     165    // Fill histogram from array
     166    for (int i=0; i<fNum; i++)
     167    {
     168        const TVector2 &v = (TVector2&)*fPositions[i];
     169        fHist.Fill(v.X(), v.Y(), scale);
     170    }
     171
     172    // reset time stamp and remove all buffered positions
    162173    fTimeLastEffOn = *fTimeEffOn;
     174    fNum = 0;
    163175
    164176    return kTRUE;
    165177}
    166178
     179// --------------------------------------------------------------------------
     180//
    167181void MHSrcPosCam::Paint(Option_t *)
    168182{
     
    172186// --------------------------------------------------------------------------
    173187//
    174 //
    175 //
    176188void MHSrcPosCam::Draw(Option_t *)
    177189{
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.h

    r8388 r8689  
    1414#endif
    1515
    16 #ifndef ROOT_TVector2
    17 #include <TVector2.h>
     16#ifndef ROOT_TClonesArray
     17#include <TClonesArray.h>
    1818#endif
    1919
     
    2525{
    2626private:
    27     TH2D          fHist;           //
     27    TH2D          fHist;           // Histogram of observation time vs source position
    2828
    29 private:
    30     MTime         fTimeLastEffOn;  //!
    31     MTime        *fTimeEffOn;      //!
    32     MParameterD  *fEffOnTime;      //!
    33     MPointingPos *fSourcePos;      //!
     29    MTime         fTimeLastEffOn;  //! Last time stamp of effective on time
     30    MTime        *fTimeEffOn;      //! Current effective on time
     31    MParameterD  *fEffOnTime;      //! Effective on time
     32    MPointingPos *fSourcePos;      //! Pointing position of the telescope
    3433
    35     TVector2      fXY;             //!
    36     UInt_t        fNum;            //!
    37     Double_t      fConvMm2Deg;     //!
     34    Double_t      fConvMm2Deg;     //! Conversion factor from mm to deg
     35    TClonesArray  fPositions;      //! Buffer to store source positions
     36    Int_t         fNum;            //! Position in array
    3837
    3938public:
    40     //MHSrcPosCam(const char *name=NULL, const char *title=NULL);
    4139    MHSrcPosCam(Bool_t wobble=kFALSE, const char *name=NULL, const char *title=NULL);
    4240
Note: See TracChangeset for help on using the changeset viewer.