Changeset 2848


Ignore:
Timestamp:
01/19/04 14:53:59 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2847 r2848  
    55                                                 -*-*- END OF LINE -*-*-
    66
     7 2004/01/19: Thomas Bretz
     8
     9   * manalysis/MPedPhotCalc.[cc,h]:
     10     - fixed order of includes
     11     - removed obsolete forward declarations
     12     - removed obsolete data member fNumPixels (stored already twice in
     13       the two TArrayF)
     14     - fixed some small bugs in the documentation
     15
     16
     17
    718 2004/01/19: Javier Rico
     19
    820   * macros/dohtml.C, NEWS
    921     - include some missing info
     
    1224
    1325 2004/01/19: Abelardo Moralejo
     26
    1427   * manalysis/MExtractedSignalPix.h
    1528     - added GetNumLoGainSaturated()
  • trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.cc

    r2837 r2848  
    1616!
    1717!
    18 !   Author(s): Josep Flix  <mailto:jflix@ifae.es>
    19 !              Javier Rico <mailto:jrico@ifae.es>
    20 !              (01/04)
     18!   Author(s): Josep Flix 1/2004 <mailto:jflix@ifae.es>
     19!   Author(s): Javier Rico 1/2004 <mailto:jrico@ifae.es>
    2120!
    2221!   Copyright: MAGIC Software Development, 2000-2004
     
    2625
    2726/////////////////////////////////////////////////////////////////////////////
    28 //                                                                         //
    29 //   MPedPhotCalc                                                          //
    30 //                                                                         // 
    31 //  This is a Task class to compute, for each pixel, the signal mean and   //
    32 //  rms from a pedestal run file that has undergone the standard signal    //
    33 //  extration  and calibration procedure. The signal rms can be used as    //
    34 //  reference to compute the significance of the measured signals in the   //
    35 //  following data runs (e.g. during the image cleaning).                  //
    36 //                                                                         //
    37 //  Input Containers:                                                      //
    38 //   MCerPhotEvt                                                           //
    39 //                                                                         //
    40 //  Output Containers:                                                     //
    41 //   MPedPhotCam
    42 //                                                                         //
    43 //                                                                         //
     27//
     28//   MPedPhotCalc
     29//
     30//  This is a Task class to compute, for each pixel, the signal mean and
     31//  rms from a pedestal run file that has undergone the standard signal
     32//  extration  and calibration procedure. The signal rms can be used as
     33//  reference to compute the significance of the measured signals in the
     34//  following data runs (e.g. during the image cleaning).
     35//
     36//  Input Containers:
     37//   MCerPhotEvt
     38//
     39//  Output Containers:
     40//   MPedPhotCam
     41//
    4442/////////////////////////////////////////////////////////////////////////////
     43#include "MPedPhotCalc.h"
    4544
    4645#include "MLog.h"
    4746#include "MLogManip.h"
    4847
    49 #include "MPedPhotCalc.h"
    5048#include "MParList.h"
    51 #include "MRawRunHeader.h" 
     49#include "MRawRunHeader.h"
     50
    5251#include "MCerPhotPix.h"
    5352#include "MCerPhotEvt.h"
     53
    5454#include "MPedPhotPix.h"
    5555#include "MPedPhotCam.h"
     
    9696 
    9797
    98   fNumPixels = fPedestals->GetSize();
    99 
    10098  // Initialize arrays
    10199  if(fSumx.GetSize()==0)
    102100    {
    103       fSumx.Set(fNumPixels);
    104       fSumx2.Set(fNumPixels);
    105  
    106       memset(fSumx.GetArray(),  0, sizeof(Float_t)*fNumPixels);
    107       memset(fSumx2.GetArray(), 0, sizeof(Float_t)*fNumPixels);
     101        const UShort_t num = fPedestals->GetSize();
     102
     103        fSumx.Set(num);
     104        fSumx2.Set(num);
     105
     106        memset(fSumx.GetArray(),  0, sizeof(Float_t)*num);
     107        memset(fSumx2.GetArray(), 0, sizeof(Float_t)*num);
    108108    }
    109109
     
    115115  for(UInt_t i=0;i<fCerPhot->GetNumPixels();i++)
    116116    {
    117       MCerPhotPix &pix = (*fCerPhot)[i];
    118       Float_t nphot = pix.GetNumPhotons();
    119       Int_t idx     = pix.GetPixId();
     117      const MCerPhotPix &pix = (*fCerPhot)[i];
     118
     119      const Float_t nphot = pix.GetNumPhotons();
     120      const Int_t idx     = pix.GetPixId();
    120121     
    121122      fSumx[idx]  += nphot;
     
    131132  {
    132133    // Compute pedestals and rms from fSumx and fSumx2 arrays
    133     const Int_t n  = GetNumExecutions();
     134    const Int_t n    = GetNumExecutions();
     135    const Int_t npix = fSumx.GetSize();
    134136
    135     for(Int_t i=0;i<fNumPixels;i++)
     137    for(Int_t i=0; i<npix; i++)
    136138      {
    137         const Float_t sum  = fSumx.At(i);
    138         const Float_t sum2 = fSumx2.At(i);
     139        const Float_t sum  = fSumx[i];
     140        const Float_t sum2 = fSumx2[i];
    139141       
    140142        const Float_t photped = sum/n;
  • trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.h

    r2837 r2848  
    11#ifndef MARS_MPedPhotCalc
    22#define MARS_MPedPhotCalc
    3 
    4 /////////////////////////////////////////////////////////////////////////////
    5 //                                                                         //
    6 // MPedPhotCalc                                                            //
    7 //                                                                         //
    8 // Evaluate the pedestals from pedestal runs using charge extraction       //
    9 //                                                                         //
    10 /////////////////////////////////////////////////////////////////////////////
    113
    124#ifndef MARS_MTask
     
    146#endif
    157
     8#ifndef ROOT_TArrayF
    169#include <TArrayF.h>
     10#endif
    1711
    1812class MPedPhotCam;
    19 class MRawEvtData;
    2013class MCerPhotEvt;
    2114
    2215class MPedPhotCalc : public MTask
    2316{
    24     UShort_t fNumPixels;
    25 
    2617    MPedPhotCam  *fPedestals;  // Pedestals of all pixels in the camera
    2718    MCerPhotEvt  *fCerPhot;
     
    3930    MPedPhotCalc(const char *name=NULL, const char *title=NULL);
    4031
    41     ClassDef(MPedPhotCalc, 0)   // Task to calculate pedestals from pedestal runs raw data
     32    ClassDef(MPedPhotCalc, 0)//Task to calculate pedestals from the charge computed from pedestal runs (in units of photons)
    4233};
    4334
Note: See TracChangeset for help on using the changeset viewer.