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)
42 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger()
45 fPayload(new AliMUONPayloadTrigger()),
52 /// create an object to read MUON raw digits
53 /// Default ctor for monitoring purposes
59 //_________________________________________________________________
60 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger(AliRawReader* rawReader)
62 fRawReader(rawReader),
63 fPayload(new AliMUONPayloadTrigger()),
71 /// ctor with AliRawReader as argument
72 /// for reconstruction purpose
77 //___________________________________
78 AliMUONRawStreamTrigger::~AliMUONRawStreamTrigger()
86 //_____________________________________________________________
87 Bool_t AliMUONRawStreamTrigger::Next()
89 /// read the next raw digit (buspatch structure)
90 /// returns kFALSE if there is no digit left
93 // if(!NextDDL()) return kFALSE;
95 // Int_t nEntries = fDDLTrigger->GetBusPatchEntries();
97 // if (fSubEntries < nEntries) {
98 // fLocalStruct = (AliMUONLocalStruct*)fDDLTrigger->GetBusPatchEntry(fSubEntries);
100 // fNextDDL = kFALSE;
103 // fDDLTrigger->GetBusPatchArray()->Delete();
112 //______________________________________________________
113 Bool_t AliMUONRawStreamTrigger::NextDDL()
115 /// reading tracker DDL
116 /// store buspatch info into Array
117 /// store only non-empty structures (buspatch info with datalength !=0)
120 fPayload->ResetDDL();
123 // loop over the two ddl's
124 if (fDDL >= fMaxDDL) {
130 fRawReader->Select("MUONTRG", fDDL, fDDL); //Select the DDL file to be read
132 fRawReader->ReadHeader();
134 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
135 UInt_t *buffer = new UInt_t[totalDataWord/4];
137 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
139 fPayload->Decode(buffer);
149 //______________________________________________________
150 void AliMUONRawStreamTrigger::SetMaxDDL(Int_t ddl)
153 if (ddl > 2) ddl = 2;
157 //______________________________________________________
158 void AliMUONRawStreamTrigger::SetMaxReg(Int_t reg)
160 /// set regional card number
161 fPayload->SetMaxReg(reg);
164 //______________________________________________________
165 void AliMUONRawStreamTrigger::SetMaxLoc(Int_t loc)
167 /// set local card number
168 fPayload->SetMaxLoc(loc);