]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/muon/AliDimuInfoStoreRD.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muon / AliDimuInfoStoreRD.cxx
CommitLineData
fd1d0cb9 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
27de2dfb 16/* $Id$ */
17
fd1d0cb9 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
32ClassImp(AliDimuInfoStoreRD)
33
34const TString AliDimuInfoStoreRD::fgkStdBranchName("DimuRD");
fd1d0cb9 35
36//-----------------------------------------------------------------------------
37AliDimuInfoStoreRD::AliDimuInfoStoreRD() :
38TObject(),
9bbc42ca 39fSelMask(0),
fd1d0cb9 40fMomentum(),
41fCharge(0),
42fInvM(0.)
43{
44 //
45 // default constructor
46 //
47 for (Int_t i=2; i--;) fMuonRef[i] = 0;
48}
49
50//-----------------------------------------------------------------------------
9bbc42ca 51AliDimuInfoStoreRD::AliDimuInfoStoreRD(AliMuonInfoStoreRD* const trk0, AliMuonInfoStoreRD* const trk1, UInt_t selMask) :
fd1d0cb9 52TObject(),
9bbc42ca 53fSelMask(selMask),
fd1d0cb9 54fMomentum(),
55fCharge(0),
56fInvM(0.)
57{
58 //
59 // default constructor
60 //
61 fMuonRef[0] = trk0;
62 fMuonRef[1] = trk1;
63 FillDimuInfo();
64}
65
66//-----------------------------------------------------------------------------
67AliDimuInfoStoreRD::AliDimuInfoStoreRD(const AliDimuInfoStoreRD &src) :
68TObject(src),
9bbc42ca 69fSelMask(src.fSelMask),
fd1d0cb9 70fMomentum(src.fMomentum),
71fCharge(src.fCharge),
72fInvM(src.fInvM)
73{
74 //
75 // copy constructor
76 //
77 for (Int_t i=2; i--;) fMuonRef[i] = src.fMuonRef[i];
78}
79
80//-----------------------------------------------------------------------------
81AliDimuInfoStoreRD& AliDimuInfoStoreRD::operator=(const AliDimuInfoStoreRD &src)
82{
83 //
84 // assignment constructor
85 //
86 if(&src==this) return *this;
87
9bbc42ca 88 fSelMask = src.fSelMask;
fd1d0cb9 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//-----------------------------------------------------------------------------
98AliDimuInfoStoreRD::~AliDimuInfoStoreRD()
99{
100 //
101 // destructor
102 //
103}
104
105//-----------------------------------------------------------------------------
106void 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
9bbc42ca 113 fMomentum = trk0->MomentumAtVtx() + trk1->MomentumAtVtx();
fd1d0cb9 114 fCharge = trk0->Charge() + trk1->Charge();
115
116 Double_t mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass();
117 TLorentzVector lorentzP0, lorentzP1, lorentzP;
9bbc42ca 118 lorentzP0.SetVectM(trk0->MomentumAtVtx(), mMu);
119 lorentzP1.SetVectM(trk1->MomentumAtVtx(), mMu);
fd1d0cb9 120 lorentzP = lorentzP0 + lorentzP1;
121 fInvM = lorentzP.Mag();
122
123 trk0 = 0;
124 trk1 = 0;
125 return;
126}