1 // $Id: g4ConfigCommon.C 30849 2009-02-01 11:42:22Z fca $
3 // AliRoot Configuration for running aliroot with Monte Carlo.
4 // ConfigCommon2() includes the common setting for all MCs
5 // which has to be called after MC is instantiated.
6 // Called from g4Config.C
8 // By I. Hrivnacova, IPN Orsay
11 Float_t EtaToTheta(Float_t arg);
12 AliGenerator* GeneratorFactory();
16 cout << "Running ConfigCommon2.C ... " << endl;
18 //=======================================================================
19 // Steering parameters for ALICE simulation
20 //=======================================================================
22 gMC->SetProcess("DCAY",1);
23 gMC->SetProcess("PAIR",1);
24 gMC->SetProcess("COMP",1);
25 gMC->SetProcess("PHOT",1);
26 gMC->SetProcess("PFIS",0);
27 gMC->SetProcess("DRAY",0);
28 gMC->SetProcess("ANNI",1);
29 gMC->SetProcess("BREM",1);
30 gMC->SetProcess("MUNU",1);
31 gMC->SetProcess("CKOV",1);
32 gMC->SetProcess("HADR",1);
33 gMC->SetProcess("LOSS",2);
34 gMC->SetProcess("MULS",1);
35 //gMC->SetProcess("RAYL",1);
37 Float_t cut = 1.e-3; // 1MeV cut by default
38 Float_t tofmax = 1.e10;
40 gMC->SetCut("CUTGAM", cut);
41 gMC->SetCut("CUTELE", cut);
42 gMC->SetCut("CUTNEU", cut);
43 gMC->SetCut("CUTHAD", cut);
44 gMC->SetCut("CUTMUO", cut);
45 gMC->SetCut("BCUTE", cut);
46 gMC->SetCut("BCUTM", cut);
47 gMC->SetCut("DCUTE", cut);
48 gMC->SetCut("DCUTM", cut);
49 gMC->SetCut("PPCUTM", cut);
50 gMC->SetCut("TOFMAX", tofmax);
52 //=======================================================================
54 //=======================================================================
56 TVirtualMCDecayer *decayer = new AliDecayerPythia();
57 decayer->SetForceDecay(kAll);
61 AliPythia * py= AliPythia::Instance();
62 py->SetMDME(737,1,0); //forbid D*+->D+ + pi0
63 py->SetMDME(738,1,0);//forbid D*+->D+ + gamma
65 for(Int_t d=747; d<=762; d++){
69 for(Int_t d=764; d<=807; d++){
73 gMC->SetExternalDecayer(decayer);
75 //=======================================================================
77 //=======================================================================
79 // Set Random Number seed
80 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
81 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
84 if (gSystem->Getenv("CONFIG_NPARTICLES")) {
85 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
88 AliGenCocktail *gener = new AliGenCocktail();
89 gener->SetPhiRange(0, 360);
90 // Set pseudorapidity range from -8 to 8.
91 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
92 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
93 gener->SetThetaRange(thmin,thmax);
94 gener->SetOrigin(0, 0, 0); //vertex position
95 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
97 AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
98 hijingparam->SetMomentumRange(0.2, 999);
99 gener->AddGenerator(hijingparam,"HIJING PARAM",1);
102 // Activate this line if you want the vertex smearing to happen
105 //gener->SetVertexSmear(perTrack);
108 // External generator configuration
109 AliGenerator* gener = GeneratorFactory();
110 gener->SetOrigin(0, 0, 0); // vertex position
111 gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
112 gener->SetCutVertexZ(1.); // Truncate at 1 sigma
113 gener->SetVertexSmear(kPerEvent);
114 gener->SetTrackingFlag(1);
117 cout << "Running ConfigCommon2.C finished ... " << endl;
120 Float_t EtaToTheta(Float_t arg){
121 return (180./TMath::Pi())*2.*atan(exp(-arg));
124 AliGenerator* GeneratorFactory() {
126 AliGenExtFile *gener = new AliGenExtFile(-1);
127 AliGenReaderTreeK * reader = new AliGenReaderTreeK();
129 reader->SetFileName("galice.root");
130 reader->AddDir("gen");
131 gener->SetReader(reader);