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 |
|
---|
46 | MViewAdcSpectra::MViewAdcSpectra()
|
---|
47 | {
|
---|
48 | // default constructor
|
---|
49 | }
|
---|
50 |
|
---|
51 | MViewAdcSpectra::~MViewAdcSpectra()
|
---|
52 | {
|
---|
53 | // default destructor
|
---|
54 | delete fHistosAdc;
|
---|
55 | }
|
---|
56 |
|
---|
57 |
|
---|
58 | // ================================================================================
|
---|
59 | Bool_t MViewAdcSpectra::AdcSpectra ( Char_t *inputfile, Char_t *treeName )
|
---|
60 | {
|
---|
61 | // This job reads in the FADC data from all events and fills
|
---|
62 | // the spectrum for each pmt pixel.
|
---|
63 | //
|
---|
64 |
|
---|
65 | cout << "PedAdcSpectra:: Analyse the tree " << treeName
|
---|
66 | << "in the file " << inputfile << endl ;
|
---|
67 |
|
---|
68 | // create a (empty) list of parameters which can be used by the tasks
|
---|
69 | // and an (empty) list of tasks which should be executed
|
---|
70 | // connect them in the required way.
|
---|
71 |
|
---|
72 | //
|
---|
73 | // create the data containers for the raw data
|
---|
74 | //
|
---|
75 | MParList plist;
|
---|
76 |
|
---|
77 | MRawRunHeader runheader;
|
---|
78 | plist.AddToList(&runheader);
|
---|
79 |
|
---|
80 | MRawEvtHeader evtheader;
|
---|
81 | plist.AddToList(&evtheader);
|
---|
82 |
|
---|
83 | MRawEvtData evtdata;
|
---|
84 | plist.AddToList(&evtdata);
|
---|
85 |
|
---|
86 | MRawCrateArray cratearray;
|
---|
87 | plist.AddToList(&cratearray);
|
---|
88 |
|
---|
89 | MTime evttime("MTime");
|
---|
90 | plist.AddToList(&evttime);
|
---|
91 |
|
---|
92 | fHistosAdc= new MHFadcCam;
|
---|
93 | plist.AddToList( fHistosAdc ) ;
|
---|
94 |
|
---|
95 | //
|
---|
96 | // set up the tasks for this job
|
---|
97 | //
|
---|
98 | MTaskList tasks;
|
---|
99 | plist.AddToList(&tasks);
|
---|
100 |
|
---|
101 | MReadTree readin ( treeName, inputfile ) ;
|
---|
102 | tasks.AddToList( &readin ) ;
|
---|
103 |
|
---|
104 | // MDumpEvtHeader *dumpheader = new MDumpEvtHeader() ;
|
---|
105 | // tasks->AddToList( dumpheader ) ;
|
---|
106 |
|
---|
107 | MFillHFadc fillspect;
|
---|
108 | tasks.AddToList( &fillspect ) ;
|
---|
109 |
|
---|
110 | MShowSpect showspect( "MHFadcCam" ) ;
|
---|
111 | tasks.AddToList( &showspect ) ;
|
---|
112 |
|
---|
113 | // set up the loop for the processing
|
---|
114 |
|
---|
115 | MEvtLoop magic;
|
---|
116 | magic.SetParList(&plist);
|
---|
117 |
|
---|
118 | // start the loop running
|
---|
119 |
|
---|
120 | magic.Eventloop() ;
|
---|
121 |
|
---|
122 | return kTRUE ;
|
---|
123 |
|
---|
124 | }
|
---|