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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // This is a class for reading ITS SPD raw data files and providing
19 // information about digits
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "AliITSRawStreamSPD.h"
25 ClassImp(AliITSRawStreamSPD)
28 AliITSRawStreamSPD::AliITSRawStreamSPD(AliRawReader* rawReader) :
29 AliITSRawStream(rawReader)
31 // create an object to read ITS SPD raw digits
33 fRawReader->Select(1);
37 Bool_t AliITSRawStreamSPD::Next()
39 // read the next raw digit
40 // returns kFALSE if there is no digit left
42 fPrevModuleID = fModuleID;
43 while (fRawReader->ReadNextShort(fData)) {
45 if ((fData & 0xE000) == 0x6000) { // header
47 UShort_t halfStave = (fData >> 4) & 0x007F;
48 UShort_t chipAddr = fData & 0x000F;
49 fModuleID = 2 * halfStave;
50 if (chipAddr >= 5) fModuleID++;
51 fOffset = 32 * (chipAddr % 5);
52 } else if ((fData & 0xE000) == 0x0000) { // trailer
53 UShort_t hitCount = fData & 0x1FFF;
54 if (hitCount != fHitCount) Error("Next", "wrong number of hits!");
55 } else if ((fData & 0xC000) == 0x8000) { // pixel hit
57 fCoord1 = (fData & 0x001F) + fOffset;
58 fCoord2 = (fData >> 5) & 0x00FF;
61 if (fData != 0xFEDC) Error("Next", "wrong fill word!");