From d02055c6fa2df8d661f060272abcb9ecd04ebdea Mon Sep 17 00:00:00 2001 From: hristov Date: Sun, 24 Jun 2007 20:53:11 +0000 Subject: [PATCH] New generator for the krypton runs of TPC (Marek) --- EVGEN/AliGenKrypton.cxx | 154 ++++++++++++++++++++++++++++++++++++++++ EVGEN/AliGenKrypton.h | 23 ++++++ EVGEN/EVGENLinkDef.h | 1 + EVGEN/libEVGEN.pkg | 3 +- 4 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 EVGEN/AliGenKrypton.cxx create mode 100644 EVGEN/AliGenKrypton.h diff --git a/EVGEN/AliGenKrypton.cxx b/EVGEN/AliGenKrypton.cxx new file mode 100644 index 00000000000..d9a7c06c9ca --- /dev/null +++ b/EVGEN/AliGenKrypton.cxx @@ -0,0 +1,154 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +*/ + +// +// generates single Kr decay, in order to generate the calibration data +// one should use it together with the AliGenCocktail class +// +#include "AliGenKrypton.h" +#include "TPDGCode.h" +// +ClassImp(AliGenKrypton) + +//________________________________________________________________________ +AliGenKrypton::AliGenKrypton(){ + // + // Default constructor + // +} +//________________________________________________________________________ +void AliGenKrypton::Generate(){ + Double_t eelectron[6]; + Double_t egamma[2]; + Float_t polar[3]={0.,0.,0.}; + Int_t nelectron, ngamma; + Int_t nt; + // + // generate decay vertex within the gas TPC volume + // + Float_t rmin,rmax,zmax; + zmax=249.7; + rmin=78.8; + rmax=258.; + Float_t me=511.e-6; + Double_t rnd; + // + rnd=gRandom->Rndm(); + Float_t r = (rmax-rmin)*rnd+rmin; + rnd=gRandom->Rndm(); + Float_t phi=TMath::TwoPi()*rnd; + // + Float_t origin[3]; + // + rnd=gRandom->Rndm(); + origin[2]=zmax*(2.*rnd-1.); + origin[0]=r*TMath::Cos(phi); + origin[1]=r*TMath::Sin(phi); + // + Float_t ptot,p[3]; + // + // generate decay + // + KrDecay(nelectron,ngamma,eelectron,egamma); + // + // electrons + // + for(Int_t i=0;iRndm(); + phi=TMath::TwoPi()*rnd; + ptot=TMath::Sqrt(eelectron[i]*(eelectron[i]+2.*me)); + p[0]=ptot*TMath::Cos(phi); + p[1]=ptot*TMath::Sin(phi); + rnd=gRandom->Rndm(); + p[2]=ptot*TMath::Cos(TMath::Pi()*rnd); + // + // her push particle + // + PushTrack(fTrackIt,-1,kElectron,p,origin,polar,0,kPPrimary,nt); + } + // + // gammas + // + for(Int_t i=0;iRndm(); + phi=TMath::TwoPi()*rnd; + ptot=egamma[i]; + p[0]=ptot*TMath::Cos(phi); + p[1]=ptot*TMath::Sin(phi); + rnd=gRandom->Rndm(); + p[2]=ptot*TMath::Cos(TMath::Pi()*rnd); + // + // her push particle + // + PushTrack(fTrackIt,-1,kGamma,p,origin,polar,0,kPPrimary,nt); + } +} +//________________________________________________________________________ +void AliGenKrypton::KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron, Double_t *egamma) +{ + Double_t prob1[2]={0.76,0.88}; // 0.76, 0.12, 0.12 + Double_t prob2=0.95; // 0.95, 0.05 + nelectron=0; + ngamma=0; + + Double_t rnd; + rnd = gRandom->Rndm(); + // + // + // first decay - 32 keV + // + if(rnd < prob1[0]) { + // 2 electrons + nelectron = 2; + eelectron[0]=30.e-6; + eelectron[1]=1.8e-6; + } + else if (rnd > prob1[1]){ + // 4 electrons + nelectron=4; + eelectron[0]=18.e-6; + eelectron[1]=10.e-6; + eelectron[2]=1.8e-6; + eelectron[3]=1.8e-6; + } + else { + // 2 electrons + 1 gamma + nelectron = 2; + ngamma = 1; + eelectron[0]=18.e-6; + eelectron[1]=1.8e-6; + egamma[0]=12.e-6; + } + // + // second decay - 9 keV + // + rnd=gRandom->Rndm(); + // + if(rnd < prob2){ + // 2 electrons + nelectron+=2; + eelectron[nelectron-2]=7.6e-6; + eelectron[nelectron-1]=1.8e-6; + } + else { + ngamma++; + egamma[ngamma-1]=9.e-6; + } +} +//________________________________________________________________________ diff --git a/EVGEN/AliGenKrypton.h b/EVGEN/AliGenKrypton.h new file mode 100644 index 00000000000..c3e32669020 --- /dev/null +++ b/EVGEN/AliGenKrypton.h @@ -0,0 +1,23 @@ +#ifndef ALIGENKR_H +#define ALIGENKR_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +// +// Generator of Krypton decay +// +#include "AliGenerator.h" +class AliGenKrypton : public AliGenerator +{ +public: + AliGenKrypton(); + virtual void Generate(); + virtual ~AliGenKrypton(){} + private: + void KrDecay(Int_t &nelectron, Int_t &ngamma, Double_t *eelectron, Double_t *egamma); + + ClassDef(AliGenKrypton,1) +}; +#endif diff --git a/EVGEN/EVGENLinkDef.h b/EVGEN/EVGENLinkDef.h index a22899859d4..e5176414e8b 100644 --- a/EVGEN/EVGENLinkDef.h +++ b/EVGEN/EVGENLinkDef.h @@ -57,4 +57,5 @@ #pragma link C++ class AliDecayerPolarized+; #pragma link C++ class AliGenCorrHF+; #pragma link C++ class AliGenCosmicsParam+; +#pragma link C++ class AliGenKrypton+; #endif diff --git a/EVGEN/libEVGEN.pkg b/EVGEN/libEVGEN.pkg index 47318102b8d..806f4592fb1 100644 --- a/EVGEN/libEVGEN.pkg +++ b/EVGEN/libEVGEN.pkg @@ -17,7 +17,8 @@ SRCS = AliGenHIJINGpara.cxx AliGenBox.cxx AliGenFixed.cxx \ AliGenGeVSimEventHeader.cxx\ AliSlowNucleonModel.cxx AliSlowNucleonModelExp.cxx \ AliGenMUONCocktail.cxx AliGenMUONCocktailpp.cxx AliGenHBTosl.cxx AliGenCocktailEventHeader.cxx \ - AliGenReaderEMD.cxx AliDecayerPolarized.cxx AliGenCorrHF.cxx AliGenCosmicsParam.cxx + AliGenReaderEMD.cxx AliDecayerPolarized.cxx AliGenCorrHF.cxx AliGenCosmicsParam.cxx \ + AliGenKrypton.cxx # Headerfiles for this particular package (Path respect to own directory) HDRS= $(SRCS:.cxx=.h) -- 2.31.1