]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/AliAODDimuon.h
Fixing coding violations (Livio, Pietro)
[u/mrichter/AliRoot.git] / PWG3 / AliAODDimuon.h
1 #ifndef AliAODDimuon_H
2 #define AliAODDimuon_H
3
4 // AliAODDimuon: a class for AODs for the MUON Arm of the ALICE Experiment
5 // Author: P. Cortese, Universita' del Piemonte Orientale in Alessandria and
6 // INFN of Torino - Italy
7 //
8 // The class defines a dimuon pair object from two AliAODTrack objects.
9 // AliAODDimuon objects are supposed to be added to the AliAODEvent structure
10 // during analysis. They would then allow to calculate the dimuon-related
11 // kinematic variables with a minimal disk occupancy.
12 // The payload of the class has been reduced to two pointers to the two
13 // tracks with the addition of a pointer to the AliAODEventInfo. An instance of
14 // this class has also to be added to the AliAODEvent structure to provide
15 // additional information that is specific to MUON and therefore has not been
16 // included into the AOD header.
17 // Two transient data members are not stored on file as they can be recomputed
18 // at runtime.
19 //
20
21 // 2007/07/07 v1.00 Initial version
22 // 2007/12/06 v1.01 Introduction of AliAODEventInfo
23 // 2007/12/18 v1.02 Corrected CostCS for Like-Sign, added CostKh, CostHe and xf
24 // 2008/02/01 v1.03 Apply coding conventions
25
26 #include "TRef.h"
27 #include "AliVParticle.h"
28 #include "AliAODTrack.h"
29 #include "AliAODEvent.h"
30 #include "AliAODEventInfo.h"
31
32 class TLorentzVector;
33
34 class AliAODDimuon: public AliVParticle {
35 public:
36   AliAODDimuon();
37   AliAODDimuon(const AliAODDimuon& dimu);
38   AliAODDimuon &operator=(const AliAODDimuon& dimu);
39   AliAODDimuon(TObject *mu0, TObject *mu1, TObject *ei=0);
40   virtual ~AliAODDimuon();
41
42   // Methods to access kinematics
43   virtual Double_t Px() const;
44   virtual Double_t Py() const;
45   virtual Double_t Pz() const;
46   virtual Bool_t PxPyPz(Double_t* p) const { p[0]=Px(); p[1]=Py(); p[2]=Pz(); return 1;}
47   virtual Double_t Pt() const;
48   virtual Double_t P() const;
49
50   virtual Double_t OneOverPt() const {return Pt()>0 ? 1./Pt() : -999999999;}
51   virtual Double_t Phi() const;
52   virtual Double_t Theta() const;
53
54   virtual Double_t E() const;
55   virtual Double_t M() const;
56   
57   virtual Double_t Eta() const;
58   virtual Double_t Y() const;
59   
60   virtual Short_t Charge() const;
61
62   // Dimuon vertex will be implemented when the muon track covariance matrix 
63   // at vertex will be included in the ESD (and AOD)
64   // It would require also the information about magnetic field when filling AOD
65   virtual Double_t Xv() const {return -999999999;}
66   virtual Double_t Yv() const {return -999999999;}
67   virtual Double_t Zv() const {return -999999999;}
68   virtual Bool_t XvYvZv(Double_t* v) const { v[0]=-999999999; v[1]=-999999999; v[2]=-999999999; return 0;}
69
70   Double_t P();
71   Double_t Phi();
72   Double_t Theta();
73   Double_t M();
74   Double_t Mass();
75   Double_t Eta();
76   Double_t Y();
77
78   // Added functions
79   Double_t XF();     // Feynman x
80   Double_t CostCS(); // Cosinus of the Collins-Soper polar decay angle
81   Double_t CostHe(); // Cosinus of the Helicity polar decay angle
82   Int_t AnyPt();
83   Int_t LowPt();
84   Int_t HighPt();
85   Double_t MaxChi2Match();
86   // PID
87   virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still)
88
89   // Additional getters and setters
90   AliAODTrack* GetMu(Int_t imu=0) const {return (imu==0||imu==1)&&(fMu[imu]!=0) ? (AliAODTrack*)fMu[imu].GetObject() : 0; } // Get a pointer to a muon
91   AliAODTrack* Mu(Int_t imu=0) const {return (imu==0||imu==1)&&(fMu[imu]!=0) ? (AliAODTrack*)fMu[imu].GetObject() : 0; } // Get a pointer to a muon
92   AliAODEventInfo* GetEventInfo() const {return (fEi!=0) ? (AliAODEventInfo*)fEi.GetObject() : 0; } // Get a pointer to the AliAODEventInfo
93   AliAODEventInfo* GetEi() const { return (fEi!=0) ? (AliAODEventInfo*)fEi.GetObject() : 0; }
94   AliAODEventInfo* Ei() const { return (fEi!=0) ? (AliAODEventInfo*)fEi.GetObject() : 0; }
95
96   void SetEi(AliAODEventInfo *ei){ fEi=ei; }
97   void SetMu(Int_t imu=0, AliAODTrack *mu=0);
98   void SetMuons(AliAODTrack *mu0=0, AliAODTrack *mu1=0);
99
100 private:
101   Int_t CheckPointers() const;
102   void BookP();
103
104   // Data members
105   TRef fMu[2];  // Pointers to the reconstructed muons
106   TRef fEi;     // Pointer to the EventInfo object
107   TLorentzVector *fP; //! TLorentzVector of dimuon momentum (not stored into file)
108
109   // Useful constants
110   Double_t fMProton; //! Proton mass (not stored into file)
111
112   ClassDef(AliAODDimuon,1)  // AliAODDimuon track
113 };
114
115 #endif