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()
53 // create an object to read MUON raw digits
54 // Default ctor for monitoring purposes
57 fPayload = new AliMUONPayloadTracker();
61 //_________________________________________________________________
62 AliMUONRawStreamTracker::AliMUONRawStreamTracker(AliRawReader* rawReader)
72 // ctor with AliRawReader as argument
73 // for reconstruction purpose
76 fRawReader = rawReader;
77 fPayload = new AliMUONPayloadTracker();
81 //_________________________________________________________________
82 AliMUONRawStreamTracker::AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream) :
88 AliFatal("copy constructor not implemented");
91 //______________________________________________________________________
92 AliMUONRawStreamTracker& AliMUONRawStreamTracker::operator = (const AliMUONRawStreamTracker&
96 // assignment operator
98 AliFatal("assignment operator not implemented");
103 //___________________________________
104 AliMUONRawStreamTracker::~AliMUONRawStreamTracker()
113 //_____________________________________________________________
114 Bool_t AliMUONRawStreamTracker::Next()
117 // read the next raw digit (buspatch structure)
118 // returns kFALSE if there is no digit left
119 // (under development)
121 // AliMUONDDLTracker* ddlTracker = 0x0;
122 // AliMUONBlockHeader* blkHeader = 0x0;
123 // AliMUONDspHeader* dspHeader = 0x0;
130 // printf("iDDL %d\n", fDDL+1);
137 // fNextDDL = kFALSE;
139 // ddlTracker = GetDDLTracker();
141 // nBlock = ddlTracker->GetBlkHeaderEntries();
142 // if (fBlkId < nBlock) {
144 // blkHeader = ddlTracker->GetBlkHeaderEntry(fBlkId);
145 // nDsp = blkHeader->GetDspHeaderEntries();
147 // if( fDspId < nDsp) {
148 // dspHeader = blkHeader->GetDspHeaderEntry(fDspId);
149 // nBusPatch = dspHeader->GetBusPatchEntries();
151 // if (fBusPatchId < nBusPatch) {
152 // fBusStructPtr = dspHeader->GetBusPatchEntry(fBusPatchId++);
155 // } else {// iBusPatch
182 //______________________________________________________
183 Bool_t AliMUONRawStreamTracker::NextDDL()
185 // reading tracker DDL
187 fPayload->ResetDDL();
194 AliDebug(3, Form("DDL Number %d\n", fDDL ));
197 fRawReader->Select("MUONTRK", fDDL, fDDL); //Select the DDL file to be read
199 fRawReader->ReadHeader();
201 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
203 UInt_t *buffer = new UInt_t[totalDataWord/4];
205 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
207 fPayload->Decode(buffer, totalDataWord/4);
216 //______________________________________________________
217 void AliMUONRawStreamTracker::SetMaxDDL(Int_t ddl)
220 if (ddl > 20) ddl = 20;
225 //______________________________________________________
226 void AliMUONRawStreamTracker::SetMaxBlock(Int_t blk)
228 // set regional card number
229 fPayload->SetMaxBlock(blk);