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