Changeset 9342 for trunk


Ignore:
Timestamp:
02/15/09 15:52:47 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9341 r9342  
    1919                                                 -*-*- END OF LINE -*-*-
    2020 2009/02/15 Thomas Bretz
     21
     22   * mpointing/MSrcPosCalc.cc:
     23     - ignore the WobbleMode from the MMcCorsikaRunHeader
     24       if it is a ceres file
     25
     26   * msim/MPhotonEvent.[h,cc]:
     27     - added function GetTimeFirst
     28     - added function GetTimeLast
     29     - added function GetTimeMedianDev
     30     - added fLength to MPhotonStatistics
     31
     32   * msimcamera/MSimGeomCam.cc:
     33     - make use of the new functions
     34     - set length to statistics container
    2135
    2236   * mpointing/MHSrcPosCam.[h,cc], mpointing/MSrcPosRndm.[h,cc],
  • trunk/MagicSoft/Mars/NEWS

    r9328 r9342  
    22
    33== <cvs> ==
     4
     5 ;SUGGESTION
     6
     7   * There is no need to re-run any data because no change took place which
     8     could have an effect on the output. However, if you want a
     9     meaningful SrcPos plot for your MCs in sponde you must re-process
     10     star for your MCs first.
    411
    512 ;general
     
    1017   * in sequence file the date can now be omittet. In this case the
    1118     leading date with the underscore is missing in the expected filename
     19
     20 ;automation
     21
     22   * added magnetic field Azimuth direction (ARRANG), currently
     23     at ~ -7deg at La Palma
     24 
    1225
    1326 ;database
     
    5366   * A new tab ''info'' now display basic things like the reflector
    5467     layout
     68
     69 ;star
     70
     71   * Now outputs MSrcPosCam for Monte Carlos in the Events tree.
     72
     73 ;sponde
     74
     75   * The SrcPos plot for your MCs was so far meaningless because it just
     76     displayes the MSrcPosCam data from the input star-files. Unfortunately,
     77     this containes was never written to the star-files yet.
    5578
    5679
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r9145 r9342  
    342342    }
    343343
     344    if (fMcHeader->IsCeres())
     345        return kTRUE;
     346
    344347    const MMcCorsikaRunHeader *h = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
    345348    if (!h)
  • trunk/MagicSoft/Mars/msim/MPhotonEvent.cc

    r9301 r9342  
    113113#include <TMarker.h>
    114114
     115#include <MMath.h>
     116
     117#include "MArrayF.h"
     118
    115119#include "MLog.h"
    116120#include "MLogManip.h"
     
    213217}
    214218
     219// --------------------------------------------------------------------------
     220//
     221// Return the number of "external" photons, i.e. which are not NightSky
     222//
    215223Int_t MPhotonEvent::GetNumExternal() const
    216224{
     
    222230
    223231    return n;
     232}
     233
     234// --------------------------------------------------------------------------
     235//
     236// Return time of first photon, 0 if none in array.
     237// Note: If you want this to be the earliest make sure that the array
     238// is properly sorted.
     239//
     240Float_t MPhotonEvent::GetTimeFirst() const
     241{
     242    const MPhotonData *dat=GetFirst();
     243    return dat ? dat->GetTime() : 0;
     244}
     245
     246// --------------------------------------------------------------------------
     247//
     248// Return time of first photon, 0 if none in array.
     249// Note: If you want this to be the latest make sure that the array
     250// is properly sorted.
     251//
     252Float_t MPhotonEvent::GetTimeLast() const
     253{
     254    const MPhotonData *dat=GetLast();
     255    return dat ? dat->GetTime() : 0;
     256}
     257
     258// --------------------------------------------------------------------------
     259//
     260// Return the median devian from the median of all arrival times.
     261// The median deviation is calculated using MMath::MedianDev.
     262// It is the half width in which one sigma (~68%) of all times are
     263// contained around the median.
     264//
     265Double_t MPhotonEvent::GetTimeMedianDev() const
     266{
     267    const UInt_t n = GetNumPhotons();
     268
     269    MArrayF arr(n);
     270    for (UInt_t i=0; i<n; i++)
     271        arr[i] = operator[](i).GetTime();
     272
     273    return MMath::MedianDev(n, arr.GetArray()/*, Double_t &med*/);
    224274}
    225275
  • trunk/MagicSoft/Mars/msim/MPhotonEvent.h

    r9308 r9342  
    8080    Int_t GetNumExternal() const;
    8181
     82    Float_t  GetTimeFirst() const;
     83    Float_t  GetTimeLast() const;
     84    Double_t GetTimeMedianDev() const;
     85
    8286    TClonesArray &GetArray() { return fData; }
    8387    const TClonesArray &GetArray() const { return fData; }
     
    131135{
    132136private:
    133     Float_t fTimeFirst;
    134     Float_t fTimeLast;
     137    Float_t fTimeFirst;  //! Start of (simulated) sampling window
     138    Float_t fTimeLast;   //! Start of (simulated) sampling window
     139
     140    Float_t fLength;     // Time between first and last photon
     141    Float_t fTimeMedDev; // Median deviation
    135142
    136143//    Float_t fOffset;
    137144//    Float_t fWindow;
    138145
    139     Int_t fMaxIndex;
     146    Int_t fMaxIndex;     //!
    140147
    141148public:
     
    147154
    148155    void SetTime(Float_t first, Float_t last) { fTimeFirst=first; fTimeLast=last; }
     156    void SetLength(Float_t len) { fLength=len; }
    149157    void SetMaxIndex(UInt_t idx) { fMaxIndex=idx; }
     158    void SetTimeMedDev(Float_t dev) { fTimeMedDev=dev; }
    150159
    151160//    Float_t GetRawTimeFirst() const { return fTimeFirst; }
     
    154163    Float_t GetTimeFirst() const { return fTimeFirst; }
    155164    Float_t GetTimeLast() const { return fTimeLast; }
     165
     166    Float_t GetLength() const { return fLength; }
     167    Float_t GetTimeMedDev() const { return fTimeMedDev; }
    156168
    157169    Int_t GetMaxIndex() const { return fMaxIndex; }
  • trunk/MagicSoft/Mars/msimcamera/MSimGeomCam.cc

    r9332 r9342  
    181181    const Int_t   ns   = fHeader->GetNumSamplesHiGain()+1;
    182182
    183     const Float_t first = cnt>0 ? fEvt->GetFirst()->GetTime() :  0;
    184     const Float_t last  = cnt>0 ? fEvt->GetLast()->GetTime()  : ns*freq;
     183    const Float_t first = cnt>0 ? fEvt->GetTimeFirst() :  0;
     184    const Float_t last  = cnt>0 ? fEvt->GetTimeLast()  : ns*freq;
    185185
    186186    // Length (ns), Pulse position (Units ns)
     
    188188    const Float_t pw   = fPulse->GetPulseWidth();
    189189
     190    fStat->SetTimeMedDev(fEvt->GetTimeMedianDev());
    190191    fStat->SetTime(first-pp-pw, last-pp+pw + ns*freq);
     192    fStat->SetLength(last-first);
    191193    fStat->SetMaxIndex(fGeom->GetNumPixels()-1);
    192194    fStat->SetReadyToSave();
Note: See TracChangeset for help on using the changeset viewer.