Ignore:
Timestamp:
03/30/01 12:01:58 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r710 r711  
     1////////////////////////////////////////////////////////////////////////
     2//
     3//  MFillHFadc
     4//
     5//  This task fill the n time slices from all pixels
     6//  (stored in a MRawEvtData container) into histograms.
     7//  This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix
     8//
     9////////////////////////////////////////////////////////////////////////
     10
    111#include "MFillHFadc.h"
    212
     
    1020ClassImp(MFillHFadc)
    1121
    12     MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
     22MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
    1323{
    1424  *fName  = name  ? name  : "MFillHFadc";
     
    1828Bool_t MFillHFadc::PreProcess (MParList *pList)
    1929{
    20   // connect the raw data with this task
    21  
    22   fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
    23   if (!fHistos)
    24       return kFALSE;
     30    //
     31    // The PrProcess function checks for the existance of all necessary
     32    // parameter containers
     33    //
    2534
    26   fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
    27   if (!fRawEvtData)
    28   {
    29       *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
    30       return kFALSE ;
    31   }
     35    //
     36    // check if all necessary input containers are existing
     37    //
     38    fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
     39    if (!fRawEvtData)
     40    {
     41        *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
     42        return kFALSE;
     43    }
    3244
    33   return kTRUE ;
     45    //
     46    // check if the output containers are existing, if not craete them
     47    //
     48    fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
     49    if (!fHistos)
     50        return kFALSE;
    3451
     52    return kTRUE;
    3553}
    3654
    3755Bool_t MFillHFadc::Process()
    3856{
    39   //  loop over the pixels and fill the values in the histograms
     57    //
     58    // This process function loops over all pixels in an MRawEvtData
     59    // event and fills the values into histograms
     60    //
     61
     62    //  loop over the pixels and fill the values in the histograms
    4063 
    41   MRawEvtPixelIter pixel(fRawEvtData);
     64    MRawEvtPixelIter pixel(fRawEvtData);
    4265
    43   const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
    44   const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
     66    const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
     67    const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
    4568
    46   //  cout << "HighSamples " << iHighSamples ;
     69    //  cout << "HighSamples " << iHighSamples ;
    4770
    48   while ( pixel.Next() )
    49     {
    50       for (Int_t i=0 ; i<nhisamples ; i++ )
    51         {
    52             fHistos->FillHi ( pixel.GetPixelId(),
    53                               pixel.GetHiGainFadcSamples()[i] );
    54         }
     71    while ( pixel.Next() )
     72    {
     73        const UInt_t id = pixel.GetPixelId();
    5574
    56       for (Int_t i=0 ; i<nlosamples ; i++ )
    57         {
    58             fHistos->FillLo ( pixel.GetPixelId(),
    59                               pixel.GetLoGainFadcSamples()[i] );
    60         }
    61     }
    62  
    63   return kTRUE;
    64  
    65 }
     75        for (Int_t i=0;  i<nhisamples; i++)
     76            fHistos->FillHi(id, pixel.GetHiGainFadcSamples()[i]);
     77
     78        if (!pixel.HasLoGain())
     79            continue;
     80
     81        for (Int_t i=0; i<nlosamples; i++)
     82            fHistos->FillLo(id, pixel.GetLoGainFadcSamples()[i]);
     83    }
     84
     85    return kTRUE;
     86
     87}
Note: See TracChangeset for help on using the changeset viewer.