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;
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();
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()
{
enum {kNoTrigger, kHardProcesses, kDirectPhotons};
-
+ enum {kHeJets = 1500, kHeDirectGamma = 1800};
public:
AliGenHerwig();
AliGenHerwig(Int_t npart);
virtual void SetStrucFunc(StrucFunc_t func = kCTEQ5L)
{fStrucFunc = func;}
virtual void SetPtHardMin(Double_t pt) {fPtHardMin=pt;}
+ virtual void SetPtHardMax(Double_t pt) {fPtHardMax=pt;}
virtual void SetPtRMS(Double_t pt) {fPtRMS=pt;}
virtual void SetMaxPr(Int_t i) {fMaxPr=i;}
virtual void SetMaxErrors(Int_t i) {fMaxErrors=i;}
virtual void SetHardProcessFile(TString filename) {fFileName=TString(filename);};
virtual void SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
+ virtual Bool_t CheckParton(TParticle* parton1, TParticle* parton2);
+
+ virtual void GetPartonEtaRange(Float_t& etamin, Float_t& etamax) const
+ {etamin = fEtaMinParton; etamax = fEtaMaxParton;}
+ virtual void GetPartonPhiRange(Float_t& phimin, Float_t& phimax) const
+ {phimin = fPhiMinParton*180./TMath::Pi(); phimax = fPhiMaxParton*180/TMath::Pi();}
+ virtual void GetGammaEtaRange(Float_t& etamin, Float_t& etamax) const
+ {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
+ virtual void GetGammaPhiRange(Float_t& phimin, Float_t& phimax) const
+ {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
+
+ virtual void SetPartonEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
+ {fEtaMinParton = etamin; fEtaMaxParton = etamax;}
+ // Phi range for jet trigger
+ virtual void SetPartonPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
+ {fPhiMinParton = TMath::Pi()*phimin/180.; fPhiMaxParton = TMath::Pi()*phimax/180.;}
+ // Eta range for gamma trigger
+ virtual void SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
+ {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
+ // Phi range for gamma trigger
+ virtual void SetGammaPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
+ {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
+
protected:
Bool_t SelectFlavor(Int_t pid);
Float_t fXsection; // Cross-section
THerwig6 *fHerwig; // Herwig
Int_t fProcess; // Process number
- Double_t fPtHardMin; // lower pT-hard cut
+ Double_t fPtHardMin; // higher pT-hard cut
+ Double_t fPtHardMax; // lower pT-hard cut
Double_t fPtRMS; // intrinsic pt of incoming hadrons
Int_t fMaxPr; // maximum number of events to print out
Int_t fMaxErrors; // maximum number of errors allowed
Int_t fEv1Pr; // first event to be printed
Int_t fEv2Pr; // last event to be printed
TString fFileName; //!Name of file to read from hard scattering
+ Float_t fEtaMinParton; //Minimum eta of parton shower
+ Float_t fEtaMaxParton; //Maximum eta of parton shower
+ Float_t fPhiMinParton; //Minimum phi of parton shower
+ Float_t fPhiMaxParton; //Maximum phi of parton shower
+ Float_t fEtaMinGamma; // Minimum eta of triggered gamma
+ Float_t fEtaMaxGamma; // Maximum eta of triggered gamma
+ Float_t fPhiMinGamma; // Minimum phi of triggered gamma
+ Float_t fPhiMaxGamma; // Maximum phi of triggered gamma
private:
AliGenHerwig(const AliGenHerwig &Herwig);