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 TClonesArrays
27 /// First version implement for Trigger
29 ///////////////////////////////////////////////////////////////////////////////
31 #include "AliMUONRawStreamTrigger.h"
33 #include "AliRawReader.h"
34 #include "AliRawDataHeader.h"
39 ClassImp(AliMUONRawStreamTrigger)
41 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger()
50 // create an object to read MUON raw digits
51 // Default ctor for monitoring purposes
54 fPayload = new AliMUONPayloadTrigger();
58 //_________________________________________________________________
59 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger(AliRawReader* rawReader)
68 // ctor with AliRawReader as argument
69 // for reconstruction purpose
72 fRawReader = rawReader;
73 fPayload = new AliMUONPayloadTrigger();
77 //_________________________________________________________________
78 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger(const AliMUONRawStreamTrigger& stream) :
84 AliFatal("copy constructor not implemented");
87 //______________________________________________________________________
88 AliMUONRawStreamTrigger& AliMUONRawStreamTrigger::operator = (const AliMUONRawStreamTrigger&
92 // assignment operator
94 AliFatal("assignment operator not implemented");
98 //___________________________________
99 AliMUONRawStreamTrigger::~AliMUONRawStreamTrigger()
107 //_____________________________________________________________
108 Bool_t AliMUONRawStreamTrigger::Next()
110 // read the next raw digit (buspatch structure)
111 // returns kFALSE if there is no digit left
114 // if(!NextDDL()) return kFALSE;
116 // Int_t nEntries = fDDLTrigger->GetBusPatchEntries();
118 // if (fSubEntries < nEntries) {
119 // fLocalStruct = (AliMUONLocalStruct*)fDDLTrigger->GetBusPatchEntry(fSubEntries);
121 // fNextDDL = kFALSE;
124 // fDDLTrigger->GetBusPatchArray()->Delete();
133 //______________________________________________________
134 Bool_t AliMUONRawStreamTrigger::NextDDL()
136 // reading tracker DDL
137 // store buspatch info into Array
138 // store only non-empty structures (buspatch info with datalength !=0)
141 fPayload->ResetDDL();
144 // loop over the two ddl's
145 if (fDDL >= fMaxDDL) {
151 fRawReader->Select("MUONTRG", fDDL, fDDL); //Select the DDL file to be read
153 fRawReader->ReadHeader();
155 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
156 UInt_t *buffer = new UInt_t[totalDataWord/4];
158 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
160 fPayload->Decode(buffer);
170 //______________________________________________________
171 void AliMUONRawStreamTrigger::SetMaxDDL(Int_t ddl)
174 if (ddl > 2) ddl = 2;
178 //______________________________________________________
179 void AliMUONRawStreamTrigger::SetMaxReg(Int_t reg)
181 // set regional card number
182 fPayload->SetMaxReg(reg);
185 //______________________________________________________
186 void AliMUONRawStreamTrigger::SetMaxLoc(Int_t loc)
188 // set local card number
189 fPayload->SetMaxLoc(loc);