X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenMC.cxx;h=115736974493104cdb40900fb1efe1bb4204cdf8;hb=768ac2f5853343b584a9c875bde9cfbefeee1c21;hp=08b58eeaae4b95fbf693135ceed3d6267b7519c1;hpb=969a210b19e3df311ad5f76da1e954c45b3d11a6;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenMC.cxx b/EVGEN/AliGenMC.cxx index 08b58eeaae4..11573697449 100644 --- a/EVGEN/AliGenMC.cxx +++ b/EVGEN/AliGenMC.cxx @@ -25,10 +25,14 @@ #include #include #include +#include +#include #include "AliGenMC.h" +#include "AliGenEventHeader.h" #include "AliRun.h" #include "AliGeometry.h" +#include "AliDecayer.h" ClassImp(AliGenMC) @@ -52,12 +56,6 @@ AliGenMC::AliGenMC() fXingAngleY(0.), fForceDecay(kAll), fMaxLifeTime(1.e-15), - fAProjectile(1), - fZProjectile(1), - fATarget(1), - fZTarget(1), - fProjectile("P"), - fTarget("P"), fDyBoost(0.), fGeometryAcceptance(0), fPdgCodeParticleforAcceptanceCut(0), @@ -65,6 +63,12 @@ AliGenMC::AliGenMC() fNprimaries(0) { // Default Constructor + fAProjectile = 1; + fZProjectile = 1; + fATarget = 1; + fZTarget = 1; + fProjectile = "P"; + fTarget = "P"; } AliGenMC::AliGenMC(Int_t npart) @@ -87,12 +91,6 @@ AliGenMC::AliGenMC(Int_t npart) fXingAngleY(0.), fForceDecay(kAll), fMaxLifeTime(1.e-15), - fAProjectile(1), - fZProjectile(1), - fATarget(1), - fZTarget(1), - fProjectile("P"), - fTarget("P"), fDyBoost(0.), fGeometryAcceptance(0), fPdgCodeParticleforAcceptanceCut(0), @@ -101,7 +99,13 @@ AliGenMC::AliGenMC(Int_t npart) { // Constructor // - for (Int_t i=0; i<8; i++) fParentSelect[i]=fChildSelect[i]=0; + fAProjectile = 1; + fZProjectile = 1; + fATarget = 1; + fZTarget = 1; + fProjectile = "P"; + fTarget = "P"; + for (Int_t i=0; i<8; i++) fParentSelect[i]=fChildSelect[i]=0; } AliGenMC::~AliGenMC() @@ -119,12 +123,15 @@ void AliGenMC::Init() case kDiElectron: case kBJpsiDiElectron: case kBPsiPrimeDiElectron: + case kElectronEM: + case kDiElectronEM: fChildSelect[0] = kElectron; break; case kHardMuons: case kBSemiMuonic: case kSemiMuonic: case kDiMuon: + case kJpsiDiMuon: case kBJpsiDiMuon: case kBPsiPrimeDiMuon: case kPiToMu: @@ -146,6 +153,7 @@ void AliGenMC::Init() fChildSelect[0]=kKPlus; break; case kBJpsi: + case kBJpsiUndecayed: fChildSelect[0]= 443; break; case kChiToJpsiGammaToMuonMuon: @@ -156,13 +164,25 @@ void AliGenMC::Init() fChildSelect[0]= 22; fChildSelect[1]= 11; break; - - case kOmega: + case kLambda: + fChildSelect[0]= kProton; + fChildSelect[1]= 211; + break; + case kPsiPrimeJpsiDiElectron: + fChildSelect[0]= 211; + fChildSelect[1]= 11; + break; + case kGammaEM: + fChildSelect[0] = kGamma; + break; + case kOmega: case kAll: case kAllMuonic: case kNoDecay: case kNoDecayHeavy: + case kNoDecayBeauty: case kNeutralPion: + case kBeautyUpgrade: break; } @@ -194,17 +214,21 @@ Bool_t AliGenMC::ChildSelected(Int_t ip) const return kFALSE; } -Bool_t AliGenMC::KinematicSelection(TParticle *particle, Int_t flag) const +Bool_t AliGenMC::KinematicSelection(const TParticle *particle, Int_t flag) const { // Perform kinematic selection Double_t pz = particle->Pz(); - Double_t e = particle->Energy(); Double_t pt = particle->Pt(); Double_t p = particle->P(); Double_t theta = particle->Theta(); Double_t mass = particle->GetCalcMass(); Double_t mt2 = pt * pt + mass * mass; Double_t phi = particle->Phi(); + Double_t e = particle->Energy(); + + if (e == 0.) + e = TMath::Sqrt(p * p + mass * mass); + Double_t y, y0; @@ -361,7 +385,7 @@ void AliGenMC::Boost() // Double_t beta = TMath::TanH(fDyBoost); - Double_t gamma = 1./TMath::Sqrt(1.-beta*beta); + Double_t gamma = 1./TMath::Sqrt((1.-beta)*(1.+beta)); Double_t gb = gamma * beta; // printf("\n Boosting particles to lab frame %f %f %f", fDyBoost, beta, gamma); @@ -384,10 +408,51 @@ 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 if (fContainer) { + header->SetName(fName); fContainer->AddHeader(header); } else { gAlice->SetGenEventHeader(header);