]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/muondep/AccEffTemplates/GenParamCustomSingle.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muondep / AccEffTemplates / GenParamCustomSingle.C
CommitLineData
81190958 1/*
2 * MuonGenerator.C
3 * aliroot_dev
4 *
5 * Created by philippe pillot on 05/03/13.
6 * Copyright 2013 SUBATECH. All rights reserved.
7 *
8 */
9
10
11#if !defined(__CINT__) || defined(__MAKECINT__)
12#include <Riostream.h>
13#include "TRandom.h"
14#include "AliGenerator.h"
15#include "AliGenParam.h"
16#endif
17
18
19static Int_t IpMuon( TRandom *ran);
20static Double_t PtMuon( const Double_t *px, const Double_t */*dummy*/ );
21static Double_t YMuon( const Double_t *py, const Double_t */*dummy*/ );
22static Double_t V2Muon( const Double_t *pv, const Double_t */*dummy*/ );
23
24
25//-------------------------------------------------------------------------
26AliGenerator* GenParamCustomSingle()
27{
28 AliGenParam *singleMu = new AliGenParam(1,-1,PtMuon,YMuon,V2Muon,IpMuon);
29 singleMu->SetMomentumRange(0,1e6);
30 singleMu->SetPtRange(VAR_GENPARAMCUSTOMSINGLE_PTMIN,999.);
31 singleMu->SetYRange(-4.2, -2.3);
32 singleMu->SetPhiRange(0., 360.);
33 singleMu->SetForceDecay(kNoDecay);
34 singleMu->SetTrackingFlag(1);
35 return singleMu;
36}
37
38//-------------------------------------------------------------------------
39Int_t IpMuon(TRandom *ran)
40{
41 // muon composition
42
43 if (ran->Rndm() < 0.5 )
44 {
45 return 13;
46 }
47 else
48 {
49 return -13;
50 }
51}
52
53//-------------------------------------------------------------------------
54Double_t PtMuon( const Double_t *px, const Double_t */*dummy*/ )
55{
56 // muon pT
57
58 Double_t x=*px;
59 Float_t p0,p1,p2,p3;
60 p0 = VAR_GENPARAMCUSTOMSINGLE_PT_P0; //4.05962;
61 p1 = VAR_GENPARAMCUSTOMSINGLE_PT_P1; //1;
62 p2 = VAR_GENPARAMCUSTOMSINGLE_PT_P2; //2.46187;
63 p3 = VAR_GENPARAMCUSTOMSINGLE_PT_P3; //2.08644;
64 return p0 / TMath::Power( p1 + TMath::Power(x,p2), p3 );
65}
66
67//-------------------------------------------------------------------------
68Double_t YMuon( const Double_t *py, const Double_t */*dummy*/ )
69{
70 // muon y
71
72 Double_t y = *py;
73 //pol4 only valid in y= -4;-2.5
74 Float_t p0,p1,p2,p3;
75 p0 = VAR_GENPARAMCUSTOMSINGLE_Y_P0; //0.729545;
76 p1 = VAR_GENPARAMCUSTOMSINGLE_Y_P1; //0.53837;
77 p2 = VAR_GENPARAMCUSTOMSINGLE_Y_P2; //0.141776;
78 p3 = VAR_GENPARAMCUSTOMSINGLE_Y_P3; //0.0130173;
79 return p0 * (1. + p1*y + p2*y*y + p3*y*y*y);
80}
81
82//-------------------------------------------------------------------------
83Double_t V2Muon( const Double_t */*dummy*/, const Double_t */*dummy*/ )
84{
85 //muon v2
86 return 0.;
87}
88