source: trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc@ 1052

Last change on this file since 1052 was 959, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.8 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// MDumpEvtHeader
29//
30// Print out some event header information to the screen. This maybe useful
31// if you are not sure what the events in the file conatins or you
32// want to check for the contents.
33//
34// Input Containers:
35// MRawEvtHeader, MRawEvtData
36//
37// Output Containers:
38// -/-
39//
40//////////////////////////////////////////////////////////////////////////////
41
42#include "MDumpEvtHeader.h"
43
44#include "MLog.h"
45#include "MLogManip.h"
46
47#include "MParList.h"
48#include "MRawEvtHeader.h"
49#include "MRawEvtPixelIter.h"
50
51ClassImp(MDumpEvtHeader);
52
53// --------------------------------------------------------------------------
54//
55// Preprocessing of class. Check for the two container which should
56// get printed by the Process-function: MRawEvtHeader and MRawEvtData.
57// If one of the two doesn't exist (input containers) stop processing of
58// data.
59//
60Bool_t MDumpEvtHeader::PreProcess (MParList *pList)
61{
62 fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
63 if (!fRawEvtHeader)
64 {
65 *fLog << dbginf << " Error: MRawEvtHeader not found... exit." << endl;
66 return kFALSE;
67 }
68
69 fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
70 if (!fRawEvtData)
71 {
72 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
73 return kFALSE;
74 }
75
76 return kTRUE ;
77}
78
79// --------------------------------------------------------------------------
80//
81// Print out information of the actual event (header) and print the
82// pixel ID's of all pixels in this event.
83//
84Bool_t MDumpEvtHeader::Process()
85{
86 fRawEvtHeader->Print();
87
88 MRawEvtPixelIter pixel(fRawEvtData);
89
90 while (pixel.Next())
91 *fLog << " " << pixel.GetPixelId();
92
93 *fLog << endl;
94
95 return kTRUE;
96}
Note: See TracBrowser for help on using the repository browser.