Ignore:
Timestamp:
05/25/05 16:18:11 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhflux
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r7066 r7091  
    357357    case kEntries:     *fLog << "entries.";      break;
    358358    case kIntegral:    *fLog << "integral.";     break;
    359     case kOffRegion:   *fLog << "off region.";  break;
    360     case kBackground:  *fLog << "background.";  break;
    361     case kLeastSquare: *fLog << "least square."; break;
     359    case kOffRegion:   *fLog << "off region (intgeral between " << fScaleMin << " and " << fScaleMax << ")"; break;
     360    case kBackground:  *fLog << "background (integral between " << fBgMin    << " and " << fBgMax    << ")"; break;
     361    case kLeastSquare: *fLog << "least square (N/A)"; break;
    362362    case kUserScale:   *fLog << "user def (" << fScaleUser << ")"; break;
    363363    }
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r7000 r7091  
    7575//    MTimeEffectiveOnTime [MTime]
    7676//
     77//
     78// ==========================================================================
     79// Dear Colleagues,
     80//
     81// for the case that we are taking calibration events interleaved with
     82// cosmics events the calculation of the effective observation time has to
     83// be modified. I have summarized the proposed procedures in the note at the
     84// end of this message. The formulas have been checked by a simulation.
     85//
     86// Comments are welcome.
     87//
     88// Regards,  Wolfgang
     89// --------------------------------------------------------------------------
     90//                                                       Wolfgang Wittek
     91//                                                         2 Dec. 2004
     92//
     93// Calculation of the effective observation time when cosmics and calibration
     94// events are taken simultaneously.
     95// --------------------------------
     96//
     97// I. Introduction
     98// ---------------
     99// It is planned to take light calibration events (at a certain fixed frequency
     100// lambda_calib) interlaced with cosmics events. The advantages of this
     101// procedure are :
     102//
     103// - the pedestals, which would be determined from the cosmics, could be
     104//   used for both the calibration and the cosmics events
     105//
     106// - because calibration and cosmics events are taken quasi simultaneously,
     107//   rapid variations (in the order of a few minutes) of base lines and of the
     108//   photon/ADC conversion factors could be recognized and taken into account
     109//
     110// The effective observation time T_eff is defined as that time range, within
     111// which the recorded number of events N_cosmics would be obtained under ideal
     112// conditions (only cosmics, no dead time, no calibration events, ...).
     113//
     114// In the absence of calibration events the effective observation time can
     115// be determined from the distribution of time differences 'dt' between
     116// successive cosmics events (see first figure in the attached ps file).
     117// The exponential slope 'lambda' of this distribution is the ideal cosmics
     118// event rate. If 'N_cosmics' is the total number of recorded cosmics events,
     119// T_eff is obtained by
     120//
     121//    T_eff = N_cosmics / lambda
     122//
     123// In the case of a finite dead time 'dead', the distribution (for dt > dead) is
     124// still exponential with the same slope 'lambda'. 'lambda' should be determined
     125// in a region of 'dt' which is not affected by the dead time, i.e. at not too
     126// low 'dt'.
     127//
     128//
     129//
     130// II. Problems in the presence of calibration events
     131// --------------------------------------------------
     132// If calibration events are taken interlaced with cosmics, and if the dead time
     133// is negligible, the distribution of time differences 'dt' between cosmics can
     134// be used for calculating the effective observation time, as if the calibration
     135// events were not present.
     136//
     137// In the case of a non-negligible dead time 'dead', however, the distribution of
     138// time differences between cosmics is distorted, because a cosmics event may be
     139// lost due to the dead time after a calibration event. Even if the time
     140// intervals are ignored which contain a calibration event,
     141//
     142//
     143//        ---|---------o--------|--------->  t
     144//
     145//        cosmics    calib    cosmics
     146//
     147//            <---------------->           <==== time interval to be ignored
     148//
     149//
     150// the distribution of 'dt' is still distorted, because there would be no
     151// 'dt' with dt > tau_calib = 1/lambda_calib. The distribution would also be
     152// distorted in the region dt < tau_calib, due to calibration events occuring
     153// shortly after cosmics events. As a result, the slope of the distribution of
     154// 'dt' would not reflect the ideal cosmics event rate (see second figure; the
     155// values assumed in the simulation are lambda = 200 Hz, lambda_calib = 50
     156// Hz, dead = 0.001 sec, total time = 500 sec, number of generated cosmics
     157// events = 100 000).
     158//
     159//
     160// Note also that some calibration events will not be recorded due to the dead
     161// time after a cosmics event.
     162//
     163//
     164// III. Proposed procedures
     165// ------------------------
     166//
     167// A) The ideal event rate 'lambda' may be calculated from the distribution of
     168// the time difference 'dt_first' between a calibration event and the first
     169// recorded cosmics event after the calibration event. In the region
     170//
     171//     dead < dt_first < tau_calib
     172//
     173// the probability distribution of dt_first is given by
     174//
     175//     p(dt_first) = c * exp(-lambda*dt_first)
     176//
     177// where c is a normalization constant. 'lambda' can be obtained by a simple
     178// exponential fit to the experimental distribution of dt_first (see third
     179// figure). The fit range should start well above the average value of the dead
     180// time 'dead'.
     181//
     182//
     183// B) One may consider those time intervals between recorded cosmics events, which
     184// are completely contained in the region
     185//
     186//    t_calib < t < t_calib + tau_calib
     187//
     188// where t_calib is the time of a recorded calibration event.
     189//
     190//
     191//          <--------------- tau_calib ----------->
     192//
     193//
     194//           0   1  2   3 4  5   6  7    8  9   10
     195//      --|-o---|-|---|--|-|----|--|---|---|-|----o-|---|-|--------->  t
     196//          ^                                     ^
     197//          |                                     |
     198//        t_calib                               t_calib + tau_calib
     199//
     200//
     201// In this example, of the time intervals 0 to 10 only the intervals 1 to 9
     202// should be retained and plotted. The distribution of the length 'dt' of these
     203// intervals in the region
     204//
     205//     dead < dt < tau_calib
     206//
     207// is given by
     208//
     209//     p(dt) = c * (tau_calib-dt-dead) * exp(-lambda*dt)
     210//
     211// A fit of this expression to the experimental distribution of 'dt' yields
     212// 'lambda' (see fourth figure). For 'dead' an average value of the dead time
     213// should be chosen, and the fit range should end well before dt = tau_calib-dead.
     214//
     215//
     216// Method A has the advantage that the p(dt_first) does not depend on 'dead'.
     217// 'dead' has to be considered when defining the fit range, both in method A and
     218// in method B. In method B the event statistics is larger leading to a smaller
     219// fitted error of 'lambda' than method A (see the figures).
     220//
     221//
     222// The effective observation time is again obtained by
     223//
     224//    T_eff = N_cosmics / lambda
     225//
     226// where N_cosmics is the total number of recorded cosmics events. Note that
     227// N_cosmics is equal to
     228//
     229//    N_cosmics = N_tot - N_calib
     230//
     231// where N_tot is the total number of recorded events (including the calibration
     232// events) and N_calib is the number of recorded calibration events.
     233//
     234// Note that if time intervals are discarded for the determination of lambda,
     235// the corresponding cosmics events need not and should not be discarded.
     236//
     237//
     238// IV. Procedure if the calibration events are taken in bunches
     239// ------------------------------------------------------------
     240// In November 2004 the rate of calibration events is not constant. The events
     241// are taken in 200 Hz bunches every second, such that the rate is 200 Hz for
     242// 0.25 sec, followed by a gap of 0.75 sec. Then follows the next 200 Hz bunch.
     243//
     244// In this case it is proposed to consider for the calculation of 'lambda' only
     245// the cosmics events within the gaps of 0.75 sec. For these cosmics events one
     246// of the methods described in III. can be applied.
     247//
     248//
     249// V. Alternative pocedure
     250// -----------------------
     251// The effective observation time can also be determined from the total
     252// observation time and the total dead time. The latter is written out by the DAQ.
     253// In this case it has to be made sure that the dead time is available in Mars
     254// when the effective observation time is calculated.
     255//
    77256//////////////////////////////////////////////////////////////////////////////
    78257#include "MHEffectiveOnTime.h"
     
    646825void MHEffectiveOnTime::Paint(Option_t *opt)
    647826{
    648     *fLog << all << "Paint: '" << opt << "'" << endl;
    649 
    650827    TH1D *h=0;
    651828    TPaveStats *st=0;
  • trunk/MagicSoft/Mars/mhflux/MHThetaSq.cc

    r7064 r7091  
    6969    fHist.SetName("Theta");
    7070    fHist.SetTitle("Theta");
    71     fHist.SetZTitle("\\theta^{2} [deg^{2}]");
     71    fHist.SetZTitle("\\vartheta^{2} [deg^{2}]");
    7272    fHist.SetDirectory(NULL);
    7373
    7474    // Main histogram
    7575    fHistTime.SetName("Theta");
    76     fHistTime.SetXTitle("\\theta^{2} [deg^{2}]");
     76    fHistTime.SetXTitle("\\vartheta^{2} [deg^{2}]");
    7777    fHistTime.SetDirectory(NULL);
    7878
Note: See TracChangeset for help on using the changeset viewer.