1 /**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // class used to extract and store reco info of dimu candidate
22 // Author: X-M. Zhang, zhang@clermont.in2p3.fr
23 // zhangxm@iopp.ccnu.edu.cn
24 /////////////////////////////////////////////////////////////
26 #include <TDatabasePDG.h>
27 #include <TLorentzVector.h>
29 #include "AliMuonInfoStoreRD.h"
30 #include "AliDimuInfoStoreRD.h"
32 ClassImp(AliDimuInfoStoreRD)
34 const TString AliDimuInfoStoreRD::fgkStdBranchName("DimuRD");
36 //-----------------------------------------------------------------------------
37 AliDimuInfoStoreRD::AliDimuInfoStoreRD() :
45 // default constructor
47 for (Int_t i=2; i--;) fMuonRef[i] = 0;
50 //-----------------------------------------------------------------------------
51 AliDimuInfoStoreRD::AliDimuInfoStoreRD(AliMuonInfoStoreRD* const trk0, AliMuonInfoStoreRD* const trk1, UInt_t selMask) :
59 // default constructor
66 //-----------------------------------------------------------------------------
67 AliDimuInfoStoreRD::AliDimuInfoStoreRD(const AliDimuInfoStoreRD &src) :
69 fSelMask(src.fSelMask),
70 fMomentum(src.fMomentum),
77 for (Int_t i=2; i--;) fMuonRef[i] = src.fMuonRef[i];
80 //-----------------------------------------------------------------------------
81 AliDimuInfoStoreRD& AliDimuInfoStoreRD::operator=(const AliDimuInfoStoreRD &src)
84 // assignment constructor
86 if(&src==this) return *this;
88 fSelMask = src.fSelMask;
89 fMomentum = src.fMomentum;
90 fCharge = src.fCharge;
92 for (Int_t i=2; i--;) fMuonRef[i] = src.fMuonRef[i];
97 //-----------------------------------------------------------------------------
98 AliDimuInfoStoreRD::~AliDimuInfoStoreRD()
105 //-----------------------------------------------------------------------------
106 void AliDimuInfoStoreRD::FillDimuInfo()
108 // fill dimuon candidate info from the corresponding two muon tracks
110 AliMuonInfoStoreRD *trk0 = (AliMuonInfoStoreRD*)fMuonRef[0].GetObject();
111 AliMuonInfoStoreRD *trk1 = (AliMuonInfoStoreRD*)fMuonRef[1].GetObject();
113 fMomentum = trk0->MomentumAtVtx() + trk1->MomentumAtVtx();
114 fCharge = trk0->Charge() + trk1->Charge();
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();