AliPhysics  1168478 (1168478)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTrackContainerToyModel.cxx
Go to the documentation of this file.
1 /*************************************************************************
2 * Copyright(c) 1998-2016, 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 
17 #include <TMath.h>
18 #include <TRandom3.h>
22 
28  fTrackScalePt(1),
29  fTrackEtaWindow(0.9),
30  fRandomizeEtaPhi(0)
31 {
32 }
33 
39  AliTrackContainer(name),
40  fTrackScalePt(1),
41  fTrackEtaWindow(0.9),
42  fRandomizeEtaPhi(0)
43 {
44 }
45 
56 Bool_t AliTrackContainerToyModel::GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack* track, Double_t mass) const
57 {
58  Bool_t r = AliTrackContainer::GetMomentumFromTrack(mom, track, mass);
61  return r;
62 }
63 
75 {
79  return r;
80 }
81 
94 {
98  return r;
99 }
100 
112 {
116  return r;
117 }
118 
130 {
134  return r;
135 }
136 
142 {
143  if(fTrackScalePt<1.){
144  Double_t pTscale = fTrackScalePt*mom.Pt();
145  Double_t phiscale = mom.Phi();
146  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(mom.Eta())));
147  Double_t pXscale = pTscale * TMath::Cos(phiscale);
148  Double_t pYscale = pTscale * TMath::Sin(phiscale);
149  Double_t pZscale = pTscale/TMath::Tan(thetascale);
150  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
151  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
152  }
153 }
159 {
160  if(fRandomizeEtaPhi==1){
161 
162 
163  Double_t pTscale = mom.Pt();
164  Double_t etascale = 2.*fTrackEtaWindow * gRandom->Rndm() - fTrackEtaWindow;
165  Double_t phiscale = 2.* TMath::Pi() * gRandom->Rndm();
166  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(etascale)));
167  Double_t pXscale = pTscale * TMath::Cos(phiscale);
168  Double_t pYscale = pTscale * TMath::Sin(phiscale);
169  Double_t pZscale = pTscale/TMath::Tan(thetascale);
170  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
171  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
172  }
173 }
175 {
176  if (gRandom) delete gRandom;
177  gRandom = new TRandom3(0);
178  }
179 
180 
181 
182 
double Double_t
Definition: External.C:58
Allows to modify the tracks to implement toy models.
Double_t mass
Container with name, TClonesArray and cuts for particles.
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
TRandom * gRandom
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack *track, Double_t mass) const
int Int_t
Definition: External.C:63
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
void ScalePtOfLorentzVector(TLorentzVector &mom) const
virtual Bool_t GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack *track, Double_t mass) const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
bool Bool_t
Definition: External.C:53
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
void SetRandomEtaPhiOfLorentzVector(TLorentzVector &mom) const