]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add Boost() method to boost all particles to LHC lab frame. Needed for asymmetric...
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2001 12:30:34 +0000 (12:30 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2001 12:30:34 +0000 (12:30 +0000)
EVGEN/AliGenHijing.cxx
EVGEN/AliGenHijing.h

index 639c895a7d4c50f148d1690e2d2c85d2fa9bd7d9..9bd097b9daf447a3d6a98261d599f92bc5e6dd68 100644 (file)
@@ -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
index 58a02feb38df1183f871efc57778ecc5152ee701..4671b5471025dff642249f4bff4d3ff289658760 100644 (file)
@@ -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();