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()
44 fPayload(new AliMUONPayloadTrigger()),
51 // create an object to read MUON raw digits
52 // Default ctor for monitoring purposes
58 //_________________________________________________________________
59 AliMUONRawStreamTrigger::AliMUONRawStreamTrigger(AliRawReader* rawReader)
61 fRawReader(rawReader),
62 fPayload(new AliMUONPayloadTrigger()),
70 // ctor with AliRawReader as argument
71 // for reconstruction purpose
76 //___________________________________
77 AliMUONRawStreamTrigger::~AliMUONRawStreamTrigger()
85 //_____________________________________________________________
86 Bool_t AliMUONRawStreamTrigger::Next()
88 // read the next raw digit (buspatch structure)
89 // returns kFALSE if there is no digit left
92 // if(!NextDDL()) return kFALSE;
94 // Int_t nEntries = fDDLTrigger->GetBusPatchEntries();
96 // if (fSubEntries < nEntries) {
97 // fLocalStruct = (AliMUONLocalStruct*)fDDLTrigger->GetBusPatchEntry(fSubEntries);
102 // fDDLTrigger->GetBusPatchArray()->Delete();
111 //______________________________________________________
112 Bool_t AliMUONRawStreamTrigger::NextDDL()
114 // reading tracker DDL
115 // store buspatch info into Array
116 // store only non-empty structures (buspatch info with datalength !=0)
119 fPayload->ResetDDL();
122 // loop over the two ddl's
123 if (fDDL >= fMaxDDL) {
129 fRawReader->Select("MUONTRG", fDDL, fDDL); //Select the DDL file to be read
131 fRawReader->ReadHeader();
133 Int_t totalDataWord = fRawReader->GetDataSize(); // in bytes
134 UInt_t *buffer = new UInt_t[totalDataWord/4];
136 fRawReader->ReadNext((UChar_t*)buffer, totalDataWord);
138 fPayload->Decode(buffer);
148 //______________________________________________________
149 void AliMUONRawStreamTrigger::SetMaxDDL(Int_t ddl)
152 if (ddl > 2) ddl = 2;
156 //______________________________________________________
157 void AliMUONRawStreamTrigger::SetMaxReg(Int_t reg)
159 // set regional card number
160 fPayload->SetMaxReg(reg);
163 //______________________________________________________
164 void AliMUONRawStreamTrigger::SetMaxLoc(Int_t loc)
166 // set local card number
167 fPayload->SetMaxLoc(loc);