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 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 /// \class AliMUONRawStreamTracker
22 /// This class provides access to MUON digits in raw data.
24 /// It loops over all MUON digits in the raw data given by the AliRawReader.
25 /// The Next method goes to the next digit. If there are no digits left
26 /// it returns kFALSE (under develpment)
27 /// It can loop also over DDL and store the decoded rawdata in TClonesArray
30 /// First version implement for Tracker
32 /// \author Christian Finck
33 ///////////////////////////////////////////////////////////////////////////////
35 #include "AliMUONRawStreamTracker.h"
37 #include "AliRawReader.h"
38 #include "AliRawDataHeader.h"
43 ClassImp(AliMUONRawStreamTracker)
46 AliMUONRawStreamTracker::AliMUONRawStreamTracker()
55 fPayload(new AliMUONPayloadTracker())
58 /// create an object to read MUON raw digits
59 /// Default ctor for monitoring purposes
65 //_________________________________________________________________
66 AliMUONRawStreamTracker::AliMUONRawStreamTracker(AliRawReader* rawReader)
68 fRawReader(rawReader),
75 fPayload(new AliMUONPayloadTracker())
79 /// ctor with AliRawReader as argument
80 /// for reconstruction purpose
86 //___________________________________
87 AliMUONRawStreamTracker::~AliMUONRawStreamTracker()
96 //_____________________________________________________________
97 Bool_t AliMUONRawStreamTracker::Next()
100 /// read the next raw digit (buspatch structure)
101 /// returns kFALSE if there is no digit left
102 /// (under development)
104 // AliMUONDDLTracker* ddlTracker = 0x0;
105 // AliMUONBlockHeader* blkHeader = 0x0;
106 // AliMUONDspHeader* dspHeader = 0x0;
113 // printf("iDDL %d\n", fDDL+1);
120 // fNextDDL = kFALSE;
122 // ddlTracker = GetDDLTracker();
124 // nBlock = ddlTracker->GetBlkHeaderEntries();
125 // if (fBlkId < nBlock) {
127 // blkHeader = ddlTracker->GetBlkHeaderEntry(fBlkId);
128 // nDsp = blkHeader->GetDspHeaderEntries();
130 // if( fDspId < nDsp) {
131 // dspHeader = blkHeader->GetDspHeaderEntry(fDspId);
132 // nBusPatch = dspHeader->GetBusPatchEntries();
134 // if (fBusPatchId < nBusPatch) {
135 // fBusStructPtr = dspHeader->GetBusPatchEntry(fBusPatchId++);
138 // } else {// iBusPatch
165 //______________________________________________________
166 Bool_t AliMUONRawStreamTracker::NextDDL()
168 /// reading tracker DDL
170 fPayload->ResetDDL();
177 AliDebug(3, Form("DDL Number %d\n", fDDL ));
180 fRawReader->Select("MUONTRK", fDDL, fDDL); //Select the DDL file to be read
182 fRawReader->ReadHeader();
184 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
186 UInt_t *buffer = new UInt_t[totalDataWord/4];
188 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
190 fPayload->Decode(buffer, totalDataWord/4);
199 //______________________________________________________
200 void AliMUONRawStreamTracker::SetMaxDDL(Int_t ddl)
203 if (ddl > 20) ddl = 20;
208 //______________________________________________________
209 void AliMUONRawStreamTracker::SetMaxBlock(Int_t blk)
211 /// set regional card number
212 fPayload->SetMaxBlock(blk);