// The main Herwig options are accessable for the user through this interface.
// Uses the THerwig implementation of TGenerator.
-#include "AliGenHerwig.h"
-#include "AliHerwigRndm.h"
-#include "AliRun.h"
+#include <Riostream.h>
+#include <TClonesArray.h>
#include <TParticle.h>
-#include "THerwig6.h"
-#include "Riostream.h"
-#include "AliMC.h"
+#include <THerwig6.h>
+#include "AliGenHerwig.h"
+#include "AliHerwigRndm.h"
+#include "AliMC.h"
+#include "AliRun.h"
#include "driver.h"
ClassImp(AliGenHerwig)
fTrigger(0),
fSelectAll(0),
fFlavor(0),
- fEnergyCMS(14000),
fMomentum1(7000),
fMomentum2(7000),
fKineBias(1),
fHerwig(0x0),
fProcess(0),
fPtHardMin(0.),
+ fPtHardMax(9999.),
fPtRMS(0.),
fMaxPr(10),
fMaxErrors(1000),
fEnSoft(1),
fEv1Pr(0),
fEv2Pr(0),
- fFileName(0)
+ fFileName(0),
+ fEtaMinParton(-20.),
+ fEtaMaxParton(20.),
+ fPhiMinParton(0.),
+ fPhiMaxParton(2.* TMath::Pi()),
+ fEtaMinGamma(-20.),
+ fEtaMaxGamma(20.),
+ fPhiMinGamma(0.),
+ fPhiMaxGamma(2. * TMath::Pi())
{
// Constructor
+ fEnergyCMS = 14000;
}
AliGenHerwig::AliGenHerwig(Int_t npart)
fTrigger(0),
fSelectAll(0),
fFlavor(0),
- fEnergyCMS(14000),
fMomentum1(7000),
fMomentum2(7000),
fKineBias(1),
fHerwig(0x0),
fProcess(0),
fPtHardMin(0.),
+ fPtHardMax(9999.),
fPtRMS(0.),
fMaxPr(10),
fMaxErrors(1000),
fEnSoft(1),
fEv1Pr(0),
fEv2Pr(0),
- fFileName(0)
+ fFileName(0),
+ fEtaMinParton(-20.),
+ fEtaMaxParton(20.),
+ fPhiMinParton(0.),
+ fPhiMaxParton(2.* TMath::Pi()),
+ fEtaMinGamma(-20.),
+ fEtaMaxGamma(20.),
+ fPhiMinGamma(0.),
+ fPhiMaxGamma(2. * TMath::Pi())
{
+ fEnergyCMS = 14000;
SetTarget();
SetProjectile();
// Set random number generator
AliHerwigRndm::SetHerwigRandom(GetRandom());
}
-AliGenHerwig::AliGenHerwig(const AliGenHerwig & Herwig)
- :AliGenMC(Herwig),
- fAutPDF("LHAPDF"),
- fModPDF(19070),
- fStrucFunc(kCTEQ5L),
- fKeep(0),
- fDecaysOff(1),
- fTrigger(0),
- fSelectAll(0),
- fFlavor(0),
- fEnergyCMS(14000),
- fMomentum1(7000),
- fMomentum2(7000),
- fKineBias(1),
- fTrials(0),
- fXsection(0),
- fHerwig(0x0),
- fProcess(0),
- fPtHardMin(0.),
- fPtRMS(0.),
- fMaxPr(10),
- fMaxErrors(1000),
- fEnSoft(1),
- fEv1Pr(0),
- fEv2Pr(0),
- fFileName(0)
-{
-// Copy constructor
- Herwig.Copy(*this);
-}
-
-
AliGenHerwig::~AliGenHerwig()
{
// Destructor
// reset parameters according to user needs
InitPDF();
fHerwig->SetPTMIN(fPtHardMin);
+ fHerwig->SetPTMAX(fPtHardMax);
fHerwig->SetPTRMS(fPtRMS);
fHerwig->SetMAXPR(fMaxPr);
fHerwig->SetMAXER(fMaxErrors);
if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50);
- fHerwig->Hwusta("PI0 ");
+ //fHerwig->Hwusta("PI0 ");
// compute parameter dependent constants
fHerwig->PrepareRun();
if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50);
- fHerwig->Hwusta("PI0 ");
+ // fHerwig->Hwusta("PI0 ");
// compute parameter dependent constants
fHerwig->PrepareRunJimmy();
Int_t np = particles->GetEntriesFast()-1;
if (np == 0 ) continue;
+ //Check hard partons or direct gamma in kine range
+
+ if (fProcess == kHeJets || fProcess == kHeDirectGamma) {
+ TParticle* parton1 = (TParticle *) particles->At(6);
+ TParticle* parton2 = (TParticle *) particles->At(7);
+ if (!CheckParton(parton1, parton2)) continue ;
+ }
+
Int_t nc=0;
Int_t * newPos = new Int_t[np];
AdjustWeights();
// get cross-section
fXsection=fHerwig->GetAVWGT();
+ //printf(">> trials << %d\n",fTrials);
+}
+
+Bool_t AliGenHerwig::CheckParton(TParticle* parton1, TParticle* parton2)
+{
+// Check the kinematic trigger condition
+//
+//Select events with parton max energy
+ if(fPtHardMax < parton1->Pt()) return kFALSE;
+
+// Select events within angular window
+ Double_t eta[2];
+ eta[0] = parton1->Eta();
+ eta[1] = parton2->Eta();
+ Double_t phi[2];
+ phi[0] = parton1->Phi();
+ phi[1] = parton2->Phi();
+ Int_t pdg[2];
+ pdg[0] = parton1->GetPdgCode();
+ pdg[1] = parton2->GetPdgCode();
+ printf("min %f, max %f\n",fPtHardMin, fPtHardMax);
+ printf("Parton 1: %s, pT= %2.2f, eta = %1.2f, phi = %2.2f\n", parton1->GetName(),parton1->Pt(), eta[0],phi[0]*TMath::RadToDeg());
+ printf("Parton 2: %s, pT= %2.2f, eta = %1.2f, phi = %2.2f\n", parton2->GetName(),parton2->Pt(), eta[1],phi[1]*TMath::RadToDeg());
+
+ if (fProcess == kHeJets) {
+ //Check if one of the 2 outgoing partons are in the eta-phi window
+ for(Int_t i = 0; i < 2; i++)
+ if ((eta[i] < fEtaMaxParton && eta[i] > fEtaMinParton) &&
+ (phi[i] < fPhiMaxParton && phi[i] > fPhiMinParton)) return kTRUE ;
+ }
+
+ else {
+ //Check if the gamma and the jet are in the eta-phi window
+ Int_t igj = 0;
+ Int_t ijj = 0;
+ if(pdg[0] == 22) ijj=1;
+ else igj=1;
+ if ((eta[ijj] < fEtaMaxParton && eta[ijj] > fEtaMinParton) &&
+ (phi[ijj] < fPhiMaxParton && phi[ijj] > fPhiMinParton)) {
+
+ if ((eta[igj] < fEtaMaxGamma && eta[igj] > fEtaMinGamma) &&
+ (phi[igj] < fPhiMaxGamma && phi[igj] > fPhiMinGamma)) return kTRUE;
+
+ }
+ }
+
+ return kFALSE ;
}
void AliGenHerwig::AdjustWeights()
fHerwig->Hwefin();
}
-
-AliGenHerwig& AliGenHerwig::operator=(const AliGenHerwig& rhs)
-{
-// Assignment operator
- rhs.Copy(*this);
- return (*this);
-}
-
void AliGenHerwig::FinishRunJimmy()
{
fHerwig->Hwefin();