AliPhysics  cdeda5a (cdeda5a)
 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 <TRandom3.h>
21 
27  fTrackScalePt(1),
28  fTrackEtaWindow(0.9),
29  fRandomizeEtaPhi(0)
30 {
31 }
32 
38  AliTrackContainer(name),
39  fTrackScalePt(1),
40  fTrackEtaWindow(0.9),
41  fRandomizeEtaPhi(0)
42 {
43 }
44 
55 Bool_t AliTrackContainerToyModel::GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack* track, Double_t mass) const
56 {
57  Bool_t r = AliTrackContainer::GetMomentumFromTrack(mom, track, mass);
60  return r;
61 }
62 
74 {
78  return r;
79 }
80 
93 {
97  return r;
98 }
99 
111 {
115  return r;
116 }
117 
129 {
133  return r;
134 }
135 
141 {
142  if(fTrackScalePt<1.){
143  Double_t pTscale = fTrackScalePt*mom.Pt();
144  Double_t phiscale = mom.Phi();
145  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(mom.Eta())));
146  Double_t pXscale = pTscale * TMath::Cos(phiscale);
147  Double_t pYscale = pTscale * TMath::Sin(phiscale);
148  Double_t pZscale = pTscale/TMath::Tan(thetascale);
149  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
150  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
151  }
152 }
158 {
159  if(fRandomizeEtaPhi==1){
160 
161 
162  Double_t pTscale = mom.Pt();
163  Double_t etascale = 2.*fTrackEtaWindow * gRandom->Rndm() - fTrackEtaWindow;
164  Double_t phiscale = 2.* TMath::Pi() * gRandom->Rndm();
165  Double_t thetascale = 2.*TMath::ATan(TMath::Exp(-1.*(etascale)));
166  Double_t pXscale = pTscale * TMath::Cos(phiscale);
167  Double_t pYscale = pTscale * TMath::Sin(phiscale);
168  Double_t pZscale = pTscale/TMath::Tan(thetascale);
169  Double_t pscale=TMath::Sqrt(pTscale*pTscale+pZscale*pZscale);
170  mom.SetPxPyPzE(pXscale, pYscale, pZscale, pscale);
171  }
172 }
174 {
175  if (gRandom) delete gRandom;
176  gRandom = new TRandom3(0);
177  }
178 
179 
180 
181 
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