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 (tbretz@uni-sw.gwdg.de)
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2001
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | // //
|
---|
27 | // MTask //
|
---|
28 | // //
|
---|
29 | // Base class for all tasks which can perfomed in a tasklist //
|
---|
30 | // For each event processed in the eventloop all the different //
|
---|
31 | // tasks in the tasklist will be processed. //
|
---|
32 | // //
|
---|
33 | // So all tasks must inherit from this baseclass. //
|
---|
34 | // //
|
---|
35 | // The inheritance from MInputStreamID is used to indicate the //
|
---|
36 | // type of event that this task is for. If it is "All" it is executed //
|
---|
37 | // independantly of the actual ID of the task list. //
|
---|
38 | // //
|
---|
39 | // Inside this abstract class, there are three fundamental function: //
|
---|
40 | // //
|
---|
41 | // - PreProcess(): executed before the eventloop starts. Here you //
|
---|
42 | // can initiate different things, open files, etc. //
|
---|
43 | // As an argument this function gets a pointer to the //
|
---|
44 | // parameter list. You can stop the execution by //
|
---|
45 | // returning kFALSE instead of kTRUE. If an error //
|
---|
46 | // occured and you return kFALSE make sure, that //
|
---|
47 | // any action is closed correctly and all newly //
|
---|
48 | // created object are deleted. The PostProcess in //
|
---|
49 | // such a case won't be executed by the Tasklist or //
|
---|
50 | // Eventloop. //
|
---|
51 | // //
|
---|
52 | // - Process(): executed for each event in the eventloop. Do it //
|
---|
53 | // one task after the other (as they occur in the //
|
---|
54 | // tasklist). Only the tasks with a Stream ID //
|
---|
55 | // which matches the actual ID of the tasklist //
|
---|
56 | // are executed. A task can return kFALSE to //
|
---|
57 | // stop the execuition of the tasklist or //
|
---|
58 | // kCONTINUE to skip the pending tasks. //
|
---|
59 | // //
|
---|
60 | // - PostProcess(): executed after the eventloop. Here you can close //
|
---|
61 | // output files, start display of the run parameter, //
|
---|
62 | // etc. PostProcess should be executed only if //
|
---|
63 | // PreProcess was successfull (returned kTRUE) //
|
---|
64 | // //
|
---|
65 | /////////////////////////////////////////////////////////////////////////////
|
---|
66 |
|
---|
67 | #include "MTask.h"
|
---|
68 |
|
---|
69 | ClassImp(MTask);
|
---|
70 |
|
---|
71 | // --------------------------------------------------------------------------
|
---|
72 | //
|
---|
73 | // This is processed before the eventloop starts
|
---|
74 | //
|
---|
75 | // It is the job of the PreProcess to connect the tasks
|
---|
76 | // with the right container in the parameter list.
|
---|
77 | //
|
---|
78 | // the virtual implementation returns kTRUE
|
---|
79 | //
|
---|
80 | Bool_t MTask::PreProcess(MParList *pList)
|
---|
81 | {
|
---|
82 | return kTRUE;
|
---|
83 | }
|
---|
84 |
|
---|
85 | // --------------------------------------------------------------------------
|
---|
86 | //
|
---|
87 | // This is processed for every event in the eventloop
|
---|
88 | //
|
---|
89 | // the virtual implementation returns kTRUE
|
---|
90 | //
|
---|
91 | Bool_t MTask::Process()
|
---|
92 | {
|
---|
93 | return kTRUE;
|
---|
94 | }
|
---|
95 |
|
---|
96 | // --------------------------------------------------------------------------
|
---|
97 | //
|
---|
98 | // This is processed after the eventloop starts
|
---|
99 | //
|
---|
100 | // the virtual implementation returns kTRUE
|
---|
101 | //
|
---|
102 | Bool_t MTask::PostProcess()
|
---|
103 | {
|
---|
104 | return kTRUE;
|
---|
105 | }
|
---|
106 |
|
---|
107 |
|
---|