Fix Coverity defects
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStreamBase.cxx
CommitLineData
615f0826 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
ef1860eb 31#include "AliTRDrawStreamOld.h"
d60fe037 32#include "AliTRDrawStream.h"
615f0826 33
34#include "AliTRDrawStreamBase.h"
35
36//--------------------------------------------------------
37ClassImp(AliTRDrawStreamBase)
38
732bb806 39Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDdefaultStream;
615f0826 40
41//_____________________________________________________________________________
42AliTRDrawStreamBase::AliTRDrawStreamBase()
43 : TObject()
44{
45 //
46 // this is just for API
47 //
48 ;
49}
50
51//_____________________________________________________________________________
52AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/)
53 : TObject()
54{
55 //
56 // this is just for API
57 //
58 ;
59}
60
61//_____________________________________________________________________________
62AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/)
63 : TObject()
64{
65 //
66 // copy
67 //
68 TRD_NOIMP();
69 ;
70}
71
72//_____________________________________________________________________________
73AliTRDrawStreamBase::~AliTRDrawStreamBase()
74{
75 //
76 // destructor
77 //
78 ;
79}
80
81//_____________________________________________________________________________
82AliTRDrawStreamBase &
83AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &)
84{
85 //
86 // we are not using this functionality
87 //
88 TRD_NOIMP();
89 return *this;
90}
91
92//_____________________________________________________________________________
93AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream()
94{
95 //
96 // Returns the selected raw stream implementation
97 //
98
99 if (fgRawStreamVersion == kTRDrealStream)
ef1860eb 100 return new AliTRDrawStreamOld();
615f0826 101
102 if (fgRawStreamVersion == kTRDsimStream)
ef1860eb 103 return new AliTRDrawStreamOld();
615f0826 104
db10d95a 105 //if (fgRawStreamVersion == kTRDfastStream)
106 // return new AliTRDrawFastStream();
615f0826 107
d60fe037 108 if (fgRawStreamVersion == kTRDdefaultStream)
109 return new AliTRDrawStream();
110
615f0826 111 return new AliTRDrawStreamBase;
112}
113
114//_____________________________________________________________________________
115AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader)
116{
117 //
118 // Returns the selected raw stream implementation
119 //
120
121 if (fgRawStreamVersion == kTRDrealStream)
ef1860eb 122 return new AliTRDrawStreamOld(reader);
615f0826 123
124 if (fgRawStreamVersion == kTRDsimStream)
ef1860eb 125 return new AliTRDrawStreamOld(reader);
615f0826 126
127
db10d95a 128 //if (fgRawStreamVersion == kTRDfastStream){
129 // return new AliTRDrawFastStream(reader);}
615f0826 130
d60fe037 131 if (fgRawStreamVersion == kTRDdefaultStream)
132 return new AliTRDrawStream(reader);
133
615f0826 134 return new AliTRDrawStreamBase;
135}
136
137//_____________________________________________________________________________
138void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt)
139{
140 //
141 // Sets the raw stream version
142 //
143
144 fgRawStreamVersion = 0;
145
146 if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0)
147 fgRawStreamVersion = kTRDsimStream;
148
149 if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0)
150 fgRawStreamVersion = kTRDrealStream;
151
152 if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0)
153 fgRawStreamVersion = kTRDrealStream;
154
db10d95a 155 //if (strstr(opt, "fast" ) != 0 || strstr(opt, "FAST") != 0)
156 // fgRawStreamVersion = kTRDfastStream;
d60fe037 157
158 if (strstr(opt, "default" ) != 0 || strstr(opt, "DEFAULT") != 0)
159 fgRawStreamVersion = kTRDdefaultStream;
615f0826 160
161}
162