]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/muon/AliMuonInfoStoreRD.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muon / AliMuonInfoStoreRD.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 muon track
21//
22// Author: X-M. Zhang, zhang@clermont.in2p3.fr
23// zhangxm@iopp.ccnu.edu.cn
24/////////////////////////////////////////////////////////////
25
26#include "AliAODTrack.h"
27#include "AliESDMuonTrack.h"
28#include "AliMuonInfoStoreRD.h"
29
30class TObject;
31
32ClassImp(AliMuonInfoStoreRD)
33
34const TString AliMuonInfoStoreRD::fgkStdBranchName("MuonRD");
fd1d0cb9 35
36//-----------------------------------------------------------------------------
37AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
38TObject(),
9bbc42ca 39fMomentumAtVtx(),
40fMomentumAtDCA(),
41fMomentumUncor(),
fd1d0cb9 42fCharge(0),
43fMatchTrigger(-1),
fd1d0cb9 44fChi2FitMomentum(0.),
1195bb6f 45fChi2MatchTrigger(0.),
9bbc42ca 46fRabsEnd(0.),
47fSelMask(0)
fd1d0cb9 48{
49 //
50 // default constructor
51 //
1195bb6f 52 for (Int_t i=3; i--;) fDCA[i]=0.;
fd1d0cb9 53}
54
55//-----------------------------------------------------------------------------
9bbc42ca 56AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk, UInt_t selMask) :
fd1d0cb9 57TObject(),
9bbc42ca 58fMomentumAtVtx(),
59fMomentumAtDCA(),
60fMomentumUncor(),
fd1d0cb9 61fCharge(0),
62fMatchTrigger(-1),
fd1d0cb9 63fChi2FitMomentum(0.),
1195bb6f 64fChi2MatchTrigger(0.),
9bbc42ca 65fRabsEnd(0.),
66fSelMask(selMask)
fd1d0cb9 67{
68 //
69 // AOD-base constructor
70 //
1195bb6f 71 for (Int_t i=3; i--;) fDCA[i]=0.;
fd1d0cb9 72 this->FillMuonInfo(trk);
73}
74
75//-----------------------------------------------------------------------------
9bbc42ca 76AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk, UInt_t selMask) :
fd1d0cb9 77TObject(),
9bbc42ca 78fMomentumAtVtx(),
79fMomentumAtDCA(),
80fMomentumUncor(),
fd1d0cb9 81fCharge(0),
82fMatchTrigger(-1),
fd1d0cb9 83fChi2FitMomentum(0.),
1195bb6f 84fChi2MatchTrigger(0.),
9bbc42ca 85fRabsEnd(0.),
86fSelMask(selMask)
fd1d0cb9 87{
88 //
89 // ESD-base constructor
90 //
1195bb6f 91 for (Int_t i=3; i--;) fDCA[i]=0.;
fd1d0cb9 92 this->FillMuonInfo(trk);
93}
94
95//-----------------------------------------------------------------------------
96AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) :
97TObject(src),
9bbc42ca 98fMomentumAtVtx(src.fMomentumAtVtx),
99fMomentumAtDCA(src.fMomentumAtDCA),
100fMomentumUncor(src.fMomentumUncor),
fd1d0cb9 101fCharge(src.fCharge),
102fMatchTrigger(src.fMatchTrigger),
fd1d0cb9 103fChi2FitMomentum(src.fChi2FitMomentum),
1195bb6f 104fChi2MatchTrigger(src.fChi2MatchTrigger),
9bbc42ca 105fRabsEnd(src.fRabsEnd),
106fSelMask(src.fSelMask)
fd1d0cb9 107{
108 //
109 // copy constructor
110 //
1195bb6f 111 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
fd1d0cb9 112}
113
114//-----------------------------------------------------------------------------
115AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
116{
117 //
118 // assignment constructor
119 //
120 if(&src==this) return *this;
121
9bbc42ca 122 fMomentumAtVtx = src.fMomentumAtVtx;
123 fMomentumAtDCA = src.fMomentumAtDCA;
124 fMomentumUncor = src.fMomentumUncor;
fd1d0cb9 125 fCharge = src.fCharge;
126 fMatchTrigger = src.fMatchTrigger;
fd1d0cb9 127 fChi2FitMomentum = src.fChi2FitMomentum;
128 fChi2MatchTrigger = src.fChi2MatchTrigger;
1195bb6f 129 fRabsEnd = src.fRabsEnd;
9bbc42ca 130 fSelMask = src.fSelMask;
fd1d0cb9 131
1195bb6f 132 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
fd1d0cb9 133
134 return *this;
135}
136
137//-----------------------------------------------------------------------------
138AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
139{
140 //
141 // destructor
142 //
143}
144
145//-----------------------------------------------------------------------------
146void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
147{
148 // extract reco info of muon track from AOD
149
150 Double_t arr[3];
9bbc42ca 151 trk->PxPyPz(arr); this->SetMomentumAtVtx(arr);
152 trk->PxPyPzAtDCA(arr); this->SetMomentumAtDCA(arr);
153 trk->XYZAtDCA(arr); this->SetDCA(arr);
fd1d0cb9 154 this->SetCharge(trk->Charge());
155 this->SetMatchTrigger(trk->GetMatchTrigger());
fd1d0cb9 156 this->SetChi2FitMomentum(trk->Chi2perNDF());
157 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
1195bb6f 158 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
d387f518 159
fd1d0cb9 160 return;
161}
162
163
164//-----------------------------------------------------------------------------
165void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
166{
167 // extract reco info of muon track from ESD
fd1d0cb9 168
169 Double_t arr[3];
9bbc42ca 170 arr[0]=trk->Px(); arr[1]=trk->Py(); arr[2]=trk->Pz(); this->SetMomentumAtVtx(arr);
171 arr[0]=trk->PxAtDCA(); arr[1]=trk->PyAtDCA(); arr[2]=trk->PzAtDCA(); this->SetMomentumAtDCA(arr);
172 arr[0]=trk->PxUncorrected(); arr[1]=trk->PyUncorrected(); arr[2]=trk->PzUncorrected(); this->SetMomentumUncor(arr);
173 arr[0]=trk->GetNonBendingCoorAtDCA(); arr[1]=trk->GetBendingCoorAtDCA(); arr[2]=trk->GetZ(); this->SetDCA(arr);
fd1d0cb9 174 this->SetCharge(trk->Charge());
175 this->SetMatchTrigger(trk->GetMatchTrigger());
fd1d0cb9 176 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
177 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
1195bb6f 178 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
d387f518 179
fd1d0cb9 180 return;
181}