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 CTP DDL raw data.
20 /// The raw data format is taken form the trigger TDR.
21 /// The meaning of the trigger class and cluster masks
22 /// are given in the trigger description file (in /data)
23 /// and in the AliCentralTrigger class.
25 ///////////////////////////////////////////////////////////////////////////////
27 #include "AliCTPRawStream.h"
28 #include "AliRawReader.h"
31 ClassImp(AliCTPRawStream)
33 //_____________________________________________________________________________
34 AliCTPRawStream::AliCTPRawStream(AliRawReader* rawReader) :
39 // create an object to read CTP raw data
41 // select the raw data corresponding to
42 // the CTP detector id
44 AliDebug(1,Form("Selecting raw data for detector %d",kCTPIndex));
45 fRawReader->Select(kCTPIndex);
48 //_____________________________________________________________________________
49 AliCTPRawStream::AliCTPRawStream(const AliCTPRawStream& stream) :
56 AliFatal("Copy constructor not implemented");
59 //_____________________________________________________________________________
60 AliCTPRawStream& AliCTPRawStream::operator = (const AliCTPRawStream&
63 AliFatal("Assignment operator not implemented");
67 //_____________________________________________________________________________
68 AliCTPRawStream::~AliCTPRawStream()
73 //_____________________________________________________________________________
74 void AliCTPRawStream::Reset()
76 // reset raw stream params
78 fClassMask = fClusterMask = 0;
80 if (fRawReader) fRawReader->Reset();
83 //_____________________________________________________________________________
84 Bool_t AliCTPRawStream::Next()
86 // read the whole CTP raw data stream
87 // return kFALSE in case of error
91 if (!fRawReader->ReadNextData(data)) return kFALSE;
93 if (fRawReader->GetDataSize() != 32) {
94 AliError(Form("Wrong CTP raw data size: %d",fRawReader->GetDataSize()));
98 fClusterMask = data[12] >> 2;
100 fClassMask = ((ULong64_t)data[12] & 0x3) << 48;
102 fClassMask |= (ULong64_t)data[16] << 36;
103 fClassMask |= ((ULong64_t)data[17] & 0xF) << 44;
105 fClassMask |= (ULong64_t)data[20] << 24;
106 fClassMask |= ((ULong64_t)data[21] & 0xF) << 32;
108 fClassMask |= (ULong64_t)data[24] << 12;
109 fClassMask |= ((ULong64_t)data[25] & 0xF) << 20;
111 fClassMask |= (ULong64_t)data[28];
112 fClassMask |= ((ULong64_t)data[29] & 0xF) << 8;