]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Do the proper unit conversion
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Apr 2008 09:28:51 +0000 (09:28 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Apr 2008 09:28:51 +0000 (09:28 +0000)
TTherminator/AliGenTherminator.cxx
TTherminator/TTherminator.cxx

index 004564af140bcf38f85f5bb8cac489341e43d314..6f95dd3cb7fffaa9e19f867b33a3ad2dc8d883c5 100644 (file)
@@ -128,22 +128,22 @@ void AliGenTherminator::Generate()
       
       Double_t vphi = TMath::ATan2(iparticle->Vy(), iparticle->Vx());
       Double_t vrho = TMath::Hypot(iparticle->Vx(), iparticle->Vy());
-      origin[0] = origin0[0]+vrho*TMath::Cos(vphi + evrot);
-      origin[1] = origin0[1]+vrho*TMath::Sin(vphi + evrot);
-      origin[2] = origin0[2]+iparticle->Vz();
+      origin[0] = vrho*TMath::Cos(vphi + evrot);
+      origin[1] = vrho*TMath::Sin(vphi + evrot);
+      origin[2] = iparticle->Vz();
       
       imo = -1;
       TParticle* mother = 0;
       if (hasMother) {
        imo = iparticle->GetFirstMother();
-       mother = (TParticle *) fParticles->At(imo);
+       mother = (TParticle *) fParticles.At(imo);
       } // if has mother   
       Bool_t tFlag = (!hasDaughter);
       
       printf("Pushing Track %d with status %d mother %d\n", kf, tFlag, imo);
       PushTrack(tFlag,imo,kf,
                p[0],p[1],p[2],energy,
-               origin[0],origin[1],origin[2],iparticle->T()*0.197327*1e-13/300000000,
+               origin[0],origin[1],origin[2],iparticle->T(),
                polar[0],polar[1],polar[2],
                hasMother ? kPDecay:kPNoProcess,nt);
       fNprimaries++;
@@ -180,14 +180,14 @@ void AliGenTherminator::Generate()
       TParticle* mother = 0;
       if (hasMother) {
        imo = iparticle->GetFirstMother();
-       mother = (TParticle *) fParticles->At(imo);
+       mother = (TParticle *) fParticles.At(imo);
       } // if has mother   
       Bool_t tFlag = (hasDaughter);
       
       printf("Pushing Track %d with status %d mother %d\n", kf, tFlag, imo);
       PushTrack(tFlag,imo,kf,
                p[0],p[1],p[2],energy,
-               origin[0],origin[1],origin[2],iparticle->T()*0.197327*1e-13/300000000,
+               origin[0],origin[1],origin[2],iparticle->T(),
                polar[0],polar[1],polar[2],
                hasMother ? kPDecay:kPNoProcess,nt);
       fNprimaries++;
@@ -198,13 +198,13 @@ void AliGenTherminator::Generate()
       origin[2] = origin0[2]+iparticle->Vz();
 
       imo = nt;
-      mother = (TParticle *) fParticles->At(nt);
+      mother = (TParticle *) fParticles.At(nt);
       tFlag = (!hasDaughter);
       
       printf("Pushing Track %d with status %d mother %d\n", kf, tFlag, imo);
       PushTrack(tFlag,imo,kf,
                p[0],p[1],p[2],energy,
-               origin[0],origin[1],origin[2],iparticle->T()*0.197327*1e-13/300000000,
+               origin[0],origin[1],origin[2],iparticle->T(),
                polar[0],polar[1],polar[2],
                hasMother ? kPDecay:kPNoProcess,nt);
       fNprimaries++;
index 6574c2c35d795f5d0572486bd1958c023afe6d71..f41e37c319fd6116525604b1310c82575acd009b 100644 (file)
@@ -225,6 +225,8 @@ void        TTherminator::GenerateEvent()
 Int_t       TTherminator::ImportParticles(TClonesArray *particles, Option_t */*option*/)
 {
   // Import particles from a generated event into an external array
+  const double kFmToGev = 0.197327;
+
   if (particles == 0) return 0;
   TClonesArray &particlesR = *particles;
   particlesR.Clear();
@@ -248,8 +250,7 @@ Int_t       TTherminator::ImportParticles(TClonesArray *particles, Option_t */*o
     new (particlesR[iPart]) TParticle(tPart->GetParticleType()->GetPDGCode(), tPart->HadDecayed(),
                                      tFather, -1, -1, -1,
                                      tPart->px, tPart->py, tPart->pz, tPart->GetEnergy() ,
-                                     tPart->rx*1.e-13, tPart->ry*1.e-13, tPart->rz*1.e-13, tPart->rt*1.e-13/300000000 
-                                     );
+                                     tPart->rx*1.e-13*kFmToGev, tPart->ry*1.e-13*kFmToGev, tPart->rz*1.e-13*kFmToGev, tPart->rt*1.e-13*kFmToGev/3e10);
     particlesR[iPart]->SetUniqueID(iPart);
   }
   
@@ -259,6 +260,8 @@ Int_t       TTherminator::ImportParticles(TClonesArray *particles, Option_t */*o
 TObjArray*  TTherminator::ImportParticles(Option_t */*option*/)
 {
   // Import generated particles into an internal array
+  const double kFmToGev = 0.197327;
+
   Int_t nump = 0;
   fParticles->Clear();
   if (!fEvent) return 0;
@@ -279,8 +282,7 @@ TObjArray*  TTherminator::ImportParticles(Option_t */*option*/)
     TParticle* p = new TParticle(tPart->GetParticleType()->GetPDGCode(), tPart->HadDecayed(),
                                 tFather, -1, -1, -1,
                                 tPart->px, tPart->py, tPart->pz, tPart->GetEnergy() ,
-                                tPart->rx*1.e-13, tPart->ry*1.e-13, tPart->rz*1.e-13, tPart->rt*1.e-13/300000000 
-                                );
+                                tPart->rx*1.e-13*kFmToGev, tPart->ry*1.e-13*kFmToGev, tPart->rz*1.e-13*kFmToGev, tPart->rt*1.e-13*kFmToGev/3e10);
     p->SetUniqueID(iPart);
     fParticles->Add(p);
   }