Changeset 711 for trunk


Ignore:
Timestamp:
03/30/01 12:01:58 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r710 r711  
    44 
    55   * mdatacheck/MH*, mdatacheck/MFillH* moved to mhist
     6   
     7   * mraw/MrawEvtPixelIter: IsLoGain -> HasLoGain
    68 
    79 
  • 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}
  • trunk/MagicSoft/Mars/mhist/MFillHFadc.h

    r710 r711  
    1616class MFillHFadc : public MTask {
    1717 private:
    18   MRawEvtData      *fRawEvtData;
    19 
    20   MHFadcCam        *fHistos ;
     18  MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created
     19  MHFadcCam   *fHistos ;    // The histogram container into which holds the spektrum
    2120
    2221 public:   
  • trunk/MagicSoft/Mars/mhist/MFillHHillas.cc

    r710 r711  
     1////////////////////////////////////////////////////////////////////////
     2//
     3//  MFillHHillas
     4//
     5//  This task fills the hillas parameter from MHillas into
     6//  histograms (MHHillas)
     7//
     8////////////////////////////////////////////////////////////////////////
    19#include "MFillHHillas.h"
    210
  • trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc

    r710 r711  
     1////////////////////////////////////////////////////////////////////////
     2//
     3//  MFillHStarMap
     4//
     5//  This task fills a star map (a 2D histogram, MHStarMap)
     6//  from the calculated hillas parameter (MHillas).
     7//  The algorithm for this can be found in MHStarMap::Fill
     8//
     9////////////////////////////////////////////////////////////////////////
    110#include "MFillHStarMap.h"
    211
     
    3342Bool_t MFillHStarMap::Process()
    3443{
    35 //    if (fabs(fEvt->GetAlpha())>60)
    36 //        return kCONTINUE;
    37 
    3844    fHistos->Fill(fEvt);
    3945
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.cc

    r710 r711  
    33// MHFadcCam
    44//
    5 // This class contains a list of all ADC spektra histograms
     5// This class contains a list of MHFadcPix.
    66//
    77///////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.cc

    r710 r711  
    11///////////////////////////////////////////////////////////////////////
    22//
    3 // MHistosAdc
     3// MHFadcPix
    44//
    5 // This class contains a list of all ADC spektra histograms
     5// This container stores a hostogram to display an Fadc Spekrtum.
     6// The spektrum of all the values measured by the Fadcs.
    67//
    78///////////////////////////////////////////////////////////////////////
     
    1213
    1314ClassImp(MHFadcPix)
     15
     16MHFadcPix::MHFadcPix(UInt_t pixid)
     17{
     18    //
     19    // Creates the histograms for lo and hi gain of one pixel
     20    //
     21    // FIXME! Set the right axis titles and ... and ...
     22    //
     23    Char_t tmp1[40]="hi";
     24    Char_t tmp2[40]="hi gain Pixel";
     25
     26    if (pixid)
     27    {
     28        sprintf(tmp1, "%s%d",  tmp1, pixid);
     29        sprintf(tmp2, "%s %d", tmp2, pixid);
     30    }
     31    fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
     32
     33
     34    Char_t tmp3[40]="lo";
     35    Char_t tmp4[40]="lo gain Pixel";
     36
     37    if (pixid)
     38    {
     39        sprintf(tmp3, "%s%d",  tmp3, pixid);
     40        sprintf(tmp4, "%s %d", tmp4, pixid);
     41    }
     42    fHistLo =  new TH1F(tmp3, tmp4, 256, 0, 255);
     43}
     44
     45MHFadcPix::~MHFadcPix()
     46{
     47    delete fHistHi;
     48    delete fHistLo;
     49}
    1450
    1551void MHFadcPix::Draw(Option_t *)
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.h

    r710 r711  
    1717
    1818public:
    19     MHFadcPix(UInt_t pixid)
    20     {
    21         Char_t tmp1[40];
    22         Char_t tmp2[40];
     19    MHFadcPix(UInt_t pixid=0);
     20    ~MHFadcPix();
    2321
    24         sprintf(tmp1, "high%d", pixid);
    25         sprintf(tmp2, "high gain Pixel %d", pixid);
    26 
    27         fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
    28 
    29         sprintf(tmp1, "low %d", pixid);
    30         sprintf(tmp2, "low gain Pixel %d", pixid);
    31 
    32         fHistLo =  new TH1F(tmp1, tmp2, 256, 0, 255);
    33     }
    34     ~MHFadcPix()
    35     {
    36         delete fHistHi;
    37         delete fHistLo;
    38     }
    3922    TH1F *GetHistHi() { return fHistHi; }
    4023    TH1F *GetHistLo() { return fHistLo; }
Note: See TracChangeset for help on using the changeset viewer.