]>
Commit | Line | Data |
---|---|---|
c391f9d9 | 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 | /////////////////////////////////////////////////////////////////////////////// | |
17 | // | |
18 | // This is a class for reading ITS SPD raw data files and providing | |
19 | // information about digits | |
20 | // | |
21 | /////////////////////////////////////////////////////////////////////////////// | |
22 | ||
23 | #include "AliITSRawStreamSPD.h" | |
42d20574 | 24 | #include "AliRawReader.h" |
c391f9d9 | 25 | |
26 | ClassImp(AliITSRawStreamSPD) | |
27 | ||
28 | ||
a864f8e9 | 29 | const Int_t AliITSRawStreamSPD::fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL] = { |
30 | { 0, 1, 4, 5, 80, 81, 84, 85, 88, 89, 92, 93}, | |
31 | { 2, 3, 6, 7, 82, 83, 86, 87, 90, 91, 94, 95}, | |
32 | { 8, 9,12,13, 96, 97,100,101,104,105,108,109}, | |
33 | {10,11,14,15, 98, 99,102,103,106,107,110,111}, | |
34 | {16,17,20,21,112,113,116,117,120,121,124,125}, | |
35 | {18,19,22,23,114,115,118,119,122,123,126,127}, | |
36 | {24,25,28,29,128,129,132,133,136,137,140,141}, | |
37 | {26,27,30,31,130,131,134,135,138,139,142,143}, | |
38 | {32,33,36,37,144,145,148,149,152,153,156,157}, | |
39 | {34,35,38,39,146,147,150,151,154,155,158,159}, | |
40 | {40,41,44,45,160,161,164,165,168,169,172,173}, | |
41 | {42,43,46,47,162,163,166,167,170,171,174,175}, | |
42 | {48,49,52,53,176,177,180,181,184,185,188,189}, | |
43 | {50,51,54,55,178,179,182,183,186,187,190,191}, | |
44 | {56,57,60,61,192,193,196,197,200,201,204,205}, | |
45 | {58,59,62,63,194,195,198,199,202,203,206,207}, | |
46 | {64,65,68,69,208,209,212,213,216,217,220,221}, | |
47 | {66,67,70,71,210,211,214,215,218,219,222,223}, | |
48 | {72,73,76,77,224,225,228,229,232,233,236,237}, | |
49 | {74,75,78,79,226,227,230,231,234,235,238,239} | |
50 | }; | |
51 | ||
52 | ||
7941072e | 53 | AliITSRawStreamSPD::AliITSRawStreamSPD(AliRawReader* rawReader) : |
54 | AliITSRawStream(rawReader) | |
c391f9d9 | 55 | { |
56 | // create an object to read ITS SPD raw digits | |
57 | ||
7941072e | 58 | fRawReader->Select(1); |
c391f9d9 | 59 | } |
60 | ||
61 | ||
62 | Bool_t AliITSRawStreamSPD::Next() | |
63 | { | |
64 | // read the next raw digit | |
65 | // returns kFALSE if there is no digit left | |
66 | ||
67 | fPrevModuleID = fModuleID; | |
7941072e | 68 | while (fRawReader->ReadNextShort(fData)) { |
c391f9d9 | 69 | |
70 | if ((fData & 0xE000) == 0x6000) { // header | |
71 | fHitCount = 0; | |
72 | UShort_t halfStave = (fData >> 4) & 0x007F; | |
73 | UShort_t chipAddr = fData & 0x000F; | |
74 | fModuleID = 2 * halfStave; | |
75 | if (chipAddr >= 5) fModuleID++; | |
76 | fOffset = 32 * (chipAddr % 5); | |
77 | } else if ((fData & 0xE000) == 0x0000) { // trailer | |
78 | UShort_t hitCount = fData & 0x1FFF; | |
79 | if (hitCount != fHitCount) Error("Next", "wrong number of hits!"); | |
80 | } else if ((fData & 0xC000) == 0x8000) { // pixel hit | |
81 | fHitCount++; | |
82 | fCoord1 = (fData & 0x001F) + fOffset; | |
83 | fCoord2 = (fData >> 5) & 0x00FF; | |
84 | return kTRUE; | |
85 | } else { // fill word | |
86 | if (fData != 0xFEDC) Error("Next", "wrong fill word!"); | |
87 | } | |
88 | ||
89 | } | |
90 | ||
91 | return kFALSE; | |
92 | } |