/[PAMELA software]/quicklook/OrbitalRate/inc/Algorithm.h
ViewVC logotype

Annotation of /quicklook/OrbitalRate/inc/Algorithm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Dec 5 19:49:13 2006 UTC (18 years ago) by pam-rm2
Branch: MAIN
CVS Tags: v2r02, v2r01, v2r00, HEAD
File MIME type: text/plain
New version of OrbitalRate quicklook.  Initial import.
Nico

1 pam-rm2 1.1 /** @file
2     * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/event/Algorithm.h,v $
3     * $Id: Algorithm.h,v 6.0 2006/02/07 17:11:06 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 <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