]>
Commit | Line | Data |
---|---|---|
d04aea32 | 1 | // @(#) $Id$ |
5ea08be4 | 2 | // Author: Fons Rademakers 26/11/99 |
5ea08be4 | 3 | |
35aa01d6 | 4 | /************************************************************************** |
5 | * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. * | |
6 | * * | |
7 | * Author: The ALICE Off-line Project. * | |
8 | * Contributors are mentioned in the code where appropriate. * | |
9 | * * | |
10 | * Permission to use, copy, modify and distribute this software and its * | |
11 | * documentation strictly for non-commercial purposes is hereby granted * | |
12 | * without fee, provided that the above copyright notice appears in all * | |
13 | * copies and that both the copyright notice and this permission notice * | |
14 | * appear in the supporting documentation. The authors make no claims * | |
15 | * about the suitability of this software for any purpose. It is * | |
16 | * provided "as is" without express or implied warranty. * | |
17 | **************************************************************************/ | |
18 | ||
19 | ////////////////////////////////////////////////////////////////////////// | |
20 | // // | |
21 | // AliRawEvent // | |
22 | // // | |
23 | // Set of classes defining the ALICE RAW event format. The AliRawEvent // | |
24 | // class defines a RAW event. It consists of an AliEventHeader object // | |
25 | // an AliEquipmentHeader object, an AliRawData object and an array of // | |
26 | // sub-events, themselves also being AliRawEvents. The number of // | |
27 | // sub-events depends on the number of DATE LDC's. // | |
28 | // The AliRawEvent objects are written to a ROOT file using different // | |
29 | // technologies, i.e. to local disk via AliRawDB or via rfiod using // | |
30 | // AliRawRFIODB or via rootd using AliRawRootdDB or to CASTOR via // | |
31 | // rootd using AliRawCastorDB (and for performance testing there is // | |
32 | // also AliRawNullDB). // | |
35aa01d6 | 33 | // The AliStats class provides statics information that is added as // |
34 | // a single keyed object to each raw file. // | |
35 | // The AliTagDB provides an interface to a TAG database. // | |
36 | // The AliMDC class is usid by the "alimdc" stand-alone program // | |
37 | // that reads data directly from DATE. // | |
38 | // // | |
39 | ////////////////////////////////////////////////////////////////////////// | |
40 | ||
a197a4ce | 41 | #include <TObjArray.h> |
5ea08be4 | 42 | |
f2dc6b20 | 43 | #include "AliLog.h" |
44 | ||
45 | #include "AliRawEventHeaderBase.h" | |
94d918a7 | 46 | #include "AliRawEquipment.h" |
5ea08be4 | 47 | |
48 | #include "AliRawEvent.h" | |
49 | ||
5ea08be4 | 50 | |
51 | ClassImp(AliRawEvent) | |
5ea08be4 | 52 | |
5ea08be4 | 53 | |
54 | //______________________________________________________________________________ | |
f3c1e83c | 55 | AliRawEvent::AliRawEvent(): |
56 | fNEquipments(0), | |
57 | fNSubEvents(0), | |
58 | fEvtHdr(NULL), | |
59 | fEquipments(NULL), | |
60 | fSubEvents(NULL) | |
5ea08be4 | 61 | { |
a197a4ce | 62 | // Create ALICE event object. If ownData is kFALSE we will use a static |
63 | // raw data object, otherwise a private copy will be made. | |
5ea08be4 | 64 | |
5ea08be4 | 65 | } |
66 | ||
f2dc6b20 | 67 | //______________________________________________________________________________ |
68 | AliRawEventHeaderBase *AliRawEvent::GetHeader() | |
69 | { | |
70 | if (!fEvtHdr) { | |
33314186 | 71 | AliFatal("Event header does not exist!"); |
72 | return 0x0; | |
73 | } | |
c51de60d | 74 | |
f2dc6b20 | 75 | return fEvtHdr; |
c51de60d | 76 | } |
77 | ||
5ea08be4 | 78 | //______________________________________________________________________________ |
62b52349 | 79 | AliRawVEquipment *AliRawEvent::GetEquipment(Int_t index) const |
5ea08be4 | 80 | { |
94d918a7 | 81 | // Get specified equipment. Returns 0 if equipment does not exist. |
5ea08be4 | 82 | |
94d918a7 | 83 | if (!fEquipments) |
84 | return 0; | |
5ea08be4 | 85 | |
94d918a7 | 86 | return (AliRawEquipment *) fEquipments->At(index); |
5ea08be4 | 87 | } |
88 | ||
89 | //______________________________________________________________________________ | |
62b52349 | 90 | AliRawVEvent *AliRawEvent::GetSubEvent(Int_t index) |
04fa961a | 91 | { |
5459c838 | 92 | // Get specified sub event. Returns 0 if sub event does not exist. |
93 | ||
94 | if (!fSubEvents) | |
95 | return 0; | |
96 | ||
97 | return (AliRawEvent *) fSubEvents->At(index); | |
04fa961a | 98 | } |
99 | ||
5ea08be4 | 100 | //______________________________________________________________________________ |
101 | AliRawEvent::~AliRawEvent() | |
102 | { | |
103 | // Clean up event object. Delete also, possible, private raw data. | |
104 | ||
105 | delete fEvtHdr; | |
94d918a7 | 106 | if (fEquipments) |
107 | fEquipments->Delete(); | |
108 | delete fEquipments; | |
5ea08be4 | 109 | if (fSubEvents) |
110 | fSubEvents->Delete(); | |
111 | delete fSubEvents; | |
112 | } | |
33314186 | 113 | |
114 | //______________________________________________________________________________ | |
115 | void AliRawEvent::Streamer(TBuffer &R__b) | |
116 | { | |
117 | // Stream an object of class AliRawEvent. | |
118 | ||
119 | UInt_t R__s, R__c; | |
120 | if (R__b.IsReading()) { | |
121 | Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } | |
122 | TObject::Streamer(R__b); | |
123 | R__b >> fNEquipments; | |
124 | R__b >> fNSubEvents; | |
125 | R__b >> fEvtHdr; | |
126 | R__b >> fEquipments; | |
127 | R__b >> fSubEvents; | |
128 | R__b.CheckByteCount(R__s, R__c, AliRawEvent::IsA()); | |
129 | } else { | |
130 | R__c = R__b.WriteVersion(AliRawEvent::IsA(), kTRUE); | |
131 | TObject::Streamer(R__b); | |
132 | R__b << fNEquipments; | |
133 | R__b << fNSubEvents; | |
134 | R__b << fEvtHdr; | |
135 | R__b << fEquipments; | |
136 | R__b << fSubEvents; | |
137 | R__b.SetByteCount(R__c, kTRUE); | |
138 | } | |
139 | } |