]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added new class for D0 daughter cuts (Massimo)
authorfbellini <fbellini@cern.ch>
Wed, 19 Feb 2014 22:22:44 +0000 (23:22 +0100)
committerfbellini <fbellini@cern.ch>
Wed, 19 Feb 2014 22:25:22 +0000 (23:25 +0100)
PWGLF/CMakelibPWGLFresonances.pkg
PWGLF/PWGLFresonancesLinkDef.h
PWGLF/RESONANCES/AliRsnCutDaughterD0.cxx [new file with mode: 0644]
PWGLF/RESONANCES/AliRsnCutDaughterD0.h [new file with mode: 0644]

index c58f5682199d42cfd6a644b36d71033c17b76ce8..88d81f44f6dddad6077199744e4a1ea123b9d73b 100644 (file)
@@ -61,6 +61,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
           RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx 
           RESONANCES/AliRsnCutSetDaughterParticle.cxx 
           RESONANCES/AliRsnCutPhiRAA.cxx
+          RESONANCES/AliRsnCutDaughterD0.cxx
            RESONANCES/AliRsnCutV0.cxx 
            RESONANCES/AliRsnCutSet.cxx
            RESONANCES/AliRsnExpression.cxx
index 76c11ea80a70b60a2ec53dc0964feecc453a522e..9574942e532f7fb9fb2bb2250e39145137eb214e 100644 (file)
@@ -41,6 +41,7 @@
 #pragma link C++ class AliRsnCutDaughterSigmaStar2010PP+;
 #pragma link C++ class AliRsnCutSetDaughterParticle+;
 #pragma link C++ class AliRsnCutPhiRAA+;
+#pragma link C++ class AliRsnCutDaughterD0+;
 
 #pragma link C++ class AliRsnCutSet+;
 #pragma link C++ class AliRsnExpression+;
diff --git a/PWGLF/RESONANCES/AliRsnCutDaughterD0.cxx b/PWGLF/RESONANCES/AliRsnCutDaughterD0.cxx
new file mode 100644 (file)
index 0000000..150386f
--- /dev/null
@@ -0,0 +1,111 @@
+//
+// All cuts for single track in D0 analysis,
+// based on track quality and particle identification
+// with TPC and TOF.
+// Author: Massimo Venaruzzo
+//
+//
+
+#include <Riostream.h>
+
+#include "AliPID.h"
+#include "AliPIDResponse.h"
+#include "AliRsnCutDaughterD0.h"
+
+ClassImp(AliRsnCutDaughterD0)
+
+//__________________________________________________________________________________________________
+AliRsnCutDaughterD0::AliRsnCutDaughterD0(const char *name, AliPID::EParticleType pid) :
+AliRsnCut(name, AliRsnTarget::kDaughter),
+  fNoPID(kFALSE),
+  fPID(pid),
+  fCutQuality(Form("%sQuality", name)),
+  fPionTPCPIDCut(3.0),
+  fKaonTPCPIDCut(3.0),
+  fPionTOFPIDCut(3.0),
+  fKaonTOFPIDCut(3.0)
+{
+  //
+  // Constructor
+  // Initialize track quality cuts to 2010 defaults
+  //
+
+  fCutQuality.SetPtRange(0.15, 1E+20);
+  fCutQuality.SetEtaRange(-0.8, 0.8);
+  fCutQuality.SetDCARPtFormula("0.0105+0.0350/pt^1.1");
+  fCutQuality.SetDCARmin(0.0);
+  fCutQuality.SetDCAZmax(2.0);
+  fCutQuality.SetSPDminNClusters(1);
+  fCutQuality.SetITSminNClusters(0);
+  fCutQuality.SetITSmaxChi2(1E+20);
+  fCutQuality.SetTPCminNClusters(70);
+  fCutQuality.SetTPCmaxChi2(4.0);
+  fCutQuality.SetRejectKinkDaughters();
+  fCutQuality.SetAODTestFilterBit(5);
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnCutDaughterD0::IsSelected(TObject *obj)
+{
+  //
+  // Global check
+  //
+
+  // coherence check
+  if (!TargetOK(obj)) return kFALSE;
+
+  // check track
+  AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef());
+  if (!track) return kFALSE;
+   
+  AliDebugClass(2, "Checking status...");
+  // check flags
+  if ((track->GetStatus() & AliESDtrack::kTPCin   ) == 0) return kFALSE;
+  if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
+  if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
+  AliDebugClass(2, "...passed");
+  
+  // quality
+  AliDebugClass(2, "Checking quality cuts...");
+  if (!fCutQuality.IsSelected(obj)) return kFALSE;
+  AliDebugClass(2, "...passed");
+
+  // if no PID is required, accept
+  if (fNoPID) return kTRUE;
+  
+  // check initialization of PID object
+  AliPIDResponse *pid = fEvent->GetPIDResponse();
+  if (!pid) {
+    AliFatal("NULL PID response");
+    return kFALSE;
+  }
+  
+  AliDebugClass(2, "Checking TOF Matching..."); 
+  // check if TOF is matched
+  // and computes all values used in the PID cut
+  Bool_t   isTOF  = MatchTOF(track);   
+  AliDebugClass(2, "...passed");
+   
+  // Double_t pTPC   = track->GetTPCmomentum();
+  // Double_t p      = track->P();
+  Double_t nsTPC  = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
+  Double_t nsTOF  = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20;
+  Double_t maxTPC = 1E20;
+  Double_t maxTOF = 1E20;
+  AliDebugClass(2, "Checking PID...");
+
+  // applies the cut differently depending on the PID and the momentum
+  if (isTOF) {
+    if (fPID == AliPID::kPion) {maxTPC = fPionTPCPIDCut; maxTOF = fPionTOFPIDCut;}
+    if (fPID == AliPID::kKaon) {maxTPC = fKaonTPCPIDCut; maxTOF = fKaonTOFPIDCut;}
+    return (nsTPC <= maxTPC && nsTOF <= maxTOF);
+  } else {
+    if (fPID == AliPID::kPion) maxTPC = fPionTPCPIDCut;
+    if (fPID == AliPID::kKaon) maxTPC = fKaonTPCPIDCut;
+    return (nsTPC <= maxTPC); 
+  }     
+  
+  AliDebugClass(2, "...passed"); 
+  // if we reach this point, all checks were successful
+  AliDebugClass(2, "Good Pion/Kaon Candidate Found!!");
+}
diff --git a/PWGLF/RESONANCES/AliRsnCutDaughterD0.h b/PWGLF/RESONANCES/AliRsnCutDaughterD0.h
new file mode 100644 (file)
index 0000000..9b3db10
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef ALIRSNCUTDAUGHTERD0_H
+#define ALIRSNCUTDAUGHTERD0_H
+
+//
+// Cuts for selecting good pion candidates for D0 analysis
+// with the data samples from pp/PbPb/pPb runs in 2010/2011/2012/2013.
+// Applies track quality selection plus PID selection,
+// with different tolerance ranges depending on the momentum.
+//
+
+#include "AliVTrack.h"
+#include "AliRsnCut.h"
+#include "AliRsnCutTrackQuality.h"
+
+class AliRsnCutDaughterD0 : public AliRsnCut {
+
+ public:
+
+  AliRsnCutDaughterD0(const char *name = "", AliPID::EParticleType pid = AliPID::kPion);
+  AliRsnCutDaughterD0(const AliRsnCutDaughterD0 &copy);
+  AliRsnCutDaughterD0 &operator=(const AliRsnCutDaughterD0 &copy);
+  virtual ~AliRsnCutDaughterD0() { }
+
+  void           SetNoPID(Bool_t yn = kTRUE)                  {fNoPID = yn;}
+
+  void           SetPID(AliPID::EParticleType type)           {fPID = type;}
+   
+  void           SetTPCPionPIDCut(Double_t value)             {fPionTPCPIDCut = value;}
+  void           SetTPCKaonPIDCut(Double_t value)             {fKaonTPCPIDCut = value;}
+   
+  void           SetTOFPionPIDCut(Double_t value)             {fPionTOFPIDCut = value;}
+  void           SetTOFKaonPIDCut(Double_t value)             {fKaonTOFPIDCut = value;}
+   
+  AliRsnCutTrackQuality *CutQuality()                       {return &fCutQuality;}
+  Bool_t                 MatchTOF(const AliVTrack *vtrack);
+  virtual Bool_t         IsSelected(TObject *obj);
+   
+ private:
+  Bool_t                fNoPID;            // flag to switch off PID check
+  AliPID::EParticleType fPID;              // PID for track
+  AliRsnCutTrackQuality fCutQuality;       // track quality cut 
+
+ protected:
+  Double_t         fPionTPCPIDCut;                // TPC nsigmas for pions
+  Double_t         fKaonTPCPIDCut;                // TPC nsigmas for kaons
+  Double_t         fPionTOFPIDCut;                // TOF nsigmas for pions
+  Double_t         fKaonTOFPIDCut;                // TOF nsigmas for kaons
+
+  ClassDef(AliRsnCutDaughterD0,1)          // cut definitions for D0
+    };
+
+//__________________________________________________________________________________________________
+inline Bool_t AliRsnCutDaughterD0::MatchTOF(const AliVTrack *vtrack)
+{
+  //
+  // Checks if the track has matched the TOF detector
+  //
+
+  if (!vtrack) {
+    AliWarning("NULL argument: impossible to check status");
+    return kFALSE;
+  }
+
+  if (!(vtrack->GetStatus() & AliESDtrack::kTOFout)) return kFALSE;
+  if (!(vtrack->GetStatus() & AliESDtrack::kTIME  )) return kFALSE;
+
+  return kTRUE;
+}
+
+#endif