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

Contents of /chewbacca/event/Algorithm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Tue Sep 23 07:19:53 2008 UTC (16 years, 2 months ago) by mocchiut
Branch: v0r00
CVS Tags: v1r02, v1r00, v1r01, start
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
Imported sources, 23/09/2008

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

  ViewVC Help
Powered by ViewVC 1.1.23