/[PAMELA software]/yoda/techmodel/EventReader.h
ViewVC logotype

Annotation of /yoda/techmodel/EventReader.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5.1 - (hide annotations) (download)
Sat Feb 4 12:37:45 2006 UTC (18 years, 10 months ago) by kusanagi
Branch: MAIN
Changes since 5.0: +3 -4 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 5.1 * $Author: Maurizio Nagni $
3     * $Date: 2005/08/29 09:46:13 $
4     * $Revision: 5.0 $
5 kusanagi 1.1 *
6     * Header file for the algorithms used to read the techmodel data file.
7     */
8    
9     #include "TechmodelPamelaRun.h"
10     #include "TechmodelAlgorithm.h"
11    
12     namespace pamela {
13     namespace techmodel {
14     /**
15     * Main event reader algorithm. It handles all other specific
16     * reader algorithms.
17     */
18     class EventReader: public TechmodelAlgorithm {
19     private:
20     /**
21     * A map with an algorithm to read the techmodel file with the packet
22     * type as key.
23     */
24     typedef std::map<const PacketType *, TechmodelAlgorithm *> AlgorithmMap;
25     /**
26     * The map that links every packet type to an algorithm that reads it.
27     */
28     AlgorithmMap TechmodelAlgorithmMap; //!
29     /**
30     * The event header.
31     */
32     EventHeader* Header; //!
33     /**
34     * The Run that is processed.
35     */
36     TechmodelPamelaRun *Run; //!
37 kusanagi 4.5 void UnpackPscuHeader(void) throw (WrongCRCHeaderException, LengthException, BackwardCounterException);
38 kusanagi 1.1 void UnpackPscuTrailer(void) throw (std::exception);
39 kusanagi 1.3
40     /**
41     maxPackets define the maximum number of packets
42     the user wants to get from the raw file.
43     By default is initialized to -1 (no limit)
44     */
45     static unsigned int maxPackets;
46    
47     /**
48     prevPckCounter and prevPckOBT are used to check the
49     integrity of the raw file stream
50     */
51 kusanagi 1.2 static unsigned int prevPckCounter;
52     static unsigned int prevPckOBT;
53 kusanagi 2.1 std::stringstream oss;
54     public:
55 kusanagi 1.3 //EventReader(void);
56     EventReader(int);
57 kusanagi 1.1 virtual void Init(PamelaRun *);
58     virtual void RunEvent(int);
59     virtual std::string GetVersionInfo(void) const;
60 kusanagi 2.2 virtual bool FindStart(void) throw (std::exception);
61 kusanagi 1.1 ClassDef(EventReader, 1)
62     };
63     }
64     }

  ViewVC Help
Powered by ViewVC 1.1.23