/*
$Log$
+Revision 1.17 2003/04/30 14:48:21 hristov
+Changes related to the initialization of random numbers generators. Now one can use its own randoms for each module, particle generator, and/or tracking package. The interface with Fortran is simplified and some inter-library dependencies are avoided. Future improvements are welcome...
+
+Revision 1.16 2003/04/08 10:22:05 morsch
+Rapidity shift calculated in Init().
+
+Revision 1.15 2003/04/04 08:13:26 morsch
+Boost method added.
+
+Revision 1.14 2003/01/14 10:50:19 alibrary
+Cleanup of STEER coding conventions
+
+Revision 1.13 2002/10/14 14:55:35 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.5.4.2 2002/07/24 08:56:28 alibrary
Updating EVGEN on TVirtulaMC
// decay products and particle selection.
// andreas.morsch@cern.ch
-#include "AliGenMC.h"
-#include "AliPDG.h"
#include <TMath.h>
+#include <TPDGCode.h>
#include <TParticle.h>
+#include "AliGenMC.h"
+
ClassImp(AliGenMC)
AliGenMC::AliGenMC()
SetGeometryAcceptance();
SetPdgCodeParticleforAcceptanceCut();
SetNumberOfAcceptedParticles();
+ SetTarget();
+ SetProjectile();
}
AliGenMC::AliGenMC(Int_t npart)
SetGeometryAcceptance();
SetPdgCodeParticleforAcceptanceCut();
SetNumberOfAcceptedParticles();
+ SetTarget();
+ SetProjectile();
}
AliGenMC::AliGenMC(const AliGenMC & mc)
case kNoDecayHeavy:
break;
}
+
+ if (fZTarget != 0 && fAProjectile != 0)
+ {
+ fDyBoost = - 0.5 * TMath::Log(Double_t(fZProjectile) * Double_t(fATarget) /
+ (Double_t(fZTarget) * Double_t(fAProjectile)));
+ }
}
Bool_t AliGenMC::KinematicSelection(TParticle *particle, Int_t flag) const
{
// Perform kinematic selection
- Float_t px = particle->Px();
- Float_t py = particle->Py();
Float_t pz = particle->Pz();
Float_t e = particle->Energy();
Float_t pt = particle->Pt();
Float_t theta = particle->Theta();
Float_t mass = particle->GetCalcMass();
Float_t mt2 = pt * pt + mass * mass;
+ Float_t phi = particle->Phi();
- Float_t phi = Float_t(TMath::ATan2(Double_t(py),Double_t(px)));
Double_t y, y0;
if (TMath::Abs(pz) < e) {
//non diffractive state -- return code unchanged
return pdgcode;
}
+
+void AliGenMC::Boost()
+{
+//
+// Boost cms into LHC lab frame
+//
+
+ Double_t beta = TMath::TanH(fDyBoost);
+ Double_t gamma = 1./TMath::Sqrt(1.-beta*beta);
+ Double_t gb = gamma * beta;
+
+ // printf("\n Boosting particles to lab frame %f %f %f", fDyBoost, beta, gamma);
+
+ Int_t i;
+ Int_t np = fParticles->GetEntriesFast();
+ for (i = 0; i < np; i++)
+ {
+ TParticle* iparticle = (TParticle*) fParticles->At(i);
+
+ Double_t e = iparticle->Energy();
+ Double_t px = iparticle->Px();
+ Double_t py = iparticle->Py();
+ Double_t pz = iparticle->Pz();
+
+ Double_t eb = gamma * e - gb * pz;
+ Double_t pzb = -gb * e + gamma * pz;
+
+ iparticle->SetMomentum(px, py, pzb, eb);
+ }
+}
+
+
AliGenMC& AliGenMC::operator=(const AliGenMC& rhs)
{