ROOT logo
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include "TRandom.h"
#include "AliGenerator.h"
#include "AliGenParam.h"
#endif

static Int_t IpCustom( TRandom *ran);
static Double_t PtCustom( const Double_t *px, const Double_t */*dummy*/ );
static Double_t YCustom( const Double_t *py, const Double_t */*dummy*/ );
static Double_t V2Custom( const Double_t *pv, const Double_t */*dummy*/ );

//-------------------------------------------------------------------------
AliGenerator* GenParamCustom()
{
  AliGenParam* gener = new AliGenParam(1,-1,PtCustom,YCustom,V2Custom,IpCustom);
  gener->SetMomentumRange(0,1e6);
  gener->SetPtRange(0,999.);
  gener->SetYRange(-4.2, -2.3);
  gener->SetPhiRange(0., 360.);
  gener->SetCutOnChild(1);
  gener->SetChildPhiRange(0.,360.);
  gener->SetChildThetaRange(0.,180.);
  gener->SetForceDecay(kDiMuon);
  gener->SetTrackingFlag(1);
  
  return gener;
}

//-------------------------------------------------------------------------
Int_t IpCustom( TRandom *)
{
  // particle to simulate (e.g. 443 for J/psi)
  return VAR_GENPARAMCUSTOM_PDGPARTICLECODE;
}

//-------------------------------------------------------------------------
Double_t PtCustom( const Double_t *px, const Double_t */*dummy*/ )
{
  // pT distribution
  Double_t x=*px;
  Float_t p0,p1,p2,p3;
  p0 = VAR_GENPARAMCUSTOM_PT_P0; // 1.13e9;
  p1 = VAR_GENPARAMCUSTOM_PT_P1; // 18.05;
  p2 = VAR_GENPARAMCUSTOM_PT_P2; // 2.05;
  p3 = VAR_GENPARAMCUSTOM_PT_P3; // 3.34;
  return p0 *x / TMath::Power( p1 + TMath::Power(x,p2), p3 );
}

//-------------------------------------------------------------------------
Double_t YCustom( const Double_t *py, const Double_t */*dummy*/ )
{
  // y distribution
  Double_t y = *py;
  Float_t p0,p1;
  p0 = VAR_GENPARAMCUSTOM_Y_P0; // 4.08e5;
  p1 = VAR_GENPARAMCUSTOM_Y_P1; // 7.1e4;
  return p0 + p1*y;
}

//-------------------------------------------------------------------------
Double_t V2Custom( const Double_t */*dummy*/, const Double_t */*dummy*/ )
{
  // v2
  return 0.;
}

 GenParamCustom.C:1
 GenParamCustom.C:2
 GenParamCustom.C:3
 GenParamCustom.C:4
 GenParamCustom.C:5
 GenParamCustom.C:6
 GenParamCustom.C:7
 GenParamCustom.C:8
 GenParamCustom.C:9
 GenParamCustom.C:10
 GenParamCustom.C:11
 GenParamCustom.C:12
 GenParamCustom.C:13
 GenParamCustom.C:14
 GenParamCustom.C:15
 GenParamCustom.C:16
 GenParamCustom.C:17
 GenParamCustom.C:18
 GenParamCustom.C:19
 GenParamCustom.C:20
 GenParamCustom.C:21
 GenParamCustom.C:22
 GenParamCustom.C:23
 GenParamCustom.C:24
 GenParamCustom.C:25
 GenParamCustom.C:26
 GenParamCustom.C:27
 GenParamCustom.C:28
 GenParamCustom.C:29
 GenParamCustom.C:30
 GenParamCustom.C:31
 GenParamCustom.C:32
 GenParamCustom.C:33
 GenParamCustom.C:34
 GenParamCustom.C:35
 GenParamCustom.C:36
 GenParamCustom.C:37
 GenParamCustom.C:38
 GenParamCustom.C:39
 GenParamCustom.C:40
 GenParamCustom.C:41
 GenParamCustom.C:42
 GenParamCustom.C:43
 GenParamCustom.C:44
 GenParamCustom.C:45
 GenParamCustom.C:46
 GenParamCustom.C:47
 GenParamCustom.C:48
 GenParamCustom.C:49
 GenParamCustom.C:50
 GenParamCustom.C:51
 GenParamCustom.C:52
 GenParamCustom.C:53
 GenParamCustom.C:54
 GenParamCustom.C:55
 GenParamCustom.C:56
 GenParamCustom.C:57
 GenParamCustom.C:58
 GenParamCustom.C:59
 GenParamCustom.C:60
 GenParamCustom.C:61
 GenParamCustom.C:62
 GenParamCustom.C:63
 GenParamCustom.C:64
 GenParamCustom.C:65
 GenParamCustom.C:66
 GenParamCustom.C:67
 GenParamCustom.C:68