]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Should have been part of the previous commit
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Mar 2008 23:22:24 +0000 (23:22 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Mar 2008 23:22:24 +0000 (23:22 +0000)
MUON/AliMUONTrackerDataWrapper.cxx [new file with mode: 0644]
MUON/AliMUONTrackerDataWrapper.h [new file with mode: 0644]

diff --git a/MUON/AliMUONTrackerDataWrapper.cxx b/MUON/AliMUONTrackerDataWrapper.cxx
new file mode 100644 (file)
index 0000000..47829fe
--- /dev/null
@@ -0,0 +1,72 @@
+/**************************************************************************
+* 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 AliMUONTrackerDataWrapper
+///
+/// A simple wrapper to convert an AliMUONVTrackerData object into
+/// an AliMUONVTrackerDataMaker object.
+///
+/// This is mainly to offer backward compatibility : the mchview program
+/// used to save AliMUONVTrackerData objects, while it now saves 
+/// AliMUONVTrackerDataMaker ones.
+/// So to read back old files, we need to be able to do the "conversion".
+///
+/// \author Laurent Aphecetche, Subatech
+
+#include "AliMUONTrackerDataWrapper.h"
+
+#include "AliLog.h"
+#include "AliMUONVTrackerData.h"
+
+/// \cond CLASSIMP
+ClassImp(AliMUONTrackerDataWrapper)
+/// \endcond
+
+//_____________________________________________________________________________
+AliMUONTrackerDataWrapper::AliMUONTrackerDataWrapper(AliMUONVTrackerData* data)
+: AliMUONVTrackerDataMaker(), fData(data)
+{
+  /// ctor
+}
+
+//_____________________________________________________________________________
+AliMUONTrackerDataWrapper::~AliMUONTrackerDataWrapper()
+{
+  /// dtor
+  delete fData;
+}
+
+//_____________________________________________________________________________
+Long64_t 
+AliMUONTrackerDataWrapper::Merge(TCollection*)
+{
+  /// Merge
+  AliError("Not implemented yet");
+  return 0;
+}
+
+//_____________________________________________________________________________
+Int_t
+AliMUONTrackerDataWrapper::NumberOfEvents() const
+{
+  /// Get the number of events the data has seen
+  if ( Data() ) 
+  {
+    return Data()->NumberOfEvents();
+  }
+  return 0;
+}
diff --git a/MUON/AliMUONTrackerDataWrapper.h b/MUON/AliMUONTrackerDataWrapper.h
new file mode 100644 (file)
index 0000000..0ba9647
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef ALIMUONTRACKERDATAWRAPPER_H
+#define ALIMUONTRACKERDATAWRAPPER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup graphics
+/// \class AliMUONTrackerDataWrapper
+/// \brief Simple wrapper of AliMUONVTrackerData (for backward compatibility)
+/// 
+// Author Laurent Aphecetche, Subatech
+
+#ifndef ALIMUONVTRACKERDATAMAKER_H
+#  include "AliMUONVTrackerDataMaker.h"
+#endif
+
+#ifndef ROOT_TString
+#  include "TString.h"
+#endif
+
+class AliMUONTrackerDataWrapper : public AliMUONVTrackerDataMaker
+{
+public:
+  AliMUONTrackerDataWrapper(AliMUONVTrackerData* data=0x0);
+  virtual ~AliMUONTrackerDataWrapper();
+  
+  /// Whether we are valid or not
+  virtual Bool_t IsValid() const { return kTRUE; }
+  
+  /// Our data
+  virtual AliMUONVTrackerData* Data() const { return fData; }
+  
+  /// Whether we can be run
+  virtual Bool_t IsRunnable() const { return kFALSE; }
+  
+  /// Whether we are running (must be false if IsRunnable is false)
+  virtual Bool_t IsRunning() const { return kFALSE; }
+  
+  /// Set the running state (no effect if not runnable)
+  virtual void SetRunning(Bool_t /*flag*/) {}
+  
+  /// Advance to next event (no effect if not runnable)
+  virtual Bool_t NextEvent() { return kFALSE; }
+  
+  /// Rewind events (no effect if not runnable)
+  virtual void Rewind() { }
+  
+  /// Set our source URI
+  virtual void SetSource(const char* /*source*/) {}
+  
+  /// Get our source URI
+  virtual TString Source() const { return ""; }
+  
+  /// Get the number of events we have seen (but not necessarily used...)
+  virtual Int_t NumberOfEvents() const;
+  
+  virtual Long64_t Merge(TCollection* li);
+  
+private:
+    AliMUONTrackerDataWrapper(const AliMUONTrackerDataWrapper& rhs);
+  AliMUONTrackerDataWrapper& operator=(const AliMUONTrackerDataWrapper& rhs);
+  
+private:
+    AliMUONVTrackerData* fData; ///< our data (owner)
+  
+  ClassDef(AliMUONTrackerDataWrapper,1) // Wrapper of AliMUONVTrackerData
+};
+
+#endif