// Author: Markus Oldenburg, CERN
//-------------------------------------------------------------------------
-#include <TRef.h>
+#include <AliVCluster.h>
-#include "AliVParticle.h"
-#include "AliAODVertex.h"
-#include "AliAODTrack.h"
-
-class AliAODCluster : public AliVParticle {
+class AliAODCluster : public AliVCluster {
public:
- enum AODClu_t {kUndef = -1,
- kPHOSNeutral,
- kPHOSCharged,
- kEMCALPseudoCluster,
- kEMCALClusterv1,
- kPMDNeutral,
- kPMDCharged};
-
- enum AODCluPID_t {
- kUnknown = 0,
- kPhoton = 1,
- kPi0 = 2,
- kNeutron = 3,
- kKaon0 = 4,
- kEleCon = 5,
- kCharged = 6,
- kNeutral = 7 ,
- kOther = 8};
-
AliAODCluster();
AliAODCluster(Int_t id,
- Int_t label,
+ UInt_t nLabel,
+ Int_t *label,
Double_t energy,
Double_t x[3],
- Double_t covMatrix[10],
- Double_t pid[9],
- AliAODVertex *prodVertex, // not necessary for PMD
- AliAODTrack *primTrack,
- Char_t ttype=kUndef);
+ Double_t pid[13],
+ Char_t ttype=kUndef,
+ UInt_t selectInfo=0);
AliAODCluster(Int_t id,
- Int_t label,
+ UInt_t nLabel,
+ Int_t *label,
Float_t energy,
Float_t x[3],
- Float_t covMatrix[10],
- Float_t pid[9],
- AliAODVertex *prodVertex,
- AliAODTrack *primTrack,
- Char_t ttype=kUndef);
-
+ Float_t pid[13],
+ Char_t ttype=kUndef,
+ UInt_t selectInfo=0);
+
virtual ~AliAODCluster();
- AliAODCluster(const AliAODCluster& trk);
- AliAODCluster& operator=(const AliAODCluster& trk);
-
+ AliAODCluster(const AliAODCluster& clus);
+ AliAODCluster& operator=(const AliAODCluster& clus);
+ void Clear(const Option_t*);
+
Double_t Chi2() const { return fChi2; }
-
- virtual Double_t E() const { return fEnergy; }
- // make a connection to the PID object, here!!!
- virtual Double_t M() const { return (fType==AliAODCluster::kPHOSNeutral) ? 0. : -999.; }
- // make a connection to the PID object, here!!!
- virtual Double_t Y() const { return (fType==AliAODCluster::kPHOSNeutral) ? Eta() : -999.; }
-
+ Double_t E() const { return fEnergy; }
+
// PID
- virtual const Double_t *PID() const { return fPID; }
- AODCluPID_t GetMostProbablePID() const;
-
- template <class T> void GetPID(T *pid) const {
- for(Int_t i=0; i<9; ++i) pid[i]=fPID[i];}
-
- template <class T> void SetPID(const T *pid) {
- if(pid) for(Int_t i=0; i<9; ++i) fPID[i]=pid[i];
- else {for(Int_t i=0; i<9; fPID[i++]=0);} fPID[AliAODCluster::kUnknown]=1.;}
-
- Int_t GetID() const { return fID; }
- Int_t GetLabel() const { return fLabel; }
-
- template <class T> Bool_t GetPosition(T *x) const {
- x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
- return kTRUE;}
-
- template <class T> void SetCovMatrix(const T *covMatrix) {
- if(!fCovMatrix) fCovMatrix=new AliAODRedCov<4>();
- fCovMatrix->SetCovMatrix(covMatrix);}
-
- template <class T> Bool_t GetCovMatrix(T *covMatrix) const {
- if(!fCovMatrix) return kFALSE;
- fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
-
- void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
-
- AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
- AliAODTrack *GetPrimTrack() const { return (AliAODTrack*)fPrimTrack.GetObject(); }
+
+ UShort_t GetMostProbablePID() const;
+ const Double_t *GetPID() const { return fPID; }//{ for(Int_t i=0; i<13; ++i) pid[i]=fPID[i]; }
+ Int_t GetID() const { return fID; }
+ Int_t GetLabel() const {
+ if( fLabel && fNLabel > 0) return fLabel[0];
+ else return -1;} //Most likely the track associated to the cluster
+ Int_t GetLabelAt(UInt_t i) const;
+ Int_t * GetLabels() const {return fLabel ; }
+ UInt_t GetNLabels() const { return (UInt_t)fNLabel; }
+ Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
+ Char_t GetType() const { return fType; }
+
+ void GetPosition(Float_t *x) const {
+ x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];}
+
+ Bool_t IsEMCAL() const {if(fType == kEMCALClusterv1) return kTRUE;
+ else return kFALSE;}
+ Bool_t IsPHOS() const {if(fType == kPHOSCharged || fType == kPHOSNeutral) return kTRUE;
+ else return kFALSE;}
// print
void Print(const Option_t *opt = "") const;
-
+
// setters
+ void SetE(Double32_t energy) {fEnergy = energy ; }
void SetID(Int_t id) { fID = id; }
- void SetLabel(Int_t label) {fLabel = label; }
-
- template <class T> void SetPosition(const T *x);
-
+ void SetType(Char_t ttype) { fType=ttype; }
+ void SetLabel(Int_t *label, UInt_t size);
void SetChi2(Double_t chi2) { fChi2 = chi2; }
-
- void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
- void SetPrimTrack(TObject *ptrack) { fPrimTrack = ptrack; }
-
- virtual Double_t Px() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[0] : 0.;}
- virtual Double_t Py() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[1] : 0.;}
- virtual Double_t Pz() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[2] : 0.;}
- virtual Double_t Pt() const {return TMath::Sqrt(Px()*Px() + Py()*Py()); }
- virtual Double_t P() const {return TMath::Sqrt(Px()*Px() + Py()*Py() + Pz()*Pz()); }
- virtual Double_t OneOverPt() const {return Pt() ? 1./Pt(): -999.;}
- virtual Double_t Phi() const {return (fType==AliAODCluster::kPHOSNeutral) ? TMath::Pi()+TMath::ATan2(-fPosition[1], -fPosition[0]) : 0.;}
- virtual Double_t Theta() const {return (fType==AliAODCluster::kPHOSNeutral) ? TMath::ATan2(Pt(), fPosition[2]) : 0.;}
- virtual Double_t Eta() const {return (fType==AliAODCluster::kPHOSNeutral) ? -TMath::Log(TMath::Tan(0.5 * Theta())) : 0.;}
- virtual Short_t Charge() const {return (fType==AliAODCluster::kPHOSNeutral) ? 0 : -999;}
-
+
+ void SetPosition(Float_t *x);
+ void SetPositionAt(Float_t x,Int_t i) { if(i>=0 && i<3) fPosition[i] = x ;
+ else printf("Bad index for position array, i = %d\n",i);}
+
+ void SetPIDAt(Float_t x,Int_t i) { if(i>=0 && i<13) fPID[i] = x ;
+ else printf("Bad index for PID array, i = %d\n",i);}
+ void SetPID(const Float_t *pid) {
+ if(pid) for(Int_t i=0; i<13; ++i) fPID[i]=pid[i];
+ else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
+ template <class T> void SetPIDFromESD(const T *pid) {
+ if(pid) {for(Int_t i=0; i<11; ++i) fPID[i]=pid[i]; fPID[11]=0; fPID[12]=0;}
+ else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
+
+ void RemoveLabel();
+
+
private :
-
+
// Energy & position
Double32_t fEnergy; // energy
Double32_t fPosition[3]; // position of the cluster
-
+
Double32_t fChi2; // chi2 (probably not necessary for PMD)
- Double32_t fPID[9]; // [0.,1.,8] pointer to PID object
-
+ Double32_t fPID[13]; // [0.,1.,8] pointer to PID object
+
Int_t fID; // unique cluster ID, points back to the ESD cluster
- Int_t fLabel; // particle label, points back to MC track
+ Int_t fNLabel; // number of original track for this cluster
+ Int_t *fLabel; // [fNLabel] particle label, points back to MC tracks
+ UInt_t fFilterMap; // filter information, one bit per set of cuts
Char_t fType; // cluster type
-
- AliAODRedCov<4> *fCovMatrix; // covariance matrix (x, y, z, E)
- TRef fProdVertex; // vertex of origin (not necessary for PMD)
- TRef fPrimTrack; // primary track associated with this cluster (not necessary for PMD)
-
- // TRef fAssocCluster; // for PMD: cluster of other layer associated with this cluster
-
- ClassDef(AliAODCluster,3);
+
+ ClassDef(AliAODCluster,6);
};
#endif