]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AliDimuInfoStoreRD.cxx
1 validate the official physics selection, centrality selection and event plane selec...
[u/mrichter/AliRoot.git] / PWG / muon / AliDimuInfoStoreRD.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 /////////////////////////////////////////////////////////////
19 //
20 // class used to extract and store reco info of dimu candidate
21 //
22 // Author: X-M. Zhang, zhang@clermont.in2p3.fr
23 //                     zhangxm@iopp.ccnu.edu.cn
24 /////////////////////////////////////////////////////////////
25
26 #include <TDatabasePDG.h>
27 #include <TLorentzVector.h>
28
29 #include "AliMuonInfoStoreRD.h"
30 #include "AliDimuInfoStoreRD.h"
31
32 ClassImp(AliDimuInfoStoreRD)
33
34 const TString AliDimuInfoStoreRD::fgkStdBranchName("DimuRD");
35
36 //-----------------------------------------------------------------------------
37 AliDimuInfoStoreRD::AliDimuInfoStoreRD() :
38 TObject(),
39 fSelMask(0),
40 fMomentum(),
41 fCharge(0),
42 fInvM(0.)
43 {
44   //
45   // default constructor
46   //
47   for (Int_t i=2; i--;) fMuonRef[i] = 0;
48 }
49
50 //-----------------------------------------------------------------------------
51 AliDimuInfoStoreRD::AliDimuInfoStoreRD(AliMuonInfoStoreRD* const trk0, AliMuonInfoStoreRD* const trk1, UInt_t selMask) :
52 TObject(),
53 fSelMask(selMask),
54 fMomentum(),
55 fCharge(0),
56 fInvM(0.)
57 {
58   //
59   // default constructor
60   //
61   fMuonRef[0] = trk0;
62   fMuonRef[1] = trk1;
63   FillDimuInfo();
64 }
65
66 //-----------------------------------------------------------------------------
67 AliDimuInfoStoreRD::AliDimuInfoStoreRD(const AliDimuInfoStoreRD &src) :
68 TObject(src),
69 fSelMask(src.fSelMask),
70 fMomentum(src.fMomentum),
71 fCharge(src.fCharge),
72 fInvM(src.fInvM)
73 {
74   //
75   // copy constructor
76   //
77   for (Int_t i=2; i--;) fMuonRef[i] = src.fMuonRef[i];
78 }
79
80 //-----------------------------------------------------------------------------
81 AliDimuInfoStoreRD& AliDimuInfoStoreRD::operator=(const AliDimuInfoStoreRD &src)
82 {
83   //
84   // assignment constructor
85   //
86   if(&src==this) return *this;
87
88   fSelMask  = src.fSelMask;
89   fMomentum = src.fMomentum;
90   fCharge   = src.fCharge;
91   fInvM     = src.fInvM;
92   for (Int_t i=2; i--;) fMuonRef[i] = src.fMuonRef[i];
93
94   return *this;
95 }
96
97 //-----------------------------------------------------------------------------
98 AliDimuInfoStoreRD::~AliDimuInfoStoreRD()
99 {
100   //
101   // destructor
102   //
103 }
104
105 //-----------------------------------------------------------------------------
106 void AliDimuInfoStoreRD::FillDimuInfo()
107 {
108   // fill dimuon candidate info from the corresponding two muon tracks
109
110   AliMuonInfoStoreRD *trk0 = (AliMuonInfoStoreRD*)fMuonRef[0].GetObject();
111   AliMuonInfoStoreRD *trk1 = (AliMuonInfoStoreRD*)fMuonRef[1].GetObject();
112
113   fMomentum = trk0->MomentumAtVtx() + trk1->MomentumAtVtx();
114   fCharge   = trk0->Charge()   + trk1->Charge();
115
116   Double_t mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass();
117   TLorentzVector lorentzP0, lorentzP1, lorentzP;
118   lorentzP0.SetVectM(trk0->MomentumAtVtx(), mMu);
119   lorentzP1.SetVectM(trk1->MomentumAtVtx(), mMu);
120   lorentzP = lorentzP0 + lorentzP1;
121   fInvM = lorentzP.Mag();
122
123   trk0 = 0;
124   trk1 = 0;
125   return;
126 }