Added Roberto's implementation of Kaon/Pion cuts for K* analysis
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Jun 2011 13:11:56 +0000 (13:11 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Jun 2011 13:11:56 +0000 (13:11 +0000)
Corrected a serious bug in AliRsnEvent::SetRefMC()

PWG2/CMakelibPWG2resonances.pkg
PWG2/PWG2resonancesLinkDef.h
PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnEvent.h

index bd4f12f..6d2553e 100644 (file)
@@ -50,6 +50,7 @@ set ( SRCS RESONANCES/AliRsnDaughter.cxx
            RESONANCES/AliRsnCutKaonForPhi2010PP.cxx
            RESONANCES/AliRsnCutPion2010PP.cxx
            RESONANCES/AliRsnCutProton2010PP.cxx
+           RESONANCES/AliRsnCutDaughterKStar2010PP.cxx 
            RESONANCES/AliRsnCutSet.cxx
            RESONANCES/AliRsnExpression.cxx
            RESONANCES/AliRsnVariableExpression.cxx
index c4bf801..0ccfa80 100644 (file)
@@ -29,6 +29,7 @@
 #pragma link C++ class AliRsnCutKaonForPhi2010PP+;
 #pragma link C++ class AliRsnCutPion2010PP+;
 #pragma link C++ class AliRsnCutProton2010PP+;
+#pragma link C++ class AliRsnCutDaughterKStar2010PP+;
 
 
 #pragma link C++ class AliRsnCutSet+;
diff --git a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx
new file mode 100644 (file)
index 0000000..d21471d
--- /dev/null
@@ -0,0 +1,109 @@
+//
+// All cuts for single pions in phi analysis 2010,
+// based on track quality and particle identification
+// with TPC and TOF.
+// Author: Serguey Kiselev.
+//
+//
+
+#include <Riostream.h>
+
+#include "AliPID.h"
+#include "AliPIDResponse.h"
+#include "AliRsnCutDaughterKStar2010PP.h"
+
+ClassImp(AliRsnCutDaughterKStar2010PP)
+
+//__________________________________________________________________________________________________
+AliRsnCutDaughterKStar2010PP::AliRsnCutDaughterKStar2010PP(const char *name, AliPID::EParticleType pid) :
+   AliRsnCut(name, AliRsnTarget::kDaughter),
+   fPID(pid),
+   fCutQuality(Form("%sQuality", name))
+{
+//
+// Constructor
+// Initialize track quality cuts to 2010 defaults
+//
+
+   fCutQuality.SetPtRange(0.15, 1E+20);
+   fCutQuality.SetEtaRange(-0.8, 0.8);
+   fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
+   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 AliRsnCutDaughterKStar2010PP::IsSelected(TObject *obj)
+{
+//
+// Global check
+//
+
+   // coherence check
+   if (!TargetOK(obj)) return kFALSE;
+   
+   // check track
+   AliVTrack *track = fDaughter->Ref2Vtrack();
+   if (!track) {
+      if (!fDaughter->GetRef()) AliWarning("NULL ref");
+      return kFALSE;
+   }
+   
+   // 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;
+   
+   // quality
+   if (!fCutQuality.IsSelected(obj)) return kFALSE;
+   
+   // check initialization of PID object
+   AliPIDResponse *pid = fEvent->GetPIDResponse();
+   if (!pid) {
+      AliFatal("NULL PID response");
+      return kFALSE;
+   }
+   
+   // check if TOF is matched
+   // and computes all values used in the PID cut
+   Bool_t   isTOF  = MatchTOF(track);
+   Double_t pTPC   = track->GetTPCmomentum();
+   Double_t p      = track->P();
+   Double_t nsTPC  = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
+   Double_t nsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(track, fPID));
+   Double_t maxTPC = 1E20;
+   Double_t maxTOF = 1E20;
+   
+   // applies the cut differently depending on the PID and the momentum
+   if (isTOF) {
+      // TPC: 5sigma cut for all
+      if (nsTPC > 5.0) return kFALSE;
+      // TOF: 3sigma below 1.5 GeV, 2sigma above
+      if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
+      return (nsTOF <= maxTOF);
+   } else {
+      // TPC: 
+      // below 350 MeV: 5sigma
+      // between 350 and 500 MeV: 3sigma
+      // pions above 500 MeV: 2sigma
+      // kaons between 500 and 700 MeV: 2sigma
+      // kaons above 700 MeV: rejected
+      if (pTPC <= 0.35) 
+         maxTPC = 5.0;
+      else if (pTPC <= 0.5)
+         maxTPC = 3.0;
+      else if (pTPC > 0.5 && fPID == AliPID::kPion)
+         maxTPC = 2.0;
+      else if (pTPC > 0.5 && pTPC <= 0.7 && fPID == AliPID::kKaon)
+         maxTPC = 2.0;
+      else
+         return kFALSE;
+      return (nsTPC <= maxTPC);
+   }
+}
diff --git a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h
new file mode 100644 (file)
index 0000000..321dcc6
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIRSNCUTDAUGHTERKSTAR2010PP_H
+#define ALIRSNCUTDAUGHTERKSTAR2010PP_H
+
+//
+// Cuts for selecting good pion candidates for K* analysis
+// with the data samples from pp runs in 2010.
+// 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 AliRsnCutDaughterKStar2010PP : public AliRsnCut {
+
+public:
+
+   AliRsnCutDaughterKStar2010PP(const char *name = "", AliPID::EParticleType pid = AliPID::kPion);
+   virtual ~AliRsnCutDaughterKStar2010PP() { }
+   
+   void                   SetPID(AliPID::EParticleType type) {fPID = type;}
+   AliRsnCutTrackQuality *CutQuality()                       {return &fCutQuality;}
+   Bool_t                 MatchTOF(const AliVTrack *vtrack);
+   virtual Bool_t         IsSelected(TObject *obj);
+
+private:
+
+   AliPID::EParticleType fPID;              // PID for track
+   AliRsnCutTrackQuality fCutQuality;       // track quality cut
+
+   ClassDef(AliRsnCutDaughterKStar2010PP,1) // cut definitions for K*
+
+};
+
+//__________________________________________________________________________________________________
+inline Bool_t AliRsnCutDaughterKStar2010PP::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
index 5daa2bd..23750c9 100644 (file)
@@ -117,6 +117,7 @@ inline void AliRsnEvent::SetRefMC(AliVEvent *mc)
    if (!mc) {
       fRefMC = 0x0;
       fAODList = 0x0;
+      return;
    }
 
    fRefMC = mc;