1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.2 2007/10/23 09:27:16 hristov
19 Adding dependence on the dip angle (Marek)
21 Revision 1.1 2007/06/24 20:53:11 hristov
22 New generator for the krypton runs of TPC (Marek)
27 // generates single Kr decay, in order to generate the calibration data
28 // one should use it together with the AliGenCocktail class
30 #include "AliGenKrypton.h"
33 ClassImp(AliGenKrypton)
35 //________________________________________________________________________
36 AliGenKrypton::AliGenKrypton(){
38 // Default constructor
41 //________________________________________________________________________
42 void AliGenKrypton::Generate(){
43 Double_t eelectron[6];
45 Float_t polar[3]={0.,0.,0.};
46 Int_t nelectron, ngamma;
49 // generate decay vertex within the gas TPC volume
51 Float_t rmin,rmax,zmax;
59 Float_t r = (rmax-rmin)*rnd+rmin;
61 Float_t phi=TMath::TwoPi()*rnd;
66 origin[2]=zmax*(2.*rnd-1.);
67 origin[0]=r*TMath::Cos(phi);
68 origin[1]=r*TMath::Sin(phi);
74 KrDecay(nelectron,ngamma,eelectron,egamma);
78 for(Int_t i=0;i<nelectron;i++){
80 phi=TMath::TwoPi()*rnd;
82 Double_t theta = TMath::Pi()*rnd;
83 ptot=TMath::Sqrt(eelectron[i]*(eelectron[i]+2.*me));
84 p[0]=ptot*TMath::Cos(phi)*TMath::Sin(theta);
85 p[1]=ptot*TMath::Sin(phi)*TMath::Sin(theta);
86 p[2]=ptot*TMath::Cos(theta);
90 PushTrack(fTrackIt,-1,kElectron,p,origin,polar,0,kPPrimary,nt);
95 for(Int_t i=0;i<ngamma;i++){
97 Double_t theta = TMath::Pi()*rnd;
99 phi=TMath::TwoPi()*rnd;
101 p[0]=ptot*TMath::Cos(phi)*TMath::Sin(theta);
102 p[1]=ptot*TMath::Sin(phi)*TMath::Sin(theta);
103 p[2]=ptot*TMath::Cos(theta);
107 PushTrack(fTrackIt,-1,kGamma,p,origin,polar,0,kPPrimary,nt);
110 //________________________________________________________________________
111 void AliGenKrypton::KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron, Double_t *egamma)
113 Double_t prob1[2]={0.76,0.88}; // 0.76, 0.12, 0.12
114 Double_t prob2=0.95; // 0.95, 0.05
119 rnd = gRandom->Rndm();
122 // first decay - 32 keV
130 else if (rnd > prob1[1]){
139 // 2 electrons + 1 gamma
147 // second decay - 9 keV
154 eelectron[nelectron-2]=7.6e-6;
155 eelectron[nelectron-1]=1.8e-6;
159 egamma[ngamma-1]=9.e-6;
164 //________________________________________________________________________