Get correct MCM numbering in GetMCMStatus
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRawStream.cxx
CommitLineData
65792ca0 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.
b7f3cbac 26/// usage:
27/// root > AliRawReaderFile rawReader ;
28/// root > AliPHOSRawStream input(&rawReader) ;
29/// root > while (input.Next()) .....
65792ca0 30///////////////////////////////////////////////////////////////////////////////
31
32#include "AliPHOSRawStream.h"
33#include "AliRawReader.h"
65792ca0 34
c2b19535 35ClassImp(AliPHOSRawStream)
65792ca0 36
f88e2313 37
65792ca0 38//_____________________________________________________________________________
f88e2313 39AliPHOSRawStream::AliPHOSRawStream(AliRawReader* rawReader) :
7b916e14 40 AliAltroRawStream(rawReader),
41 fModule(-1),
42 fPrevModule(-1),
43 fRow(-1),
44 fPrevRow(-1),
45 fColumn(-1),
46 fPrevColumn(-1)
65792ca0 47{
f88e2313 48// create an object to read PHOS raw digits
65792ca0 49
362c9d61 50 SelectRawData("PHOS");
7b916e14 51
52 fNoAltroMapping = kTRUE;
53}
54
55//_____________________________________________________________________________
56AliPHOSRawStream::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//_____________________________________________________________________________
69AliPHOSRawStream& AliPHOSRawStream::operator = (const AliPHOSRawStream&
70 /* stream */)
71{
72 Fatal("operator =", "assignment operator not implemented");
73 return *this;
74}
75
76//_____________________________________________________________________________
77AliPHOSRawStream::~AliPHOSRawStream()
78{
79// destructor
80}
81
82//_____________________________________________________________________________
83void AliPHOSRawStream::Reset()
84{
85 // reset phos raw stream params
86 AliAltroRawStream::Reset();
87 fModule = fPrevModule = fRow = fPrevRow = fColumn = fPrevColumn = -1;
88}
89
90//_____________________________________________________________________________
91Bool_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//_____________________________________________________________________________
109void 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];
65792ca0 117}