/************************************************************************** * Copyright(c) 2001-2002, 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. * **************************************************************************/ /* $Id$ */ //////////////////////////////////////////////////////////////////////// // Class used to generate correlated gaussian numbers with mean // zero and known covariance matrix. // Adapted from the Fortran code in Cernlib V122 (corset, corgen) // F. James, Monte Carlo theory and practice, // Rep. Prog. Phys. 43 (1980) 1145-1189. // M.Masera 15.03.2001 9:30 - modified on 26.02.2002 17:40 //////////////////////////////////////////////////////////////////////// #include #include #include #include "AliGausCorr.h" ClassImp(AliGausCorr) //_______________________________________________________________________ AliGausCorr::AliGausCorr(): fSize(0), fCv(0) { // // Default constructor // } //_______________________________________________________________________ AliGausCorr::AliGausCorr(const TMatrixD & vec, Int_t size): fSize(size), fCv(new TMatrixD(fSize,fSize)) { // // Standard constructor // for(Int_t j=0;jRndm(); } while (!y); z = gRandom->Rndm(); x = z * 6.283185; tmpv[i] = TMath::Sin(x)*TMath::Sqrt(-2*TMath::Log(y)); } for(Int_t i=0;i