//
#include "AliPicoTrack.h"
+#include "AliExternalTrackParam.h"
+#include "AliVCluster.h"
//_________________________________________________________________________________________________
AliPicoTrack::AliPicoTrack() :
AliVTrack(),
- fPt(0), fEta(0), fPhi(0), fQ(0), fLabel(-1), fEtaEmc(0), fPhiEmc(0), fEmcal(0)
+ fPt(0), fEta(0), fPhi(0), fQ(0), fLabel(-1), fEtaEmc(0), fPhiEmc(0), fEmcal(0), fClusId(-1)
{
// Default constructor.
}
Double_t etaemc, Double_t phiemc, Bool_t ise) :
AliVTrack(),
fPt(pt), fEta(eta), fPhi(phi), fQ(q), fLabel(lab),
- fEtaEmc(etaemc), fPhiEmc(phiemc), fEmcal(ise)
+ fEtaEmc(etaemc), fPhiEmc(phiemc), fEmcal(ise), fClusId(-1)
{
// Constructor.
}
AliVTrack(pc),
fPt(pc.fPt), fEta(pc.fEta), fPhi(pc.fPhi),
fQ(pc.fQ), fLabel(pc.fLabel),
- fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fEmcal(pc.fEmcal)
+ fEtaEmc(pc.fEtaEmc), fPhiEmc(pc.fPhiEmc), fEmcal(pc.fEmcal),
+ fClusId(pc.fClusId)
{
// Constructor.
}
fEtaEmc = pc.fEtaEmc;
fPhiEmc = pc.fPhiEmc;
fEmcal = pc.fEmcal;
+ fClusId = pc.fClusId;
}
return *this;
return 0;
}
+//_________________________________________________________________________________________________
+void AliPicoTrack::GetEtaPhiDiff(AliVTrack *t, AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
+{
+ // Calculate phi and eta difference between track and cluster.
+
+ phidiff = 999;
+ etadiff = 999;
+
+ if (!t||!v)
+ return;
+
+ if (!t->IsEMCAL())
+ return;
+ const AliExternalTrackParam *outp = t->GetOuterParam();
+ Double_t veta = 999;
+ Double_t vphi = 999;
+ if (outp) {
+ Double_t trkPos[3] = {0.,0.,0.};
+ if (!outp->GetXYZ(trkPos))
+ return;
+ TVector3 vec(trkPos[0],trkPos[1],trkPos[2]);
+ veta = vec.Eta();
+ vphi = vec.Phi();
+ } else {
+ AliPicoTrack *ptrack = dynamic_cast<AliPicoTrack*>(t);
+ if (ptrack) {
+ veta = ptrack->GetEtaEmc();
+ vphi = ptrack->GetPhiEmc();
+ }
+ }
+
+ if (0&&(TMath::Abs(veta)>0.75 || (vphi<70*TMath::DegToRad()) || (vphi>190*TMath::DegToRad())))
+ return;
+
+ Float_t pos[3] = {0};
+ v->GetPosition(pos);
+ TVector3 cpos(pos);
+ Double_t ceta = cpos.Eta();
+ Double_t cphi = cpos.Phi();
+ etadiff=veta-ceta;
+ phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
+}
#include "AliVTrack.h"
#include <TMath.h>
+class AliVCluster;
class AliPicoTrack: public AliVTrack {
public:
const Double_t *PID() const { return 0; }
Int_t GetID() const { return 0; }
UChar_t GetITSClusterMap() const { return 0; }
- Int_t GetEMCALcluster() const { return -1; }
+ Int_t GetEMCALcluster() const { return fClusId; }
Double_t GetEtaEmc() const { return fEtaEmc; }
Double_t GetPhiEmc() const { return fPhiEmc; }
Bool_t IsEMCAL() const { return fEmcal; }
- ULong_t GetStatus() const { return 0; }
+ ULong_t GetStatus() const { return 0; }
Bool_t GetXYZ(Double_t *v) const { v[0]=0; v[1]=0; v[2]=0; return 0; }
- Double_t GetBz() const { return 0; }
- void GetBxByBz(Double_t b[3]) const {b[0]=0;b[1]=0;b[2]=0;}
- Bool_t GetCovarianceXYZPxPyPz(Double_t /*cv*/[21]) const {return 0;}
+ Double_t GetBz() const { return 0; }
+ void GetBxByBz(Double_t b[3]) const { b[0]=0;b[1]=0;b[2]=0; }
+ Bool_t GetCovarianceXYZPxPyPz(Double_t /*cv*/[21]) const { return 0; }
Int_t Compare(const TObject* obj) const;
Bool_t PropagateToDCA(const AliVVertex *, Double_t, Double_t, Double_t *, Double_t *) { return 0; }
- void SetEMCALcluster(Int_t) {;}
+ void SetEMCALcluster(Int_t id) { fClusId = id; }
+
+ static void GetEtaPhiDiff(AliVTrack *t, AliVCluster *v, Double_t &phidiff, Double_t &etadiff);
protected:
Double32_t fPt; //[0,0,12] pt at vertex
Double32_t fEtaEmc; //[-1,1,12] eta at emcal surface
Double32_t fPhiEmc; //[0,6.3,12] phi at emcal surface
Bool_t fEmcal; // is true if track propagated to emcal
+ Short_t fClusId; //! cluster id of matched cluster; -1 if not set
- ClassDef(AliPicoTrack, 1) // Pico track class
+ ClassDef(AliPicoTrack, 2) // Pico track class
};
#endif