AliDecayers will return particles coordinates,time in cm,sec. Generators
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Aug 2012 16:02:08 +0000 (16:02 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Aug 2012 16:02:08 +0000 (16:02 +0000)
which before were converting decay outputs from mm and mm/c are fixed.

EVGEN/AliGenCorrHF.cxx
EVGEN/AliGenParam.cxx
PYTHIA6/AliDecayerPythia.cxx
PYTHIA8/AliDecayerPythia8.cxx
TAmpt/AliGenAmpt.cxx
TEvtGen/AliDecayerEvtGen.cxx
TEvtGen/AliGenEvtGen.cxx

index e92e64e..51b56cd 100644 (file)
@@ -810,10 +810,10 @@ void AliGenCorrHF::LoadTracks(Int_t iquark, Float_t *pq,
        TParticle* iparticle = (TParticle *) particles->At(i);
        Int_t kf  = iparticle->GetPdgCode();
        Int_t jpa = iparticle->GetFirstMother()-1;
-
-       och[0] = origin0[0]+iparticle->Vx()/10;
-       och[1] = origin0[1]+iparticle->Vy()/10;
-       och[2] = origin0[2]+iparticle->Vz()/10;
+       // RS: note, the conversion mm->cm is done now in the decayer. The time is ignored here!
+       och[0] = origin0[0]+iparticle->Vx();
+       och[1] = origin0[1]+iparticle->Vy();
+       och[2] = origin0[2]+iparticle->Vz();
        pc[0]  = iparticle->Px();
        pc[1]  = iparticle->Py();
        pc[2]  = iparticle->Pz();
index 1089601..2c78f83 100644 (file)
@@ -504,9 +504,9 @@ void AliGenParam::Generate()
                          Int_t ksc  = iparticle->GetStatusCode();
                          Int_t jpa  = iparticle->GetFirstMother()-1;
                          
-                         och[0] = origin0[0]+iparticle->Vx()/10;
-                         och[1] = origin0[1]+iparticle->Vy()/10;
-                         och[2] = origin0[2]+iparticle->Vz()/10;
+                         och[0] = origin0[0]+iparticle->Vx();
+                         och[1] = origin0[1]+iparticle->Vy();
+                         och[2] = origin0[2]+iparticle->Vz();
                          pc[0]  = iparticle->Px();
                          pc[1]  = iparticle->Py();
                          pc[2]  = iparticle->Pz();
index bf14fba..7a826fe 100644 (file)
@@ -28,6 +28,7 @@
 #include <TPDGCode.h>
 #include <TLorentzVector.h>
 #include <TClonesArray.h>
+#include <TParticle.h>
 
 ClassImp(AliDecayerPythia)
 
@@ -158,7 +159,16 @@ Int_t AliDecayerPythia::ImportParticles(TClonesArray *particles)
 {
 // Import the decay products
 //
-    return fPythia->ImportParticles(particles, "All");
+  const Float_t kconvT=0.001/2.999792458e8; // mm/c to seconds conversion
+  const Float_t kconvL=1./10; // mm to cm conversion
+  int np = fPythia->ImportParticles(particles, "All");
+  // pythia assigns decay time in mm/c, convert to seconds
+  for (int ip=1;ip<np;ip++) {
+    TParticle* prod = (TParticle*)particles->At(ip);
+    if (!prod) continue;
+    prod->SetProductionVertex(prod->Vx()*kconvL,prod->Vy()*kconvL,prod->Vz()*kconvL,kconvT*prod->T());
+  }
+  return np;
 }
 
 
index 0be6f40..7fb2265 100644 (file)
@@ -20,6 +20,8 @@
 #include <TMath.h>
 #include <TPDGCode.h>
 #include <TLorentzVector.h>
+#include <TClonesArray.h>
+#include <TParticle.h>
 #include "AliTPythia8.h"
 #include "AliDecayerPythia8.h"
 #include "ParticleData.h"
@@ -55,8 +57,17 @@ void AliDecayerPythia8::Decay(Int_t pdg, TLorentzVector* p)
 //___________________________________________________________________________
 Int_t AliDecayerPythia8::ImportParticles(TClonesArray *particles)
 {
-   //import the decay products into particles array
-   return (fPythia8->ImportParticles(particles, "All"));
+  //import the decay products into particles array
+  const Float_t kconvT=0.001/2.999792458e8; // mm/c to seconds conversion
+  const Float_t kconvL=1./10; // mm to cm conversion
+  int np = fPythia8->ImportParticles(particles, "All");
+  // pythia assigns decay time in mm/c, convert to seconds
+  for (int ip=1;ip<np;ip++) {
+    TParticle* prod = (TParticle*)particles->At(ip);
+    if (!prod) continue;
+    prod->SetProductionVertex(prod->Vx()*kconvL,prod->Vy()*kconvL,prod->Vz()*kconvL,kconvT*prod->T());
+  }
+  return np;
 }
 
 
index b166057..1b1dcfa 100644 (file)
@@ -246,9 +246,6 @@ void AliGenAmpt::Generate()
   Float_t p[3];
   Float_t tof;
 
-  //  converts from mm/c to s
-  const Float_t kconv = 0.001/2.99792458e8;
-
   Int_t nt  = 0;
   Int_t jev = 0;
   Int_t j, kf, ks, ksp, imo;
@@ -289,7 +286,17 @@ void AliGenAmpt::Generate()
     Int_t np = fParticles.GetEntriesFast();
     if (np == 0 ) 
       continue;
-
+    //
+    //RS>>: Decayers now returns cm and sec. Since TAmpt returns mm and mm/c, convert its result to cm and sec here
+    const Float_t kconvT=0.001/2.999792458e8; // mm/c to seconds conversion
+    const Float_t kconvL=1./10; // mm to cm conversion
+    for (int ip=np;ip--;) {
+      TParticle* part = (TParticle*)fParticles[ip];
+      if (!part) continue;
+      part->SetProductionVertex(part->Vx()*kconvL,part->Vy()*kconvL,part->Vz()*kconvL,kconvT*part->T());
+    }
+    // RS<<
+    //
     if (fTrigger != kNoTrigger) {
       if (!CheckTrigger()) 
         continue;
@@ -475,10 +482,10 @@ void AliGenAmpt::Generate()
         p[0] = iparticle->Px();
         p[1] = iparticle->Py();
         p[2] = iparticle->Pz() * sign;
-        origin[0] = origin0[0]+iparticle->Vx()/10;
-        origin[1] = origin0[1]+iparticle->Vy()/10;
-        origin[2] = origin0[2]+iparticle->Vz()/10;
-       tof = time0+kconv * iparticle->T();
+        origin[0] = origin0[0]+iparticle->Vx();
+        origin[1] = origin0[1]+iparticle->Vy();
+        origin[2] = origin0[2]+iparticle->Vz();
+       tof = time0 + iparticle->T();
 
         imo = -1;
         TParticle* mother = 0;
index 2b4dbbf..4bc8604 100644 (file)
@@ -158,11 +158,12 @@ Int_t AliDecayerEvtGen::ImportParticles(TClonesArray *particles)
   py=p4.get(2);
   pz=p4.get(3);
   e=p4.get(0);
-
-  x=x4.get(1);//[mm]
-  y=x4.get(2);//[mm]
-  z=x4.get(3);//[mm]
-  t=x4.get(0);//[mm]
+  const Float_t kconvT=0.001/2.999792458e8; // mm/c to seconds conversion
+  const Float_t kconvL=1./10; // mm to cm conversion
+  x=x4.get(1)*kconvL;//[cm]
+  y=x4.get(2)*kconvL;//[cm]
+  z=x4.get(3)*kconvL;//[cm]
+  t=x4.get(0)*kconvT;//[s]
 
   AliDebug(1,Form("partnum = %d istat = %d primaMadre = %d ultimaMadre = %d primaF = %d ultimaF=%d x=%f y=%f z=%f t=%f e=%f px=%f \n",partnum,istat,jmotherfirst,jmotherlast,jdaugfirst,jdauglast,x,y,z,t,e,px));
 
index c5eec44..ea5846e 100644 (file)
@@ -181,13 +181,13 @@ void AliGenEvtGen::Generate()
          Int_t jpa  = iparticle->GetFirstMother()-1; //jpa = 0 for daughters of beauty particles
          Int_t iparent = (jpa > 0) ? pParent[jpa] : iTrack;      
 
-         och[0] = origin0[0]+iparticle->Vx()/10; //[cm]
-         och[1] = origin0[1]+iparticle->Vy()/10; //[cm]
-         och[2] = origin0[2]+iparticle->Vz()/10; //[cm]
+         och[0] = origin0[0]+iparticle->Vx(); //[cm]
+         och[1] = origin0[1]+iparticle->Vy(); //[cm]
+         och[2] = origin0[2]+iparticle->Vz(); //[cm]
          pc[0]  = iparticle->Px(); //[GeV/c]
          pc[1]  = iparticle->Py(); //[GeV/c]
          pc[2]  = iparticle->Pz(); //[GeV/c]
-         tof = part->T()+kconv*iparticle->T(); 
+         tof = part->T()+iparticle->T(); 
 
          AliDebug(1,Form("FirstMother = %d e indicePart = %d e pdg = %d \n",jpa,i,kf));