AliRoot Core  3dc7879 (3dc7879)
AliEMCALCCUSBRawStream.cxx
Go to the documentation of this file.
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 #include "AliEMCALCCUSBRawStream.h"
17 
18 // AliRoot system
19 #include "AliRawReader.h"
20 #include "AliLog.h"
21 
23 ClassImp(AliEMCALCCUSBRawStream) ;
25 
28 //_______________________________________________________________________
30  fRawReader(rawReader),
31  fData(0),
32  fHeader(0),
33  fOptHeader(0),
34  fEventLength(0),
35  fEOBuffer(0)
36 {
37  fRawReader = rawReader;
38 
39  fRawReader->Reset();
40  fRawReader->SelectEquipment(1, 1, 1);
41 
42  for(Int_t i = 0 ; i < fgkNTDC; i++ ) fTDC[i] = 0 ;
43  for(Int_t i = 0 ; i < fgkNQDC; i++ ) fQDC[i] = 0 ;
44  for(Int_t i = 0 ; i < fgkNScalerCCUSB; i++ ) fScalerCCUSB[i] = 0;
45  for(Int_t i = 0 ; i < fgkNScalerLecroy; i++ ) fScalerLecroy[i] = 0;
46 }
47 
51 //_______________________________________________________________________
53 {
54 
55  if ( fEOBuffer == 0xFFFF ) { fEOBuffer = 0; return kFALSE; }
56 
57  if (!fRawReader->ReadNextInt((UInt_t&) fHeader))
58  {
59  AliError("No header");
60  return kFALSE;
61  }
62 
63  if (!fRawReader->ReadNextInt((UInt_t&) fOptHeader))
64  {
65  AliError("No optional header");
66  return kFALSE;
67  }
68 
69  if (!fRawReader->ReadNextInt((UInt_t&) fEventLength))
70  {
71  AliError("No event length");
72  return kFALSE;
73  }
74 
75  for (Int_t i = 0; i < fgkNScalerCCUSB; i++)
76  {
77  if (!fRawReader->ReadNext((UChar_t*)&fData,8))
78  {
79  AliError("Internal CC-USB scaler issing");
80  return kFALSE;
81  }
82 
83  fScalerCCUSB[i] = fData;
84  }
85 
86  for (Int_t i = 0; i < fgkNScalerLecroy; i++)
87  {
88  if (!fRawReader->ReadNext((UChar_t*)&fData,8))
89  {
90  AliError("Lecroy scaler missing");
91  return kFALSE;
92  }
93 
94  fScalerLecroy[i] = fData;
95  }
96 
97  for (Int_t i = 0; i < fgkNTDC; i++)
98  {
99  if (!fRawReader->ReadNextInt(fData))
100  {
101  AliError("Incomplete TDC equipment");
102  return kFALSE;
103  }
104 
105  fTDC[i] = fData;
106  }
107 
108  for (Int_t i = 0; i < fgkNQDC; i++)
109  {
110  if (!fRawReader->ReadNextInt(fData))
111  {
112  AliError("Incomplete QDC equipment");
113  return kFALSE;
114  }
115 
116  fQDC[i] = fData;
117  }
118 
119  if ( !fRawReader->ReadNextInt((UInt_t&) fEOBuffer) )
120  {
121  AliError("No end of buffer");
122  return kFALSE;
123  }
124 
125  return kTRUE;
126 }
127 
UInt_t fQDC[fgkNQDC]
QDC values.
Access to CC-USB data in test bench raw data.
UInt_t fEventLength
Event length including terminator words.
static const Int_t fgkNTDC
Number of TDC.
UInt_t fTDC[fgkNTDC]
TDC channels.
UInt_t fScalerCCUSB[fgkNScalerCCUSB]
Internal scaler values.
UInt_t fData
data read for file
UInt_t fOptHeader
bits 0-11 represent the number of words in the buffer
static const Int_t fgkNQDC
Number of QDC.
UInt_t fEOBuffer
Event terminator.
AliRawReader * fRawReader
object for reading the raw data
#define AliError(message)
Definition: AliLog.h:591
AliEMCALCCUSBRawStream(AliRawReader *rawReader)
Constructor.
static const Int_t fgkNScalerCCUSB
Number of internal CC-USB scalers.
static const Int_t fgkNScalerLecroy
Number of Lecroy scalers.
UInt_t fScalerLecroy[fgkNScalerLecroy]
Lecroy scaler values.