]> git.uio.no Git - u/mrichter/AliRoot.git/blame - test/vmctest/gun/genExtFileConfig.C
RWGCF converted to native cmake
[u/mrichter/AliRoot.git] / test / vmctest / gun / genExtFileConfig.C
CommitLineData
267e5cd8 1// $Id$
2//
3// AliRoot Configuration for running aliroot with Monte Carlo.
250872b3 4// genExtFileConfig() includes the common setting for all MCs
267e5cd8 5// which has to be called after MC is instantiated.
6// Called from MC specific configs (g3Config.C, g4Config.C).
7//
8// Extracted from G3 specific Config.C
9// by I. Hrivnacova, IPN Orsay
10
11// Functions
12Float_t EtaToTheta(Float_t arg);
250872b3 13AliGenerator* GeneratorFactory(Int_t startEvent);
267e5cd8 14
250872b3 15void genExtFileConfig(Int_t startEvent=0)
267e5cd8 16{
17 cout << "Running genExtFileConfig.C ... " << endl;
18
19 //=======================================================================
20 // Steering parameters for ALICE simulation
21 //=======================================================================
22
23 gMC->SetProcess("DCAY",1);
24 gMC->SetProcess("PAIR",1);
25 gMC->SetProcess("COMP",1);
26 gMC->SetProcess("PHOT",1);
27 gMC->SetProcess("PFIS",0);
28 gMC->SetProcess("DRAY",0);
29 gMC->SetProcess("ANNI",1);
30 gMC->SetProcess("BREM",1);
31 gMC->SetProcess("MUNU",1);
32 gMC->SetProcess("CKOV",1);
33 gMC->SetProcess("HADR",1);
34 gMC->SetProcess("LOSS",2);
35 gMC->SetProcess("MULS",1);
36 //gMC->SetProcess("RAYL",1);
37
38 Float_t cut = 1.e-3; // 1MeV cut by default
39 Float_t tofmax = 1.e10;
40
41 gMC->SetCut("CUTGAM", cut);
42 gMC->SetCut("CUTELE", cut);
43 gMC->SetCut("CUTNEU", cut);
44 gMC->SetCut("CUTHAD", cut);
45 gMC->SetCut("CUTMUO", cut);
46 gMC->SetCut("BCUTE", cut);
47 gMC->SetCut("BCUTM", cut);
48 gMC->SetCut("DCUTE", cut);
49 gMC->SetCut("DCUTM", cut);
50 gMC->SetCut("PPCUTM", cut);
51 gMC->SetCut("TOFMAX", tofmax);
52
53 //=======================================================================
54 // External decayer
55 //=======================================================================
56
57 TVirtualMCDecayer *decayer = new AliDecayerPythia();
58 decayer->SetForceDecay(kAll);
59 decayer->Init();
60/*
61 //forbid some decays
62 AliPythia * py= AliPythia::Instance();
63 py->SetMDME(737,1,0); //forbid D*+->D+ + pi0
64 py->SetMDME(738,1,0);//forbid D*+->D+ + gamma
65
66 for(Int_t d=747; d<=762; d++){
67 py->SetMDME(d,1,0);
68 }
69
70 for(Int_t d=764; d<=807; d++){
71 py->SetMDME(d,1,0);
72 }
73*/
74 gMC->SetExternalDecayer(decayer);
75
76 //=======================================================================
77 // Event generator
78 //=======================================================================
79
80 // External generator configuration
250872b3 81 AliGenerator* gener = GeneratorFactory(startEvent);
267e5cd8 82 gener->SetOrigin(0, 0, 0); // vertex position
83 //gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
84 //gener->SetCutVertexZ(1.); // Truncate at 1 sigma
85 //gener->SetVertexSmear(kPerEvent);
86 gener->SetTrackingFlag(1);
87 gener->Init();
88
89 cout << "Running genExtFileConfig.C finished ... " << endl;
90}
91
92Float_t EtaToTheta(Float_t arg){
93 return (180./TMath::Pi())*2.*atan(exp(-arg));
94}
95
250872b3 96AliGenerator* GeneratorFactory(Int_t startEvent) {
267e5cd8 97
98 AliGenExtFile *gener = new AliGenExtFile(-1);
99 AliGenReaderTreeK * reader = new AliGenReaderTreeK();
100
101 reader->SetFileName("galice.root");
102 reader->AddDir("gen");
103 gener->SetReader(reader);
250872b3 104 gener->SetStartEvent(startEvent);
267e5cd8 105
106 return gener;
107}
108