Determine correctly "flavor" of resonances.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Feb 2005 04:24:50 +0000 (04:24 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Feb 2005 04:24:50 +0000 (04:24 +0000)
PYTHIA6/AliGenPythia.cxx

index c73145bbc05de3308010f2b7e10fb1f6d245d1eb..2683ca5e4e4909898350cd7d5029c9f13743e30d 100644 (file)
@@ -367,12 +367,6 @@ void AliGenPythia::Generate()
 // .. and perform hadronisation
 //     printf("Calling hadronisation %d\n", fPythia->GetN());
        fPythia->Pyexec();      
-
-       if (gAlice) {
-           if (gAlice->GetEvNumber()>=fDebugEventFirst &&
-               gAlice->GetEvNumber()<=fDebugEventLast) fPythia->Pylist(1);
-       }
-       
        fTrials++;
        fPythia->ImportParticles(fParticles,"All");
        Boost();
@@ -416,12 +410,12 @@ void AliGenPythia::Generate()
                // quark ?
                kf = TMath::Abs(kf);
                Int_t kfl = kf;
+               // Resonance
+               if (kfl > 100000) kfl %= 100000;
                // meson ?
                if  (kfl > 10) kfl/=100;
                // baryon
                if (kfl > 10) kfl/=10;
-               if (kfl > 10) kfl/=10;
-
                Int_t ipa = iparticle->GetFirstMother()-1;
                Int_t kfMo = 0;
                
@@ -456,7 +450,7 @@ void AliGenPythia::Generate()
 // Kinematic seletion on final state heavy flavor mesons
                    if (ParentSelected(kf) && !KinematicSelection(iparticle, 0)) 
                    {
-                     continue;
+                       continue;
                    }
                    pSelected[i] = 1;
                    if (ParentSelected(kf)) ++nParents; // Update parent count
@@ -464,9 +458,9 @@ void AliGenPythia::Generate()
                } else {
 // Kinematic seletion on decay products
                    if (fCutOnChild && ParentSelected(kfMo) && ChildSelected(kf) 
-                       && !KinematicSelection(iparticle, 1))
+                       && !KinematicSelection(iparticle, 1)) 
                    {
-                     continue;
+                       continue;
                    }
 //
 // Decay products 
@@ -496,6 +490,7 @@ void AliGenPythia::Generate()
                if (!pSelected[i]) continue;
                // Count quarks only if you did not include fragmentation
                if (fFragmentation && kf <= 10) continue;
+
                nc++;
 // Decision on tracking
                trackIt[i] = 0;
@@ -733,6 +728,11 @@ void AliGenPythia::MakeHeader()
        Int_t ntrig, njet;
        Float_t jets[4][10];
        GetJets(njet, ntrig, jets);
+
+       if (gAlice) {
+           if (gAlice->GetEvNumber()>=fDebugEventFirst &&
+               gAlice->GetEvNumber()<=fDebugEventLast) fPythia->Pylist(1);
+       }
        
        for (Int_t i = 0; i < ntrig; i++) {
            ((AliGenPythiaEventHeader*) fHeader)->AddJet(jets[0][i], jets[1][i], jets[2][i], 
@@ -953,7 +953,6 @@ void  AliGenPythia::GetJets(Int_t& nJets, Int_t& nJetsTrig, Float_t jets[4][10])
        Float_t theta = TMath::ATan2(pt,pz);
        Float_t et    = e * TMath::Sin(theta);
        Float_t eta   = -TMath::Log(TMath::Tan(theta / 2.));
-
        if (
            eta > fEtaMinJet && eta < fEtaMaxJet && 
            phi > fPhiMinJet && phi < fPhiMaxJet &&