source: trunk/MagicSoft/Mars/mdatacheck/MViewAdcSpectra.cc@ 972

Last change on this file since 972 was 938, checked in by tbretz, 23 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.3 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#include "MViewAdcSpectra.h"
27
28#include <iostream.h>
29
30#include "MParList.h"
31#include "MTaskList.h"
32#include "MEvtLoop.h"
33
34#include "MRawRunHeader.h"
35#include "MRawEvtHeader.h"
36#include "MRawEvtData.h"
37#include "MRawCrateArray.h"
38#include "MTime.h"
39
40#include "MReadTree.h"
41#include "MDumpEvtHeader.h"
42#include "MFillHFadc.h"
43#include "MShowSpect.h"
44#include "MHFadcCam.h"
45
46ClassImp(MViewAdcSpectra);
47
48// ================================================================================
49//
50// default constructor
51//
52MViewAdcSpectra::MViewAdcSpectra()
53{
54 fHistosAdc = new MHFadcCam;
55}
56
57// ================================================================================
58//
59// default destructor
60//
61MViewAdcSpectra::~MViewAdcSpectra()
62{
63 delete fHistosAdc;
64}
65
66
67// ================================================================================
68//
69// This job reads in the FADC data from all events and fills
70// the spectrum for each pmt pixel.
71//
72Bool_t MViewAdcSpectra::AdcSpectra(Char_t *inputfile, Char_t *treeName)
73{
74 cout << "MViewAdcSpectra:: Analyse the tree '" << treeName << "'";
75 cout << "in the file '" << inputfile << "'" << endl;
76
77 //
78 // create a (empty) list of parameters which can be used by the tasks
79 // and an (empty) list of tasks which should be executed
80 // connect them in the required way.
81 //
82
83 //
84 // create the data containers for the raw data
85 //
86 MParList plist;
87
88 MRawRunHeader runheader;
89 plist.AddToList(&runheader);
90
91 MRawEvtHeader evtheader;
92 plist.AddToList(&evtheader);
93
94 MRawEvtData evtdata;
95 plist.AddToList(&evtdata);
96
97 MRawCrateArray cratearray;
98 plist.AddToList(&cratearray);
99
100 MTime evttime("MTime");
101 plist.AddToList(&evttime);
102
103 plist.AddToList(fHistosAdc);
104
105 //
106 // set up the tasks for this job
107 //
108 MTaskList tasks;
109 plist.AddToList(&tasks);
110
111 MReadTree readin(treeName, inputfile);
112 tasks.AddToList(&readin);
113
114 //
115 // MDumpEvtHeader *dumpheader = new MDumpEvtHeader() ;
116 // tasks->AddToList( dumpheader ) ;
117 //
118 MFillHFadc fillspect;
119 tasks.AddToList(&fillspect);
120
121 MShowSpect showspect("MHFadcCam");
122 tasks.AddToList(&showspect);
123
124 //
125 // set up the loop for the processing
126 //
127 MEvtLoop magic;
128 magic.SetParList(&plist);
129
130 //
131 // start the loop running
132 //
133 magic.Eventloop();
134
135 return kTRUE;
136}
Note: See TracBrowser for help on using the repository browser.