]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenMC.cxx
Change to prevent from uncorrect reading of pedestal data by the DAs
[u/mrichter/AliRoot.git] / EVGEN / AliGenMC.cxx
index d2e374cd862c09746fcae2b49dac7ca34eac6b6b..cefaa40bcda14929a3a2142df6f3270fa8f70aaf 100644 (file)
@@ -34,7 +34,7 @@ ClassImp(AliGenMC)
 
 AliGenMC::AliGenMC()
     :AliGenerator(),
-     fParticles(0),
+     fParticles("TParticle", 1000),
      fParentSelect(8),
      fChildSelect(8),
      fCutOnChild(0),
@@ -52,12 +52,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,11 +59,17 @@ AliGenMC::AliGenMC()
      fNprimaries(0)
 {
 // Default Constructor
+  fAProjectile = 1;
+  fZProjectile = 1;
+  fATarget = 1;
+  fZTarget = 1;
+  fProjectile = "P";
+  fTarget = "P";
 }
 
 AliGenMC::AliGenMC(Int_t npart)
     :AliGenerator(npart),
-     fParticles(0),
+     fParticles("TParticle", 1000),
      fParentSelect(8),
      fChildSelect(8),
      fCutOnChild(0),
@@ -87,12 +87,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 +95,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()
@@ -156,8 +156,11 @@ void AliGenMC::Init()
         fChildSelect[0]= 22;
         fChildSelect[1]= 11;
         break;
-
-    case kOmega:       
+    case kLambda:      
+       fChildSelect[0]= kProton;
+        fChildSelect[1]= 211;
+       break;
+    case kOmega:
     case kAll:
     case kAllMuonic:
     case kNoDecay:
@@ -198,13 +201,17 @@ Bool_t AliGenMC::KinematicSelection(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,16 +368,16 @@ 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);
     
     Int_t i;
-    Int_t np = fParticles->GetEntriesFast();
+    Int_t np = fParticles.GetEntriesFast();
     for (i = 0; i < np; i++) 
     {
-       TParticle* iparticle = (TParticle*) fParticles->At(i);
+       TParticle* iparticle = (TParticle*) fParticles.At(i);
 
        Double_t e   = iparticle->Energy();
        Double_t px  = iparticle->Px();