]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONBusStruct.cxx
Init event before deleting it !
[u/mrichter/AliRoot.git] / MUON / AliMUONBusStruct.cxx
index ddeb74dab32d66507ad4405a5a19b9a5f57cf4ab..2ed5c2ef1ac9a277733368a1dd175ceabf20f0c0 100644 (file)
  **************************************************************************/
 
 /* $Id$ */
+
 #include "AliMUONBusStruct.h"
-#include "AliLog.h"
 
+#include "AliLog.h"
+#include <Riostream.h>
+#include <string.h>
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONBusStruct
 /// Bus patch structure for tracker raw data
 /// each Dsp contains at most 5 bus patch structure
@@ -28,6 +31,7 @@
 /// 12 bits for charge)
 ///
 /// \author Christian Finck
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONBusStruct)
@@ -35,6 +39,7 @@ ClassImp(AliMUONBusStruct)
 
 const Int_t  AliMUONBusStruct::fgkHeaderLength = 4;
 const UInt_t AliMUONBusStruct::fgkDefaultDataKey = 0xB000000B;
+const Int_t  AliMUONBusStruct::fgkManuNofChannels(64);
 
 //___________________________________________
 AliMUONBusStruct::AliMUONBusStruct()
@@ -43,7 +48,7 @@ AliMUONBusStruct::AliMUONBusStruct()
      fTotalLength(0),
      fLength(0),
      fBusPatchId(0),
-     fBufSize(43*64), 
+fBufSize(43*fgkManuNofChannels), 
   /* assuming 43 manus max per bustpatch.
   Anyway fData is resized where needed (though it makes it slower) */
      fData(new UInt_t[fBufSize]),
@@ -94,7 +99,6 @@ void AliMUONBusStruct::ResizeData(Int_t size)
   /// In case of resizing the vector
   /// the most simplest way to do it
   ///
-  AliInfo("reallocating");
   if (size == 0)
     fBufSize *= 2;
   else
@@ -166,7 +170,6 @@ void AliMUONBusStruct::Clear(Option_t *)
   /// clear
   /// delete the allocated memory 
   ///
-  AliInfo("here");
   delete[] fData;
 }
 //___________________________________________
@@ -206,7 +209,7 @@ UShort_t AliMUONBusStruct::GetManuId(Int_t n) const
 }
 
 //___________________________________________
-Char_t AliMUONBusStruct::GetChannelId(Int_t n) const  
+UChar_t AliMUONBusStruct::GetChannelId(Int_t n) const  
 {
   /// 
   /// get channel Id
@@ -228,3 +231,23 @@ UShort_t AliMUONBusStruct::GetCharge(Int_t n) const
   AliError("Index outside limits."); 
   return 0; 
 }
+
+//___________________________________________
+void AliMUONBusStruct::Print(Option_t* opt) const
+{
+  /// print out
+
+  cout << "Bus patch info" << endl;
+  cout << "DataKey: "      << fDataKey << endl;
+  cout << "fTotalLength: " << fTotalLength << endl;
+  cout << "fLength: "      << fLength << endl;
+  cout << "fBusPatchId: "  << fBusPatchId << endl;
+  cout << "fBufSize: "     << fBufSize << endl;
+
+  if (strstr(opt, "all")) {
+  for (Int_t i = 0; i <fLength; ++i)
+      cout << "Data["<< i << "] = " << fData[i] << endl;
+  }
+}
+
+