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