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 "AliTRDrawOldStream.h"
34 #include "AliTRDrawStream.h"
36 #include "AliTRDrawStreamBase.h"
38 //--------------------------------------------------------
39 ClassImp(AliTRDrawStreamBase)
41 Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDrealStream;
43 //_____________________________________________________________________________
44 AliTRDrawStreamBase::AliTRDrawStreamBase()
48 // this is just for API
53 //_____________________________________________________________________________
54 AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/)
58 // this is just for API
63 //_____________________________________________________________________________
64 AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/)
74 //_____________________________________________________________________________
75 AliTRDrawStreamBase::~AliTRDrawStreamBase()
83 //_____________________________________________________________________________
85 AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &)
88 // we are not using this functionality
94 //_____________________________________________________________________________
95 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream()
98 // Returns the selected raw stream implementation
101 if (fgRawStreamVersion == kTRDoldStream)
102 return new AliTRDrawOldStream();
104 if (fgRawStreamVersion == kTRDrealStream)
105 return new AliTRDrawStream();
107 if (fgRawStreamVersion == kTRDsimStream)
108 return new AliTRDrawStream();
110 return new AliTRDrawStreamBase;
113 //_____________________________________________________________________________
114 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader)
117 // Returns the selected raw stream implementation
120 if (fgRawStreamVersion == kTRDoldStream)
121 return new AliTRDrawOldStream(reader);
123 if (fgRawStreamVersion == kTRDrealStream)
124 return new AliTRDrawStream(reader);
126 if (fgRawStreamVersion == kTRDsimStream)
127 return new AliTRDrawStream(reader);
129 return new AliTRDrawStreamBase;
132 //_____________________________________________________________________________
133 void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt)
136 // Sets the raw stream version
139 fgRawStreamVersion = 0;
141 if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0)
142 fgRawStreamVersion = kTRDsimStream;
144 if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0)
145 fgRawStreamVersion = kTRDrealStream;
147 if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0)
148 fgRawStreamVersion = kTRDrealStream;
150 if (strstr(opt, "old" ) != 0 || strstr(opt, "OLD") != 0)
151 fgRawStreamVersion = kTRDoldStream;