Possibility to apply a cut on kaon PID in the 3 prong filtering
authorfprino <fprino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Nov 2012 09:19:18 +0000 (09:19 +0000)
committerfprino <fprino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Nov 2012 09:19:18 +0000 (09:19 +0000)
PWGHF/vertexingHF/AliAnalysisTaskSEVertexingHF.cxx
PWGHF/vertexingHF/AliAnalysisVertexingHF.cxx
PWGHF/vertexingHF/AliAnalysisVertexingHF.h
PWGHF/vertexingHF/AliRDHFCuts.cxx
PWGHF/vertexingHF/AliRDHFCuts.h

index 774a6b6..90b4066 100644 (file)
@@ -41,6 +41,8 @@
 #include "AliESDUtils.h"
 #include "AliAODHFUtil.h"
 
+#include "AliInputEventHandler.h"
+#include "AliPIDResponse.h"
 
 ClassImp(AliAnalysisTaskSEVertexingHF)
 
@@ -227,6 +229,11 @@ void AliAnalysisTaskSEVertexingHF::UserExec(Option_t */*option*/)
      if (aodhandler) aodhandler->SetFillExtension(kTRUE);
   }   
 
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
+  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
+  fVHF->SetPidResponse(pidResp);
+
   // heavy flavor vertexing
   fVHF->FindCandidates(event,
                       fVerticesHFTClArr,
index 70e3860..0bbd94c 100644 (file)
@@ -44,6 +44,7 @@
 #include "AliESDtrack.h"
 #include "AliESDtrackCuts.h"
 #include "AliAODEvent.h"
+#include "AliPIDResponse.h"
 #include "AliAODRecoDecay.h"
 #include "AliAODRecoDecayHF.h"
 #include "AliAODRecoDecayHF2Prong.h"
@@ -88,6 +89,10 @@ fCascades(kTRUE),
 fLikeSign(kFALSE),
 fLikeSign3prong(kFALSE),
 fMixEvent(kFALSE),
+fPidResponse(0x0),
+fUseKaonPIDfor3Prong(kFALSE),
+fnSigmaTOFKaonLow(5.),
+fnSigmaTOFKaonHi(5.),
 fMaxCentPercentileForTightCuts(-9999),
 fTrackFilter(0x0),
 fTrackFilter2prongCentral(0x0),
@@ -156,6 +161,10 @@ fCascades(source.fCascades),
 fLikeSign(source.fLikeSign),
 fLikeSign3prong(source.fLikeSign3prong),
 fMixEvent(source.fMixEvent),
+fPidResponse(source.fPidResponse),
+fUseKaonPIDfor3Prong(source.fUseKaonPIDfor3Prong),
+fnSigmaTOFKaonLow(source.fnSigmaTOFKaonLow),
+fnSigmaTOFKaonHi(source.fnSigmaTOFKaonHi),
 fMaxCentPercentileForTightCuts(source.fMaxCentPercentileForTightCuts),
 fTrackFilter(source.fTrackFilter),
 fTrackFilter2prongCentral(source.fTrackFilter2prongCentral),
@@ -221,6 +230,10 @@ AliAnalysisVertexingHF &AliAnalysisVertexingHF::operator=(const AliAnalysisVerte
   fLikeSign = source.fLikeSign;
   fLikeSign3prong = source.fLikeSign3prong;
   fMixEvent = source.fMixEvent;
+  fPidResponse = source.fPidResponse;
+  fUseKaonPIDfor3Prong = source.fUseKaonPIDfor3Prong;
+  fnSigmaTOFKaonLow = source.fnSigmaTOFKaonLow;
+  fnSigmaTOFKaonHi = source.fnSigmaTOFKaonHi;
   fMaxCentPercentileForTightCuts = source.fMaxCentPercentileForTightCuts;
   fTrackFilter = source.fTrackFilter;
   fTrackFilter2prongCentral = source.fTrackFilter2prongCentral;
@@ -489,8 +502,15 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
     return;
   }
 
-  // event selection
+  // event selection + PID configuration
   if(!fCutsD0toKpi->IsEventSelected(event)) return;
+  if(fCutsJpsitoee) fCutsJpsitoee->SetupPID(event);
+  if(fCutsDplustoKpipi) fCutsDplustoKpipi->SetupPID(event);
+  if(fCutsDstoKKpi) fCutsDstoKKpi->SetupPID(event);
+  if(fCutsLctopKpi) fCutsLctopKpi->SetupPID(event);
+  if(fCutsLctoV0) fCutsLctoV0->SetupPID(event);
+  if(fCutsD0toKpipipi) fCutsD0toKpipipi->SetupPID(event);
+  if(fCutsDStartoKpipi) fCutsDStartoKpipi->SetupPID(event);
 
   // call function that applies sigle-track selection,
   // for displaced tracks and soft pions (both charges) for D*,
@@ -927,6 +947,10 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
          }
        }
 
+       if(fUseKaonPIDfor3Prong){
+         Double_t nsigmatofK= fPidResponse->NumberOfSigmasTOF(negtrack1,AliPID::kKaon);
+         if(nsigmatofK>-990. && (nsigmatofK<-fnSigmaTOFKaonLow || nsigmatofK>fnSigmaTOFKaonHi)) continue;
+       }
        // back to primary vertex
        //      postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig);
        //      postrack2->PropagateToDCA(fV1,fBzkG,kVeryBig);
@@ -1153,6 +1177,11 @@ void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event,
          isLikeSign3Prong=kFALSE;
        }
 
+       if(fUseKaonPIDfor3Prong){
+         Double_t nsigmatofK= fPidResponse->NumberOfSigmasTOF(postrack1,AliPID::kKaon);
+         if(nsigmatofK>-990. && (nsigmatofK<-fnSigmaTOFKaonLow || nsigmatofK>fnSigmaTOFKaonHi)) continue;
+       }
+
        // back to primary vertex
        // postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig);
        // negtrack1->PropagateToDCA(fV1,fBzkG,kVeryBig);
index 357fc14..57c049c 100644 (file)
@@ -19,6 +19,7 @@
 #include "AliAnalysisFilter.h"
 #include "AliESDtrackCuts.h"
 
+class AliPIDResponse;
 class AliESDVertex;
 class AliAODRecoDecay;
 class AliAODRecoDecayHF;
@@ -157,6 +158,10 @@ class AliAnalysisVertexingHF : public TNamed {
   void SetMassCutBeforeVertexing(Bool_t flag) { fMassCutBeforeVertexing=flag; } 
 
   void SetMasses();
+  void SetUseKaonPIDfor3Prong(Bool_t opt=kTRUE){fUseKaonPIDfor3Prong=opt;}
+  void SetnSigmaTOFforKaonSel(Double_t nsl, Double_t nsh){
+    fnSigmaTOFKaonLow=nsl; fnSigmaTOFKaonHi=nsh;}
+  void SetPidResponse(AliPIDResponse* p){fPidResponse=p;}
 
   //
  private:
@@ -190,6 +195,11 @@ class AliAnalysisVertexingHF : public TNamed {
   Bool_t fLikeSign3prong;  // Like-sign triplets
   Bool_t fMixEvent; // event mixing
 
+  AliPIDResponse* fPidResponse; // PID response
+  Bool_t fUseKaonPIDfor3Prong;  // Kaon PID usage flag
+  Double_t fnSigmaTOFKaonLow;   //Low cut value on number of sigmas for TOF PID
+  Double_t fnSigmaTOFKaonHi;    //High cut value on number of sigmas for TOF PID
+
   Float_t fMaxCentPercentileForTightCuts; //max. centrality percentile for using tight cuts
 
   // single-track cuts
@@ -297,7 +307,7 @@ class AliAnalysisVertexingHF : public TNamed {
                                  TObjArray *twoTrackArrayV0);
 
   //
-  ClassDef(AliAnalysisVertexingHF,20);  // Reconstruction of HF decay candidates
+  ClassDef(AliAnalysisVertexingHF,21);  // Reconstruction of HF decay candidates
 };
 
 
index c4c7ab7..734f35a 100644 (file)
@@ -370,32 +370,10 @@ Bool_t AliRDHFCuts::IsEventSelectedForCentrFlattening(Float_t centvalue){
 
 }
 //---------------------------------------------------------------------------
-Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
-  //
-  // Event selection
-  // 
-  //if(fTriggerMask && event->GetTriggerMask()!=fTriggerMask) return kFALSE;
-
-
+void AliRDHFCuts::SetupPID(AliVEvent *event) {
+  // Set the PID response object in the AliAODPidHF
+  // in case of old PID sets the TPC dE/dx BB parameterization
 
-  fWhyRejection=0;
-  fEvRejectionBits=0;
-  Bool_t accept=kTRUE;
-
-  if(fRecomputePrimVertex){
-    Bool_t vertOK= RecomputePrimaryVertex((AliAODEvent*)event);
-    if(!vertOK){
-      fWhyRejection=6;
-      return kFALSE;
-    }
-  }
-
-  // check if it's MC
-  Bool_t isMC=kFALSE;
-  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
-  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
-
-  // settings for the TPC dE/dx BB parameterization
   if(fPidHF){
     if(fPidHF->GetPidResponse()==0x0){
       AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -403,8 +381,13 @@ Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
       AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
       fPidHF->SetPidResponse(pidResp);
     }
-      if(fPidHF->GetUseCombined()) fPidHF->SetUpCombinedPID();
+    if(fPidHF->GetUseCombined()) fPidHF->SetUpCombinedPID();
     if(fPidHF->GetOldPid()) {
+
+      Bool_t isMC=kFALSE;
+      TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
+      if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
+
       // pp, from LHC10d onwards
       if((event->GetRunNumber()>121693 && event->GetRunNumber()<136851) ||
         event->GetRunNumber()>139517) fPidHF->SetOnePad(kTRUE);
@@ -425,7 +408,35 @@ Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
       if(fPidHF->GetPidResponse()==0x0) AliFatal("AliPIDResponse object not set");
     }
   }
+}
+//---------------------------------------------------------------------------
+Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
+  //
+  // Event selection
+  // 
+  //if(fTriggerMask && event->GetTriggerMask()!=fTriggerMask) return kFALSE;
+
+
+
+  fWhyRejection=0;
+  fEvRejectionBits=0;
+  Bool_t accept=kTRUE;
+
+  if(fRecomputePrimVertex){
+    Bool_t vertOK= RecomputePrimaryVertex((AliAODEvent*)event);
+    if(!vertOK){
+      fWhyRejection=6;
+      return kFALSE;
+    }
+  }
+
+  // check if it's MC
+  Bool_t isMC=kFALSE;
+  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
+  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
+
 
+  SetupPID(event);
 
   // trigger class
   TString firedTriggerClasses=((AliAODEvent*)event)->GetFiredTriggerClasses();
index 2c61d56..ebd1ec1 100644 (file)
@@ -191,6 +191,7 @@ class AliRDHFCuts : public AliAnalysisCuts
   Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd) const;
   Bool_t IsDaughterSelected(AliAODTrack *track,const AliESDVertex *primary,AliESDtrackCuts *cuts) const;
   virtual Int_t IsSelectedPID(AliAODRecoDecayHF * /*rd*/) {return 1;}
+  void SetupPID(AliVEvent *event);
 
   virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel) = 0;
   virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent* /*aod*/)