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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 /// This class provides access to MUON digits in raw data.
21 /// It loops over all MUON digits in the raw data given by the AliRawReader.
22 /// The Next method goes to the next digit. If there are no digits left
23 /// it returns kFALSE (under develpment)
24 /// It can loop also over DDL and store the decoded rawdata in TClonesArray
27 /// First version implement for Tracker
29 ///////////////////////////////////////////////////////////////////////////////
31 #include "AliMUONRawStreamTracker.h"
33 #include "AliRawReader.h"
34 #include "AliRawDataHeader.h"
38 #include "AliMpBusPatch.h"
41 ClassImp(AliMUONRawStreamTracker)
44 AliMUONRawStreamTracker::AliMUONRawStreamTracker()
53 fPayload(new AliMUONPayloadTracker())
56 /// create an object to read MUON raw digits
57 /// Default ctor for monitoring purposes
63 //_________________________________________________________________
64 AliMUONRawStreamTracker::AliMUONRawStreamTracker(AliRawReader* rawReader)
66 fRawReader(rawReader),
73 fPayload(new AliMUONPayloadTracker())
77 /// ctor with AliRawReader as argument
78 /// for reconstruction purpose
84 //___________________________________
85 AliMUONRawStreamTracker::~AliMUONRawStreamTracker()
94 //_____________________________________________________________
95 Bool_t AliMUONRawStreamTracker::Next()
98 /// read the next raw digit (buspatch structure)
99 /// returns kFALSE if there is no digit left
100 /// (under development)
102 // AliMUONDDLTracker* ddlTracker = 0x0;
103 // AliMUONBlockHeader* blkHeader = 0x0;
104 // AliMUONDspHeader* dspHeader = 0x0;
111 // printf("iDDL %d\n", fDDL+1);
118 // fNextDDL = kFALSE;
120 // ddlTracker = GetDDLTracker();
122 // nBlock = ddlTracker->GetBlkHeaderEntries();
123 // if (fBlkId < nBlock) {
125 // blkHeader = ddlTracker->GetBlkHeaderEntry(fBlkId);
126 // nDsp = blkHeader->GetDspHeaderEntries();
128 // if( fDspId < nDsp) {
129 // dspHeader = blkHeader->GetDspHeaderEntry(fDspId);
130 // nBusPatch = dspHeader->GetBusPatchEntries();
132 // if (fBusPatchId < nBusPatch) {
133 // fBusStructPtr = dspHeader->GetBusPatchEntry(fBusPatchId++);
136 // } else {// iBusPatch
163 //______________________________________________________
164 Bool_t AliMUONRawStreamTracker::NextDDL()
166 /// reading tracker DDL
168 fPayload->ResetDDL();
175 AliDebug(3, Form("DDL Number %d\n", fDDL ));
178 fRawReader->Select("MUONTRK", fDDL, fDDL); //Select the DDL file to be read
180 fRawReader->ReadHeader();
182 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
184 UInt_t *buffer = new UInt_t[totalDataWord/4];
186 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
188 fPayload->Decode(buffer, totalDataWord/4);
197 //______________________________________________________
198 void AliMUONRawStreamTracker::SetMaxDDL(Int_t ddl)
201 if (ddl > 20) ddl = 20;
206 //______________________________________________________
207 void AliMUONRawStreamTracker::SetMaxBlock(Int_t blk)
209 /// set regional card number
210 fPayload->SetMaxBlock(blk);