From: pulvir Date: Wed, 15 Jun 2011 13:11:56 +0000 (+0000) Subject: Added Roberto's implementation of Kaon/Pion cuts for K* analysis X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=de957967ebc708c586f9c169316259b67b8b4e2e;hp=9fd4cc3ed2aeb9600e48a569664bcdbb9c1f7151 Added Roberto's implementation of Kaon/Pion cuts for K* analysis Corrected a serious bug in AliRsnEvent::SetRefMC() --- diff --git a/PWG2/CMakelibPWG2resonances.pkg b/PWG2/CMakelibPWG2resonances.pkg index bd4f12f7778..6d2553e0057 100644 --- a/PWG2/CMakelibPWG2resonances.pkg +++ b/PWG2/CMakelibPWG2resonances.pkg @@ -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 diff --git a/PWG2/PWG2resonancesLinkDef.h b/PWG2/PWG2resonancesLinkDef.h index c4bf8014421..0ccfa80d94b 100644 --- a/PWG2/PWG2resonancesLinkDef.h +++ b/PWG2/PWG2resonancesLinkDef.h @@ -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 index 00000000000..d21471d34e5 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx @@ -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 + +#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 index 00000000000..321dcc61b05 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h @@ -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 diff --git a/PWG2/RESONANCES/AliRsnEvent.h b/PWG2/RESONANCES/AliRsnEvent.h index 5daa2bd2a8d..23750c91f4e 100644 --- a/PWG2/RESONANCES/AliRsnEvent.h +++ b/PWG2/RESONANCES/AliRsnEvent.h @@ -117,6 +117,7 @@ inline void AliRsnEvent::SetRefMC(AliVEvent *mc) if (!mc) { fRefMC = 0x0; fAODList = 0x0; + return; } fRefMC = mc;