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"
37 #include "AliMpBusPatch.h"
39 ClassImp(AliMUONRawStreamTracker)
41 AliMUONRawStreamTracker::AliMUONRawStreamTracker()
52 // create an object to read MUON raw digits
53 // Default ctor for monitoring purposes
56 fPayload = new AliMUONPayloadTracker();
60 //_________________________________________________________________
61 AliMUONRawStreamTracker::AliMUONRawStreamTracker(AliRawReader* rawReader)
71 // ctor with AliRawReader as argument
72 // for reconstruction purpose
75 fRawReader = rawReader;
76 fPayload = new AliMUONPayloadTracker();
80 //_________________________________________________________________
81 AliMUONRawStreamTracker::AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream) :
87 AliFatal("copy constructor not implemented");
90 //______________________________________________________________________
91 AliMUONRawStreamTracker& AliMUONRawStreamTracker::operator = (const AliMUONRawStreamTracker&
95 // assignment operator
97 AliFatal("assignment operator not implemented");
102 //___________________________________
103 AliMUONRawStreamTracker::~AliMUONRawStreamTracker()
112 //_____________________________________________________________
113 Bool_t AliMUONRawStreamTracker::Next()
116 // read the next raw digit (buspatch structure)
117 // returns kFALSE if there is no digit left
118 // (under development)
120 // AliMUONDDLTracker* ddlTracker = 0x0;
121 // AliMUONBlockHeader* blkHeader = 0x0;
122 // AliMUONDspHeader* dspHeader = 0x0;
129 // printf("iDDL %d\n", fDDL+1);
136 // fNextDDL = kFALSE;
138 // ddlTracker = GetDDLTracker();
140 // nBlock = ddlTracker->GetBlkHeaderEntries();
141 // if (fBlkId < nBlock) {
143 // blkHeader = ddlTracker->GetBlkHeaderEntry(fBlkId);
144 // nDsp = blkHeader->GetDspHeaderEntries();
146 // if( fDspId < nDsp) {
147 // dspHeader = blkHeader->GetDspHeaderEntry(fDspId);
148 // nBusPatch = dspHeader->GetBusPatchEntries();
150 // if (fBusPatchId < nBusPatch) {
151 // fBusStructPtr = dspHeader->GetBusPatchEntry(fBusPatchId++);
154 // } else {// iBusPatch
181 //______________________________________________________
182 Bool_t AliMUONRawStreamTracker::NextDDL()
184 // reading tracker DDL
186 fPayload->ResetDDL();
193 AliDebug(3, Form("DDL Number %d\n", fDDL ));
196 fRawReader->Select(0X9, fDDL, fDDL); //Select the DDL file to be read
198 fRawReader->ReadHeader();
200 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
202 UInt_t *buffer = new UInt_t[totalDataWord/4];
204 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
206 fPayload->Decode(buffer, fDDL);
215 //______________________________________________________
216 void AliMUONRawStreamTracker::SetMaxDDL(Int_t ddl)
219 if (ddl > 20) ddl = 20;
224 //______________________________________________________
225 void AliMUONRawStreamTracker::SetMaxBlock(Int_t blk)
227 // set regional card number
228 fPayload->SetMaxBlock(blk);