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 "AliTRDrawStream.h"
32 #include "AliTRDrawFastStream.h"
34 #include "AliTRDrawStreamBase.h"
36 //--------------------------------------------------------
37 ClassImp(AliTRDrawStreamBase)
39 Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDrealStream;
41 //_____________________________________________________________________________
42 AliTRDrawStreamBase::AliTRDrawStreamBase()
46 // this is just for API
51 //_____________________________________________________________________________
52 AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/)
56 // this is just for API
61 //_____________________________________________________________________________
62 AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/)
72 //_____________________________________________________________________________
73 AliTRDrawStreamBase::~AliTRDrawStreamBase()
81 //_____________________________________________________________________________
83 AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &)
86 // we are not using this functionality
92 //_____________________________________________________________________________
93 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream()
96 // Returns the selected raw stream implementation
99 if (fgRawStreamVersion == kTRDrealStream)
100 return new AliTRDrawStream();
102 if (fgRawStreamVersion == kTRDsimStream)
103 return new AliTRDrawStream();
105 if (fgRawStreamVersion == kTRDfastStream)
106 return new AliTRDrawFastStream();
108 return new AliTRDrawStreamBase;
111 //_____________________________________________________________________________
112 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader)
115 // Returns the selected raw stream implementation
118 if (fgRawStreamVersion == kTRDrealStream)
119 return new AliTRDrawStream(reader);
121 if (fgRawStreamVersion == kTRDsimStream)
122 return new AliTRDrawStream(reader);
125 if (fgRawStreamVersion == kTRDfastStream){
126 return new AliTRDrawFastStream(reader);}
128 return new AliTRDrawStreamBase;
131 //_____________________________________________________________________________
132 void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt)
135 // Sets the raw stream version
138 fgRawStreamVersion = 0;
140 if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0)
141 fgRawStreamVersion = kTRDsimStream;
143 if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0)
144 fgRawStreamVersion = kTRDrealStream;
146 if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0)
147 fgRawStreamVersion = kTRDrealStream;
149 if (strstr(opt, "fast" ) != 0 || strstr(opt, "FAST") != 0)
150 fgRawStreamVersion = kTRDfastStream;