Changeset 4925


Ignore:
Timestamp:
09/10/04 15:31:34 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.cc

    r4923 r4925  
    2828//  MHEffectiveOnTime
    2929//
    30 //  Fills a 2-D histogram Time-difference vs. Theta
     30//  Filling this you will get the effective on-time versus theta and
     31//  observation time.
    3132//
    3233//  From this histogram the effective on-time is determined by a fit.
     
    3435//  are stored in corresponding histograms
    3536//
     37//  To determin the efective on time a poisson fit is done. For more details
     38//  please have a look into the source code of FitH() it should be simple
     39//  to understand. In this function a Delta-T distribution is fitted, while
     40//  Delta-T is the time between two consecutive events.
     41//
     42//  The fit is done for projections of a 2D histogram in Theta and Delta T.
     43//  So you get the effective on time versus theta.
     44//
     45//  To get the effective on-time versus time a histogram is filled with
     46//  the Delta-T distribution of a number of events set by SetNumEvents().
     47//  The default is 12000 (roughly 1min at 200Hz)
     48//
     49//  For each "time-bin" the histogram is fitted and the resulting effective
     50//  on-time is stored in the fHEffOnTime histogram. Each entry in this
     51//  histogram is the effective observation time between the upper and
     52//  lower edges of the bins.
     53//
     54//  In addition the calculated effective on time is stored in a
     55//  "MEffectiveOnTime [MParameterDerr]" and the corresponding time-stamp
     56//  (the upper edge of the bin) "MTimeEffectiveOnTime [MTime]"
     57//
     58//  The class takes two binnings from the Parameter list; if these binnings
     59//  are not available the defaultbinning is used:
     60//      MBinning("BinningDeltaT"); // Units of seconds
     61//      MBinning("BinningTheta");  // Units of degrees
     62//
     63//
     64//  Usage:
     65//  ------
     66//    MFillH fill("MHEffectiveOnTime", "MTime");
     67//    tlist.AddToList(&fill);
     68//
     69//
     70//  Input Container:
     71//    MPointingPos
     72//
     73//  Output Container:
     74//    MEffectiveOnTime [MParameterDerr]
     75//    MTimeEffectiveOnTime [MTime]
     76//
    3677//////////////////////////////////////////////////////////////////////////////
    37 
    3878#include "MHEffectiveOnTime.h"
    3979
     
    73113    //
    74114    fName  = name  ? name  : "MHEffectiveOnTime";
    75     fTitle = title ? title : "2-D histogram in Theta and time difference";
     115    fTitle = title ? title : "Histogram to determin effective On-Time vs Time and Zenith Angle";
    76116
    77117    // Main histogram
     
    264304    h->Fit(&func, "0IRQ");
    265305
    266     const Double_t chi2   = func.GetChisquare();
    267     const Int_t    NDF    = func.GetNDF();
     306    const Double_t chi2 = func.GetChisquare();
     307    const Int_t    NDF  = func.GetNDF();
    268308
    269309    // was fit successful ?
     
    293333    gMinuit->mnemat((Double_t*)emat, 2);
    294334
    295     const Double_t dldl   = emat[0][0];
     335    const Double_t dldl  = emat[0][0];
    296336    //const Double_t dN0dN0 = emat[1][1];
    297337
    298     const Double_t teff   = Nm/lambda;
    299     const Double_t dteff  = teff * TMath::Sqrt(dldl/(lambda*lambda) + 1.0/Nm);
    300 
    301     const Double_t dl     = TMath::Sqrt(dldl);
     338    const Double_t teff  = Nm/lambda;
     339    const Double_t dteff = teff * TMath::Sqrt(dldl/(lambda*lambda) + 1.0/Nm);
     340    const Double_t dl    = TMath::Sqrt(dldl);
    302341
    303342    //const Double_t kappa  = Nm/N0;
  • trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.h

    r4920 r4925  
    2424{
    2525private:
    26     MPointingPos   *fPointPos;   //!
    27     MTime           fLastTime;   //!
     26    MPointingPos   *fPointPos; //! Container to get the zenith angle from
     27    MTime           fLastTime; //! Time-Stamp of last event
    2828
    29     MTime          *fTime;       //!
    30     MParameterDerr *fParam;      //!
     29    MTime          *fTime;     //! Time-Stamp of "effective on-time" event
     30    MParameterDerr *fParam;    //! Output container for effective on-time
    3131
    32     TH2D fH2DeltaT;              // Counts vs Delta T and Theta
    33     TH1D fH1DeltaT;              //! Counts vs Delta T (for a time interval)
     32    TH2D fH2DeltaT;      // Counts vs Delta T and Theta
     33    TH1D fH1DeltaT;      //! Counts vs Delta T (for a time interval)
    3434
    35     TH1D fHEffOnTheta;           // Effective On time versus Theta
    36     TH1D fHEffOnTime;            // Effective On time versus Time
     35    TH1D fHEffOnTheta;   // Effective On time versus Theta
     36    TH1D fHEffOnTime;    // Effective On time versus Time
    3737
    38     TH1D fHProbTheta;            // Chisq prob fit of Effective On time versus Theta
    39     TH1D fHProbTime;             // Chisq prob fit of Effective On time versus Time
     38    TH1D fHProbTheta;    // Chisq prob fit of Effective On time versus Theta
     39    TH1D fHProbTime;     // Chisq prob fit of Effective On time versus Time
    4040
    4141    TH1D fHN0;
    4242    TH1D fHLambda;
    4343
    44     Bool_t fIsFinalized;
     44    Bool_t fIsFinalized; // Flag telling you whether fHEffOnTheta is the final result
    4545
    46     Int_t fNumEvents;
     46    Int_t fNumEvents;    // Number of events to be used for a bin in time
    4747
    48     const TString fNameProjDeltaT;  //! This should make sure, that gROOT doen't confuse the projection with something else
    49     const TString fNameProjTheta;   //! This should make sure, that gROOT doen't confuse the projection with something else
     48    const TString fNameProjDeltaT; //! This should make sure, that gROOT doen't confuse the projection with something else
     49    const TString fNameProjTheta;  //! This should make sure, that gROOT doen't confuse the projection with something else
    5050
    5151    Bool_t FitH(TH1D *h, Double_t *res, Bool_t paint=kFALSE) const;
     
    6363    Bool_t Finalize();
    6464
     65    const TH1D &GetHEffOnTheta() const { return fHEffOnTheta; }
     66    const TH1D &GetHEffOnTime() const { return fHEffOnTime; }
     67
    6568    void Draw(Option_t *option="");
    6669    void Paint(Option_t *opt="");
    6770
    68     ClassDef(MHEffectiveOnTime, 1) // 2D-histogram to determin effective on-time vs. theta
     71    ClassDef(MHEffectiveOnTime, 1) // Histogram to determin effective On-Time vs Time and Zenith Angle
    6972};
    7073
Note: See TracChangeset for help on using the changeset viewer.