From cc71f2d3ce63ea2a58e86f986f113af262e2fc95 Mon Sep 17 00:00:00 2001 From: morsch Date: Tue, 6 Nov 2001 12:30:34 +0000 Subject: [PATCH] Add Boost() method to boost all particles to LHC lab frame. Needed for asymmetric collision systems. --- EVGEN/AliGenHijing.cxx | 40 ++++++++++++++++++++++++++++++++++++++++ EVGEN/AliGenHijing.h | 7 ++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/EVGEN/AliGenHijing.cxx b/EVGEN/AliGenHijing.cxx index 639c895a7d4..9bd097b9daf 100644 --- a/EVGEN/AliGenHijing.cxx +++ b/EVGEN/AliGenHijing.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.30 2001/10/21 18:35:56 hristov +Several pointers were set to zero in the default constructors to avoid memory management problems + Revision 1.29 2001/10/15 08:12:24 morsch - Vertex smearing with truncated gaussian. - Store triggered jet info before and after final state radiation into mc-heade @@ -152,6 +155,7 @@ AliGenHijing::AliGenHijing(Int_t npart) SetImpactParameterRange(); SetTarget(); SetProjectile(); + SetBoostLHC(); fKeep = 0; fQuench = 1; fShadowing = 1; @@ -265,6 +269,8 @@ void AliGenHijing::Generate() fHijing->GenerateEvent(); fTrials++; fHijing->ImportParticles(particles,"All"); + if (fLHC) Boost(particles); + Int_t np = particles->GetEntriesFast(); printf("\n **************************************************%d\n",np); Int_t nc = 0; @@ -523,6 +529,39 @@ Bool_t AliGenHijing::Stable(TParticle* particle) } } + +void AliGenHijing::Boost(TClonesArray* particles) +{ +// +// Boost cms into LHC lab frame +// + Double_t dy = - 0.5 * TMath::Log(Double_t(fZProjectile) * Double_t(fATarget) / + (Double_t(fZTarget) * Double_t(fAProjectile))); + Double_t beta = TMath::TanH(dy); + Double_t gamma = 1./TMath::Sqrt(1.-beta*beta); + Double_t gb = gamma * beta; + + printf("\n Boosting particles to lab frame %f %f %f", dy, beta, gamma); + + Int_t i; + Int_t np = particles->GetEntriesFast(); + for (i = 0; i < np; i++) + { + TParticle* iparticle = (TParticle*) particles->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); + } +} + + void AliGenHijing::MakeHeader() { // Builds the event header, to be called after each event @@ -566,6 +605,7 @@ void AliGenHijing::MakeHeader() gAlice->SetGenEventHeader(header); } + AliGenHijing& AliGenHijing::operator=(const AliGenHijing& rhs) { // Assignment operator diff --git a/EVGEN/AliGenHijing.h b/EVGEN/AliGenHijing.h index 58a02feb38d..4671b547102 100644 --- a/EVGEN/AliGenHijing.h +++ b/EVGEN/AliGenHijing.h @@ -59,9 +59,13 @@ class AliGenHijing : public AliGenMC virtual void SetRadiation(Int_t flag=3) {fRadiation = flag;} virtual void SetSpectators(Int_t spects=1) {fSpectators = spects;} virtual void SetPtMinJet(Float_t ptmin) {fPtMinJet = ptmin;} + virtual void SetBoostLHC(Int_t flag=0) {fLHC = flag;} + + AliGenHijing & operator=(const AliGenHijing & rhs); // Physics Routines virtual void EvaluateCrossSections(); + virtual void Boost(TClonesArray* particles); virtual TGraph* CrossSection() {return fDsigmaDb;} virtual TGraph* BinaryCollisions() {return fDnDb;} protected: @@ -104,7 +108,8 @@ class AliGenHijing : public AliGenMC // ZDC proposal (by Chiara) to store num. of SPECTATORS protons and neutrons Int_t fSpecn; // Num. of spectator neutrons Int_t fSpecp; // Num. of spectator protons - + Int_t fLHC; // Assume LHC as lab frame + private: // adjust the weight from kinematic cuts void AdjustWeights(); -- 2.43.0