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 class provides access to CC-USB data in test bench raw data.
19 /// Author: guernane@lpsc.in2p3.fr
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "AliEMCALCCUSBRawStream.h"
24 #include "AliRawReader.h"
26 ClassImp(AliEMCALCCUSBRawStream)
28 AliEMCALCCUSBRawStream::AliEMCALCCUSBRawStream(AliRawReader* rawReader) :
29 fRawReader(rawReader),
36 fRawReader = rawReader;
39 fRawReader->SelectEquipment(1, 1, 1);
42 Bool_t AliEMCALCCUSBRawStream::Next()
44 // read the next raw digit
45 // returns kFALSE if there is no digit left
47 if ( fEOBuffer == 0xFFFF ) { fEOBuffer = 0; return kFALSE; }
49 if (!fRawReader->ReadNextInt((UInt_t&) fHeader)) {
50 Error("Next", "No header");
54 if (!fRawReader->ReadNextInt((UInt_t&) fOptHeader)) {
55 Error("Next", "No optional header");
59 if (!fRawReader->ReadNextInt((UInt_t&) fEventLength)) {
60 Error("Next", "No event length");
64 for (Int_t i = 0; i < fgkNScalerCCUSB; i++)
66 if (!fRawReader->ReadNext((UChar_t*)&fData,8))
68 Error("Next", "Internal CC-USB scaler issing");
72 fScalerCCUSB[i] = fData;
75 for (Int_t i = 0; i < fgkNScalerLecroy; i++)
77 if (!fRawReader->ReadNext((UChar_t*)&fData,8))
79 Error("Next", "Lecroy scaler missing");
83 fScalerLecroy[i] = fData;
86 for (Int_t i = 0; i < fgkNTDC; i++)
88 if (!fRawReader->ReadNextInt(fData))
90 Error("Next", "Incomplete TDC equipment");
97 for (Int_t i = 0; i < fgkNQDC; i++)
99 if (!fRawReader->ReadNextInt(fData))
101 Error("Next", "Incomplete QDC equipment");
108 if ( !fRawReader->ReadNextInt((UInt_t&) fEOBuffer) )
110 Error("Next", "No end of buffer");