Parent Directory | Revision Log
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 | /** @file |
2 | * $Author: Maurizio Nagni $ |
3 | * $Date: 2005/08/29 09:45:48 $ |
4 | * $Revision: 5.0 $ |
5 | * |
6 | * Implementation of the CalibHeaderReader class. |
7 | */ |
8 | |
9 | #include "ReaderAlgorithms.h" |
10 | |
11 | using namespace pamela::techmodel; |
12 | |
13 | static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibHeaderReader")); |
14 | |
15 | /** |
16 | * Constructor. |
17 | */ |
18 | CalibHeaderReader::CalibHeaderReader(void): |
19 | TechmodelAlgorithm(PacketType::CalibHeader, "TechmodelCalibHeaderReader") { |
20 | logger->debug(_T("Constructor")); |
21 | calibHeader = new CalibHeaderEvent(); |
22 | } |
23 | |
24 | /** |
25 | * Get a string with the version info of the algorithm. |
26 | */ |
27 | std::string CalibHeaderReader::GetVersionInfo(void) const { |
28 | return |
29 | "$Header: /home/cvsmanager/yoda/techmodel/CalibHeaderReader.cpp,v 5.0 2005/08/29 09:46:13 Maurizio Nagni Exp $\n"; |
30 | } |
31 | |
32 | /** |
33 | * Initialize the algorithm with a special run. This will initialize the |
34 | * event reader routines for all packet types. |
35 | */ |
36 | void CalibHeaderReader::Init(PamelaRun *run) { |
37 | logger->debug(_T("Initialize")); |
38 | SetInputStream(run); |
39 | run->WriteSubPacket(this, &calibHeader, calibHeader->Class()); |
40 | } |
41 | |
42 | /** |
43 | * Unpack the CalibHeader event from an input file. |
44 | */ |
45 | void CalibHeaderReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ |
46 | char subData[dataLength]; |
47 | UINT16 subCRC; //calculated CRC of the data |
48 | UINT16 readCRC; //CRC read from the end of the subpacket |
49 | long int length = dataLength - 2; //the block of data |
50 | |
51 | InputFile->read(subData, sizeof(subData)); |
52 | subCRC = CM_Compute_CRC16(0, (UINT8*)subData, length); |
53 | readCRC = (((UINT16)(subData[dataLength - 2]<<8))&0xFF00) + (((UINT16)subData[dataLength - 1])&0x00FF); |
54 | |
55 | if (subCRC != readCRC) throw WrongCRCException(" Wrong CRC for CalibHeader Packet "); |
56 | } |
57 |
ViewVC Help | |
Powered by ViewVC 1.1.23 |