New class for DStar->D0pi cuts (Alessandro)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 8 May 2010 14:51:14 +0000 (14:51 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 8 May 2010 14:51:14 +0000 (14:51 +0000)
PWG3/PWG3vertexingHFLinkDef.h
PWG3/libPWG3vertexingHF.pkg
PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.cxx [new file with mode: 0644]
PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.h [new file with mode: 0644]

index 37694b9943c9d4d8afec588a8dce233a62798937..a5b1767824b138d39a8212b4e3f7f196165e8369 100644 (file)
@@ -19,6 +19,7 @@
 #pragma link C++ class AliRDHFCutsLctopKpi+;
 #pragma link C++ class AliRDHFCutsLctoV0+;
 #pragma link C++ class AliRDHFCutsD0toKpipipi+;
+#pragma link C++ class AliRDHFCutsDStartoKpipi+;
 #pragma link C++ class AliAnalysisVertexingHF+;
 #pragma link C++ class AliAnalysisTaskSEVertexingHF+;
 #pragma link C++ class AliAnalysisTaskMEVertexingHF+;
index 76947f8c071f772fbd77d2b9667f76705353d176..4d402cc75d033604ac4fbbafa11629e99a448a7e 100644 (file)
@@ -13,6 +13,7 @@ SRCS:=   vertexingHF/AliAODRecoDecayHF.cxx \
        vertexingHF/AliRDHFCutsLctopKpi.cxx \
        vertexingHF/AliRDHFCutsLctoV0.cxx \
        vertexingHF/AliRDHFCutsD0toKpipipi.cxx \
+       vertexingHF/AliRDHFCutsDStartoKpipi.cxx \
        vertexingHF/AliAnalysisVertexingHF.cxx \
        vertexingHF/AliAnalysisTaskSEVertexingHF.cxx \
        vertexingHF/AliAnalysisTaskMEVertexingHF.cxx \
diff --git a/PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.cxx b/PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.cxx
new file mode 100644 (file)
index 0000000..661f9c3
--- /dev/null
@@ -0,0 +1,373 @@
+/**************************************************************************
+ * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/////////////////////////////////////////////////////////////
+//
+// Class for cuts on AOD reconstructed DStar->Kpipi
+//
+// Author: A.Grelli, alessandro.grelli@uu.nl
+/////////////////////////////////////////////////////////////
+
+#include <TDatabasePDG.h>
+#include <Riostream.h>
+
+#include "AliAODRecoDecayHF2Prong.h"
+#include "AliAODRecoCascadeHF.h"
+#include "AliRDHFCutsD0toKpi.h"
+#include "AliRDHFCutsDStartoKpipi.h"
+#include "AliAODTrack.h"
+#include "AliESDtrack.h"
+
+ClassImp(AliRDHFCutsDStartoKpipi)
+
+//--------------------------------------------------------------------------
+AliRDHFCutsDStartoKpipi::AliRDHFCutsDStartoKpipi() : 
+AliRDHFCuts()
+{
+  //
+  // Default Constructor
+  //
+  Int_t nvars=14;
+  SetNVars(nvars);
+  TString varNames[14]={
+    "inv. mass [GeV]",   
+    "dca [cm]",
+    "cosThetaStar", 
+    "pTK [GeV/c]",
+    "pTPi [GeV/c]",
+    "d0K [cm]",
+    "d0Pi [cm]",
+    "d0d0 [cm^2]",
+    "cosThetaPoint",
+    "inv. mass half width of D* [GeV]",
+    "half width of (M_Kpipi-M_D0) [GeV]",
+    "PtMin of pi_s [GeV/c]",
+    "PtMax of pi_s [GeV/c]",
+    "theta, angle between the pi_s and decay plane of the D0 [rad]"};
+  Bool_t isUpperCut[14]={
+    kTRUE,
+    kTRUE,
+    kTRUE,
+    kFALSE,
+    kFALSE,
+    kTRUE,
+    kTRUE,
+    kTRUE,
+    kFALSE,
+    kTRUE,
+    kTRUE,
+    kTRUE,
+    kTRUE,
+    kFALSE};
+  SetVarNames(nvars,varNames,isUpperCut);
+  Bool_t forOpt[14]={
+    kFALSE,
+    kTRUE,
+    kTRUE,
+    kFALSE,
+    kFALSE,
+    kFALSE,
+    kFALSE,
+    kTRUE,
+    kTRUE,
+    kFALSE,
+    kTRUE,
+    kFALSE,
+    kFALSE,
+    kFALSE};
+  SetVarsForOpt(5,forOpt);
+  Float_t limits[2]={0,999999999.};
+  SetPtBins(2,limits);
+}
+//--------------------------------------------------------------------------
+AliRDHFCutsDStartoKpipi::AliRDHFCutsDStartoKpipi(const AliRDHFCutsDStartoKpipi &source) :
+  AliRDHFCuts(source)
+{
+  //
+  // Copy constructor
+  //
+
+}
+//--------------------------------------------------------------------------
+AliRDHFCutsDStartoKpipi &AliRDHFCutsDStartoKpipi::operator=(const AliRDHFCutsDStartoKpipi &source)
+{
+  //
+  // assignment operator
+  //
+  if(&source == this) return *this;
+
+  AliRDHFCuts::operator=(source);
+
+  return *this;
+}
+
+
+//---------------------------------------------------------------------------
+void AliRDHFCutsDStartoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
+  // 
+  // Fills in vars the values of the variables 
+  //
+  if(nvars!=fnVarsForOpt) {
+    printf("AliRDHFCutsDStartoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
+    return;
+  }
+  
+  AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)d;
+
+  AliAODTrack *softPi = (AliAODTrack*)dstarD0pi->GetBachelor();
+
+  AliAODRecoDecayHF2Prong* dd = (AliAODRecoDecayHF2Prong*)dstarD0pi->Get2Prong();
+  
+   Int_t iter=-1;
+  if(fVarsForOpt[0]){
+    iter++;
+    if(TMath::Abs(pdgdaughters[0])==211) {
+      vars[iter]=dd->InvMassD0();
+    } else {
+      vars[iter]=dd->InvMassD0bar();
+    }
+  }
+  if(fVarsForOpt[1]){
+    iter++;
+    vars[iter]=dd->GetDCA();
+  }
+  if(fVarsForOpt[2]){
+    iter++;
+    if(TMath::Abs(pdgdaughters[0])==211) {
+      vars[iter] = dd->CosThetaStarD0();
+    } else {
+      vars[iter] = dd->CosThetaStarD0bar();
+    }
+  }
+  if(fVarsForOpt[3]){
+    iter++;
+   if(TMath::Abs(pdgdaughters[0])==321) {
+     vars[iter]=dd->PtProng(0);
+   }
+   else{
+     vars[iter]=dd->PtProng(1);
+   }
+  }
+  if(fVarsForOpt[4]){
+    iter++;
+   if(TMath::Abs(pdgdaughters[0])==211) {
+     vars[iter]=dd->PtProng(0);
+   }
+   else{
+     vars[iter]=dd->PtProng(1);
+   }
+  }
+  if(fVarsForOpt[5]){
+    iter++;
+    if(TMath::Abs(pdgdaughters[0])==321) {
+     vars[iter]=dd->Getd0Prong(0);
+   }
+   else{
+     vars[iter]=dd->Getd0Prong(1);
+   }
+  }
+  if(fVarsForOpt[6]){
+    iter++;
+     if(TMath::Abs(pdgdaughters[0])==211) {
+     vars[iter]=dd->Getd0Prong(0);
+   }
+   else{
+     vars[iter]=dd->Getd0Prong(1);
+   }
+  }
+  if(fVarsForOpt[7]){
+    iter++;
+    vars[iter]= dd->Prodd0d0();
+  }
+  if(fVarsForOpt[8]){
+    iter++;
+    vars[iter]=dd->CosPointingAngle();
+  }
+  if(fVarsForOpt[9]){
+    iter++;
+    vars[iter]=dstarD0pi->InvMassDstarKpipi();
+  }
+  if(fVarsForOpt[10]){
+    iter++;
+    vars[iter]=dstarD0pi->DeltaInvMass();
+  }
+  if(fVarsForOpt[11]){
+    iter++;
+    vars[iter] = softPi->Pt();
+  }
+  if(fVarsForOpt[12]){
+    iter++;
+    vars[iter] = softPi->Pt();
+  }
+  if(fVarsForOpt[13]){
+    iter++;
+    vars[iter] =dstarD0pi->AngleD0dkpPisoft();
+  }
+  return;
+}
+//---------------------------------------------------------------------------
+Int_t AliRDHFCutsDStartoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
+  //
+  // Apply selection for D*.
+  //
+  if(!fCutsRD){
+    cout<<"Cut matrice not inizialized. Exit..."<<endl;
+    return 0;
+  }
+  
+  AliAODRecoCascadeHF* d = (AliAODRecoCascadeHF*)obj;
+  if(!d){
+    cout<<"AliAODRecoCascadeHF null"<<endl;
+    return 0;
+  }
+  
+  AliAODRecoDecayHF2Prong* dd = (AliAODRecoDecayHF2Prong*)d->Get2Prong();  
+  if(!dd){
+    cout<<"AliAODRecoDecayHF2Prong null"<<endl;
+    return 0;
+  }
+
+  AliAODTrack *b = (AliAODTrack*)d->GetBachelor();
+
+  // selection on daughter tracks 
+  if(selectionLevel==AliRDHFCuts::kAll || 
+     selectionLevel==AliRDHFCuts::kTracks) {
+    if(!AreDaughtersSelected(d)) return 0;
+  }
+  
+  Int_t returnvalue=1;
+  
+  // selection on candidate
+  if(selectionLevel==AliRDHFCuts::kAll || 
+     selectionLevel==AliRDHFCuts::kCandidate) {
+    
+    Double_t pt=d->Pt();
+    Int_t ptbin=PtBin(pt);
+
+    // select D0 that passes D* cuts
+    returnvalue = IsD0FromDStarSelected(pt,dd,selectionLevel);
+
+    // DStarMass and D0mass
+    Double_t mDSPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
+    Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
+    // delta mass PDG
+    Double_t deltaPDG = mDSPDG-mD0PDG;
+    
+    Double_t mD0,mD0bar;
+  
+    Int_t okDStarP =0;
+    Int_t okDStarM =0;
+   
+    okDStarP=1; okDStarM=1; 
+
+    dd->InvMassD0(mD0,mD0bar);
+    // Half width DStar mass
+    if(TMath::Abs((d->InvMassDstarKpipi()-mDSPDG))>fCutsRD[GetGlobalIndex(9,ptbin)]) return 0;
+    // Half width Delta mass
+    
+    if(TMath::Abs((d->InvMassDstarKpipi()-mD0)-deltaPDG) > fCutsRD[GetGlobalIndex(10,ptbin)]) okDStarP =0;
+    if(TMath::Abs((d->InvMassDstarKpipi()-mD0bar)-deltaPDG) > fCutsRD[GetGlobalIndex(10,ptbin)]) okDStarM =0;
+    if(!okDStarP && !okDStarM) return 0;
+    
+    // cut on soft pion pt
+    if(b->Pt() < fCutsRD[GetGlobalIndex(11,ptbin)] || b->Pt() > fCutsRD[GetGlobalIndex(12,ptbin)]) return 0;
+    // cut on the angle between D0 decay plane and soft pion
+    if(d->AngleD0dkpPisoft() > fCutsRD[GetGlobalIndex(13,ptbin)]) return 0;
+  
+  }
+
+  return returnvalue;
+}
+//_________________________________________________________________________________________________
+Int_t AliRDHFCutsDStartoKpipi::IsD0FromDStarSelected(Double_t pt, TObject* obj,Int_t selectionLevel) {
+  //
+  // Apply selection for D0 from D*. The selection in on D0 prongs
+  //
+  
+  if(!fCutsRD){
+    cout<<"Cut matrice not inizialized. Exit..."<<endl;
+    return 0;
+  }
+  
+  AliAODRecoDecayHF2Prong* dd = (AliAODRecoDecayHF2Prong*)obj;
+  
+  if(!dd){
+    cout<<"AliAODRecoDecayHF2Prong null"<<endl;
+    return 0;
+  }
+
+  // selection on daughter tracks 
+  if(selectionLevel==AliRDHFCuts::kAll || 
+     selectionLevel==AliRDHFCuts::kTracks) {
+    if(!AreDaughtersSelected(dd)) return 0;
+  }
+  
+  Int_t returnvalue=1;
+  
+  // selection on candidate
+  if(selectionLevel==AliRDHFCuts::kAll || 
+     selectionLevel==AliRDHFCuts::kCandidate) {
+    
+    // D0 mass
+    Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
+    // delta mass PDG
+    Int_t ptbin=PtBin(pt);
+    
+    Double_t mD0,mD0bar,ctsD0,ctsD0bar;
+  
+    Int_t okD0     =0;
+    Int_t okD0bar  =0;
+    okD0=1; okD0bar=1;
+
+    if(dd->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || dd->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
+    if(dd->PtProng(0) < fCutsRD[GetGlobalIndex(3,ptbin)] || dd->PtProng(1) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0bar = 0;
+    
+    if(!okD0 && !okD0bar) return 0;
+    
+    if(TMath::Abs(dd->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] || 
+       TMath::Abs(dd->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
+    if(TMath::Abs(dd->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)] ||
+       TMath::Abs(dd->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)]) okD0bar = 0;
+    if(!okD0 && !okD0bar) return 0;
+    
+    if(dd->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0;
+    
+    dd->InvMassD0(mD0,mD0bar);
+    if(TMath::Abs(mD0-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
+    if(TMath::Abs(mD0bar-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0bar = 0;
+    if(!okD0 && !okD0bar) return 0;
+    
+    dd->CosThetaStarD0(ctsD0,ctsD0bar);
+    if(TMath::Abs(ctsD0) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
+    if(TMath::Abs(ctsD0bar) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0bar = 0;
+    if(!okD0 && !okD0bar) return 0;
+    
+    if(dd->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
+    
+    if(dd->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
+
+    if (okD0) returnvalue=1; //cuts passed as D0
+    if (okD0bar) returnvalue=2; //cuts passed as D0bar
+    if (okD0 && okD0bar) returnvalue=3; //both
+  }
+
+  return returnvalue;
+}
+
+
diff --git a/PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.h b/PWG3/vertexingHF/AliRDHFCutsDStartoKpipi.h
new file mode 100644 (file)
index 0000000..5b3a588
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef ALIRDHFCUTSDSTARTOKPIPI_H
+#define ALIRDHFCUTSDSTARTOKPIPI_H
+/* Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//***********************************************************
+// Class AliRDHFCutsDStartoKpipi
+// class for cuts on AOD reconstructed DStar->Kpipi
+// Author: A.Grelli, alessandro.grelli@uu.nl
+//***********************************************************
+
+#include "AliRDHFCuts.h"
+
+class AliRDHFCutsDStartoKpipi : public AliRDHFCuts 
+{
+ public:
+
+  AliRDHFCutsDStartoKpipi();
+  
+  virtual ~AliRDHFCutsDStartoKpipi(){}
+
+  AliRDHFCutsDStartoKpipi(const AliRDHFCutsDStartoKpipi& source);
+  AliRDHFCutsDStartoKpipi& operator=(const AliRDHFCutsDStartoKpipi& source); 
+  virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgD0daughters);
+
+  using AliRDHFCuts::IsSelected;
+  virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel);
+  virtual Int_t IsD0FromDStarSelected(Double_t pt, TObject* obj,Int_t selectionLevel); 
+  
+  Float_t GetMassCut(Int_t iPtBin=0) const { return (GetCuts() ? fCutsRD[GetGlobalIndex(0,iPtBin)] : 1.e6);}
+  Float_t GetDCACut(Int_t iPtBin=0) const { return (GetCuts() ? fCutsRD[GetGlobalIndex(1,iPtBin)] : 1.e6);}
+
+ protected:
+
+
+  ClassDef(AliRDHFCutsDStartoKpipi,1);  // class for cuts on AOD reconstructed D0->Kpipi
+};
+
+#endif