/************************************************************************** * 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. * **************************************************************************/ /* $Id$ */ // Generator for particles in a preset // kinematic range (flat distribution) // Note that for a given theta pt and p are not independent // Range for only one variable (pt or p) should be given. // Comments and suggestions: andreas.morsch@cern.ch #include "TPDGCode.h" #include "AliConst.h" #include "AliGenBox.h" #include "AliRun.h" #include "AliGenEventHeader.h" ClassImp(AliGenBox) //_____________________________________________________________________________ AliGenBox::AliGenBox() :AliGenerator(), fIpart(0) { // // Default constructor // } //_____________________________________________________________________________ AliGenBox::AliGenBox(Int_t npart) :AliGenerator(npart), fIpart(kProton) { // // Standard constructor // fName = "Box"; fTitle = "Box particle generator"; } //_____________________________________________________________________________ void AliGenBox::Generate() { // // Generate one trigger // Float_t polar[3]= {0,0,0}; // Float_t origin[3]; Float_t p[3]; Int_t i, j, nt; Double_t pmom, theta, phi, pt; // Float_t random[6]; // for (j=0;j<3;j++) origin[j]=fOrigin[j]; if(fVertexSmear==kPerEvent) { Vertex(); for (j=0;j<3;j++) origin[j]=fVertex[j]; } for(i=0;iSetPrimaryVertex(fVertex); gAlice->SetGenEventHeader(header); } //_____________________________________________________________________________ void AliGenBox::Init() { // Initialisation, check consistency of selected ranges if(TestBit(kPtRange)&&TestBit(kMomentumRange)) Fatal("Init","You should not set the momentum range and the pt range!\n"); if((!TestBit(kPtRange))&&(!TestBit(kMomentumRange))) Fatal("Init","You should set either the momentum or the pt range!\n"); }