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 **************************************************************************/
21 // generates single Kr decay, in order to generate the calibration data
22 // one should use it together with the AliGenCocktail class
24 #include "AliGenKrypton.h"
27 ClassImp(AliGenKrypton)
29 //________________________________________________________________________
30 AliGenKrypton::AliGenKrypton(){
32 // Default constructor
35 //________________________________________________________________________
36 void AliGenKrypton::Generate(){
37 Double_t eelectron[6];
39 Float_t polar[3]={0.,0.,0.};
40 Int_t nelectron, ngamma;
43 // generate decay vertex within the gas TPC volume
45 Float_t rmin,rmax,zmax;
53 Float_t r = (rmax-rmin)*rnd+rmin;
55 Float_t phi=TMath::TwoPi()*rnd;
60 origin[2]=zmax*(2.*rnd-1.);
61 origin[0]=r*TMath::Cos(phi);
62 origin[1]=r*TMath::Sin(phi);
68 KrDecay(nelectron,ngamma,eelectron,egamma);
72 for(Int_t i=0;i<nelectron;i++){
74 phi=TMath::TwoPi()*rnd;
75 ptot=TMath::Sqrt(eelectron[i]*(eelectron[i]+2.*me));
76 p[0]=ptot*TMath::Cos(phi);
77 p[1]=ptot*TMath::Sin(phi);
79 p[2]=ptot*TMath::Cos(TMath::Pi()*rnd);
83 PushTrack(fTrackIt,-1,kElectron,p,origin,polar,0,kPPrimary,nt);
88 for(Int_t i=0;i<ngamma;i++){
90 phi=TMath::TwoPi()*rnd;
92 p[0]=ptot*TMath::Cos(phi);
93 p[1]=ptot*TMath::Sin(phi);
95 p[2]=ptot*TMath::Cos(TMath::Pi()*rnd);
99 PushTrack(fTrackIt,-1,kGamma,p,origin,polar,0,kPPrimary,nt);
102 //________________________________________________________________________
103 void AliGenKrypton::KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron, Double_t *egamma)
105 Double_t prob1[2]={0.76,0.88}; // 0.76, 0.12, 0.12
106 Double_t prob2=0.95; // 0.95, 0.05
111 rnd = gRandom->Rndm();
114 // first decay - 32 keV
122 else if (rnd > prob1[1]){
131 // 2 electrons + 1 gamma
139 // second decay - 9 keV
146 eelectron[nelectron-2]=7.6e-6;
147 eelectron[nelectron-1]=1.8e-6;
151 egamma[ngamma-1]=9.e-6;
154 //________________________________________________________________________