| 1 | #include "MViewAdcSpectra.h"
|
|---|
| 2 |
|
|---|
| 3 | #include <iostream.h>
|
|---|
| 4 |
|
|---|
| 5 | #include "MParList.h"
|
|---|
| 6 | #include "MTaskList.h"
|
|---|
| 7 | #include "MEvtLoop.h"
|
|---|
| 8 |
|
|---|
| 9 | #include "MRawRunHeader.h"
|
|---|
| 10 | #include "MRawEvtHeader.h"
|
|---|
| 11 | #include "MRawEvtData.h"
|
|---|
| 12 | #include "MRawCrateArray.h"
|
|---|
| 13 | #include "MTime.h"
|
|---|
| 14 |
|
|---|
| 15 | #include "MReadTree.h"
|
|---|
| 16 | #include "MDumpEvtHeader.h"
|
|---|
| 17 | #include "MFillHFadc.h"
|
|---|
| 18 | #include "MShowSpect.h"
|
|---|
| 19 | #include "MHFadcCam.h"
|
|---|
| 20 |
|
|---|
| 21 | MViewAdcSpectra::MViewAdcSpectra()
|
|---|
| 22 | {
|
|---|
| 23 | // default constructor
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | MViewAdcSpectra::~MViewAdcSpectra()
|
|---|
| 27 | {
|
|---|
| 28 | // default destructor
|
|---|
| 29 | delete fHistosAdc;
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | // ================================================================================
|
|---|
| 34 | Bool_t MViewAdcSpectra::AdcSpectra ( Char_t *inputfile, Char_t *treeName )
|
|---|
| 35 | {
|
|---|
| 36 | // This job reads in the FADC data from all events and fills
|
|---|
| 37 | // the spectrum for each pmt pixel.
|
|---|
| 38 | //
|
|---|
| 39 |
|
|---|
| 40 | cout << "PedAdcSpectra:: Analyse the tree " << treeName
|
|---|
| 41 | << "in the file " << inputfile << endl ;
|
|---|
| 42 |
|
|---|
| 43 | // create a (empty) list of parameters which can be used by the tasks
|
|---|
| 44 | // and an (empty) list of tasks which should be executed
|
|---|
| 45 | // connect them in the required way.
|
|---|
| 46 |
|
|---|
| 47 | //
|
|---|
| 48 | // create the data containers for the raw data
|
|---|
| 49 | //
|
|---|
| 50 | MParList plist;
|
|---|
| 51 |
|
|---|
| 52 | MRawRunHeader runheader;
|
|---|
| 53 | plist.AddToList(&runheader);
|
|---|
| 54 |
|
|---|
| 55 | MRawEvtHeader evtheader;
|
|---|
| 56 | plist.AddToList(&evtheader);
|
|---|
| 57 |
|
|---|
| 58 | MRawEvtData evtdata;
|
|---|
| 59 | plist.AddToList(&evtdata);
|
|---|
| 60 |
|
|---|
| 61 | MRawCrateArray cratearray;
|
|---|
| 62 | plist.AddToList(&cratearray);
|
|---|
| 63 |
|
|---|
| 64 | MTime evttime("MTime");
|
|---|
| 65 | plist.AddToList(&evttime);
|
|---|
| 66 |
|
|---|
| 67 | fHistosAdc= new MHFadcCam;
|
|---|
| 68 | plist.AddToList( fHistosAdc ) ;
|
|---|
| 69 |
|
|---|
| 70 | //
|
|---|
| 71 | // set up the tasks for this job
|
|---|
| 72 | //
|
|---|
| 73 | MTaskList tasks;
|
|---|
| 74 | plist.AddToList(&tasks);
|
|---|
| 75 |
|
|---|
| 76 | MReadTree readin ( inputfile, treeName ) ;
|
|---|
| 77 | tasks.AddToList( &readin ) ;
|
|---|
| 78 |
|
|---|
| 79 | // MDumpEvtHeader *dumpheader = new MDumpEvtHeader() ;
|
|---|
| 80 | // tasks->AddToList( dumpheader ) ;
|
|---|
| 81 |
|
|---|
| 82 | MFillHFadc fillspect;
|
|---|
| 83 | tasks.AddToList( &fillspect ) ;
|
|---|
| 84 |
|
|---|
| 85 | MShowSpect showspect( "MHFadcCam" ) ;
|
|---|
| 86 | tasks.AddToList( &showspect ) ;
|
|---|
| 87 |
|
|---|
| 88 | // set up the loop for the processing
|
|---|
| 89 |
|
|---|
| 90 | MEvtLoop magic;
|
|---|
| 91 | magic.SetParList(&plist);
|
|---|
| 92 |
|
|---|
| 93 | // start the loop running
|
|---|
| 94 |
|
|---|
| 95 | magic.Eventloop() ;
|
|---|
| 96 |
|
|---|
| 97 | return kTRUE ;
|
|---|
| 98 |
|
|---|
| 99 | }
|
|---|