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