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): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
|
---|
19 | ! Author(s): Harald Kornmayer 1/2001
|
---|
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 |
|
---|
51 | ClassImp(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 | //
|
---|
60 | Bool_t MDumpEvtHeader::PreProcess (MParList *pList)
|
---|
61 | {
|
---|
62 | fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
|
---|
63 | if (!fRawEvtHeader)
|
---|
64 | {
|
---|
65 | *fLog << err << dbginf << "- Error: MRawEvtHeader not found... exit." << endl;
|
---|
66 | return kFALSE;
|
---|
67 | }
|
---|
68 |
|
---|
69 | fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
|
---|
70 | if (!fRawEvtData)
|
---|
71 | {
|
---|
72 | *fLog << err << 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 | //
|
---|
84 | Bool_t MDumpEvtHeader::Process()
|
---|
85 | {
|
---|
86 | fRawEvtHeader->Print();
|
---|
87 |
|
---|
88 | *fLog << all;
|
---|
89 |
|
---|
90 | MRawEvtPixelIter pixel(fRawEvtData);
|
---|
91 |
|
---|
92 | while (pixel.Next())
|
---|
93 | *fLog << " " << pixel.GetPixelId();
|
---|
94 |
|
---|
95 | *fLog << endl;
|
---|
96 |
|
---|
97 | return kTRUE;
|
---|
98 | }
|
---|