]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONRawClusterV2.cxx
Update from Alberica. Addition of VZERO equalized signals and ZNC.
[u/mrichter/AliRoot.git] / MUON / AliMUONRawClusterV2.cxx
index 08d4b18ca3d0afd4d9df19719afc8b5b819df936..0051884632f875ed005cbba77d772443916fcb2c 100644 (file)
 
 
 #include "AliMUONRawClusterV2.h"
-#include "AliMUONConstants.h"
 
-#include "AliESDMuonCluster.h"
-#include "AliESDMuonPad.h"
 #include "AliLog.h"
 
 #include <TClonesArray.h>
@@ -45,12 +42,13 @@ AliMUONRawClusterV2::AliMUONRawClusterV2()
     fX(FLT_MAX),
     fY(FLT_MAX),
     fZ(FLT_MAX),
-    fErrX2(AliMUONConstants::DefaultNonBendingReso2()),
-    fErrY2(AliMUONConstants::DefaultBendingReso2()),
+    fErrX2(FLT_MAX),
+    fErrY2(FLT_MAX),
     fQ(0.),
     fChi2(0.),
     fNDigits(0),
-    fDigitsId(0x0)
+    fDigitsId(0x0),
+    fMCLabel(-1)
 {
   /// Default Constructor
 }
@@ -61,39 +59,17 @@ AliMUONRawClusterV2::AliMUONRawClusterV2(Int_t chamberId, Int_t detElemId, Int_t
     fX(FLT_MAX),
     fY(FLT_MAX),
     fZ(FLT_MAX),
-    fErrX2(AliMUONConstants::DefaultNonBendingReso2()),
-    fErrY2(AliMUONConstants::DefaultBendingReso2()),
+    fErrX2(FLT_MAX),
+    fErrY2(FLT_MAX),
     fQ(0.),
     fChi2(0.),
     fNDigits(0),
-    fDigitsId(0x0)
+    fDigitsId(0x0),
+    fMCLabel(-1)
 {
   /// Constructor
 }
 
-//____________________________________________________
-AliMUONRawClusterV2::AliMUONRawClusterV2(const AliESDMuonCluster& cluster)
-: AliMUONVCluster(cluster),
-  fX(cluster.GetX()),
-  fY(cluster.GetY()),
-  fZ(cluster.GetZ()),
-  fErrX2(cluster.GetErrX2()),
-  fErrY2(cluster.GetErrY2()),
-  fQ(cluster.GetCharge()),
-  fChi2(cluster.GetChi2()),
-  fNDigits(cluster.GetNPads()),
-  fDigitsId(0x0)
-
-{
-  /// Copy constructor
-  
-  if (cluster.PadsStored()) {
-    fDigitsId = new UInt_t[fNDigits];
-    for (Int_t i=0; i<fNDigits; i++)
-      fDigitsId[i] = ((AliESDMuonPad*)cluster.GetPads().UncheckedAt(i))->GetUniqueID();
-  }
-}
-
 //____________________________________________________
 AliMUONRawClusterV2::~AliMUONRawClusterV2() 
 {
@@ -112,7 +88,8 @@ AliMUONRawClusterV2::AliMUONRawClusterV2(const AliMUONRawClusterV2& cluster)
     fQ(cluster.fQ),
     fChi2(cluster.fChi2),
     fNDigits(cluster.fNDigits),
-    fDigitsId(0x0)
+    fDigitsId(0x0),
+    fMCLabel(cluster.fMCLabel)
 
 {
   /// Copy constructor
@@ -143,6 +120,7 @@ AliMUONRawClusterV2 & AliMUONRawClusterV2::operator=(const AliMUONRawClusterV2&
   fQ = cluster.fQ;
   fChi2 = cluster.fChi2;
   SetDigitsId(cluster.fNDigits,cluster.fDigitsId);
+  fMCLabel = cluster.fMCLabel;
 
   return *this;
 }
@@ -150,18 +128,10 @@ AliMUONRawClusterV2 & AliMUONRawClusterV2::operator=(const AliMUONRawClusterV2&
 //____________________________________________________
 void AliMUONRawClusterV2::Clear(Option_t*)
 {
-  /// Reset this cluster, in particular the internal arrays are deleted.
-  
-  fX = FLT_MAX;
-  fY = FLT_MAX;
-  fZ = FLT_MAX;
-  fErrX2 = AliMUONConstants::DefaultNonBendingReso2();
-  fErrY2 = AliMUONConstants::DefaultBendingReso2();
-  fQ = 0.;
-  fChi2 = 0.;
-  fNDigits = 0;
+  /// clear memory
   delete [] fDigitsId;
   fDigitsId = 0x0;
+  fNDigits = 0;
 }
 
 //____________________________________________________
@@ -191,7 +161,7 @@ void AliMUONRawClusterV2::AddDigitId(UInt_t id)
   UInt_t *digitsIdNew = new UInt_t[fNDigits+1];
   memcpy(digitsIdNew,fDigitsId, fNDigits*sizeof(UInt_t));
   digitsIdNew[fNDigits++] = id;
-  delete fDigitsId;
+  delete[] fDigitsId;
   fDigitsId = digitsIdNew;
 }