Skip to content

Commit

Permalink
adding GetPtHard option in Herwig
Browse files Browse the repository at this point in the history
  • Loading branch information
lcunquei authored and amorsch committed Feb 27, 2017
1 parent eba0766 commit bdb6641
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
6 changes: 4 additions & 2 deletions STEER/STEERBase/AliGenHerwigEventHeader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ ClassImp(AliGenHerwigEventHeader)
AliGenHerwigEventHeader::AliGenHerwigEventHeader():
fProcessType(0),
fTrials(0),
fWeight(1.)
fWeight(1.),
fPtHard(0.)
{
// Default Constructor
}
Expand All @@ -31,7 +32,8 @@ AliGenHerwigEventHeader::AliGenHerwigEventHeader(const char* name):
AliGenEventHeader(name),
fProcessType(0),
fTrials(0),
fWeight(1.)
fWeight(1.),
fPtHard(0.)
{
// Constructor
}
6 changes: 5 additions & 1 deletion STEER/STEERBase/AliGenHerwigEventHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ class AliGenHerwigEventHeader : public AliGenEventHeader
void SetTrials(Int_t trials) {fTrials = trials;}
Float_t Weight() const {return fWeight;}
void SetWeight(Float_t weight) {fWeight = weight;}
Float_t GetPtHard() const {return fPtHard;}
void SetPtHardGen(Float_t pthard) {fPtHard = pthard;}

protected:
Int_t fProcessType; // HERWIG process id for this event
Int_t fTrials; // Number of trials to fulfill trigger condition
Float_t fWeight; // Event weight (= cross section in nb for unweighted events)
ClassDef(AliGenHerwigEventHeader, 2) // Event header for Herwig event
Float_t fPtHard; // Generated pT-hard in the 2-2 process
ClassDef(AliGenHerwigEventHeader, 3) // Event header for Herwig event
};


Expand Down
13 changes: 10 additions & 3 deletions THerwig/AliGenHerwig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ClassImp(AliGenHerwig)
fProcess(0),
fPtHardMin(0.),
fPtHardMax(9999.),
fPtHardGen(0),
fWeightPower(0),
fPtRMS(0.),
fMaxPr(10),
Expand Down Expand Up @@ -99,6 +100,7 @@ AliGenHerwig::AliGenHerwig(Int_t npart)
fProcess(0),
fPtHardMin(0.),
fPtHardMax(9999.),
fPtHardGen(0),
fWeightPower(0),
fPtRMS(0.),
fMaxPr(10),
Expand Down Expand Up @@ -306,6 +308,7 @@ void AliGenHerwig::Generate()
TParticle* parton1 = (TParticle *) particles->At(6);
TParticle* parton2 = (TParticle *) particles->At(7);
if (!CheckParton(parton1, parton2)) continue ;
fPtHardGen=TMath::Sqrt(parton1->Px()*parton1->Px()+parton2->Py()*parton2->Py());
}

Int_t nc = 0;
Expand Down Expand Up @@ -383,9 +386,9 @@ Bool_t AliGenHerwig::CheckParton(const TParticle* parton1, const TParticle* part
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());
// 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
Expand Down Expand Up @@ -516,6 +519,10 @@ void AliGenHerwig::MakeHeader()
//
// Event weight (cross section)
((AliGenHerwigEventHeader*) fHeader)->SetWeight(fHerwig->GetEVWGT());

// Generated pthard
((AliGenHerwigEventHeader*) fHeader)->SetPtHardGen(fPtHardGen);

//
// Event Vertex
fHeader->SetPrimaryVertex(fVertex);
Expand Down
1 change: 1 addition & 0 deletions THerwig/AliGenHerwig.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class AliGenHerwig : public AliGenMC
Int_t fProcess; // Process number
Double_t fPtHardMin; // higher pT-hard cut
Double_t fPtHardMax; // lower pT-hard cut
Double_t fPtHardGen; // generated pT-hard
Double_t fWeightPower; //power of the event weight
Double_t fPtRMS; // intrinsic pt of incoming hadrons
Int_t fMaxPr; // maximum number of events to print out
Expand Down

0 comments on commit bdb6641

Please sign in to comment.