]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenMC.cxx
Wagon macros, update cut on PHOS clusters close to border.
[u/mrichter/AliRoot.git] / EVGEN / AliGenMC.cxx
index c35e1fd7b7f45f84e027bcbf32543d27746a4d26..6660454fcf0547232208b4c27aa84c53595b759f 100644 (file)
@@ -25,6 +25,8 @@
 #include <TMath.h>
 #include <TPDGCode.h>
 #include <TParticle.h>
+#include <TLorentzVector.h>
+#include <TVector3.h>
 
 #include "AliGenMC.h"
 #include "AliRun.h"
@@ -160,6 +162,10 @@ void AliGenMC::Init()
        fChildSelect[0]= kProton;
         fChildSelect[1]= 211;
        break;
+    case kPsiPrimeJpsiDiElectron:
+      fChildSelect[0]= 211;
+      fChildSelect[1]= 11;
+      break;
     case kOmega:
     case kAll:
     case kAllMuonic:
@@ -392,6 +398,46 @@ void AliGenMC::Boost()
     }
 }
 
+void AliGenMC::BeamCrossAngle()
+{
+  // Applies a boost in the y-direction in order to take into account the 
+  // beam crossing angle
+
+  Double_t thetaPr0, phiPr0, pyPr2, pzPr2;
+  TVector3 beta;
+  
+  thetaPr0 = fXingAngleY / 2.;
+  phiPr0 = 0;
+
+  // Momentum of the CMS system
+  pyPr2 = TMath::Sqrt(fEnergyCMS * fEnergyCMS/ 4 - 0.938 * 0.938) * TMath::Sin(thetaPr0); 
+  pzPr2 = TMath::Sqrt(fEnergyCMS * fEnergyCMS/ 4 - 0.938 * 0.938) * TMath::Cos(thetaPr0);
+
+  TLorentzVector proj1Vect, proj2Vect, projVect;
+  proj1Vect.SetPxPyPzE(0., pyPr2, pzPr2, fEnergyCMS/2);
+  proj2Vect.SetPxPyPzE(0., pyPr2,-pzPr2, fEnergyCMS/2);
+  projVect = proj1Vect + proj2Vect;
+  beta=(1. / projVect.E()) * (projVect.Vect());
+
+  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();
+      
+      TLorentzVector partIn;
+      partIn.SetPxPyPzE(px,py,pz,e);
+      partIn.Boost(beta);
+      iparticle->SetMomentum(partIn.Px(),partIn.Py(),partIn.Pz(),partIn.E());
+    }
+}
+
+
 void AliGenMC::AddHeader(AliGenEventHeader* header)
 {
     // Passes header either to the container or to gAlice