/[PAMELA software]/yoda/event/Algorithm.h
ViewVC logotype

Contents of /yoda/event/Algorithm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5.0 - (show annotations) (download)
Mon Aug 29 09:45:48 2005 UTC (19 years, 3 months ago) by kusanagi
Branch: MAIN
CVS Tags: YODA5_0/00, YODA5_0/01, YODA5_0/02
Changes since 4.4: +1 -1 lines
File MIME type: text/plain
Starting form this version:
1) includes are defined with relative (not absolute) path respect to the YODA aplication
2) RegistryEvent class is foreseen to contain post-unpack data.

1 /** @file
2 * $Source: /home/cvsmanager/yoda/event/Algorithm.h,v $
3 * $Id: Algorithm.h,v 4.4 2005/05/28 10:44:08 kusanagi Exp $
4 * $Author: kusanagi $
5 *
6 * Header file for the Algorithm class.
7 */
8 #ifndef ALGORITHM_H
9 #define ALGORITHM_H
10
11 #include <string>
12 #include <map>
13 #include <list>
14 #include <TObject.h> //Substituted by Maurizio 05 Feb 2004
15 #include "event/PamelaRun.h"
16
17
18 namespace pamela {
19 class PamelaRun;
20
21 /**
22 * Abstract base class for all processing algorithms. You need to deviate
23 * from this class and overwrite the functions Init(), RunEvent() and
24 * Finish(), if necessary. For logging purposes, you also need to write
25 * the functions GetName() and GetVersionInfo().
26 */
27 class Algorithm: public TObject {
28 protected:
29 /**
30 * The packet type of the events processed by this algorithm.
31 */
32 const pamela::PacketType *type; //!
33 /**
34 * The name of the algorithm.
35 */
36 std::string AlgorithmName;
37 public:
38
39 Algorithm(const pamela::PacketType*, std::string);
40 /**
41 * Get the name of the algorithm.
42 */
43 std::string GetAlgorithmName(void) const { return AlgorithmName; }
44 /**
45 * Get a string with the version info of the algorithm.
46 * Must be overwritten.
47 */
48 virtual std::string GetVersionInfo(void) const = 0;
49 /**
50 * Get the type this algorithm is used for.
51 */
52 const pamela::PacketType *GetPacketType(void) const { return type; }
53 /**
54 * Initialize the algorithm with a special run. Default: Do nothing.
55 */
56 virtual void Init(pamela::PamelaRun *) { }
57 /**
58 * Run the algorithm with a certain event. Default: Do nothing.
59 */
60 virtual void RunEvent(int) { }
61 /**
62 * Finish up the algorithm. Default: Do nothing.
63 */
64 virtual void Finish(void) { }
65 ClassDef(Algorithm, 1)
66 };
67
68 /**
69 * A minimal algorithm that does nothing.
70 */
71 class NullAlgorithm: public pamela::Algorithm {
72 public:
73 NullAlgorithm(const pamela::PacketType *);
74 virtual std::string GetVersionInfo(void) const = 0;
75 ClassDef(NullAlgorithm, 1)
76 };
77
78 }
79
80 #endif /* ALGORITHM_H */

  ViewVC Help
Powered by ViewVC 1.1.23