Ignore:
Timestamp:
12/22/00 16:25:50 (24 years ago)
Author:
tbretz
Message:
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
2000/12/23: Thomas Bretz, changes see Changelog.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc

    r454 r456  
     1///////////////////////////////////////////////////////////////////////////////
     2//
     3//  MRawEvtPixelIter
     4//
     5//  class to iterate over all pixels of one event.
     6//  The calling is similar to a root iterator:
     7// 
     8//  MRawEvtData *evtdata;            // must be filled with data from somewhere
     9//  MRawEvtPixelIter pixel(evtdata); // evtdata: ptr to event you want to iterate
     10//
     11//  while (pixel.Next())
     12//  {
     13//     // here you can access the actual time slices by using
     14//     //   pixel.GetPixelId();
     15//     //   pixel.GetHiGainFadcSamples()[i]; // i is the number of the slice
     16//     //   pixel.IsLoGain();                // check if pixel has
     17//     //   pixel.GetLoGainFadcSamples()[i]; // i is the number of the slice
     18//
     19//     // WARNING: Don't acces more time slices than available.
     20//     //   Get the numbers by calling: evtdata->GetNum[Lo,Hi]GainSamples()
     21//     //   This number is constant for one event
     22//  }
     23//
     24///////////////////////////////////////////////////////////////////////////////
    125#include "MRawEvtPixelIter.h"
    226
     
    832ClassImp(MRawEvtPixelIter)
    933
    10 TObject *MRawEvtPixelIter::Next()
     34MRawEvtData *MRawEvtPixelIter::Next()
    1135{
    1236    //
    1337    // if we are already at the last entry there is no 'next' entry anymore
    1438    //
    15     if (fNumHiGainEntry==fData->fHiGainPixId->GetSize()-1)
     39    if (fNumHiGainEntry==fData->fHiGainPixId->GetSize())
    1640        return NULL;
    1741
     
    1943    // if we are already at the last entry there is no 'next' entry anymore
    2044    //
    21     if (fNumLoGainEntry != fData->fLoGainPixId->GetSize()-1)
     45    if (fNumLoGainEntry != fData->fLoGainPixId->GetSize())
    2246        if (*fHiGainId == *fLoGainId)
    2347        {
     
    5680    // set pointer to first entry of arrays
    5781    //
    58     fHiGainId   = (UShort_t*)fData->fHiGainPixId->GetArray();
    59     fLoGainId   = (UShort_t*)fData->fLoGainPixId->GetArray();
    60     fHiGainPos  = (Byte_t*)fData->fHiGainFadcSamples->GetArray();
    61     fLoGainPos  = (Byte_t*)fData->fLoGainFadcSamples->GetArray();
     82    fHiGainId   = fData->fHiGainPixId->GetArray()-1;
     83    fLoGainId   = fData->fLoGainPixId->GetArray()-1;
     84    fHiGainPos  = fData->fHiGainFadcSamples->GetArray()-fData->GetNumHiGainSamples();
     85    fLoGainPos  = fData->fLoGainFadcSamples->GetArray()-fData->GetNumLoGainSamples();
    6286}
     87
     88void MRawEvtPixelIter::Draw(Option_t *t)
     89{
     90  //
     91  // Draw the actual pixel (for options see: MRawEvtData::Draw)
     92  //
     93  char *txt = new char[6+strlen(t)];
     94  sprintf(txt, "%s%d", t, *fHiGainId);
     95  fData->Draw(txt);
     96  delete txt;
     97}
     98
     99
     100
     101
     102
     103
Note: See TracChangeset for help on using the changeset viewer.