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 | using namespace std;
|
---|
54 |
|
---|
55 | // --------------------------------------------------------------------------
|
---|
56 | //
|
---|
57 | // Preprocessing of class. Check for the two container which should
|
---|
58 | // get printed by the Process-function: MRawEvtHeader and MRawEvtData.
|
---|
59 | // If one of the two doesn't exist (input containers) stop processing of
|
---|
60 | // data.
|
---|
61 | //
|
---|
62 | Int_t MDumpEvtHeader::PreProcess (MParList *pList)
|
---|
63 | {
|
---|
64 | fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
|
---|
65 | if (!fRawEvtHeader)
|
---|
66 | {
|
---|
67 | *fLog << err << dbginf << "- Error: MRawEvtHeader not found... exit." << endl;
|
---|
68 | return kFALSE;
|
---|
69 | }
|
---|
70 |
|
---|
71 | fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
|
---|
72 | if (!fRawEvtData)
|
---|
73 | {
|
---|
74 | *fLog << err << dbginf << "- Error: MRawEvtData not found... exit." << endl;
|
---|
75 | return kFALSE;
|
---|
76 | }
|
---|
77 |
|
---|
78 | return kTRUE ;
|
---|
79 | }
|
---|
80 |
|
---|
81 | // --------------------------------------------------------------------------
|
---|
82 | //
|
---|
83 | // Print out information of the actual event (header) and print the
|
---|
84 | // pixel ID's of all pixels in this event.
|
---|
85 | //
|
---|
86 | Int_t MDumpEvtHeader::Process()
|
---|
87 | {
|
---|
88 | fRawEvtHeader->Print();
|
---|
89 |
|
---|
90 | *fLog << all;
|
---|
91 |
|
---|
92 | MRawEvtPixelIter pixel(fRawEvtData);
|
---|
93 |
|
---|
94 | while (pixel.Next())
|
---|
95 | *fLog << " " << pixel.GetPixelId();
|
---|
96 |
|
---|
97 | *fLog << endl;
|
---|
98 |
|
---|
99 | return kTRUE;
|
---|
100 | }
|
---|