First incarnations of derived cluster classes for EMCAL/PHOS, PMD, and FMD.
authormarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Oct 2007 09:19:43 +0000 (09:19 +0000)
committermarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Oct 2007 09:19:43 +0000 (09:19 +0000)
STEER/AliAODCaloCluster.cxx [new file with mode: 0644]
STEER/AliAODCaloCluster.h [new file with mode: 0644]
STEER/AliAODFmdCluster.cxx [new file with mode: 0644]
STEER/AliAODFmdCluster.h [new file with mode: 0644]
STEER/AliAODPmdCluster.cxx [new file with mode: 0644]
STEER/AliAODPmdCluster.h [new file with mode: 0644]

diff --git a/STEER/AliAODCaloCluster.cxx b/STEER/AliAODCaloCluster.cxx
new file mode 100644 (file)
index 0000000..260fab5
--- /dev/null
@@ -0,0 +1,152 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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$ */
+
+//-------------------------------------------------------------------------
+//     AOD calorimeter cluster class (for PHOS and EMCAL)
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliAODCaloCluster.h"
+
+ClassImp(AliAODCaloCluster)
+
+//______________________________________________________________________________
+AliAODCaloCluster::AliAODCaloCluster() : 
+  AliAODCluster(),
+  fDistToBadChannel(-999.),
+  fDispersion(-1),
+  fM20(0.),
+  fM01(0.),
+  fM02(0.),
+  fM11(0.),
+  fEmcCpvDistance(-999.),
+  fNExMax(0),
+  fTracksMatched(),
+  fCellNumber()
+{
+  // default constructor
+
+}
+
+//______________________________________________________________________________
+AliAODCaloCluster::AliAODCaloCluster(Int_t id,
+                                    UInt_t nLabel,
+                                    Int_t *label, 
+                                    Double_t energy,
+                                    Double_t x[3],
+                                    Double_t pid[9],
+                                    Char_t ttype,
+                                    UInt_t selectInfo) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
+  fDistToBadChannel(-999.),
+  fDispersion(-1),
+  fM20(0.),
+  fM01(0.),
+  fM02(0.),
+  fM11(0.),
+  fEmcCpvDistance(-999.),
+  fNExMax(0),
+  fTracksMatched(),
+  fCellNumber()
+{
+  // constructor
+
+}
+
+//______________________________________________________________________________
+AliAODCaloCluster::AliAODCaloCluster(Int_t id,
+                                    UInt_t nLabel,
+                                    Int_t *label, 
+                                    Float_t energy,
+                                    Float_t x[3],
+                                    Float_t pid[9],
+                                    Char_t ttype,
+                                    UInt_t selectInfo) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
+  fDistToBadChannel(-999.),
+  fDispersion(-1),
+  fM20(0.),
+  fM01(0.),
+  fM02(0.),
+  fM11(0.),
+  fEmcCpvDistance(-999.),
+  fNExMax(0),
+  fTracksMatched(),
+  fCellNumber()
+{
+  // constructor
+}
+
+
+//______________________________________________________________________________
+AliAODCaloCluster::~AliAODCaloCluster() 
+{
+  // destructor
+}
+
+
+//______________________________________________________________________________
+AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
+  AliAODCluster(clus),
+  fDistToBadChannel(clus.fDistToBadChannel),
+  fDispersion(clus.fDispersion),
+  fM20(clus.fM20),
+  fM01(clus.fM01),
+  fM02(clus.fM02),
+  fM11(clus.fM11),
+  fEmcCpvDistance(clus.fEmcCpvDistance),
+  fNExMax(clus.fNExMax),
+  fTracksMatched(clus.fTracksMatched),
+  fCellNumber(clus.fCellNumber)
+{
+  // Copy constructor
+}
+
+//______________________________________________________________________________
+AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
+{
+  // Assignment operator
+  if(this!=&clus) {
+
+    AliAODCluster::operator=(clus);
+
+    fDistToBadChannel = clus.fDistToBadChannel;
+    fDispersion = clus.fDispersion;
+    fM20 = clus.fM20;
+    fM01 = clus.fM01;
+    fM02 = clus.fM02;
+    fM11 = clus.fM11;
+    fEmcCpvDistance = clus.fEmcCpvDistance;
+    fNExMax = clus.fNExMax;
+    fTracksMatched = clus.fTracksMatched;
+    fCellNumber = clus.fCellNumber;
+  }
+
+  return *this;
+}
+
+//_______________________________________________________________________
+Bool_t AliAODCaloCluster::HasTrackMatched(TObject *trk) const
+{
+  // Checks if the given track contributed to this cluster.
+
+  TRefArrayIter iter(&fTracksMatched);
+  while (TObject *track = iter.Next()) {
+    if (trk == track) return kTRUE;
+  }
+  return kFALSE;
+}
diff --git a/STEER/AliAODCaloCluster.h b/STEER/AliAODCaloCluster.h
new file mode 100644 (file)
index 0000000..1b6fd72
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef AliAODCaloCluster_H
+#define AliAODCaloCluster_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     AOD calorimeter cluster class (for PHOS and EMCAL)
+//     Author: Markus Oldenburg, CERN, 
+//             Gustavo Conesa, INFN
+//-------------------------------------------------------------------------
+
+#include "AliAODCluster.h"
+
+#include <TRefArray.h>
+#include <TArrayS.h>
+
+class AliAODCaloCluster : public AliAODCluster {
+
+ public:
+  
+  AliAODCaloCluster();
+  AliAODCaloCluster(Int_t id,
+                   UInt_t nLabel,
+                   Int_t *label,
+                   Double_t energy,
+                   Double_t x[3],
+                   Double_t pid[9],
+                   Char_t ttype=kUndef,
+                   UInt_t selectInfo=0);
+  
+  AliAODCaloCluster(Int_t id,
+                   UInt_t nLabel,
+                   Int_t *label,
+                   Float_t energy,
+                   Float_t x[3],
+                   Float_t pid[9],
+                   Char_t ttype=kUndef,
+                   UInt_t selectInfo=0);
+  
+  virtual ~AliAODCaloCluster();
+  AliAODCaloCluster(const AliAODCaloCluster& clus); 
+  AliAODCaloCluster& operator=(const AliAODCaloCluster& clus);
+
+  
+  // getters
+  Double_t GetDistToBadChannel() const { return fDistToBadChannel; }
+  Double_t GetDispersion() const { return fDispersion; }
+  Double_t GetM20() const { return fM20; }
+  Double_t GetM01() const { return fM01; }
+  Double_t GetM02() const { return fM02; }
+  Double_t GetM11() const { return fM11; }
+  Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
+  UShort_t GetNExMax() const { return fNExMax; }
+
+  Int_t    GetNTracksMatched() const { return fTracksMatched.GetEntriesFast(); }
+  TObject *GetTrackMatched(Int_t i) const { return fTracksMatched.At(i); }
+  Int_t    GetNCellNumbers() const { return fCellNumber.GetSize(); }
+  UShort_t GetCellNumber(Int_t i) const { return fCellNumber.At(i); }
+
+  // setters
+  void SetDistToBadChannel(Double_t dist) { fDistToBadChannel = dist; }
+  void SetDispersion(Double_t disp) { fDispersion = disp; }
+  void SetM20(Double_t m20) { fM20 = m20; }
+  void SetM01(Double_t m01) { fM01 = m01; }
+  void SetM02(Double_t m02) { fM02 = m02; }
+  void SetM11(Double_t m11) { fM11 = m11; }
+  void SetEmcCpvDistance(Double_t emcCpvDist) { fEmcCpvDistance = emcCpvDist; }
+  void SetNExMax(UShort_t nExMax) { fNExMax = nExMax; }
+
+  void SetCaloCluster(Double_t dist = -999., 
+                     Double_t disp = -1., 
+                     Double_t m20 = 0., 
+                     Double_t m01 = 0., 
+                     Double_t m02 = 0., 
+                     Double_t m11 = 0., 
+                     Double_t emcCpvDist = -999., 
+                     UShort_t nExMax = 0) 
+  {
+    fDistToBadChannel = dist;
+    fDispersion = disp;
+    fM20 = m20;
+    fM01 = m01;
+    fM02 = m02;
+    fM11 = m11;
+    fEmcCpvDistance = emcCpvDist;
+    fNExMax = nExMax;
+  }
+
+  void AddTrackMatched(TObject *trk) { fTracksMatched.Add(trk); }
+  void RemoveTrackMatched(TObject *trk) { fTracksMatched.Remove(trk); }
+  Bool_t HasTrackMatched(TObject *trk) const;
+
+ private :
+
+  Double32_t   fDistToBadChannel; // Distance to nearest bad channel
+  Double32_t   fDispersion;       // cluster dispersion, for shape analysis
+  Double32_t   fM20;              // 2-nd moment along the main eigen axis
+  Double32_t   fM01;              // 
+  Double32_t   fM02;              // 2-nd moment along the second eigen axis
+  Double32_t   fM11;              // 2-nd mixed moment Mxy
+  Double32_t   fEmcCpvDistance;   // the distance from PHOS EMC rec.point to the closest CPV rec.point
+  UShort_t     fNExMax;           // number of (Ex-)maxima before unfolding
+
+  TRefArray    fTracksMatched;    // references to tracks close to cluster. First entry is the most likely match.
+  TArrayS      fCellNumber;       // fired calorimeter cell numbers
+
+  ClassDef(AliAODCaloCluster,1);
+};
+
+#endif
diff --git a/STEER/AliAODFmdCluster.cxx b/STEER/AliAODFmdCluster.cxx
new file mode 100644 (file)
index 0000000..65d7a9f
--- /dev/null
@@ -0,0 +1,100 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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$ */
+
+//-------------------------------------------------------------------------
+//     AOD FMD cluster class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliAODFmdCluster.h"
+
+ClassImp(AliAODFmdCluster)
+  
+//______________________________________________________________________________
+AliAODFmdCluster::AliAODFmdCluster() : 
+  AliAODCluster(),
+  fProdVertex(NULL),
+  fPrimTrack(NULL)
+{
+  // default constructor
+}
+
+//______________________________________________________________________________
+AliAODFmdCluster::AliAODFmdCluster(Int_t id,
+                                  Int_t nLabel,
+                                  Int_t *label, 
+                                  Double_t energy,
+                                  Double_t x[3],
+                                  Double_t pid[9],
+                                  Char_t ttype,
+                                  AliAODVertex *prodVertex,
+                                  AliAODTrack *primTrack) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype),
+  fProdVertex(prodVertex),
+  fPrimTrack(primTrack)
+{
+  // constructor
+}
+
+//______________________________________________________________________________
+AliAODFmdCluster::AliAODFmdCluster(Int_t id,
+                                  Int_t nLabel,
+                                  Int_t *label, 
+                                  Float_t energy,
+                                  Float_t x[3],
+                                  Float_t pid[9],
+                                  Char_t ttype,
+                                  AliAODVertex *prodVertex,
+                                  AliAODTrack *primTrack) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype),
+  fProdVertex(prodVertex),
+  fPrimTrack(primTrack)
+{
+  // constructor
+}
+
+
+//______________________________________________________________________________
+AliAODFmdCluster::~AliAODFmdCluster() 
+{
+  // destructor
+}
+
+
+//______________________________________________________________________________
+AliAODFmdCluster::AliAODFmdCluster(const AliAODFmdCluster& clus) :
+  AliAODCluster(clus),
+  fProdVertex(clus.fProdVertex),
+  fPrimTrack(clus.fPrimTrack)
+{
+  // Copy constructor
+}
+
+//______________________________________________________________________________
+AliAODFmdCluster& AliAODFmdCluster::operator=(const AliAODFmdCluster& clus)
+{
+  // Assignment operator
+  if(this!=&clus) {
+
+    AliAODCluster::operator=(clus);
+
+    fProdVertex = clus.fProdVertex;
+    fPrimTrack = clus.fPrimTrack;
+  }
+
+  return *this;
+}
diff --git a/STEER/AliAODFmdCluster.h b/STEER/AliAODFmdCluster.h
new file mode 100644 (file)
index 0000000..3b2da3f
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef AliAODFmdCluster_H
+#define AliAODFmdCluster_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     AOD FMD cluster class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include <TRef.h>
+
+#include "AliAODCluster.h"
+#include "AliAODTrack.h"
+
+class AliAODFmdCluster : public AliAODCluster {
+
+ public:
+  
+  AliAODFmdCluster();
+  AliAODFmdCluster(Int_t id,
+                  Int_t nLabel,
+                  Int_t *label,
+                  Double_t energy,
+                  Double_t x[3],
+                  Double_t pid[9],
+                  Char_t ttype=kUndef,
+                  AliAODVertex *prodVertex=NULL,
+                  AliAODTrack *primTrack=NULL);
+
+   AliAODFmdCluster(Int_t id,
+                   Int_t nLabel,
+                   Int_t *label,
+                   Float_t energy,
+                   Float_t x[3],
+                   Float_t pid[9],
+                   Char_t ttype=kUndef,
+                   AliAODVertex *prodVertex=NULL,
+                   AliAODTrack *primTrack=NULL);
+
+  virtual ~AliAODFmdCluster();
+  AliAODFmdCluster(const AliAODFmdCluster& trk); 
+  AliAODFmdCluster& operator=(const AliAODFmdCluster& trk);
+
+  AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
+  AliAODTrack *GetPrimTrack() const { return (AliAODTrack*)fPrimTrack.GetObject(); }
+  
+  void SetProdVertex(AliAODVertex *vertex) { fProdVertex = vertex; }
+  void SetPrimTrack(AliAODTrack *ptrack) { fPrimTrack = ptrack; }
+
+
+ private :
+
+  TRef fProdVertex;     // vertex of origin
+  TRef fPrimTrack;      // primary track associated with this cluster
+
+  ClassDef(AliAODFmdCluster,1);
+};
+
+#endif
diff --git a/STEER/AliAODPmdCluster.cxx b/STEER/AliAODPmdCluster.cxx
new file mode 100644 (file)
index 0000000..fbaed62
--- /dev/null
@@ -0,0 +1,95 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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$ */
+
+//-------------------------------------------------------------------------
+//     AOD PMD cluster class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliAODPmdCluster.h"
+
+ClassImp(AliAODPmdCluster)
+
+//______________________________________________________________________________
+AliAODPmdCluster::AliAODPmdCluster() : 
+  AliAODCluster(),
+  fAssocCluster(NULL)
+{
+  // default constructor
+}
+
+//______________________________________________________________________________
+AliAODPmdCluster::AliAODPmdCluster(Int_t id,
+                                  Int_t nLabel,
+                                  Int_t *label, 
+                                  Double_t energy,
+                                  Double_t x[3],
+                                  Double_t pid[9],
+                                  Char_t ttype,
+                                  UInt_t selectInfo,
+                                  AliAODPmdCluster* assoc) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype),
+  fAssocCluster(assoc)
+{
+  // constructor
+}
+
+//______________________________________________________________________________
+AliAODPmdCluster::AliAODPmdCluster(Int_t id,
+                                  Int_t nLabel,
+                                  Int_t *label, 
+                                  Float_t energy,
+                                  Float_t x[3],
+                                  Float_t pid[9],
+                                  Char_t ttype,
+                                  UInt_t selectInfo,
+                                  AliAODPmdCluster* assoc) :
+  AliAODCluster(id, nLabel, label, energy, x, pid, ttype),
+  fAssocCluster(assoc)
+{
+  // constructor
+}
+
+
+//______________________________________________________________________________
+AliAODPmdCluster::~AliAODPmdCluster() 
+{
+  // destructor
+}
+
+
+//______________________________________________________________________________
+AliAODPmdCluster::AliAODPmdCluster(const AliAODPmdCluster& clus) :
+  AliAODCluster(clus),
+  fAssocCluster(clus.fAssocCluster)
+{
+  // Copy constructor
+}
+
+//______________________________________________________________________________
+AliAODPmdCluster& AliAODPmdCluster::operator=(const AliAODPmdCluster& clus)
+{
+  // Assignment operator
+  if(this!=&clus) {
+
+    AliAODCluster::operator=(clus);
+    
+    fAssocCluster = clus.fAssocCluster;
+  }
+
+  return *this;
+}
diff --git a/STEER/AliAODPmdCluster.h b/STEER/AliAODPmdCluster.h
new file mode 100644 (file)
index 0000000..0683016
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef AliAODPmdCluster_H
+#define AliAODPmdCluster_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     AOD PMD cluster class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include <TRef.h>
+
+#include "AliAODCluster.h"
+class AliAODPmdCluster : public AliAODCluster {
+
+ public:
+  
+  AliAODPmdCluster();
+  AliAODPmdCluster(Int_t id,
+                  Int_t nLabel,
+                  Int_t *label,
+                  Double_t energy,
+                  Double_t x[3],
+                  Double_t pid[9],
+                  Char_t ttype=kUndef,
+                  UInt_t selectInfo=0,
+                  AliAODPmdCluster* assoc=NULL);
+  
+  AliAODPmdCluster(Int_t id,
+                  Int_t nLabel,
+                  Int_t *label,
+                  Float_t energy,
+                  Float_t x[3],
+                  Float_t pid[9],
+                  Char_t ttype=kUndef,
+                  UInt_t selectInfo=0,
+                  AliAODPmdCluster* assoc=NULL);
+  
+  virtual ~AliAODPmdCluster();
+  AliAODPmdCluster(const AliAODPmdCluster& clus); 
+  AliAODPmdCluster& operator=(const AliAODPmdCluster& clus);
+
+  AliAODPmdCluster *GetAssocCluster() const { return (AliAODPmdCluster*)fAssocCluster.GetObject(); }
+  void SetAssocCluster(AliAODPmdCluster *cluster) { fAssocCluster = cluster; }
+
+ private :
+
+  TRef fAssocCluster;   // cluster of other layer associated with this cluster
+
+  ClassDef(AliAODPmdCluster,1);
+};
+
+#endif