]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/UNICOR/AliDPair.h
Added seperate methods to write histograms to a file when not using the task framework
[u/mrichter/AliRoot.git] / PWG2 / UNICOR / AliDPair.h
CommitLineData
7148817a 1// Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2002
2
5a6d201c 3//=============================================================================
4// particle (track) pair
5//=============================================================================
6
7148817a 7#ifndef ALIDPAIR_H
8#define ALIDPAIR_H
9
5a6d201c 10#include <cmath>
7148817a 11#include <TObject.h>
5a6d201c 12#include <TLorentzVector.h>
7148817a 13
14//=============================================================================
15class AliDPair : public TObject {
16
7148817a 17 public:
18 AliDPair(); // constructor
19 virtual ~AliDPair() {printf("AliDPair object deleted\n");}
5a6d201c 20 void Set0(double m,double p,double theta,double phi) {fP0.SetXYZM(0,0,p,m); fP0.SetTheta(theta); fP0.SetPhi(phi);}
21 void Set1(double m,double p,double theta,double phi) {fP1.SetXYZM(0,0,p,m); fP1.SetTheta(theta); fP1.SetPhi(phi);}
22 void SetMXYZ0(double m,double px,double py,double pz) {fP0.SetXYZM(px,py,pz,m);}
23 void SetMXYZ1(double m,double px,double py,double pz) {fP1.SetXYZM(px,py,pz,m);}
24 void CalcLAB() {fP=fP0+fP1; fQ=fP1-fP0; fBeta=fP.BoostVector();
25 fBetaz.SetXYZ(0,0,fBeta.Z()); fBetat=fBeta; fBetat.SetZ(0);
26 fUbeta=fBeta.Unit(); fUbetat=fBetat.Unit(); fUbetaz=fBetaz.Unit();}
27 double Rapidity() const {return fP.Rapidity();}
28 double Pt() const {return fP.Pt();}
29 double Phi() const {return fP.Phi();}
30 double DTheta() const {return fP1.Theta()-fP0.Theta();}
31 double DPhi() const {return TVector2::Phi_mpi_pi(fP1.Phi()-fP0.Phi());}
32 void CalcPairCM() {fCMp=fP; fCMp.Boost(-fBeta); fCMq=fQ; fCMq.Boost(-fBeta);}
33 void CalcLcmsCM() {fCMp=fP; fCMp.Boost(-fBetaz); fCMq=fQ; fCMq.Boost(-fBetaz);}
34 void Swap() {fBuf=fP0; fP0=fP1; fP1=fBuf; fQ=-fQ; fCMq=-fCMq;}
35 double Minv() const {return fP.M();}
36 double Qinv2() const {return -fQ.M2();}
37 double QCM() const {return fCMq.Vect().Mag();}
38 double QCMpar() const {return fCMq.Vect()*fUbeta;}
39 double QCMper() const {return sqrt(fabs(QCM()*QCM()-QCMpar()*QCMpar()));}
40 double QCMout() const {return +fCMq.Vect().X()*fUbetat.X()+fCMq.Vect().Y()*fUbetat.Y();}
41 double QCMside() const {return -fCMq.Vect().X()*fUbetat.Y()+fCMq.Vect().Y()*fUbetat.X();}
42 double QCMlong() const {return fCMq.Vect().Z();}
43 double QCMTheta() const {return fCMq.Theta();}
44 double QCMPhi() const {return fCMq.Phi();}
45 double QCMPhiOut() const {return atan2(QCMside(),QCMout());} // phi w.r.t. out
46
47 protected:
48 TLorentzVector fP0; // LAB four-momentum of track 0
49 TLorentzVector fP1; // LAB four-momentum of track 1
50 TLorentzVector fP; // LAB total four-momentum
51 TLorentzVector fQ; // LAB four-momentum difference
52 TVector3 fBeta; // LAB pair velocity
53 TVector3 fBetat; // LAB pair velocity transverse
54 TVector3 fBetaz; // LAB pair velocity along z
55 TVector3 fUbeta; // LAB pair velocity direction
56 TVector3 fUbetat; // LAB pair velocity transverse direction
57 TVector3 fUbetaz; // LAB pair velocity along z direction (hm)
58 TLorentzVector fCMp; // CM total four-momentum
59 TLorentzVector fCMq; // CM four-momentum difference
60 TLorentzVector fBuf; // dummy buffer for swapping
7148817a 61
62 ClassDef(AliDPair,1)
63};
64//=============================================================================
65#endif