AliPhysics  8dc8609 (8dc8609)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMCParticleContainerToyModel.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 
34 {
35 }
36 
43  fTrackScalePt(1),
44  fTrackEtaWindow(0.9),
45  fRandomizeEtaPhi(0)
46 {
47 }
48 
59 Bool_t AliMCParticleContainerToyModel::GetMomentumFromParticle(TLorentzVector &mom, const AliAODMCParticle* track, Double_t mass) const
60 {
64  return r;
65 }
66 
78 {
82  return r;
83 }
84 
97 {
101  return r;
102 }
103 
115 {
119  return r;
120 }
121 
133 {
137  return r;
138 }
139 
145 {
146  if(fTrackScalePt<1.){
147 
148  Double_t pTscale = fTrackScalePt*mom.Pt();
149  Double_t phiscale = mom.Phi();
150  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(mom.Eta())));
151  Double_t pXscale = pTscale * TMath::Cos(phiscale);
152  Double_t pYscale = pTscale * TMath::Sin(phiscale);
153  Double_t pZscale = pTscale/TMath::Tan(thetascale);
154  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
155  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
156  }
157 }
163 {
164  if(fRandomizeEtaPhi==1){
165 
166 
167 
168  Double_t pTscale = mom.Pt();
169 
170  Double_t etascale = 2.*fTrackEtaWindow * gRandom->Rndm() - fTrackEtaWindow;
171  Double_t phiscale = 2.* TMath::Pi() * gRandom->Rndm();
172 
173 
174  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(etascale)));
175  Double_t pXscale = pTscale * TMath::Cos(phiscale);
176  Double_t pYscale = pTscale * TMath::Sin(phiscale);
177  Double_t pZscale = pTscale/TMath::Tan(thetascale);
178  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
179  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
180 
181  }
182 }
183 
185 {
186 
187  if (gRandom) delete gRandom;
188  gRandom = new TRandom3(0);
189  }
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
double Double_t
Definition: External.C:58
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
Double_t mass
void ScalePtOfLorentzVector(TLorentzVector &mom) const
TRandom * gRandom
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
int Int_t
Definition: External.C:63
void SetRandomEtaPhiOfLorentzVector(TLorentzVector &mom) const
virtual Bool_t GetMomentumFromParticle(TLorentzVector &mom, const AliVParticle *part, Double_t mass) const
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetMomentumFromParticle(TLorentzVector &mom, const AliAODMCParticle *track, Double_t mass) const
bool Bool_t
Definition: External.C:53
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
Container for MC-true particles within the EMCAL framework.
Allows to modify the tracks to implement toy models.