AliPhysics  cda3415 (cda3415)
 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 
41  fTrackScalePt(1),
42  fTrackEtaWindow(0.9),
43  fRandomizeEtaPhi(0)
44 
45 {
46 }
47 
58 Bool_t AliMCParticleContainerToyModel::GetMomentumFromParticle(TLorentzVector &mom, const AliAODMCParticle* track, Double_t mass) const
59 {
63  return r;
64 }
65 
77 {
81  return r;
82 }
83 
96 {
100  return r;
101 }
102 
114 {
118  return r;
119 }
120 
132 {
136  return r;
137 }
138 
144 {
145  if(fTrackScalePt<1.){
146 
147  Double_t pTscale = fTrackScalePt*mom.Pt();
148  Double_t phiscale = mom.Phi();
149  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(mom.Eta())));
150  Double_t pXscale = pTscale * TMath::Cos(phiscale);
151  Double_t pYscale = pTscale * TMath::Sin(phiscale);
152  Double_t pZscale = pTscale/TMath::Tan(thetascale);
153  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
154  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
155  }
156 }
162 {
163  if(fRandomizeEtaPhi==1){
164  gRandom = new TRandom3(0);
165 
166  Double_t pTscale = mom.Pt();
167  Double_t etascale = 2.*fTrackEtaWindow * gRandom->Rndm() - fTrackEtaWindow;
168  Double_t phiscale = 2.* TMath::Pi() * gRandom->Rndm();
169 
170 
171  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(etascale)));
172  Double_t pXscale = pTscale * TMath::Cos(phiscale);
173  Double_t pYscale = pTscale * TMath::Sin(phiscale);
174  Double_t pZscale = pTscale/TMath::Tan(thetascale);
175  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
176  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
177  }
178 }
179 
180 
181 
182 
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
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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.