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

Contents of /yoda/event/Algorithm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.0 - (show annotations) (download)
Fri Mar 4 15:54:11 2005 UTC (19 years, 9 months ago) by kusanagi
Branch: MAIN
Changes since 2.1: +1 -1 lines
File MIME type: text/plain
Error proof version.
Implemented all detectors packets plus all the main telemetries packets.
Missing all the Init and Alarm packets.
Disabled CRC control on VarDump, ArrDump, TabDump for CPU debugging needs
(the data formats seems correct even if CRC get wrong)

1 /** @file
2 * $Source: /home/cvsmanager/yoda/event/Algorithm.h,v $
3 * $Id: Algorithm.h,v 2.1 2004/12/03 22:04:04 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