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

Annotation of /yoda/event/Algorithm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5.1 - (hide annotations) (download)
Sat Feb 4 12:37:42 2006 UTC (18 years, 9 months ago) by kusanagi
Branch: MAIN
Changes since 5.0: +3 -6 lines
File MIME type: text/plain
Several new features in this release:
a) all the packets are conform to the Mass Memory Format specifications (http://people.roma2.infn.it/~cpu/Mass_Memory_Format.html)
b) unpacking either using the old files structure OR the new one file unpacking.
c) parametrized root files compression factor
d) deleting of the following packet: TofTest, TrkTest, TrkEvent.
e) the Tracker routines now work without the use of temp files.

The point a) allow Yoda to unpack in the root file all the packets generated by the CPU. According to the MassMemoryFormat; that is three possible data are available:

1) almost explicit structure of the packet (like for Log, Tracker, Mcmd, etc....);
2) dummy data collection structure (InitHeader, InitTrailer, CalibHeader, CalibTrailer);
3) just the data of the packet (almost all Alarm and Init procedures). The class regarding this packets have only one parameters, a TArrayC class, which contain the data-block included in the packet (tat is the data below the packet Header).

The point b) has been implemented as a consequence of an agreement about a more compact structure of the unpacked data. Up to now the structure of each unpacked data consisted of a folder, named after the packet type, and three files: xxx.Header.root, xxx.NamePacket.root, xxx.Registry.root.
Starting from this release YODA, by default will unpack the data in a unique root file. The structure of this file will consist of:
- several TTree(s) named after the packet type;
- into each TTree are foreseen three TBranche(s):
    - 'Header'  (the old xxx.Header.root file)
    - 'NameOfThePacket' (the old xxx.Event.root file or the xxx.Event.DETECTOR.root)
    - 'Registry' (the old xxx.Registry.root file)

Anyway is still possible, but deprecated, to unpack using the old structure, passing to the "yoda" command the optional parameter "-multifile"

The point c) has been implemented because is well know that writing time in a TTree is as much fast as much lower is the compression factor for the root file; anyway for a PAMELA dat file, a compression equal to 0 will generate a root file which will be more than two times the original size. To modify the compression parameter just add the optional parameter "-c [0-9]" to the yoda command line.

1 kusanagi 1.1 /** @file
2 kusanagi 1.2 * $Source: /home/cvsmanager/yoda/event/Algorithm.h,v $
3 kusanagi 5.1 * $Id: Algorithm.h,v 5.0 2005/08/29 09:45:48 Maurizio Nagni Exp $
4     * $Author: Maurizio Nagni $
5 kusanagi 1.1 *
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 kusanagi 5.1 #include "PacketType.h"
13 kusanagi 1.1
14 kusanagi 1.2
15 kusanagi 1.1 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 kusanagi 1.2
36 kusanagi 1.1 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