This allows to pass a pointer to a library directly to AliGenParam and avoids the
use of function pointers in Config.C.
/* $Id$ */
-#include <TROOT.h>
-#include "GenTypeDefs.h"
+#include "AliGenLib.h"
-class AliGenGSIlib :public TObject{
+class AliGenGSIlib :public AliGenLib {
public:
// Upsilon RITMAN
//
typedef Double_t (*GenFunc) (Double_t *, Double_t *);
- typedef Int_t (*GenFuncIp)();
- static GenFunc GetPt(Param_t param,const char * tname=0);
- static GenFunc GetY(Param_t param,const char * tname=0);
- static GenFuncIp GetIp(Param_t param,const char *tname=0);
+ typedef Int_t (*GenFuncIp)();
+
+ GenFunc GetPt(Param_t param, const char * tname=0);
+ GenFunc GetY(Param_t param, const char * tname=0);
+ GenFuncIp GetIp(Param_t param, const char * tname=0);
static void SetDebug(Bool_t debug){fgDebug=debug;}
private:
static Bool_t fgDebug; // Debug flag
--- /dev/null
+/**************************************************************************
+ * 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 $
+*/
+
+#include "AliGenLib.h"
+
+ClassImp(AliGenLib)
--- /dev/null
+#ifndef ALIGENLIB_H
+#define ALIGENLIB_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id */
+
+#include <TObject.h>
+#include "GenTypeDefs.h"
+
+class AliGenLib :
+public TObject
+{
+ public:
+//
+ typedef Double_t (*GenFunc) (Double_t *, Double_t *);
+ typedef Int_t (*GenFuncIp)();
+ virtual GenFunc GetPt(Param_t param, const char *tname) = 0;
+ virtual GenFunc GetY (Param_t param, const char *tname) = 0;
+ virtual GenFuncIp GetIp(Param_t param, const char *tname) = 0;
+ ClassDef(AliGenLib,1) // Library providing y and pT parameterisations
+};
+#endif
+
+
+
+
+
+
+
/*
$Log$
+Revision 1.9 2000/06/14 15:20:56 morsch
+Include clean-up (IH)
+
Revision 1.8 2000/06/09 20:32:11 morsch
All coding rule violations except RS3 corrected
}
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
-GenFunc AliGenMUONlib::GetPt(Param_t param)
+GenFunc AliGenMUONlib::GetPt(Param_t param, const char* tname)
{
// Return pointer to pT parameterisation
GenFunc func;
return func;
}
-GenFunc AliGenMUONlib::GetY(Param_t param)
+GenFunc AliGenMUONlib::GetY(Param_t param, const char* tname)
{
// Return pointer to y- parameterisation
GenFunc func;
return func;
}
typedef Int_t (*GenFuncIp) ();
-GenFuncIp AliGenMUONlib::GetIp(Param_t param)
+GenFuncIp AliGenMUONlib::GetIp(Param_t param, const char* tname)
{
// Return pointer to particle type parameterisation
GenFuncIp func;
/* $Id$ */
-#include <TObject.h>
-#include "GenTypeDefs.h"
+#include "AliGenLib.h"
class AliGenMUONlib :
-public TObject
+public AliGenLib
{
public:
// pions
static Double_t YBeauty(Double_t *py, Double_t *dummy);
static Int_t IpBeauty();
//
- typedef Double_t (*GenFunc) (Double_t *, Double_t *);
- typedef Int_t (*GenFuncIp)();
- static GenFunc GetPt(Param_t param);
- static GenFunc GetY(Param_t param);
- static GenFuncIp GetIp(Param_t param);
+ GenFunc GetPt(Param_t param, const char* tname=0);
+ GenFunc GetY (Param_t param, const char* tname=0);
+ GenFuncIp GetIp(Param_t param, const char* tname=0);
ClassDef(AliGenMUONlib,1) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.4 2000/06/14 15:21:05 morsch
+Include clean-up (IH)
+
Revision 1.3 2000/06/09 20:32:54 morsch
All coding rule violations except RS3 corrected
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
- GenFunc AliGenPHOSlib::GetPt(Param_t param)
+ GenFunc AliGenPHOSlib::GetPt(Param_t param, const char* tname)
{
// Return pinter to pT parameterisation
GenFunc func;
return func;
}
- GenFunc AliGenPHOSlib::GetY(Param_t param)
+ GenFunc AliGenPHOSlib::GetY(Param_t param, const char* tname)
{
// Return pointer to Y parameterisation
GenFunc func;
return func;
}
typedef Int_t (*GenFuncIp) ();
- GenFuncIp AliGenPHOSlib::GetIp(Param_t param)
+ GenFuncIp AliGenPHOSlib::GetIp(Param_t param, const char* tname)
{
// Return pointer to particle composition
GenFuncIp func;
#ifndef ALIGENPHOSLIB_H
#define ALIGENPHOSLIB_H
-#include <TObject.h>
-#include "GenTypeDefs.h"
+#include "AliGenLib.h"
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
class AliGenPHOSlib :
-public TObject
+public AliGenLib
{
public:
// pions
static Double_t YBaryon( Double_t *py, Double_t *dummy);
static Int_t IpBaryon();
- typedef Double_t (*GenFunc) (Double_t *, Double_t *dummy);
- typedef Int_t (*GenFuncIp)();
- static GenFunc GetPt(Param_t param);
- static GenFunc GetY(Param_t param);
- static GenFuncIp GetIp(Param_t param);
+ GenFunc GetPt(Param_t param, const char* tname=0);
+ GenFunc GetY (Param_t param, const char* tname=0);
+ GenFuncIp GetIp(Param_t param, const char* tname=0);
ClassDef(AliGenPHOSlib,1) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.17 2000/06/09 20:33:30 morsch
+All coding rule violations except RS3 corrected
+
Revision 1.16 2000/05/02 07:51:31 morsch
- Control precision of pT sampling TF1::SetNpx(..)
- Correct initialisation of child-cuts in all constructors.
AliGenParam::AliGenParam()
:AliGenerator()
{
-// Constructor
- fPtPara = 0;
- fYPara = 0;
- fParam = jpsi_p;
- fAnalog = analog;
- SetCutOnChild();
- SetChildMomentumRange();
- SetChildPtRange();
- SetChildPhiRange();
- SetChildThetaRange();
- SetDeltaPt();
+// Deafault constructor
+ fPtPara = 0;
+ fYPara = 0;
+ fParam = jpsi_p;
+ fAnalog = analog;
+ SetCutOnChild();
+ SetChildMomentumRange();
+ SetChildPtRange();
+ SetChildPhiRange();
+ SetChildThetaRange();
+ SetDeltaPt();
+}
+
+AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname):AliGenerator(npart)
+{
+// Constructor using number of particles parameterisation id and library
+
+ fPtParaFunc = Library->GetPt(param, tname);
+ fYParaFunc = Library->GetY (param, tname);
+ fIpParaFunc = Library->GetIp(param, tname);
+
+ fPtPara = 0;
+ fYPara = 0;
+ fParam = param;
+ fAnalog = analog;
+ fChildSelect.Set(5);
+ for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
+ SetForceDecay();
+ SetCutOnChild();
+ SetChildMomentumRange();
+ SetChildPtRange();
+ SetChildPhiRange();
+ SetChildThetaRange();
+ SetDeltaPt();
}
//____________________________________________________________
-AliGenParam::AliGenParam(Int_t npart, Param_t param) :AliGenerator(npart)
+AliGenParam::AliGenParam(Int_t npart, Param_t param, char* tname):AliGenerator(npart)
{
-// Constructor
- //
- // fName="HMESONpara";
- // fTitle="Heavy Mesons Parametrisation";
- fPtParaFunc = AliGenMUONlib::GetPt(param);
- fYParaFunc = AliGenMUONlib::GetY(param);
- fIpParaFunc = AliGenMUONlib::GetIp(param);
-
- fPtPara = 0;
- fYPara = 0;
- fParam = param;
- fAnalog = analog;
- fChildSelect.Set(5);
- for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
- SetForceDecay();
- SetCutOnChild();
- SetChildMomentumRange();
- SetChildPtRange();
- SetChildPhiRange();
- SetChildThetaRange();
- SetDeltaPt();
+// Constructor using parameterisation id and number of particles
+//
+ AliGenLib* Library = new AliGenMUONlib();
+
+ fPtParaFunc = Library->GetPt(param, tname);
+ fYParaFunc = Library->GetY (param, tname);
+ fIpParaFunc = Library->GetIp(param, tname);
+
+ fPtPara = 0;
+ fYPara = 0;
+ fParam = param;
+ fAnalog = analog;
+ fChildSelect.Set(5);
+ for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
+ SetForceDecay();
+ SetCutOnChild();
+ SetChildMomentumRange();
+ SetChildPtRange();
+ SetChildPhiRange();
+ SetChildThetaRange();
+ SetDeltaPt();
}
AliGenParam::AliGenParam(Int_t npart, Param_t param,
class AliPythia;
class TParticle;
+class AliGenLib;
class TF1;
//-------------------------------------------------------------
{
public:
AliGenParam();
- AliGenParam(Int_t npart, Param_t param);
+ AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname=0);
+ AliGenParam(Int_t npart, Param_t param, char* tname=0);
AliGenParam(Int_t npart, Param_t param,
Double_t (*PtPara)(Double_t*, Double_t*),
Double_t (*YPara )(Double_t*, Double_t*),
#pragma link C++ class AliGenScan;
#pragma link C++ class AliGenDoubleScan;
#pragma link C++ class AliPythia;
+#pragma link C++ class AliGenLib;
#pragma link C++ class AliGenMUONlib;
#pragma link C++ class AliGenFLUKAsource;
#pragma link C++ class AliGenHalo;
SRCS = AliGenHIJINGpara.cxx AliGenBox.cxx AliGenFixed.cxx \
AliGenCocktail.cxx AliGenFLUKAsource.cxx \
+ AliGenLib.cxx \
AliGenMUONlib.cxx AliGenParam.cxx AliGenPythia.cxx \
AliPythia.cxx AliDimuCombinator.cxx AliGenHalo.cxx \
AliGenExtFile.cxx AliGenScan.cxx AliGenPHOSlib.cxx \