fFlavorSelect(0),
fXsection(0.),
fPythia(0),
+ fWeightPower(0.),
fPtHardMin(0.),
fPtHardMax(1.e4),
fYHardMin(-1.e10),
fFlavorSelect(0),
fXsection(0.),
fPythia(0),
+ fWeightPower(0.),
fPtHardMin(0.),
fPtHardMax(1.e4),
fYHardMin(-1.e10),
//
fParentWeight=1./Float_t(fNpart);
//
-
-
+ if (fWeightPower != 0)
+ fPythia->SetWeightPower(fWeightPower);
fPythia->SetCKIN(3,fPtHardMin);
fPythia->SetCKIN(4,fPtHardMax);
fPythia->SetCKIN(7,fYHardMin);
//
// Store Event Weight
- ((AliGenPythiaEventHeader*) fHeader)->SetEventWeight(fPythia->GetPARI(7));
-
+ ((AliGenPythiaEventHeader*) fHeader)->SetEventWeight(fPythia->GetPARI(7)*fPythia->GetPARI(10));
+ // PARI(7) is 1 or -1, for weighted generation with accept/reject, e.g. POWHEG
+ // PARI(10) is a weight associated with reweighted generation, using Pyevwt
//
// Pass header
//
// Select structure function
virtual void SetStrucFunc(StrucFunc_t func = kCTEQ5L) {fStrucFunc = func;}
+ // Rewieght pt, hard spectrum with pT/p0^n, set power n
+ virtual void SetWeightPower(Float_t power = 0.) { fWeightPower = power; }
// Select pt of hard scattering
virtual void SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
{fPtHardMin = ptmin; fPtHardMax = ptmax; }
Int_t fFlavorSelect; //Heavy Flavor Selection
Float_t fXsection; //Cross-section
AliPythia *fPythia; //!Pythia
+ Float_t fWeightPower; //power for cross section weights; 0 means no reweighting
Float_t fPtHardMin; //lower pT-hard cut
Float_t fPtHardMax; //higher pT-hard cut
Float_t fYHardMin; //lower y-hard cut
* provided "as is" without express or implied warranty. *
**************************************************************************/
+// Pythia 6 interface used by AliGenPythia
+// Some settings are done by AliGenPythia, others here :)
+//
/* $Id$ */
#include "AliPythia.h"
# define qpygin0 qpygin0_
# define pytune pytune_
# define py2ent py2ent_
+# define setpowwght setpowwght_
# define type_of_call
#else
# define pyclus PYCLUS
# define qpygin0 QPYGIN0
# define pytune PYTUNE
# define py2ent PY2ENT
+# define setpowwght SETPOWWGHT
# define type_of_call _stdcall
#endif
extern "C" void type_of_call pyshowq(Int_t &, Int_t &, Double_t &);
extern "C" void type_of_call pytune(Int_t &);
extern "C" void type_of_call py2ent(Int_t &, Int_t&, Int_t&, Double_t&);
-extern "C" void type_of_call qpygin0();
+extern "C" void type_of_call qpygin0();
+extern "C" void type_of_call setpowwght(Double_t &);
//_____________________________________________________________________________
AliPythia* AliPythia::fgAliPythia=NULL;
// QCD Jets
//
SetMSEL(1);
+
// Pythia Tune A (CDF)
//
if (fItune < 0) {
py2ent(idx, pdg1, pdg2, p);
}
+void AliPythia::SetWeightPower(Double_t pow)
+{
+ setpowwght(pow);
+ SetMSTP(142, 1); // Tell Pythia to use pyevwt to calculate event wghts
+ if (GetCKIN(3) <= 0)
+ AliWarning("Need to set minimum p_T,hard to nonzero value for weighted event generation");
+}
void AliPythia::InitQuenching(Float_t cMin, Float_t cMax, Float_t k, Int_t iECMethod, Float_t zmax, Int_t ngmax)
{
virtual void PrintParticles();
virtual void ResetDecayTable();
virtual void SetDecayTable();
+ virtual void SetWeightPower(Double_t pow); // use weighted cross sections
virtual void Pyevnw();
virtual void Pycell(Int_t& nclus);
virtual void Pyclus(Int_t& nclus);
# define pyevnw pyevnw_
# define pyjoin pyjoin_
# define qpygin0 qpygin0_
+# define setpowwght setpowwght_
# define type_of_call
#else
# define pyclus PYCLUS
# define pyevnw PYEVNW
# define pyjoin PYJOIN
# define qpygin0 QPYGIN0
+# define setpowwght SETPOWWGHT
# define type_of_call _stdcall
#endif
extern "C" void type_of_call pyrobo(Int_t &, Int_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &);
extern "C" void type_of_call pyquen(Double_t &, Int_t &, Double_t &);
extern "C" void type_of_call pyevnw();
+extern "C" void type_of_call setpowwght(Double_t &);
//_____________________________________________________________________________
SetPARP(89,1800.); // [GeV] Ref. energy
}
+void AliPythia6::SetWeightPower(Double_t pow)
+{
+ setpowwght(pow);
+ SetMSTP(142, 1); // Tell Pythia to use pyevwt to calculate event wghts
+}
+
void AliPythia6::SetPtHardRange(Float_t ptmin, Float_t ptmax)
{
// Set the pt hard range
virtual void ResetDecayTable();
//
// Common Physics Configuration
+ virtual void SetWeightPower(Double_t pow); // use pT,hard dependent weight instead of p_T,hard bins
virtual void SetPtHardRange(Float_t ptmin, Float_t ptmax);
virtual void SetYHardRange(Float_t ymin, Float_t ymax);
virtual void SetFragmentation(Int_t flag);
set ( EINCLUDE PYTHIA6/QPYTHIA)
-set ( FSRCS pythia6.4.21/pythia6_common_block_address.F pythia6.4.21/tpythia6_called_from_cc.F pythia6.4.21/pythia-6.4.21.f QPYTHIA/pyquen1_5.F)
+set ( FSRCS pythia6.4.21/pythia6_common_block_address.F pythia6.4.21/tpythia6_called_from_cc.F pythia6.4.21/pythia-6.4.21.f pyevwt.f QPYTHIA/pyquen1_5.F)
if( ALICE_TARGET STREQUAL "win32gcc")
set ( CSRCS pythia6.4.25/main.c pythia6.4.25/pythia6_common_address.c)
-set ( FSRCS pythia6.4.25/pythia6_common_block_address.F pythia6.4.25/tpythia6_called_from_cc.F pythia6.4.25/pythia-6.4.25.f pythia6.4.25/pydummy_6.4.25.f POWHEG-BOX/setup-PYTHIA-lhef.f POWHEG-BOX/lhefread.f)
+set ( FSRCS pythia6.4.25/pythia6_common_block_address.F pythia6.4.25/tpythia6_called_from_cc.F pythia6.4.25/pythia-6.4.25.f pythia6.4.25/pydummy_6.4.25.f POWHEG-BOX/setup-PYTHIA-lhef.f POWHEG-BOX/lhefread.f pyevwt.f)
if( ALICE_TARGET STREQUAL "win32gcc")
set ( CSRCS main.c pythia6_common_address.c)
-set ( FSRCS pythia6_common_block_address.F tpythia6_called_from_cc.F pythia6214.f pydummy.f pdf_alice.F)
+set ( FSRCS pythia6_common_block_address.F tpythia6_called_from_cc.F pythia6214.f pyevwt.f pydummy.f pdf_alice.F)
if( ALICE_TARGET STREQUAL "win32gcc")
set ( EINCLUDE FASTSIM PYTHIA6/QPYTHIA)
-set ( FSRCS QPYTHIA/pythia6_common_block_address.F QPYTHIA/pythia6_called_from_cc.F QPYTHIA/pythia-6.4.14.f QPYTHIA/pyquen1_5.F QPYTHIA/q-pyshow.1.2.F)
+set ( FSRCS QPYTHIA/pythia6_common_block_address.F QPYTHIA/pythia6_called_from_cc.F QPYTHIA/pythia-6.4.14.f pyevwt.f QPYTHIA/pyquen1_5.F QPYTHIA/q-pyshow.1.2.F)
if( ALICE_TARGET STREQUAL "win32gcc")
END
C*********************************************************************
-
+c This dummy routine is commented out; a implemtation for AliRoot
+c resides in $ALICE_ROOT/PYTHIA6/pyevwt.f
+c
C...PYEVWT
C...Dummy routine, which the user can replace in order to multiply the
C...standard PYTHIA differential cross-section by a process- and
C...MSTP(142)=2 it corresponds to a modification of the underlying
C...physics.
- SUBROUTINE PYEVWT(WTXS)
+c SUBROUTINE PYEVWT(WTXS)
C...Double precision and integer declarations.
- IMPLICIT DOUBLE PRECISION(A-H, O-Z)
- IMPLICIT INTEGER(I-N)
- INTEGER PYK,PYCHGE,PYCOMP
+c IMPLICIT DOUBLE PRECISION(A-H, O-Z)
+c IMPLICIT INTEGER(I-N)
+c INTEGER PYK,PYCHGE,PYCOMP
C...Commonblocks.
- COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
- COMMON/PYINT1/MINT(400),VINT(400)
- COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
- SAVE /PYDAT1/,/PYINT1/,/PYINT2/
+c COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
+c COMMON/PYINT1/MINT(400),VINT(400)
+c COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
+c SAVE /PYDAT1/,/PYINT1/,/PYINT2/
C...Set default weight for WTXS.
- WTXS=1D0
+c WTXS=1D0
C...Read out subprocess number.
- ISUB=MINT(1)
- ISTSB=ISET(ISUB)
+c ISUB=MINT(1)
+c ISTSB=ISET(ISUB)
C...Read out tau, y*, cos(theta), tau' (where defined, else =0).
- TAU=VINT(21)
- YST=VINT(22)
- CTH=0D0
- IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
- TAUP=0D0
- IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
+c TAU=VINT(21)
+c YST=VINT(22)
+c CTH=0D0
+c IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
+c TAUP=0D0
+c IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
C...Read out x_1, x_2, x_F, shat, that, uhat, p_T^2.
- X1=VINT(41)
- X2=VINT(42)
- XF=X1-X2
- SHAT=VINT(44)
- THAT=VINT(45)
- UHAT=VINT(46)
- PT2=VINT(48)
+c X1=VINT(41)
+c X2=VINT(42)
+c XF=X1-X2
+c SHAT=VINT(44)
+c THAT=VINT(45)
+c UHAT=VINT(46)
+c PT2=VINT(48)
C...Modifications by user to be put here.
C...Stop program if this routine is ever called.
C...You should not copy these lines to your own routine.
- WRITE(MSTU(11),5000)
- CALL PYSTOP(4)
+c WRITE(MSTU(11),5000)
+c CALL PYSTOP(4)
C...Format for error printout.
- 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
- &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
- &1X,'Execution stopped!')
+c 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
+c &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
+c &1X,'Execution stopped!')
- RETURN
- END
+c RETURN
+c END
C*********************************************************************
END
C*********************************************************************
-
+
+c Dummy routine commented out:
+c A reweighting routine for AliRoot is implemented in pyevwt.f
+c
C...PYEVWT
C...Dummy routine, which the user can replace in order to multiply the
C...standard PYTHIA differential cross-section by a process- and
C...MSTP(142)=2 it corresponds to a modification of the underlying
C...physics.
- SUBROUTINE PYEVWT(WTXS)
+c SUBROUTINE PYEVWT(WTXS)
C...Double precision and integer declarations.
- IMPLICIT DOUBLE PRECISION(A-H, O-Z)
- IMPLICIT INTEGER(I-N)
- INTEGER PYK,PYCHGE,PYCOMP
+c IMPLICIT DOUBLE PRECISION(A-H, O-Z)
+c IMPLICIT INTEGER(I-N)
+c INTEGER PYK,PYCHGE,PYCOMP
C...Commonblocks.
- COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
- COMMON/PYINT1/MINT(400),VINT(400)
- COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
- SAVE /PYDAT1/,/PYINT1/,/PYINT2/
+c COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
+c COMMON/PYINT1/MINT(400),VINT(400)
+c COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
+c SAVE /PYDAT1/,/PYINT1/,/PYINT2/
C...Set default weight for WTXS.
- WTXS=1D0
+c WTXS=1D0
C...Read out subprocess number.
- ISUB=MINT(1)
- ISTSB=ISET(ISUB)
+c ISUB=MINT(1)
+c ISTSB=ISET(ISUB)
C...Read out tau, y*, cos(theta), tau' (where defined, else =0).
- TAU=VINT(21)
- YST=VINT(22)
- CTH=0D0
- IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
- TAUP=0D0
- IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
+c TAU=VINT(21)
+c YST=VINT(22)
+c CTH=0D0
+c IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
+c TAUP=0D0
+c IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
C...Read out x_1, x_2, x_F, shat, that, uhat, p_T^2.
- X1=VINT(41)
- X2=VINT(42)
- XF=X1-X2
- SHAT=VINT(44)
- THAT=VINT(45)
- UHAT=VINT(46)
- PT2=VINT(48)
+c X1=VINT(41)
+c X2=VINT(42)
+c XF=X1-X2
+c SHAT=VINT(44)
+c THAT=VINT(45)
+c UHAT=VINT(46)
+c PT2=VINT(48)
C...Modifications by user to be put here.
C...Stop program if this routine is ever called.
C...You should not copy these lines to your own routine.
- WRITE(MSTU(11),5000)
- CALL PYSTOP(4)
+c WRITE(MSTU(11),5000)
+c CALL PYSTOP(4)
C...Format for error printout.
- 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
- &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
- &1X,'Execution stopped!')
+c 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
+c &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
+c &1X,'Execution stopped!')
- RETURN
- END
+c RETURN
+c END
C*********************************************************************
C...MSTP(142)=2 it corresponds to a modification of the underlying
C...physics.
- SUBROUTINE PYEVWT(WTXS)
+c SUBROUTINE PYEVWT(WTXS)
C...Double precision and integer declarations.
- IMPLICIT DOUBLE PRECISION(A-H, O-Z)
- IMPLICIT INTEGER(I-N)
- INTEGER PYK,PYCHGE,PYCOMP
+c IMPLICIT DOUBLE PRECISION(A-H, O-Z)
+c IMPLICIT INTEGER(I-N)
+c INTEGER PYK,PYCHGE,PYCOMP
C...Commonblocks.
- COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
- COMMON/PYINT1/MINT(400),VINT(400)
- COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
- SAVE /PYDAT1/,/PYINT1/,/PYINT2/
+c COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
+c COMMON/PYINT1/MINT(400),VINT(400)
+c COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
+c SAVE /PYDAT1/,/PYINT1/,/PYINT2/
C...Set default weight for WTXS.
- WTXS=1D0
+c WTXS=1D0
C...Read out subprocess number.
- ISUB=MINT(1)
- ISTSB=ISET(ISUB)
-
+c ISUB=MINT(1)
+c ISTSB=ISET(ISUB)
+c
C...Read out tau, y*, cos(theta), tau' (where defined, else =0).
- TAU=VINT(21)
- YST=VINT(22)
- CTH=0D0
- IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
- TAUP=0D0
- IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
-
+c TAU=VINT(21)
+c YST=VINT(22)
+c CTH=0D0
+c IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
+c TAUP=0D0
+c IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
+c
C...Read out x_1, x_2, x_F, shat, that, uhat, p_T^2.
- X1=VINT(41)
- X2=VINT(42)
- XF=X1-X2
- SHAT=VINT(44)
- THAT=VINT(45)
- UHAT=VINT(46)
- PT2=VINT(48)
-
+c X1=VINT(41)
+c X2=VINT(42)
+c XF=X1-X2
+c SHAT=VINT(44)
+c THAT=VINT(45)
+c UHAT=VINT(46)
+c PT2=VINT(48)
+c
C...Modifications by user to be put here.
C...Stop program if this routine is ever called.
C...You should not copy these lines to your own routine.
- WRITE(MSTU(11),5000)
- CALL PYSTOP(4)
+c WRITE(MSTU(11),5000)
+c CALL PYSTOP(4)
C...Format for error printout.
- 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
- &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
- &1X,'Execution stopped!')
+c5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
+c &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
+c &1X,'Execution stopped!')
- RETURN
- END
+c RETURN
+c END
C*********************************************************************
END
C*********************************************************************
-
+c
+c This dummy routine is commented out; an implementation for AliRoot
+c resides in pyevwt.f
+c
C...PYEVWT
C...Dummy routine, which the user can replace in order to multiply the
C...standard PYTHIA differential cross-section by a process- and
C...MSTP(142)=2 it corresponds to a modification of the underlying
C...physics.
- SUBROUTINE PYEVWT(WTXS)
+c SUBROUTINE PYEVWT(WTXS)
C...Double precision and integer declarations.
- IMPLICIT DOUBLE PRECISION(A-H, O-Z)
- IMPLICIT INTEGER(I-N)
- INTEGER PYK,PYCHGE,PYCOMP
+c IMPLICIT DOUBLE PRECISION(A-H, O-Z)
+c IMPLICIT INTEGER(I-N)
+c INTEGER PYK,PYCHGE,PYCOMP
C...Commonblocks.
- COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
- COMMON/PYINT1/MINT(400),VINT(400)
- COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
- SAVE /PYDAT1/,/PYINT1/,/PYINT2/
+c COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
+c COMMON/PYINT1/MINT(400),VINT(400)
+c COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
+c SAVE /PYDAT1/,/PYINT1/,/PYINT2/
C...Set default weight for WTXS.
- WTXS=1D0
+c WTXS=1D0
C...Read out subprocess number.
- ISUB=MINT(1)
- ISTSB=ISET(ISUB)
+c ISUB=MINT(1)
+c ISTSB=ISET(ISUB)
C...Read out tau, y*, cos(theta), tau' (where defined, else =0).
- TAU=VINT(21)
- YST=VINT(22)
- CTH=0D0
- IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
- TAUP=0D0
- IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
+c TAU=VINT(21)
+c YST=VINT(22)
+c CTH=0D0
+c IF(ISTSB.EQ.2.OR.ISTSB.EQ.4) CTH=VINT(23)
+c TAUP=0D0
+c IF(ISTSB.GE.3.AND.ISTSB.LE.5) TAUP=VINT(26)
C...Read out x_1, x_2, x_F, shat, that, uhat, p_T^2.
- X1=VINT(41)
- X2=VINT(42)
- XF=X1-X2
- SHAT=VINT(44)
- THAT=VINT(45)
- UHAT=VINT(46)
- PT2=VINT(48)
+c X1=VINT(41)
+c X2=VINT(42)
+c XF=X1-X2
+c SHAT=VINT(44)
+c THAT=VINT(45)
+c UHAT=VINT(46)
+c PT2=VINT(48)
C...Modifications by user to be put here.
C...Stop program if this routine is ever called.
C...You should not copy these lines to your own routine.
- WRITE(MSTU(11),5000)
- IF(PYR(0).LT.10D0) STOP
+c WRITE(MSTU(11),5000)
+c IF(PYR(0).LT.10D0) STOP
C...Format for error printout.
- 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
- &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
- &1X,'Execution stopped!')
+c 5000 FORMAT(1X,'Error: you did not link your PYEVWT routine ',
+c &'correctly.'/1X,'Dummy routine in PYTHIA file called instead.'/
+c &1X,'Execution stopped!')
- RETURN
- END
+c RETURN
+c END
C*********************************************************************