]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/muondep/AccEffTemplates/GenParamCustom.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muondep / AccEffTemplates / GenParamCustom.C
CommitLineData
963783ae 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <Riostream.h>
3#include "TRandom.h"
4#include "AliGenerator.h"
5#include "AliGenParam.h"
6#endif
7
8static Int_t IpCustom( TRandom *ran);
9static Double_t PtCustom( const Double_t *px, const Double_t */*dummy*/ );
10static Double_t YCustom( const Double_t *py, const Double_t */*dummy*/ );
11static Double_t V2Custom( const Double_t *pv, const Double_t */*dummy*/ );
12
13//-------------------------------------------------------------------------
14AliGenerator* GenParamCustom()
15{
16 AliGenParam* gener = new AliGenParam(1,-1,PtCustom,YCustom,V2Custom,IpCustom);
17 gener->SetMomentumRange(0,1e6);
18 gener->SetPtRange(0,999.);
19 gener->SetYRange(-4.2, -2.3);
20 gener->SetPhiRange(0., 360.);
21 gener->SetCutOnChild(1);
22 gener->SetChildPhiRange(0.,360.);
23 gener->SetChildThetaRange(0.,180.);
24 gener->SetForceDecay(kDiMuon);
25 gener->SetTrackingFlag(1);
26
27 return gener;
28}
29
30//-------------------------------------------------------------------------
31Int_t IpCustom( TRandom *)
32{
33 // particle to simulate (e.g. 443 for J/psi)
34 return VAR_GENPARAMCUSTOM_PDGPARTICLECODE;
35}
36
37//-------------------------------------------------------------------------
38Double_t PtCustom( const Double_t *px, const Double_t */*dummy*/ )
39{
40 // pT distribution
41 Double_t x=*px;
42 Float_t p0,p1,p2,p3;
43 p0 = VAR_GENPARAMCUSTOM_PT_P0; // 1.13e9;
44 p1 = VAR_GENPARAMCUSTOM_PT_P1; // 18.05;
45 p2 = VAR_GENPARAMCUSTOM_PT_P2; // 2.05;
46 p3 = VAR_GENPARAMCUSTOM_PT_P3; // 3.34;
47 return p0 *x / TMath::Power( p1 + TMath::Power(x,p2), p3 );
48}
49
50//-------------------------------------------------------------------------
51Double_t YCustom( const Double_t *py, const Double_t */*dummy*/ )
52{
53 // y distribution
54 Double_t y = *py;
55 Float_t p0,p1;
56 p0 = VAR_GENPARAMCUSTOM_Y_P0; // 4.08e5;
57 p1 = VAR_GENPARAMCUSTOM_Y_P1; // 7.1e4;
58 return p0 + p1*y;
59}
60
61//-------------------------------------------------------------------------
62Double_t V2Custom( const Double_t */*dummy*/, const Double_t */*dummy*/ )
63{
64 // v2
65 return 0.;
66}
67