/*
$Log$
+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)
SetGeometryAcceptance();
SetPdgCodeParticleforAcceptanceCut();
SetNumberOfAcceptedParticles();
+ SetTarget();
+ SetProjectile();
}
AliGenMC::AliGenMC(Int_t npart)
SetGeometryAcceptance();
SetPdgCodeParticleforAcceptanceCut();
SetNumberOfAcceptedParticles();
+ SetTarget();
+ SetProjectile();
}
AliGenMC::AliGenMC(const AliGenMC & mc)
//non diffractive state -- return code unchanged
return pdgcode;
}
+
+void AliGenMC::Boost(Float_t dy)
+{
+//
+// Boost cms into LHC lab frame
+//
+
+ 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 = 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)
{
#include "AliGenerator.h"
#include "AliDecayer.h"
#include "AliGeometry.h"
-#include <TArrayI.h>
+#include <TArrayI.h>
#include <TClonesArray.h>
+#include <TString.h>
class TParticle;
virtual void SetPdgCodeParticleforAcceptanceCut(Int_t PdgCodeParticleforAcceptanceCut=0) {fPdgCodeParticleforAcceptanceCut = PdgCodeParticleforAcceptanceCut;}
virtual void SetNumberOfAcceptedParticles(Int_t NumberOfAcceptedParticles=2) {fNumberOfAcceptedParticles = NumberOfAcceptedParticles;}
-
+
virtual Bool_t CheckAcceptanceGeometry(Int_t np, TClonesArray* particles);
+ virtual void SetProjectile(TString proj="A", Int_t a=208, Int_t z=82)
+ {fProjectile = proj; fAProjectile = a; fZProjectile = z;}
+ virtual void SetTarget(TString tar="A", Int_t a=208, Int_t z=82)
+ {fTarget = tar; fATarget = a; fZTarget = z;}
+ virtual void Boost(Float_t dy);
protected:
// check if particle is selected as parent particle
Int_t CheckPDGCode(Int_t pdgcode) const;
protected:
+ TClonesArray* fParticles; //!Particle List
TArrayI fParentSelect; //!Parent particles to be selected
TArrayI fChildSelect; //!Decay products to be selected
Int_t fCutOnChild; // Cuts on decay products (children) are enabled/disabled
Float_t fChildYMax; // Children maximum y
Decay_t fForceDecay; // Decay channel forced
Float_t fMaxLifeTime; // Maximum lifetime for unstable particles
+ Int_t fAProjectile; // Projectile A
+ Int_t fZProjectile; // Projectile Z
+ Int_t fATarget; // Target A
+ Int_t fZTarget; // Target Z
+ TString fProjectile; // Projectile
+ TString fTarget; // Target
+
AliGeometry * fGeometryAcceptance; // Geometry to which particles must be simulated
Int_t fPdgCodeParticleforAcceptanceCut; // Abs(PDG Code) of the particle to which the GeometryAcceptance must be applied
Int_t fNumberOfAcceptedParticles; // Number of accepted particles in GeometryAcceptance with the right Abs(PdgCode)