]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Base class for MUON Raw Stream
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2007 17:03:26 +0000 (17:03 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2007 17:03:26 +0000 (17:03 +0000)
(Christian)

MUON/AliMUONRawStream.cxx [new file with mode: 0644]
MUON/AliMUONRawStream.h [new file with mode: 0644]

diff --git a/MUON/AliMUONRawStream.cxx b/MUON/AliMUONRawStream.cxx
new file mode 100644 (file)
index 0000000..f7245c9
--- /dev/null
@@ -0,0 +1,88 @@
+/**************************************************************************
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  *
+**************************************************************************/
+
+/* $Id $ */
+
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONRawStream
+/// This base class to MUON raw stream
+///
+///
+/// \author Christian Finck
+//-----------------------------------------------------------------------------
+
+#include "AliMUONRawStream.h"
+
+#include "AliRawReader.h"
+
+
+/// \cond CLASSIMP
+ClassImp(AliMUONRawStream)
+/// \endcond
+
+//___________________________________________
+AliMUONRawStream::AliMUONRawStream()
+ : TObject(),
+   fRawReader(),
+   fEnableErrorLogger(kFALSE)
+{
+  ///
+  /// Default ctor for monitoring purposes
+  ///
+  
+  
+}
+
+//_________________________________________________________________
+AliMUONRawStream::AliMUONRawStream(AliRawReader* rawReader)
+:  TObject(),
+   fRawReader(rawReader),
+   fEnableErrorLogger(kFALSE)
+{
+  ///
+  /// ctor with AliRawReader as argument
+  /// for reconstruction purpose
+  ///
+  
+  
+}
+
+//___________________________________
+AliMUONRawStream::~AliMUONRawStream()
+{
+  ///
+  /// clean up
+  ///
+}
+
+//_________________________________________________________________
+void AliMUONRawStream::Swap(UInt_t* buffer, Int_t size) const
+{
+  /// swap from little to big endian
+    RawWord *word, temp;
+    word = (RawWord *) buffer;
+
+    for (int i = 0 ; i < size; i++) {
+      temp = *(((RawWord*)buffer)+i);
+      word->b1 = temp.b4;
+      word->b2 = temp.b3;
+      word->b3 = temp.b2;
+      word->b4 = temp.b1;
+      word++;
+    }
+
+}                
diff --git a/MUON/AliMUONRawStream.h b/MUON/AliMUONRawStream.h
new file mode 100644 (file)
index 0000000..bdd9f9a
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef ALIMUONRAWSTREAM_H
+#define ALIMUONRAWSTREAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/// \ingroup raw
+/// \class AliMUONRawStream
+/// \brief Base class for reading MUON raw digits
+///
+//  Author: Christian Finck
+
+#include <TObject.h>
+
+class AliRawReader;
+
+
+class AliMUONRawStream: public TObject {
+  public :
+    AliMUONRawStream();
+    AliMUONRawStream(AliRawReader* rawReader);
+    virtual ~AliMUONRawStream();
+
+    /// Initialize iterator
+    virtual void First() {return;} // not yet virtual pure, waiting for trigger
+    
+    /// DDL iterator 
+    virtual Bool_t NextDDL() = 0;
+
+    /// Whether the iteration is finished or not
+    virtual Bool_t IsDone() const {return kTRUE;} // not yet virtual pure, waiting for trigger
+
+    /// add error message into error logger
+    virtual void AddErrorMessage() = 0;
+
+    /// Set object for reading the raw data
+    virtual void SetReader(AliRawReader* rawReader) {fRawReader = rawReader;}
+
+    /// Get object for reading the raw data
+    virtual AliRawReader* GetReader() {return fRawReader;}
+
+    /// Enable error info logger
+    virtual void EnabbleErrorLogger() {fEnableErrorLogger = kTRUE;}
+
+    /// Check if error info logger enable
+    virtual Bool_t IsErrorLogger() const {return fEnableErrorLogger;}
+
+    /// swap method for Power PC
+    virtual void Swap(UInt_t *buffer, Int_t size) const;
+
+
+  private :
+    /// Not implemented
+    AliMUONRawStream(const AliMUONRawStream& stream);
+    /// Not implemented
+    AliMUONRawStream& operator = (const AliMUONRawStream& stream);
+
+    typedef struct {
+     UInt_t b1:8; ///< first byte word
+     UInt_t b2:8; ///< second byte word
+     UInt_t b3:8; ///< third byte word
+     UInt_t b4:8; ///< fourth byte word
+    } RawWord;
+
+    AliRawReader* fRawReader;    //!< object for reading the raw data  
+    Bool_t fEnableErrorLogger;   //!< flag to enable the error info logger
+    
+    ClassDef(AliMUONRawStream, 1)    // base class for reading MUON raw digits
+};
+
+#endif