- Pass (p,E) with PushTrack.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Oct 2003 11:38:38 +0000 (11:38 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Oct 2003 11:38:38 +0000 (11:38 +0000)
- phi in official coordinate system for jet selectio.

PYTHIA6/AliGenPythia.cxx

index 22034ac..5c9f412 100644 (file)
@@ -289,7 +289,7 @@ void AliGenPythia::Generate()
 
     Float_t polar[3]   =   {0,0,0};
     Float_t origin[3]  =   {0,0,0};
-    Float_t p[3];
+    Float_t p[4];
 //  converts from mm/c to s
     const Float_t kconv=0.001/2.999792458e8;
 //
@@ -482,14 +482,20 @@ void AliGenPythia::Generate()
                    p[0] = iparticle->Px();
                    p[1] = iparticle->Py();
                    p[2] = iparticle->Pz();
+                   p[3] = iparticle->Energy();
+                   
                    origin[0] = fOrigin[0]+iparticle->Vx()/10.;
                    origin[1] = fOrigin[1]+iparticle->Vy()/10.;
                    origin[2] = fOrigin[2]+iparticle->Vz()/10.;
                    Float_t tof   = kconv*iparticle->T();
                    Int_t ipa     = iparticle->GetFirstMother()-1;
                    Int_t iparent = (ipa > -1) ? pParent[ipa] : -1;
-                   PushTrack(fTrackIt*trackIt[i] ,
-                                    iparent, kf, p, origin, polar, tof, kPPrimary, nt, 1., ks);
+                   PushTrack(fTrackIt*trackIt[i], iparent, kf, 
+                             p[0], p[1], p[2], p[3], 
+                             origin[0], origin[1], origin[2], tof, 
+                             polar[0], polar[1], polar[2],
+                             kPPrimary, nt, 1., ks);
                    pParent[i] = nt;
                    KeepTrack(nt); 
                } //  PushTrack loop
@@ -580,12 +586,18 @@ Int_t  AliGenPythia::GenerateMB()
            p[0] = iparticle->Px();
            p[1] = iparticle->Py();
            p[2] = iparticle->Pz();
+           p[3] = iparticle->Energy();
+           
            origin[0] = fOrigin[0]+iparticle->Vx()/10.;
            origin[1] = fOrigin[1]+iparticle->Vy()/10.;
            origin[2] = fOrigin[2]+iparticle->Vz()/10.;
            Float_t tof=kconv*iparticle->T();
-           PushTrack(fTrackIt*trackIt, iparent, kf, p, origin, polar,
-                    tof, kPPrimary, nt, 1., ks);
+
+           PushTrack(fTrackIt*trackIt, iparent, kf, 
+                     p[0], p[1], p[2], p[3], 
+                     origin[0], origin[1], origin[2], tof, 
+                     polar[0], polar[1], polar[2],
+                     kPPrimary, nt, 1., ks);
            KeepTrack(nt);
            pParent[i] = nt;
        } // select particle
@@ -737,8 +749,7 @@ void  AliGenPythia::LoadEvent()
        Float_t py = MPart->Py();
        Float_t pz = MPart->Pz();
        Float_t e  = MPart->Energy();
-       Float_t p  = TMath::Sqrt(px * px + py * py + pz * pz);
-       Float_t m  = TMath::Sqrt(e * e - p * p);
+       Float_t m  = MPart->GetCalcMass();
        
        
        (fPythia->GetPyjets())->P[0][part] = px;
@@ -816,7 +827,7 @@ void  AliGenPythia::GetJets(Int_t& nJets, Int_t& nJetsTrig, Float_t jets[4][10])
        Float_t pz    = (fPythia->GetPyjets())->P[2][n+i];
        Float_t e     = (fPythia->GetPyjets())->P[3][n+i];
        Float_t pt    = TMath::Sqrt(px * px + py * py);
-       Float_t phi   = TMath::ATan2(py,px);
+       Float_t phi   = TMath::Pi() + TMath::ATan2(-py, -px);  
        Float_t theta = TMath::ATan2(pt,pz);
        Float_t et    = e * TMath::Sin(theta);
        Float_t eta   = -TMath::Log(TMath::Tan(theta / 2.));