/[PAMELA software]/yoda/techmodel/AcAlarmReader.cpp
ViewVC logotype

Contents of /yoda/techmodel/AcAlarmReader.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5.3 - (show annotations) (download)
Tue Feb 7 10:43:06 2006 UTC (18 years, 10 months ago) by kusanagi
Branch: MAIN
Changes since 5.2: +3 -3 lines
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: kusanagi $
3 * $Date: 2006/02/07 10:36:43 $
4 * $Revision: 5.2 $
5 *
6 * Implementation of the AcAlarmReader class.
7 */
8
9
10 #include <log4cxx/logger.h>
11 #include "ReaderAlgorithms.h"
12
13 using namespace pamela;
14 using namespace pamela::techmodel;
15
16 static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.AcAlarmReader"));
17
18 /**
19 * Constructor.
20 */
21 AcAlarmReader::AcAlarmReader(void):
22 TechmodelAlgorithm(PacketType::AcAlarm, "TechmodelAcAlarmReader") {
23 logger->debug(_T("Constructor"));
24 acAlarm = new AcAlarmEvent();
25 }
26
27 /**
28 * Get a string with the version info of the algorithm.
29 */
30 std::string AcAlarmReader::GetVersionInfo(void) const {
31 return
32 "$Trailer: /home/cvsmanager/yoda/techmodel/acAlarmReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n";
33 }
34
35 /**
36 * Initialize the algorithm with a special run. This will initialize the
37 * event reader routines for all packet types.
38 */
39 void AcAlarmReader::Init(PamelaRun *run) {
40 SetInputStream(run);
41 run->WriteSubPacket(this, &acAlarm, acAlarm->Class());
42 logger->debug(_T("Initialize"));
43 }
44
45 /**
46 * Unpack the AcAlarm event from an input file.
47 */
48 void AcAlarmReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){
49
50 logger->warn(_T("Missing definition.... not read"));
51 char subData[dataLength];
52 InputFile->read(subData, sizeof(unsigned char)*dataLength);
53
54
55 }
56

  ViewVC Help
Powered by ViewVC 1.1.23