]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRawStream.cxx
renamed CorrectionMatrix class
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRawStream.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$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 ///
20 /// This class provides access to PHOS digits in raw data.
21 ///
22 /// It loops over all PHOS 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 /// usage: 
27 /// root > AliRawReaderFile rawReader ; 
28 /// root > AliPHOSRawStream input(&rawReader) ; 
29 /// root > while (input.Next()) ..... 
30 ///////////////////////////////////////////////////////////////////////////////
31
32 #include "AliPHOSRawStream.h"
33 #include "AliRawReader.h"
34
35 ClassImp(AliPHOSRawStream)
36
37
38 //_____________________________________________________________________________
39 AliPHOSRawStream::AliPHOSRawStream(AliRawReader* rawReader) :
40   AliAltroRawStream(rawReader),
41   fModule(-1),
42   fPrevModule(-1),
43   fRow(-1),
44   fPrevRow(-1),
45   fColumn(-1),
46   fPrevColumn(-1)
47 {
48 // create an object to read PHOS raw digits
49
50   SelectRawData(6);
51
52   fNoAltroMapping = kTRUE;
53 }
54
55 //_____________________________________________________________________________
56 AliPHOSRawStream::AliPHOSRawStream(const AliPHOSRawStream& stream) :
57   AliAltroRawStream(stream),
58   fModule(-1),
59   fPrevModule(-1),
60   fRow(-1),
61   fPrevRow(-1),
62   fColumn(-1),
63   fPrevColumn(-1)
64 {  
65   Fatal("AliPHOSRawStream", "copy constructor not implemented");
66 }
67
68 //_____________________________________________________________________________
69 AliPHOSRawStream& AliPHOSRawStream::operator = (const AliPHOSRawStream& 
70                                               /* stream */)
71 {
72   Fatal("operator =", "assignment operator not implemented");
73   return *this;
74 }
75
76 //_____________________________________________________________________________
77 AliPHOSRawStream::~AliPHOSRawStream()
78 {
79 // destructor
80 }
81
82 //_____________________________________________________________________________
83 void AliPHOSRawStream::Reset()
84 {
85   // reset phos raw stream params
86   AliAltroRawStream::Reset();
87   fModule = fPrevModule = fRow = fPrevRow = fColumn = fPrevColumn = -1;
88 }
89
90 //_____________________________________________________________________________
91 Bool_t AliPHOSRawStream::Next()
92 {
93   // Read next PHOS signal
94   // Apply the PHOS altro mapping to get
95   // the module,row and column indeces
96   fPrevModule = fModule;
97   fPrevRow = fRow;
98   fPrevColumn = fColumn;
99   if (AliAltroRawStream::Next()) {
100     //    if (IsNewHWAddress())
101     ApplyAltroMapping();
102     return kTRUE;
103   }
104   else
105     return kFALSE;
106 }
107
108 //_____________________________________________________________________________
109 void AliPHOSRawStream::ApplyAltroMapping()
110 {
111   // Take the DDL index, load
112   // the corresponding altro mapping
113   // object and fill the sector,row and pad indeces
114   fModule = fSegmentation[0];
115   fRow = fSegmentation[1];
116   fColumn = fSegmentation[2];
117 }