]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Now it is possible to select kPyCharmppMNRwmi
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Nov 2008 21:41:12 +0000 (21:41 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Nov 2008 21:41:12 +0000 (21:41 +0000)
or kPyBeautyppMNRwmi events with at least an electron from
c or b within given cuts. (A. Dainese)

PYTHIA6/AliGenPythia.cxx
PYTHIA6/AliGenPythiaPlus.cxx

index 8d0f1cdaefefb2c2a4f560a03b4ecce045085d25..1ae76712301fd36ba04b357afde29efed6942fd4 100644 (file)
@@ -394,6 +394,9 @@ void AliGenPythia::Init()
        fParentSelect[1] =   421;
        fParentSelect[2] =   431;
        fParentSelect[3] =  4122;
+       fParentSelect[4] =  4232;
+       fParentSelect[5] =  4132;
+       fParentSelect[6] =  4332;
        fFlavorSelect    =  4;  
        break;
     case kPyD0PbPbMNR:
@@ -975,23 +978,44 @@ Int_t  AliGenPythia::GenerateMB()
     // Check if there is a ccbar or bbbar pair with at least one of the two
     // in fYMin < y < fYMax
     if (fProcess == kPyCharmppMNRwmi || fProcess == kPyBeautyppMNRwmi) {
-      TParticle *hvq;
+      TParticle *partCheck;
+      TParticle *mother;
       Bool_t  theQ=kFALSE,theQbar=kFALSE,inYcut=kFALSE;
-      Float_t yQ;  
-      Int_t   pdgQ;
+      Bool_t  theChild=kFALSE;
+      Float_t y;  
+      Int_t   pdg,mpdg,mpdgUpperFamily;
       for(i=0; i<np; i++) {
-       hvq = (TParticle*)fParticles.At(i);
-       pdgQ = hvq->GetPdgCode();  
-       if(TMath::Abs(pdgQ) != fFlavorSelect) continue; 
-       if(pdgQ>0) { theQ=kTRUE; } else { theQbar=kTRUE; }
-       yQ = 0.5*TMath::Log((hvq->Energy()+hvq->Pz()+1.e-13)/
-                           (hvq->Energy()-hvq->Pz()+1.e-13));
-       if(yQ>fYMin && yQ<fYMax) inYcut=kTRUE;
+       partCheck = (TParticle*)fParticles.At(i);
+       pdg = partCheck->GetPdgCode();  
+       if(TMath::Abs(pdg) == fFlavorSelect) { // quark  
+         if(pdg>0) { theQ=kTRUE; } else { theQbar=kTRUE; }
+         y = 0.5*TMath::Log((partCheck->Energy()+partCheck->Pz()+1.e-13)/
+                            (partCheck->Energy()-partCheck->Pz()+1.e-13));
+         if(y>fYMin && y<fYMax) inYcut=kTRUE;
+       }
+       if(fCutOnChild && TMath::Abs(pdg) == fPdgCodeParticleforAcceptanceCut) {
+         Int_t mi = partCheck->GetFirstMother() - 1;
+         if(mi<0) continue;
+         mother = (TParticle*)fParticles.At(mi);
+         mpdg=TMath::Abs(mother->GetPdgCode());
+         mpdgUpperFamily=(mpdg>1000 ? mpdg-1000 : mpdg-100); // keep e from c from b
+         if ( ParentSelected(mpdg) || 
+             (fFlavorSelect==5 && ParentSelected(mpdgUpperFamily))) {
+           if (KinematicSelection(partCheck,1)) {
+             theChild=kTRUE;
+           }
+         }
+       }
       }
-      if (!theQ || !theQbar || !inYcut) {
+      if (!theQ || !theQbar || !inYcut) { // one of the c/b conditions not satisfied
        delete[] pParent;
        return 0;
       }
+      if (fCutOnChild && !theChild) { // one of the child conditions not satisfied
+       delete[] pParent;
+       return 0;       
+      }
+
     }
 
     //Introducing child cuts in case kPyW, kPyZ, kPyMb, and kPyMbNonDiff
index 22bf4a5fb1014bf079e851ded1fdbf65d1aa3477..5579ebd84f138816b35bc03238936a36beacb28e 100644 (file)
@@ -375,6 +375,9 @@ void AliGenPythiaPlus::Init()
        fParentSelect[1] =   421;
        fParentSelect[2] =   431;
        fParentSelect[3] =  4122;
+       fParentSelect[4] =  4232;
+       fParentSelect[5] =  4132;
+       fParentSelect[6] =  4332;
        fFlavorSelect    =  4;  
        break;
     case kPyD0PbPbMNR:
@@ -907,23 +910,45 @@ Int_t  AliGenPythiaPlus::GenerateMB()
     // Check if there is a ccbar or bbbar pair with at least one of the two
     // in fYMin < y < fYMax
     if (fProcess == kPyCharmppMNRwmi || fProcess == kPyBeautyppMNRwmi) {
-      TParticle *hvq;
+      TParticle *partCheck;
+      TParticle *mother;
       Bool_t  theQ=kFALSE,theQbar=kFALSE,inYcut=kFALSE;
-      Float_t yQ;  
-      Int_t   pdgQ;
+      Bool_t  theChild=kFALSE;
+      Float_t y;  
+      Int_t   pdg,mpdg,mpdgUpperFamily;
       for(i=0; i<np; i++) {
-       hvq = (TParticle*)fParticles.At(i);
-       pdgQ = hvq->GetPdgCode();  
-       if(TMath::Abs(pdgQ) != fFlavorSelect) continue; 
-       if(pdgQ>0) { theQ=kTRUE; } else { theQbar=kTRUE; }
-       yQ = 0.5*TMath::Log((hvq->Energy()+hvq->Pz()+1.e-13)/
-                           (hvq->Energy()-hvq->Pz()+1.e-13));
-       if(yQ>fYMin && yQ<fYMax) inYcut=kTRUE;
+       partCheck = (TParticle*)fParticles.At(i);
+       pdg = partCheck->GetPdgCode();  
+       if(TMath::Abs(pdg) == fFlavorSelect) { // quark  
+         if(pdg>0) { theQ=kTRUE; } else { theQbar=kTRUE; }
+         y = 0.5*TMath::Log((partCheck->Energy()+partCheck->Pz()+1.e-13)/
+                            (partCheck->Energy()-partCheck->Pz()+1.e-13));
+         if(y>fYMin && y<fYMax) inYcut=kTRUE;
+       }
+
+       if(fCutOnChild && TMath::Abs(pdg) == fPdgCodeParticleforAcceptanceCut) {
+         Int_t mi = partCheck->GetFirstMother() - 1;
+         if(mi<0) continue;
+         mother = (TParticle*)fParticles.At(mi);
+         mpdg=TMath::Abs(mother->GetPdgCode());
+         mpdgUpperFamily=(mpdg>1000 ? mpdg-1000 : mpdg-100); // keep e from c from b
+         if ( ParentSelected(mpdg) || 
+             (fFlavorSelect==5 && ParentSelected(mpdgUpperFamily))) {
+           if (KinematicSelection(partCheck,1)) {
+             theChild=kTRUE;
+           }
+         }
+       }
       }
-      if (!theQ || !theQbar || !inYcut) {
+      if (!theQ || !theQbar || !inYcut) { // one of the c/b conditions not satisfied
        delete[] pParent;
        return 0;
       }
+      if (fCutOnChild && !theChild) { // one of the child conditions not satisfied
+       delete[] pParent;
+       return 0;       
+      }
+
     }
 
     //Introducing child cuts in case kPyW, kPyZ, kPyMb, and kPyMbNonDiff