1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliTRDrawStreamBase.cxx 23387 2008-01-17 17:25:16Z cblume $ */
18 ///////////////////////////////////////////////////////////////////////////////
20 // This class defines access to TRD digits in raw data. //
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. //
27 // Author: M. Ploskon (ploskon@ikf.uni-frankfurt.de) //
29 ///////////////////////////////////////////////////////////////////////////////
31 #include "AliRawReader.h"
33 #include "AliTRDRawStream.h"
34 #include "AliTRDRawStreamV2.h"
35 #include "AliTRDrawStreamTB.h"
37 #include "AliTRDrawStreamBase.h"
39 //--------------------------------------------------------
40 ClassImp(AliTRDrawStreamBase)
42 Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDsimStream;
44 //_____________________________________________________________________________
45 AliTRDrawStreamBase::AliTRDrawStreamBase()
49 // this is just for API
54 //_____________________________________________________________________________
55 AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/)
59 // this is just for API
64 //_____________________________________________________________________________
65 AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/)
75 //_____________________________________________________________________________
76 AliTRDrawStreamBase::~AliTRDrawStreamBase()
84 //_____________________________________________________________________________
86 AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &)
89 // we are not using this functionality
95 //_____________________________________________________________________________
96 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream()
99 // Returns the selected raw stream implementation
102 if (fgRawStreamVersion == kTRDoldStream)
103 return new AliTRDRawStream();
105 if (fgRawStreamVersion == kTRDrealStream)
106 return new AliTRDrawStreamTB();
108 if (fgRawStreamVersion == kTRDsimStream)
110 AliTRDRawStreamV2 *rstream = new AliTRDRawStreamV2();
115 return new AliTRDrawStreamBase;
118 //_____________________________________________________________________________
119 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader)
122 // Returns the selected raw stream implementation
125 if (fgRawStreamVersion == kTRDoldStream)
126 return new AliTRDRawStream(reader);
128 if (fgRawStreamVersion == kTRDrealStream)
129 return new AliTRDrawStreamTB(reader);
131 if (fgRawStreamVersion == kTRDsimStream)
133 AliTRDRawStreamV2 *rstream = new AliTRDRawStreamV2(reader);
137 return new AliTRDrawStreamBase;
140 //_____________________________________________________________________________
141 void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt)
144 // Sets the raw stream version
147 fgRawStreamVersion = 0;
149 if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0)
150 fgRawStreamVersion = kTRDsimStream;
152 if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0)
153 fgRawStreamVersion = kTRDrealStream;
155 if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0)
156 fgRawStreamVersion = kTRDrealStream;
158 if (strstr(opt, "old" ) != 0 || strstr(opt, "OLD") != 0)
159 fgRawStreamVersion = kTRDoldStream;