]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/RESONANCES/AliRsnMiniOutput.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniOutput.cxx
index 8034351d0a7d03c3c8896d6c134bc62b7c83c21b..d6bfe5cbafe2cb3ec2d8c831bbd1b0dc494973f1 100644 (file)
@@ -48,6 +48,11 @@ AliRsnMiniOutput::AliRsnMiniOutput() :
    fSel2(0),
    fMaxNSisters(-1),
    fCheckP(kFALSE),
+   fCheckFeedDown(kFALSE),   
+   fOriginDselection(kFALSE),
+   fKeepDfromB(kFALSE),
+   fKeepDfromBOnly(kFALSE),
+   fRejectIfNoQuark(kFALSE),
    fCheckHistRange(kTRUE)
 {
 //
@@ -76,6 +81,11 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, EOutputType type, EComputat
    fSel2(0),
    fMaxNSisters(-1),
    fCheckP(kFALSE),
+   fCheckFeedDown(kFALSE),   
+   fOriginDselection(kFALSE),
+   fKeepDfromB(kFALSE),
+   fKeepDfromBOnly(kFALSE),
+   fRejectIfNoQuark(kFALSE),
    fCheckHistRange(kTRUE)
 {
 //
@@ -104,6 +114,11 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, const char *outType, const
    fSel2(0),
    fMaxNSisters(-1),
    fCheckP(kFALSE),
+   fCheckFeedDown(kFALSE),   
+   fOriginDselection(kFALSE),
+   fKeepDfromB(kFALSE),
+   fKeepDfromBOnly(kFALSE),
+   fRejectIfNoQuark(kFALSE),
    fCheckHistRange(kTRUE)
 {
 //
@@ -178,6 +193,11 @@ AliRsnMiniOutput::AliRsnMiniOutput(const AliRsnMiniOutput &copy) :
    fSel2(0),
    fMaxNSisters(-1),
    fCheckP(kFALSE),
+   fCheckFeedDown(kFALSE),   
+   fOriginDselection(kFALSE),
+   fKeepDfromB(kFALSE),
+   fKeepDfromBOnly(kFALSE),
+   fRejectIfNoQuark(kFALSE),
    fCheckHistRange(copy.fCheckHistRange)
 {
 //
@@ -221,6 +241,11 @@ AliRsnMiniOutput &AliRsnMiniOutput::operator=(const AliRsnMiniOutput &copy)
    fSel2.Set(0);
    fMaxNSisters = copy.fMaxNSisters;
    fCheckP = copy.fCheckP;
+   fCheckFeedDown = copy.fCheckFeedDown;
+   fOriginDselection = copy.fOriginDselection;
+   fKeepDfromB = copy.fOriginDselection;
+   fKeepDfromBOnly = copy.fKeepDfromBOnly;
+   fRejectIfNoQuark = copy.fRejectIfNoQuark;
    fCheckHistRange = copy.fCheckHistRange;
 
    return (*this);
@@ -511,6 +536,34 @@ Int_t AliRsnMiniOutput::FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event
            if ( fCheckP &&(TMath::Abs(fPair.PmotherX()-(p1->Px(1)+p2->Px(1)))/(TMath::Abs(fPair.PmotherX())+1.e-13)) > 0.00001 &&        
                          (TMath::Abs(fPair.PmotherY()-(p1->Py(1)+p2->Py(1)))/(TMath::Abs(fPair.PmotherY())+1.e-13)) > 0.00001 &&
                          (TMath::Abs(fPair.PmotherZ()-(p1->Pz(1)+p2->Pz(1)))/(TMath::Abs(fPair.PmotherZ())+1.e-13)) > 0.00001 ) continue;
+           if ( fCheckFeedDown ){
+                       Int_t pdgGranma = 0;
+                       Bool_t isFromB=kFALSE;
+                       Bool_t isQuarkFound=kFALSE;
+                       
+                       if(fPair.IsFromB() == kTRUE) isFromB = kTRUE;
+                       if(fPair.IsQuarkFound() == kTRUE) isQuarkFound = kTRUE;
+                       if(fRejectIfNoQuark && !isQuarkFound) pdgGranma = -99999;
+                       if(isFromB){
+                         if (!fKeepDfromB) pdgGranma = -9999; //skip particle if come from a B meson.
+                       }
+                       else{ 
+                         if (fKeepDfromBOnly) pdgGranma = -999;
+                         } 
+                       if (pdgGranma == -99999){
+                               AliDebug(2,"This particle does not have a quark in his genealogy\n");
+                               continue;
+                       }
+                       if (pdgGranma == -9999){
+                               AliDebug(2,"This particle come from a B decay channel but according to the settings of the task, we keep only the prompt charm particles\n");   
+                               continue;
+                       }       
+        
+                       if (pdgGranma == -999){
+                               AliDebug(2,"This particle come from a prompt charm particles but according to the settings of the task, we want only the ones coming from B\n");  
+                               continue;
+                       }       
+                   }
          }
          // check pair against cuts
          if (fPairCuts) {
@@ -526,7 +579,33 @@ Int_t AliRsnMiniOutput::FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event
    AliDebugClass(1, Form("Pairs added in total = %4d", nadded));
    return nadded;
 }
-
+//___________________________________________________________
+void AliRsnMiniOutput::SetDselection(UShort_t originDselection)
+{
+       // setting the way the D0 will be selected
+       // 0 --> only from c quarks
+       // 1 --> only from b quarks
+       // 2 --> from both c quarks and b quarks
+               
+       fOriginDselection = originDselection;
+       
+       if (fOriginDselection == 0) {
+               fKeepDfromB = kFALSE;
+               fKeepDfromBOnly = kFALSE;
+       }
+       
+       if (fOriginDselection == 1) {
+               fKeepDfromB = kTRUE;
+               fKeepDfromBOnly = kTRUE;
+       }
+       
+       if (fOriginDselection == 2) {
+               fKeepDfromB = kTRUE;
+               fKeepDfromBOnly = kFALSE;
+       }
+       
+       return; 
+}
 //________________________________________________________________________________________
 void AliRsnMiniOutput::ComputeValues(AliRsnMiniEvent *event, TClonesArray *valueList)
 {