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"
40 ClassImp(AliMUONRawStreamTracker)
42 AliMUONRawStreamTracker::AliMUONRawStreamTracker()
51 fPayload(new AliMUONPayloadTracker())
54 // create an object to read MUON raw digits
55 // Default ctor for monitoring purposes
61 //_________________________________________________________________
62 AliMUONRawStreamTracker::AliMUONRawStreamTracker(AliRawReader* rawReader)
64 fRawReader(rawReader),
71 fPayload(new AliMUONPayloadTracker())
75 // ctor with AliRawReader as argument
76 // for reconstruction purpose
82 //___________________________________
83 AliMUONRawStreamTracker::~AliMUONRawStreamTracker()
92 //_____________________________________________________________
93 Bool_t AliMUONRawStreamTracker::Next()
96 // read the next raw digit (buspatch structure)
97 // returns kFALSE if there is no digit left
98 // (under development)
100 // AliMUONDDLTracker* ddlTracker = 0x0;
101 // AliMUONBlockHeader* blkHeader = 0x0;
102 // AliMUONDspHeader* dspHeader = 0x0;
109 // printf("iDDL %d\n", fDDL+1);
116 // fNextDDL = kFALSE;
118 // ddlTracker = GetDDLTracker();
120 // nBlock = ddlTracker->GetBlkHeaderEntries();
121 // if (fBlkId < nBlock) {
123 // blkHeader = ddlTracker->GetBlkHeaderEntry(fBlkId);
124 // nDsp = blkHeader->GetDspHeaderEntries();
126 // if( fDspId < nDsp) {
127 // dspHeader = blkHeader->GetDspHeaderEntry(fDspId);
128 // nBusPatch = dspHeader->GetBusPatchEntries();
130 // if (fBusPatchId < nBusPatch) {
131 // fBusStructPtr = dspHeader->GetBusPatchEntry(fBusPatchId++);
134 // } else {// iBusPatch
161 //______________________________________________________
162 Bool_t AliMUONRawStreamTracker::NextDDL()
164 // reading tracker DDL
166 fPayload->ResetDDL();
173 AliDebug(3, Form("DDL Number %d\n", fDDL ));
176 fRawReader->Select("MUONTRK", fDDL, fDDL); //Select the DDL file to be read
178 fRawReader->ReadHeader();
180 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
182 UInt_t *buffer = new UInt_t[totalDataWord/4];
184 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
186 fPayload->Decode(buffer, totalDataWord/4);
195 //______________________________________________________
196 void AliMUONRawStreamTracker::SetMaxDDL(Int_t ddl)
199 if (ddl > 20) ddl = 20;
204 //______________________________________________________
205 void AliMUONRawStreamTracker::SetMaxBlock(Int_t blk)
207 // set regional card number
208 fPayload->SetMaxBlock(blk);