1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 /// This class provides access to PHOS digits in raw data.
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.
27 /// root > AliRawReaderFile rawReader ;
28 /// root > AliPHOSRawStream input(&rawReader) ;
29 /// root > while (input.Next()) .....
30 ///////////////////////////////////////////////////////////////////////////////
35 #include "AliPHOSRawStream.h"
36 #include "AliRawReader.h"
37 #include "AliPHOSAltroMapping.h"
39 ClassImp(AliPHOSRawStream)
42 //_____________________________________________________________________________
43 AliPHOSRawStream::AliPHOSRawStream(AliRawReader* rawReader) :
44 AliAltroRawStream(rawReader),
53 // create an object to read PHOS raw digits
55 SelectRawData("PHOS");
57 TString path = gSystem->Getenv("ALICE_ROOT");
58 path += "/PHOS/mapping/RCU";
60 for(Int_t i = 0; i < 4; i++) {
64 fMapping[i] = new AliPHOSAltroMapping(path2.Data());
67 SetNoAltroMapping(kFALSE);
70 //_____________________________________________________________________________
71 AliPHOSRawStream::AliPHOSRawStream(const AliPHOSRawStream& stream) :
72 AliAltroRawStream(stream),
81 Fatal("AliPHOSRawStream", "copy constructor not implemented");
84 //_____________________________________________________________________________
85 AliPHOSRawStream& AliPHOSRawStream::operator = (const AliPHOSRawStream&
88 Fatal("operator =", "assignment operator not implemented");
92 //_____________________________________________________________________________
93 AliPHOSRawStream::~AliPHOSRawStream()
97 for(Int_t i = 0; i < 4; i++) delete fMapping[i];
100 //_____________________________________________________________________________
101 void AliPHOSRawStream::Reset()
103 // reset phos raw stream params
104 AliAltroRawStream::Reset();
105 fModule = fPrevModule = fRow = fPrevRow = fColumn = fPrevColumn = -1;
109 //_____________________________________________________________________________
110 Bool_t AliPHOSRawStream::Next()
112 // Read next PHOS signal
113 // Apply the PHOS altro mapping to get
114 // the module,row and column indeces
115 fPrevModule = fModule;
117 fPrevColumn = fColumn;
118 if (AliAltroRawStream::Next()) {
119 if (IsNewHWAddress())
127 //_____________________________________________________________________________
128 void AliPHOSRawStream::ApplyAltroMapping()
130 // Take the DDL index, load
131 // the corresponding altro mapping
132 // object and fill the sector,row and pad indeces
133 Int_t ddlNumber = GetDDLNumber();
134 fModule = ddlNumber / 4;
136 Int_t rcuIndex = ddlNumber % 4;
138 Short_t hwAddress = GetHWAddress();
139 fRow = fMapping[rcuIndex]->GetPadRow(hwAddress);
140 fColumn = fMapping[rcuIndex]->GetPad(hwAddress);
141 fGain = fMapping[rcuIndex]->GetSector(hwAddress);