]>
Commit | Line | Data |
---|---|---|
dfbb4bb9 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id: AliTRDrawStreamBase.cxx 23387 2008-01-17 17:25:16Z cblume $ */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // This class defines access to TRD digits in raw data. // | |
21 | // // | |
22 | // It loops over all TRD digits in the raw data given by the AliRawReader. // | |
23 | // The Next method goes to the next digit. If there are no digits left // | |
24 | // it returns kFALSE. // | |
25 | // Several getters provide information about the current digit. // | |
26 | // // | |
27 | // Author: M. Ploskon (ploskon@ikf.uni-frankfurt.de) // | |
28 | // // | |
29 | /////////////////////////////////////////////////////////////////////////////// | |
30 | ||
31 | #include "AliRawReader.h" | |
32 | ||
987ba9a3 | 33 | #include "AliTRDrawOldStream.h" |
dfbb4bb9 | 34 | #include "AliTRDRawStreamV2.h" |
987ba9a3 | 35 | #include "AliTRDrawStream.h" |
dfbb4bb9 | 36 | |
37 | #include "AliTRDrawStreamBase.h" | |
38 | ||
39 | //-------------------------------------------------------- | |
40 | ClassImp(AliTRDrawStreamBase) | |
41 | ||
6a04e92b | 42 | Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDrealStream; |
dfbb4bb9 | 43 | |
44 | //_____________________________________________________________________________ | |
45 | AliTRDrawStreamBase::AliTRDrawStreamBase() | |
46 | : TObject() | |
47 | { | |
48 | // | |
49 | // this is just for API | |
50 | // | |
51 | ; | |
52 | } | |
53 | ||
54 | //_____________________________________________________________________________ | |
55 | AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/) | |
56 | : TObject() | |
57 | { | |
58 | // | |
59 | // this is just for API | |
60 | // | |
61 | ; | |
62 | } | |
63 | ||
64 | //_____________________________________________________________________________ | |
65 | AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/) | |
66 | : TObject() | |
67 | { | |
68 | // | |
69 | // copy | |
70 | // | |
71 | TRD_NOIMP(); | |
72 | ; | |
73 | } | |
74 | ||
75 | //_____________________________________________________________________________ | |
76 | AliTRDrawStreamBase::~AliTRDrawStreamBase() | |
77 | { | |
78 | // | |
79 | // destructor | |
80 | // | |
81 | ; | |
82 | } | |
83 | ||
84 | //_____________________________________________________________________________ | |
85 | AliTRDrawStreamBase & | |
86 | AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &) | |
87 | { | |
88 | // | |
89 | // we are not using this functionality | |
90 | // | |
91 | TRD_NOIMP(); | |
92 | return *this; | |
93 | } | |
94 | ||
95 | //_____________________________________________________________________________ | |
96 | AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream() | |
97 | { | |
98 | // | |
99 | // Returns the selected raw stream implementation | |
100 | // | |
101 | ||
102 | if (fgRawStreamVersion == kTRDoldStream) | |
987ba9a3 | 103 | return new AliTRDrawOldStream(); |
dfbb4bb9 | 104 | |
105 | if (fgRawStreamVersion == kTRDrealStream) | |
987ba9a3 | 106 | return new AliTRDrawStream(); |
dfbb4bb9 | 107 | |
108 | if (fgRawStreamVersion == kTRDsimStream) | |
109 | { | |
110 | AliTRDRawStreamV2 *rstream = new AliTRDRawStreamV2(); | |
111 | rstream->Init(); | |
112 | return rstream; | |
113 | } | |
114 | ||
115 | return new AliTRDrawStreamBase; | |
116 | } | |
117 | ||
118 | //_____________________________________________________________________________ | |
119 | AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader) | |
120 | { | |
121 | // | |
122 | // Returns the selected raw stream implementation | |
123 | // | |
124 | ||
125 | if (fgRawStreamVersion == kTRDoldStream) | |
987ba9a3 | 126 | return new AliTRDrawOldStream(reader); |
dfbb4bb9 | 127 | |
128 | if (fgRawStreamVersion == kTRDrealStream) | |
987ba9a3 | 129 | return new AliTRDrawStream(reader); |
dfbb4bb9 | 130 | |
131 | if (fgRawStreamVersion == kTRDsimStream) | |
132 | { | |
133 | AliTRDRawStreamV2 *rstream = new AliTRDRawStreamV2(reader); | |
134 | rstream->Init(); | |
135 | return rstream; | |
136 | } | |
137 | return new AliTRDrawStreamBase; | |
138 | } | |
139 | ||
140 | //_____________________________________________________________________________ | |
141 | void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt) | |
142 | { | |
143 | // | |
144 | // Sets the raw stream version | |
145 | // | |
146 | ||
147 | fgRawStreamVersion = 0; | |
148 | ||
149 | if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0) | |
150 | fgRawStreamVersion = kTRDsimStream; | |
151 | ||
152 | if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0) | |
153 | fgRawStreamVersion = kTRDrealStream; | |
154 | ||
155 | if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0) | |
156 | fgRawStreamVersion = kTRDrealStream; | |
157 | ||
158 | if (strstr(opt, "old" ) != 0 || strstr(opt, "OLD") != 0) | |
159 | fgRawStreamVersion = kTRDoldStream; | |
160 | ||
161 | } |