]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDCaloCluster.h
Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliESDCaloCluster.h
index 1ba3bed0569e0b7fcc8e3d1833c485778014b944..c8d50bd318737d64a294d8de6d25e9a3a4e492cd 100644 (file)
@@ -2,7 +2,6 @@
 #define ALIESDCALOCLUSTER_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
-
 /* $Id$ */
 /* $Log $ */
 
 
 #include <TObject.h>
 #include "AliPID.h"
+#include "TArrayS.h"
+#include "TArrayI.h"
 
 class TLorentzVector;
 
-class AliESDCaloCluster : public TObject {
+class AliESDCaloCluster : public TObject 
+{
 
 public:
 
@@ -33,97 +35,138 @@ public:
   void SetID(Int_t id) {fID = id;}
   Int_t GetID() const {return fID;}
 
-  enum ClusterType {kPseudoCluster, kClusterv1};//Two types of clusters stored
-                                                //in EMCAL.
-  void SetClusterType(Int_t type) { fClusterType = type; }
-  Int_t GetClusterType() const {return fClusterType; }
+  //similar to AliAODCluster but offset by one for
+  // backward comp. -1 was undefined, which only applied
+  // for PHOS clusters before
+  enum ESDClu_t {kUndef = -2, 
+                kPHOSCluster, 
+                kEMCALPseudoCluster, //Not any more in use, keep for backward comp.
+                kEMCALClusterv1};
 
-  void SetEMCAL(Bool_t emc) { fEMCALCluster = emc;}
-  Bool_t IsEMCAL() const {return fEMCALCluster;}
+  void SetClusterType(Int_t type) { fClusterType = type; }
+  Char_t GetClusterType() const {return fClusterType; }
 
-  void SetPHOS(Bool_t phos) { fPHOSCluster = phos;}
-  Bool_t IsPHOS() const {return fPHOSCluster;}
+  Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1);}
+  Bool_t IsPHOS() const {return (fClusterType == kPHOSCluster);}
 
-  void SetGlobalPosition(const Float_t *pos) {
+  void SetPosition(const Float_t *pos) {
     fGlobalPos[0] = pos[0]; fGlobalPos[1] = pos[1]; fGlobalPos[2] = pos[2];
   }
-  void GetGlobalPosition(Float_t *pos) const {
+  void GetPosition(Float_t *pos) const {
     pos[0] = fGlobalPos[0]; pos[1] = fGlobalPos[1]; pos[2] = fGlobalPos[2];
   }
 
-  void SetClusterEnergy(Float_t ene) { fEnergy = ene;}
-  Float_t GetClusterEnergy() const   { return fEnergy;}
+  void SetE(Float_t ene) { fEnergy = ene;}
+  Double_t E() const   { return fEnergy;}
 
   void SetClusterDisp(Float_t disp)  { fDispersion = disp; }
-  Float_t GetClusterDisp() const     { return fDispersion; }
+  Double_t GetClusterDisp() const     { return fDispersion; }
 
   void SetClusterChi2(Float_t chi2)  { fChi2 = chi2; }
-  Float_t GetClusterChi2() const     { return fChi2; }
+  Double_t GetClusterChi2() const     { return fChi2; }
 
   void SetPid(const Float_t *p);
-  Float_t *GetPid() {return fPID;}
-
-  void SetPrimaryIndex(Int_t primary)     { fPrimaryIndex = primary; }
-  Int_t GetPrimaryIndex() const           { return fPrimaryIndex; }
+  Double_t *GetPid() {return fPID;}
 
   void SetM20(Float_t m20)                { fM20 = m20; }
-  Float_t GetM20() const                  { return fM20; }
+  Double_t GetM20() const                  { return fM20; }
 
   void SetM02(Float_t m02)                { fM02 = m02; }
-  Float_t GetM02() const                  { return fM02; }
+  Double_t GetM02() const                  { return fM02; }
 
   void SetM11(Float_t m11)                { fM11 = m11; }
-  Float_t GetM11() const                  { return fM11; }
+  Double_t GetM11() const                  { return fM11; }
 
-  void SetNExMax(UShort_t nExMax)         { fNExMax = nExMax; }
-  UShort_t GetNExMax() const              { return fNExMax; }
+  void SetNExMax(UChar_t nExMax)         { fNExMax = nExMax; }
+  UChar_t GetNExMax() const              { return fNExMax; }
 
   void SetEmcCpvDistance(Float_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; }
-  Float_t GetEmcCpvDistance() const       { return fEmcCpvDistance; }
-
-  void SetNumberOfDigits(Int_t ndig)      { fNumberOfDigits = ndig; }
-  Int_t GetNumberOfDigits() const         { return fNumberOfDigits; }
+  Double_t GetEmcCpvDistance() const       { return fEmcCpvDistance; }
+
+  void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
+  Double_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
+
+  void AddTracksMatched(TArrayI & array)  { fTracksMatched   = new TArrayI(array) ; }
+  void AddLabels(TArrayI & array)         { fLabels = new TArrayI(array) ; }
+
+  TArrayI * GetTracksMatched() const  {return  fTracksMatched;}
+  TArrayI * GetLabels() const         {return  fLabels;}
+  Int_t GetTrackMatched() const   
+  {if( fTracksMatched &&  fTracksMatched->GetSize() >0)  return  fTracksMatched->At(0); 
+    else return -1;} //Most likely the track associated to the cluster
+  Int_t GetLabel() const   
+  {if( fLabels &&  fLabels->GetSize() >0)  return  fLabels->At(0); 
+    else return -1;} //Most likely the track associated to the cluster
+
+  Int_t GetNTracksMatched() const {if (fTracksMatched) return  fTracksMatched->GetSize(); 
+    else return -1;}
+  Int_t GetNLabels() const        { if (fLabels) return  fLabels->GetSize(); 
+    else return -1;}
+
+  void GetMomentum(TLorentzVector& p, Double_t * vertexPosition );
+
+  // --- NEW ---
+  void SetNCells(Int_t n) { fNCells = n;}
+  Int_t GetNCells() const   { return fNCells;}
   
-  void SetDigitAmplitude(UShort_t *adc)   { fDigitAmplitude = adc;}
-  UShort_t *GetDigitAmplitude() const     { return fDigitAmplitude;}
-
-  void SetDigitTime(UShort_t *time)       { fDigitTime = time;}
-  UShort_t *GetDigitTime() const          { return fDigitTime;}
-
-  void SetDigitIndex(UShort_t *digit)     { fDigitIndex = digit;}
-  UShort_t *GetDigitIndex() const         { return fDigitIndex; }
-
-  void GetMomentum(TLorentzVector& p);
+  void SetCellsAbsId(UShort_t *array) { fCellsAbsId = array; }
+  UShort_t *GetCellsAbsId() {return  fCellsAbsId;}
+  
+  void SetCellsAmplitudeFraction(Double32_t *array) { fCellsAmpFraction = array; }
+  Double32_t *GetCellsAmplitudeFraction() {return  fCellsAmpFraction;}
+  
+  Int_t GetCellAbsId(Int_t i) const {  
+    if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i];    
+    else return -1;}
+  
+  Double_t GetCellAmplitudeFraction(Int_t i) const {  
+    if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i];    
+    else return -1;}
+    
+  //_____________________________________________________
+  //Not used anymore, kept to avoid backward incompatibility
+  void AddDigitIndex(TArrayS & array)     { fDigitIndex   = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;}
+  void AddDigitAmplitude(TArrayS & array) {  fDigitAmplitude   = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;}
+  void AddDigitTime(TArrayS & array)      {  fDigitTime   = new TArrayS(array) ;Warning("AddDigitTime","This method is no more in use") ;}
+  TArrayS * GetDigitAmplitude() const {return  fDigitAmplitude;}
+  TArrayS * GetDigitTime() const      {return  fDigitTime;}
+  TArrayS * GetDigitIndex() const     {return  fDigitIndex;}
+  Int_t GetNumberOfDigits() const        { return -1;}
+ //_____________________________________________________
 
 protected:
 
-  Int_t     fID;               // Unique Id of the cluster
-  Int_t     fClusterType;      // Flag for different clustering versions
-  Bool_t    fEMCALCluster;     // Is this is an EMCAL cluster?
-  Bool_t    fPHOSCluster;      // Is this is a PHOS cluster?
-  Float_t   fGlobalPos[3];     // position in global coordinate system
-  Float_t   fEnergy;           // energy measured by calorimeter
-  Float_t   fDispersion;       // cluster dispersion, for shape analysis
-  Float_t   fChi2;             // chi2 of cluster fit
-  Float_t   fPID[AliPID::kSPECIESN]; //"detector response probabilities" (for the PID)
-  Int_t     fPrimaryIndex;     // primary track number associated with this cluster
-  Float_t   fM20;              // 2-nd moment along the main eigen axis
-  Float_t   fM02;              // 2-nd moment along the second eigen axis
-  Float_t   fM11;              // 2-nd mixed moment Mxy
-  UShort_t  fNExMax ;          // number of (Ex-)maxima before unfolding
-  Float_t   fEmcCpvDistance;   // the distance from PHOS EMC rec.point to the closest CPV rec.point
-
-
-
-  Int_t     fNumberOfDigits;   // number of calorimeter digits in cluster
-                               // Very important! The streamer needs to
-                               // know how big these arrays are for
-                               // each event that is written out: 
-  UShort_t* fDigitAmplitude;   //[fNumberOfDigits] digit energy (integer units)
-  UShort_t* fDigitTime;        //[fNumberOfDigits] time of this digit (integer units)
-  UShort_t* fDigitIndex;       //[fNumberOfDigits] calorimeter digit index
-
-  ClassDef(AliESDCaloCluster,1)  //ESDCaloCluster 
+  TArrayI * fTracksMatched; //Index of tracks close to cluster. First entry is the most likely match.
+  TArrayI * fLabels;   //list of primaries that generated the cluster, ordered in deposited energy.
+
+  //NEW
+  Int_t  fNCells ;
+  UShort_t *fCellsAbsId;   //[fNCells] array of cell absId numbers
+  Double32_t *fCellsAmpFraction;    //[fNCells][0.,1.,16] array with cell amplitudes fraction.
+
+  //__________________________________________________________
+  //Not in use
+  TArrayS * fDigitAmplitude;   //digit energy (integer units) 
+  TArrayS * fDigitTime;        //time of this digit (integer units) 
+  TArrayS * fDigitIndex;       //calorimeter digit index 
+  //_________________________________________________________
+
+  Double32_t   fGlobalPos[3];     // position in global coordinate systemD
+  Double32_t   fEnergy;           // energy measured by calorimeter
+  Double32_t   fDispersion;       // cluster dispersion, for shape analysis
+  Double32_t   fChi2;             // chi2 of cluster fi
+  Double32_t   fM20;              // 2-nd moment along the main eigen axis
+  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
+  Double32_t   fDistToBadChannel; // Distance to nearest bad channel
+  Double32_t   fPID[AliPID::kSPECIESN]; //[0,1,8]"detector response  probabilities" (for the PID)
+  Int_t       fID;               // Unique Id of the cluster
+  UChar_t  fNExMax ;          // number of (Ex-)maxima before unfolding  
+  Char_t  fClusterType;      // Flag for different cluster type/versions
+
+  ClassDef(AliESDCaloCluster,7)  //ESDCaloCluster 
 };
 
 #endif