source: trunk/MagicSoft/Mars/mhist/MFillHFadc.cc@ 891

Last change on this file since 891 was 887, checked in by tbretz, 23 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.7 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
22!
23!
24\* ======================================================================== */
25
26//////////////////////////////////////////////////////////////////////////////
27// //
28// MFillHFadc //
29// //
30// This task fill the n time slices from all pixels //
31// (stored in a MRawEvtData container) into histograms. //
32// This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix //
33// //
34// Input Containers: //
35// MRawEvtData //
36// //
37// Output Containers: //
38// MHFadcCam //
39// //
40//////////////////////////////////////////////////////////////////////////////
41
42#include "MFillHFadc.h"
43
44#include "MLog.h"
45#include "MLogManip.h"
46#include "MParList.h"
47#include "MHFadcCam.h"
48#include "MRawEvtData.h"
49#include "MRawEvtPixelIter.h"
50
51ClassImp(MFillHFadc);
52
53// --------------------------------------------------------------------------
54MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
55{
56 *fName = name ? name : "MFillHFadc";
57 *fTitle = title ? title : "Task to fill the adc spectra with raw data";
58}
59
60// --------------------------------------------------------------------------
61//
62// The PrProcess function checks for the existance of all necessary
63// parameter containers
64//
65Bool_t MFillHFadc::PreProcess (MParList *pList)
66{
67 //
68 // check if all necessary input containers are existing
69 //
70 fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
71 if (!fRawEvtData)
72 {
73 *fLog << dbginf << "MRawEvtData not found... exit." << endl;
74 return kFALSE;
75 }
76
77 //
78 // check if the output containers are existing, if not craete them
79 //
80 fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
81 if (!fHistos)
82 return kFALSE;
83
84 return kTRUE;
85}
86
87// --------------------------------------------------------------------------
88//
89// This process function loops over all pixels in an MRawEvtData
90// event and fills the values into histograms
91//
92Bool_t MFillHFadc::Process()
93{
94 // loop over the pixels and fill the values in the histograms
95 fHistos->Fill(fRawEvtData);
96 return kTRUE;
97}
98
99Bool_t MFillHFadc::PostProcess()
100{
101 fHistos->SetReadyToSave();
102 return kTRUE;
103}
Note: See TracBrowser for help on using the repository browser.