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"
32 ClassImp(AliCTPRawStream)
34 //_____________________________________________________________________________
35 AliCTPRawStream::AliCTPRawStream(AliRawReader* rawReader) :
40 // create an object to read CTP raw data
42 // select the raw data corresponding to
43 // the CTP detector id
45 AliDebug(1,Form("Selecting raw data for detector %d",AliDAQ::DetectorID("TRG")));
46 fRawReader->Select("TRG");
49 //_____________________________________________________________________________
50 AliCTPRawStream::AliCTPRawStream(const AliCTPRawStream& stream) :
57 AliFatal("Copy constructor not implemented");
60 //_____________________________________________________________________________
61 AliCTPRawStream& AliCTPRawStream::operator = (const AliCTPRawStream&
64 AliFatal("Assignment operator not implemented");
68 //_____________________________________________________________________________
69 AliCTPRawStream::~AliCTPRawStream()
74 //_____________________________________________________________________________
75 void AliCTPRawStream::Reset()
77 // reset raw stream params
79 fClassMask = fClusterMask = 0;
81 if (fRawReader) fRawReader->Reset();
84 //_____________________________________________________________________________
85 Bool_t AliCTPRawStream::Next()
87 // read the whole CTP raw data stream
88 // return kFALSE in case of error
92 if (!fRawReader->ReadNextData(data)) return kFALSE;
94 if (fRawReader->GetDataSize() != 32) {
95 AliError(Form("Wrong CTP raw data size: %d",fRawReader->GetDataSize()));
99 fClusterMask = data[12] >> 2;
101 fClassMask = ((ULong64_t)data[12] & 0x3) << 48;
103 fClassMask |= (ULong64_t)data[16] << 36;
104 fClassMask |= ((ULong64_t)data[17] & 0xF) << 44;
106 fClassMask |= (ULong64_t)data[20] << 24;
107 fClassMask |= ((ULong64_t)data[21] & 0xF) << 32;
109 fClassMask |= (ULong64_t)data[24] << 12;
110 fClassMask |= ((ULong64_t)data[25] & 0xF) << 20;
112 fClassMask |= (ULong64_t)data[28];
113 fClassMask |= ((ULong64_t)data[29] & 0xF) << 8;