]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDrawStreamBase.cxx
Coding rules
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStreamBase.cxx
1 /**************************************************************************\r
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3  *                                                                        *\r
4  * Author: The ALICE Off-line Project.                                    *\r
5  * Contributors are mentioned in the code where appropriate.              *\r
6  *                                                                        *\r
7  * Permission to use, copy, modify and distribute this software and its   *\r
8  * documentation strictly for non-commercial purposes is hereby granted   *\r
9  * without fee, provided that the above copyright notice appears in all   *\r
10  * copies and that both the copyright notice and this permission notice   *\r
11  * appear in the supporting documentation. The authors make no claims     *\r
12  * about the suitability of this software for any purpose. It is          *\r
13  * provided "as is" without express or implied warranty.                  *\r
14  **************************************************************************/\r
15 \r
16 /* $Id: AliTRDrawStreamBase.cxx 23387 2008-01-17 17:25:16Z cblume $ */\r
17 \r
18 ///////////////////////////////////////////////////////////////////////////////\r
19 //                                                                           //\r
20 // This class defines access to TRD digits in raw data.                      //\r
21 //                                                                           //\r
22 // It loops over all TRD digits in the raw data given by the AliRawReader.   //\r
23 // The Next method goes to the next digit. If there are no digits left       //\r
24 // it returns kFALSE.                                                        //\r
25 // Several getters provide information about the current digit.              //\r
26 //                                                                           //\r
27 // Author: M. Ploskon (ploskon@ikf.uni-frankfurt.de)                         //\r
28 //                                                                           //\r
29 ///////////////////////////////////////////////////////////////////////////////\r
30 \r
31 //#include "AliRawReader.h"\r
32 \r
33 #include "AliTRDrawOldStream.h"\r
34 #include "AliTRDrawStream.h"\r
35 \r
36 #include "AliTRDrawStreamBase.h"\r
37 \r
38 //--------------------------------------------------------\r
39 ClassImp(AliTRDrawStreamBase)\r
40 \r
41 Int_t AliTRDrawStreamBase::fgRawStreamVersion = AliTRDrawStreamBase::kTRDrealStream;\r
42 \r
43 //_____________________________________________________________________________\r
44 AliTRDrawStreamBase::AliTRDrawStreamBase()\r
45   : TObject()\r
46 {\r
47   //\r
48   // this is just for API\r
49   //\r
50   ;\r
51 }\r
52 \r
53 //_____________________________________________________________________________\r
54 AliTRDrawStreamBase::AliTRDrawStreamBase(AliRawReader */*rawReader*/)\r
55   : TObject()\r
56 {\r
57   //\r
58   // this is just for API\r
59   //\r
60   ;\r
61 }\r
62 \r
63 //_____________________________________________________________________________\r
64 AliTRDrawStreamBase::AliTRDrawStreamBase(const AliTRDrawStreamBase& /*st*/)\r
65   : TObject()\r
66 {\r
67   //\r
68   // copy\r
69   //\r
70   TRD_NOIMP();\r
71   ;\r
72 }\r
73 \r
74 //_____________________________________________________________________________\r
75 AliTRDrawStreamBase::~AliTRDrawStreamBase()\r
76 {\r
77   //\r
78   // destructor\r
79   //\r
80   ;\r
81 }\r
82 \r
83 //_____________________________________________________________________________\r
84 AliTRDrawStreamBase &\r
85 AliTRDrawStreamBase::operator=(const AliTRDrawStreamBase &)\r
86 {\r
87   //\r
88   // we are not using this functionality\r
89   //\r
90   TRD_NOIMP();\r
91   return *this;\r
92 }\r
93 \r
94 //_____________________________________________________________________________\r
95 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream()\r
96 {\r
97   //\r
98   // Returns the selected raw stream implementation\r
99   //\r
100 \r
101   if (fgRawStreamVersion == kTRDoldStream)\r
102     return new AliTRDrawOldStream();\r
103 \r
104   if (fgRawStreamVersion == kTRDrealStream)\r
105     return new AliTRDrawStream();\r
106 \r
107   if (fgRawStreamVersion == kTRDsimStream)\r
108     return new AliTRDrawStream();\r
109   \r
110   return new AliTRDrawStreamBase;\r
111 }\r
112 \r
113 //_____________________________________________________________________________\r
114 AliTRDrawStreamBase *AliTRDrawStreamBase::GetRawStream(AliRawReader *reader)\r
115 {\r
116   //\r
117   // Returns the selected raw stream implementation\r
118   //\r
119 \r
120   if (fgRawStreamVersion == kTRDoldStream)\r
121     return new AliTRDrawOldStream(reader);\r
122 \r
123   if (fgRawStreamVersion == kTRDrealStream)\r
124     return new AliTRDrawStream(reader);\r
125 \r
126   if (fgRawStreamVersion == kTRDsimStream)\r
127     return new AliTRDrawStream(reader);\r
128 \r
129   return new AliTRDrawStreamBase;\r
130 }\r
131 \r
132 //_____________________________________________________________________________\r
133 void AliTRDrawStreamBase::SetRawStreamVersion(const char *opt) \r
134\r
135   //\r
136   // Sets the raw stream version\r
137   //\r
138 \r
139   fgRawStreamVersion = 0; \r
140 \r
141   if (strstr(opt, "sim" ) != 0 || strstr(opt, "SIM") != 0) \r
142     fgRawStreamVersion = kTRDsimStream; \r
143 \r
144   if (strstr(opt, "tb" ) != 0 || strstr(opt, "TB") != 0) \r
145     fgRawStreamVersion = kTRDrealStream; \r
146 \r
147   if (strstr(opt, "real" ) != 0 || strstr(opt, "REAL") != 0) \r
148     fgRawStreamVersion = kTRDrealStream; \r
149 \r
150   if (strstr(opt, "old" ) != 0 || strstr(opt, "OLD") != 0) \r
151     fgRawStreamVersion = kTRDoldStream; \r
152       \r
153 }\r