1 ////////////////////////////////////////////////////////////////////////////////
2 //345678901234567890123456789012345678901234567890123456789012345678901234567890
5 // Class AliTwoTrackRes
6 // J. Mercado <mercado@physi.uni-heidelberg.de> Last modified: 20.01.2011
8 ////////////////////////////////////////////////////////////////////////////////
10 #ifndef ALITWOTRACKRES_H
11 #define ALITWOTRACKRES_H
20 #include "TLorentzVector.h"
21 #include "AliAnalysisTask.h"
23 #include "AliESDEvent.h"
24 #include "AliESDtrack.h"
25 #include "AliESDtrackCuts.h"
26 #include "AliExternalTrackParam.h"
28 //______________________________________________________________________________
29 class AliTwoTrackRes : public AliAnalysisTask {
33 AliTwoTrackRes() : AliAnalysisTask("",""), fChain(0), fESDEvent(0), fOutContainer(0),
34 fTrackCuts(0), fNTuple1(0), fNTuple2(0), fP1(), fP2(), fPb1(), fPb2(), fP(),
35 fQ(), fTpcEnt1(), fTpcEnt2(), fTpcDist(), fOutFilename() {}
36 AliTwoTrackRes(const char *name);
37 AliTwoTrackRes(const AliTwoTrackRes& aTwoTrackRes);
38 virtual ~AliTwoTrackRes();
40 AliTwoTrackRes& operator=(const AliTwoTrackRes& aTwoTrackRes);
42 virtual void ConnectInputData(Option_t *);
43 virtual void CreateOutputObjects();
44 virtual void Exec(Option_t *opt = "");
45 virtual void Terminate(Option_t *opt = "");
47 void SetTr1(double pt1, double eta1, double phi1, double m);
48 void SetTr2(double pt2, double eta2, double phi2, double m);
49 void SetTpcEnt1(double x1, double y1, double z1);
50 void SetTpcEnt2(double x2, double y2, double z2);
51 double Qinv2() {fQ = fP2 - fP1; return -1.*fQ.M2();}
52 double Qinv() {return TMath::Sqrt(TMath::Abs(Qinv2()));}
53 double MinDist(AliExternalTrackParam *trk1, AliExternalTrackParam *trk2);
54 int GetNSha(TBits cl, TBits sh);
55 double Corr(TBits cl1, TBits cl2, TBits sh1, TBits sh2);
56 double Qfac(TBits cl1, TBits cl2, TBits sh1, TBits sh2);
58 double Dist() {fTpcDist = fTpcEnt2 - fTpcEnt1; return fTpcDist.Mag();}
59 double DEta() const {return TMath::Abs(fP2.Eta()-fP1.Eta());}
60 double DTheta() const {return fP2.Theta()-fP1.Theta();}
61 double DPhi() const {return TVector2::Phi_mpi_pi(fP2.Phi()-fP1.Phi());}
62 void NoSwap() {fPb1 = fP1; fPb2 = fP2;}
63 void Swap() {fPb1 = fP2; fPb2 = fP1;}
64 void FillNTuple1(double minsep, double sep, double corr, double qf,
66 void FillNTuple2(double minsep, double sep, double corr, double qf,
68 void SetOutfile(char *outfil) {fOutFilename = outfil;}
72 TTree *fChain; // Chain of ESD trees
73 AliESDEvent *fESDEvent; // Leaves
74 TObjArray *fOutContainer; // Output data container
75 AliESDtrackCuts *fTrackCuts; // Track cuts
76 TNtuple *fNTuple1; // True pairs
77 TNtuple *fNTuple2; // Mixed pairs
78 TLorentzVector fP1; // Four-momentum of track 1 (lab)
79 TLorentzVector fP2; // Four-momentum of track 2 (lab)
80 TLorentzVector fPb1; // Buffer single-track 1 for swapping
81 TLorentzVector fPb2; // Buffer single-track 2 for swapping
82 TLorentzVector fP; // Total four-momentum (lab)
83 TLorentzVector fQ; // Four-momentum difference (lab)
84 TVector3 fTpcEnt1; // Nominal TPC entrance point track 1
85 TVector3 fTpcEnt2; // Nominal TPC entrance point track 2
86 TVector3 fTpcDist; // Nominal TPC entrance separation
87 TString fOutFilename; // Output filename
89 ClassDef(AliTwoTrackRes, 0);
93 //______________________________________________________________________________