Adding some further mother volumes to speed-up the overlap checking and particle...
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSSDv1.cxx
CommitLineData
38300302 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/// This class provides access to beam test ITS SSD digits in raw data.
20// Modified by Enrico Fragiacomo, October 2004, for beamtest analysis
21///
22///////////////////////////////////////////////////////////////////////////////
23
24#include "AliITSRawStreamSSDv1.h"
25#include "AliRawReader.h"
26
27ClassImp(AliITSRawStreamSSDv1)
28
29
30AliITSRawStreamSSDv1::AliITSRawStreamSSDv1(AliRawReader* rawReader) :
e56160b8 31 AliITSRawStreamSSD(rawReader),
32fADModule(0),
33fADC(0){
38300302 34// create an object to read ITS SSD raw digits
35
38300302 36 fRawReader->SelectEquipment(17,102,102);
37}
38
39
40Bool_t AliITSRawStreamSSDv1::Next()
41{
42// read the next raw digit
43// returns kFALSE if there is no digit left
44
45 Int_t seq=0;
46
47 fPrevModuleID = fModuleID;
48
49 if (!fRawReader->ReadNextInt(fData)) return kFALSE;
50
51 fADModule = (fData >> 27) & 0x0000000F;
52 fADC = (fData >> 23) & 0x0000000F;
53
54 // seq 0 (first 768 strips) or 1 are obtained from fCoord2
55 fCoord2 = (fData >> 12) & 0x000007FF;
56 seq = (fCoord2 >= 768) ? 1 : 0;
57 if(seq) fCoord2 = 1535 - fCoord2;
58
59 if((fCoord2<0)||(fCoord2>=768)) return kFALSE;
60
61 // ADModule 2 -> layer 5
62 // fCoord1 is set according to the cabling map
63 if(fADModule==2) {
64 if ((fADC==0)&&(seq==0)) {fModuleID = 10; fCoord1=1;}
65 else if ((fADC==0)&&(seq==1)) {fModuleID = 11; fCoord1=1;}
66 else if ((fADC==1)&&(seq==0)) {fModuleID = 11; fCoord1=0;}
67 else if ((fADC==1)&&(seq==1)) {fModuleID = 10; fCoord1=0;}
68 }
69 // ADModule 6 -> layer 6
70 // fCoord1 is set according to the cabling map
71 else if(fADModule==6) {
72 if ((fADC==0)&&(seq==0)) {fModuleID = 12; fCoord1=0;}
73 else if ((fADC==0)&&(seq==1)) {fModuleID = 13; fCoord1=0;}
74 else if ((fADC==1)&&(seq==0)) {fModuleID = 13; fCoord1=1;}
75 else if ((fADC==1)&&(seq==1)) {fModuleID = 12; fCoord1=1;}
76 }
77
78 fSignal = (fData & 0x00000FFF);
79
80 if(fSignal>=2048) fSignal-=4096;
81
82 return kTRUE;
83}
84