Possibility to select the Lc resonant channel in the MC analysis (Rossella)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2012 10:21:08 +0000 (10:21 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Jun 2012 10:21:08 +0000 (10:21 +0000)
PWGHF/vertexingHF/AliCFTaskVertexingHF.cxx
PWGHF/vertexingHF/AliCFTaskVertexingHF.h
PWGHF/vertexingHF/AliCFVertexingHF3Prong.cxx
PWGHF/vertexingHF/AliCFVertexingHF3Prong.h
PWGHF/vertexingHF/AliRDHFCuts.cxx
PWGHF/vertexingHF/AliRDHFCuts.h

index a961da7..8dd662f 100644 (file)
@@ -113,7 +113,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF() :
        fConfiguration(kCheetah), // by default, setting the fast configuration
        fFuncWeight(0x0),
        fHistoMeasNch(0x0),
-       fHistoMCNch(0x0)
+       fHistoMCNch(0x0),
+        fResonantDecay(0)
 {
        //
        //Default ctor
@@ -158,7 +159,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts
        fConfiguration(kCheetah),  // by default, setting the fast configuration
        fFuncWeight(func),
        fHistoMeasNch(0x0),
-       fHistoMCNch(0x0)
+       fHistoMCNch(0x0),
+        fResonantDecay(0)
 {
        //
        // Constructor. Initialization of Inputs and Outputs
@@ -232,7 +234,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
        fConfiguration(c.fConfiguration),
        fFuncWeight(c.fFuncWeight),
        fHistoMeasNch(c.fHistoMeasNch),
-       fHistoMCNch(c.fHistoMCNch)
+       fHistoMCNch(c.fHistoMCNch),
+        fResonantDecay(c.fResonantDecay)
 {
        //
        // Copy Constructor
@@ -516,14 +519,17 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
          break;
        }
        case 31:
-       case 32:
+//     case 32:
        case 33:{
          cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel); 
          if(fDecayChannel==33){
-           cfVtxHF->SetGeneratedDsOption(fGenDsOption);
+           ((AliCFVertexingHF3Prong*)cfVtxHF)->SetGeneratedDsOption(fGenDsOption);
          }
                break;
        }
+       case 32:{
+         cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel,fResonantDecay); 
+        }
        case 4:{
                //cfVtxHF = new AliCFVertexingHF4Prong(mcArray, originDselection);  // not there yet
                break;
@@ -819,7 +825,10 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
                                                    
 
                                                fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object     
-                                               if (recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart){
+                                                Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
+                                               if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
+                                                
+                                               if (tempAn){
                                                        fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
                                                        icountRecoPPR++;
                                                        AliDebug(3,"Reco Analysis cuts passed and container filled \n");
@@ -832,8 +841,10 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
                                                          Bool_t keepDs=ProcessDs(recoPidSelection);
                                                          if(keepDs) recoPidSelection=3;                                                          
                                                        }
+                                                        Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
+                                                       if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
 
-                                                       if (recoPidSelection == 3 || recoPidSelection == isPartOrAntipart){
+                                                       if (tempPid){
                                                                fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight);
                                                                icountRecoPID++;
                                                                AliDebug(3,"Reco PID cuts passed and container filled \n");
index bf4dd90..f7c1036 100644 (file)
@@ -65,6 +65,14 @@ public:
                kSnail = 0,    // slow configuration, all variables
                kCheetah = 1   // fast configuration, only a subset of variables
        };
+
+        enum {
+          kAll = 0,   // all decays (resonant + non-resonant)
+          kNonResonant = 1, // only non resonant
+          kL1520 = 2,  // Lc --> L(1520) + p
+          kKstar = 3,  // Lc --> K* + pi
+          kDelta = 4   // Lc --> Delta + K
+        };
        
        AliCFTaskVertexingHF();
        AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func = 0x0);
@@ -149,6 +157,9 @@ public:
        
        void SetWeightFunction(TF1* func) {fFuncWeight = func;}
        TF1* GetWeightFunction() const {return fFuncWeight;}
+
+        void SetResonantDecay(UInt_t resonantDecay) {fResonantDecay = resonantDecay;}
+        UInt_t GetResonantDecay() const {return fResonantDecay;}
        
 protected:
        AliCFManager   *fCFManager;   //  pointer to the CF manager
@@ -188,6 +199,7 @@ protected:
        TF1* fFuncWeight;     // user-defined function to be used to calculate weights
        TH1F* fHistoMeasNch;  // histogram with measured Nch distribution (pp 7 TeV)
        TH1F* fHistoMCNch;  // histogram with Nch distribution from MC production
+        UInt_t fResonantDecay;  // resonant deacy channel to be used if the CF should be run on resonant channels only
 
        ClassDef(AliCFTaskVertexingHF,12); // class for HF corrections as a function of many variables
 };
index 47e969b..7943ebd 100644 (file)
@@ -40,10 +40,11 @@ ClassImp(AliCFVertexingHF3Prong)
 
 
 //_________________________________________
-AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(Int_t decay):
+AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(Int_t decay, UInt_t resonantDecay):
 AliCFVertexingHF(),
   fDecay(decay),
-  fGenDsOption(kCountResonant)
+  fGenDsOption(kCountResonant),
+  fResonantDecay(resonantDecay)
  {
   // 
   SetNProngs(3);
@@ -57,10 +58,11 @@ AliCFVertexingHF(),
 
 }
 //_________________________________________
-AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay):
+AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay, UInt_t resonantDecay):
   AliCFVertexingHF(mcArray, originDselection),
   fDecay(decay),
-  fGenDsOption(kCountResonant)
+  fGenDsOption(kCountResonant),
+  fResonantDecay(resonantDecay)
 {
   //
   SetNProngs(3);
@@ -145,6 +147,10 @@ Bool_t AliCFVertexingHF3Prong::SetRecoCandidateParam(AliAODRecoDecayHF *recoCand
     }
   }
 
+  if (fDecay==kLctopKpi && fResonantDecay != AliCFTaskVertexingHF::kAll) {
+    if (!CheckLc3Prong()) return bSignAssoc;
+  }
+
   bSignAssoc = kTRUE;
   return bSignAssoc;
 }
@@ -487,7 +493,10 @@ Bool_t AliCFVertexingHF3Prong::CheckMCChannelDecay() const
   Int_t daughter[3];
 
   Int_t nDau=fmcPartCandidate->GetNDaughters();
-  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0); 
+  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
+
+  if(fDecay==kLctopKpi && fResonantDecay!=AliCFTaskVertexingHF::kAll){if(!CheckLc3Prong()) return checkCD;}
   if(nDau==3){
     if(fDecay==kDstoKKpi && !(fGenDsOption==kCountAllDsKKpi || fGenDsOption==kCountNonResonant)){
       AliDebug(3,"Decay channel in direct KKpi, should be skipped");
@@ -563,3 +572,96 @@ Bool_t AliCFVertexingHF3Prong::CheckMCChannelDecay() const
   return checkCD;
   
 }
+//---------------------------------
+Bool_t AliCFVertexingHF3Prong::CheckLc3Prong() const
+{
+  Int_t numberOfLambdac=0;
+  if(TMath::Abs(fmcPartCandidate->GetPdgCode())!=4122) return kFALSE;
+  Int_t nDaugh = (Int_t)fmcPartCandidate->GetNDaughters();
+  if(nDaugh<2) return kFALSE;
+  if(nDaugh>3) return kFALSE;
+  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(0));
+  if(!pdaugh1) {return kFALSE;}
+  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
+  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(1));
+  if(!pdaugh2) {return kFALSE;}
+  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
+  if(nDaugh==3){
+    if(fResonantDecay!=AliCFTaskVertexingHF::kNonResonant && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+    Int_t thirdDaugh=fmcPartCandidate->GetDaughter(1)-1;
+    AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)fmcArray->At(thirdDaugh);
+    if(!pdaugh3) return kFALSE;
+    Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
+    if((number1==321 && number2==211 && number3==2212) || (number1==211 && number2==321 && number3==2212) || (number1==211 && number2==2212 && number3==321) || (number1==321 && number2==2212 && number3==211) || (number1==2212 && number2==321 && number3==211) || (number1==2212 && number2==211 && number3==321)) numberOfLambdac++;
+  }
+  if(nDaugh==2){
+    if(fResonantDecay==AliCFTaskVertexingHF::kNonResonant)return kFALSE; 
+    Int_t nfiglieK=0;
+    if((number1==2212 && number2==313)){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kKstar && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieK=pdaugh2->GetNDaughters();
+      if(nfiglieK!=2) return kFALSE;
+      AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
+      AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
+      if(!pdaughK1) return kFALSE;
+      if(!pdaughK2) return kFALSE;
+      if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
+    }
+    if((number1==313 && number2==2212)){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kKstar && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieK=pdaugh1->GetNDaughters();
+      if(nfiglieK!=2) return kFALSE;
+      AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
+      AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
+      if(!pdaughK1) return kFALSE;
+      if(!pdaughK2) return kFALSE;
+      if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
+    }
+    Int_t nfiglieDelta=0;
+    if(number1==321 && number2==2224){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kDelta && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieDelta=pdaugh2->GetNDaughters();
+      if(nfiglieDelta!=2) return kFALSE;
+      AliAODMCParticle *pdaughD1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
+      AliAODMCParticle *pdaughD2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
+      if(!pdaughD1) return kFALSE;
+      if(!pdaughD2) return kFALSE;
+      if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
+    }
+    if(number1==2224 && number2==321){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kDelta && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieDelta=pdaugh1->GetNDaughters();
+      if(nfiglieDelta!=2) return kFALSE;
+      AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
+      AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1)); 
+      if(!pdaughD1) return kFALSE;
+      if(!pdaughD2) return kFALSE;
+      if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
+    }
+    
+    Int_t nfiglieLa=0;
+    if(number1==3124 && number2==211){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kL1520 && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieLa=pdaugh1->GetNDaughters();
+      if(nfiglieLa!=2) return kFALSE;
+      AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
+      AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
+      if(!pdaughL1) return kFALSE;
+      if(!pdaughL2) return kFALSE;
+      if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
+    }
+    if(number1==211 && number2==3124){
+      if(fResonantDecay!=AliCFTaskVertexingHF::kL1520 && fResonantDecay!=AliCFTaskVertexingHF::kAll)return kFALSE; 
+      nfiglieLa=pdaugh2->GetNDaughters();
+      if(nfiglieLa!=2) return kFALSE;
+      AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
+      AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
+      if(!pdaughL1) return kFALSE;
+      if(!pdaughL2) return kFALSE;
+      if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
+      
+    }
+  }
+  if(numberOfLambdac>0) return kTRUE;
+  return kFALSE;
+}
index aa060b2..3c74648 100644 (file)
@@ -29,8 +29,10 @@ class TDatabasePDG;
 class AliCFVertexingHF3Prong : public AliCFVertexingHF{\r
        public:\r
                \r
+  AliCFVertexingHF3Prong(Int_t decay,UInt_t resonantDecay);\r
   AliCFVertexingHF3Prong(Int_t decay);\r
   AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay);  \r
+  AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay,UInt_t resonantDecay);  \r
   virtual ~AliCFVertexingHF3Prong(){};\r
   \r
   \r
@@ -41,6 +43,9 @@ class AliCFVertexingHF3Prong : public AliCFVertexingHF{
   \r
   Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *recoCand);\r
   virtual void SetDecay3Prong(Int_t decay){fDecay=decay;}\r
+  Bool_t CheckLc3Prong() const;\r
+  void SetResonantDecay(UInt_t resonantDecay) {fResonantDecay = resonantDecay;}\r
+  UInt_t GetResonantDecay() const {return fResonantDecay;}\r
  \r
   void SetGeneratedDsOption(Int_t opt) {fGenDsOption=opt;}\r
   Int_t GetGeneratedDsOption() const {return fGenDsOption;}\r
@@ -57,8 +62,9 @@ class AliCFVertexingHF3Prong : public AliCFVertexingHF{
   \r
   Int_t fDecay;   // decay mode id\r
   Int_t fGenDsOption;  // option for selection Ds (see enum)\r
+  UInt_t fResonantDecay; // resonant decay for which to run the CF\r
 \r
-  ClassDef(AliCFVertexingHF3Prong, 2);\r
+  ClassDef(AliCFVertexingHF3Prong, 3);\r
   \r
 };\r
 \r
index 17358ea..9bd9e84 100644 (file)
@@ -91,7 +91,8 @@ fKeepSignalMC(kFALSE),
 fIsCandTrackSPDFirst(kFALSE),
 fMaxPtCandTrackSPDFirst(0.),
 fApplySPDDeadPbPb2011(kFALSE),
-fRemoveTrackletOutliers(kFALSE)
+fRemoveTrackletOutliers(kFALSE),
+fKinkReject(kFALSE)
 {
   //
   // Default Constructor
@@ -144,7 +145,8 @@ AliRDHFCuts::AliRDHFCuts(const AliRDHFCuts &source) :
   fIsCandTrackSPDFirst(source.fIsCandTrackSPDFirst),
   fMaxPtCandTrackSPDFirst(source.fMaxPtCandTrackSPDFirst),
   fApplySPDDeadPbPb2011(source.fApplySPDDeadPbPb2011),
-  fRemoveTrackletOutliers(source.fRemoveTrackletOutliers)
+  fRemoveTrackletOutliers(source.fRemoveTrackletOutliers),
+  fKinkReject(source.fKinkReject)
 {
   //
   // Copy constructor
@@ -211,6 +213,7 @@ AliRDHFCuts &AliRDHFCuts::operator=(const AliRDHFCuts &source)
   fMaxPtCandTrackSPDFirst=source.fMaxPtCandTrackSPDFirst;
   fApplySPDDeadPbPb2011=source.fApplySPDDeadPbPb2011;
   fRemoveTrackletOutliers=source.fRemoveTrackletOutliers;
+  fKinkReject=source.fKinkReject;
 
   if(source.GetTrackCuts()) {delete fTrackCuts; fTrackCuts=new AliESDtrackCuts(*(source.GetTrackCuts()));}
   if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
@@ -471,6 +474,12 @@ Bool_t AliRDHFCuts::IsDaughterSelected(AliAODTrack *track,const AliESDVertex *pr
   esdTrack.RelateToVertex(primary,0.,3.); 
 
   if(!cuts->IsSelected(&esdTrack)) retval = kFALSE;
+
+
+  if(fKinkReject){
+   AliAODVertex *maybeKink=track->GetProdVertex();
+   if(maybeKink->GetType()==AliAODVertex::kKink) retval=kFALSE;
+  }
  
   if(fOptPileup==kRejectTracksFromPileupVertex){
     // to be implemented
index ea40d1e..a0bbdca 100644 (file)
@@ -114,6 +114,7 @@ class AliRDHFCuts : public AliAnalysisCuts
           {delete fTrackCuts; fTrackCuts=new AliESDtrackCuts(*cuts); return;}
   void SetUsePID(Bool_t flag=kTRUE) {fUsePID=flag; return;}
   void SetUseAOD049(Bool_t flag=kTRUE) {fUseAOD049=flag; return;}
+  void SetKinkRejection(Bool_t flag=kTRUE) {fKinkReject=flag; return;}
   void SetUseCentrality(Int_t flag=1);    // see enum below
   void SetPidHF(AliAODPidHF* pidObj) {
     if(fPidHF) delete fPidHF;
@@ -156,6 +157,7 @@ class AliRDHFCuts : public AliAnalysisCuts
   void    GetVarPtIndex(Int_t iGlob, Int_t& iVar, Int_t& iPtBin) const;
   Bool_t  GetIsUsePID() const {return fUsePID;}
   Bool_t  GetUseAOD049() const {return fUseAOD049;}
+  Bool_t  GetUseKinkRejection() const {return fKinkReject;}
   Bool_t  GetIsPrimaryWithoutDaughters() const {return fRemoveDaughtersFromPrimary;}
   Bool_t GetOptPileUp() const {return fOptPileup;}
   Int_t GetUseCentrality() const {return fUseCentrality;}
@@ -296,8 +298,9 @@ class AliRDHFCuts : public AliAnalysisCuts
   Double_t fMaxPtCandTrackSPDFirst; // maximum pt of the candidate for which to check if the daughters fulfill kFirst criteria
   Bool_t fApplySPDDeadPbPb2011;  // flag to apply SPD dead module map of PbPb2011
   Bool_t fRemoveTrackletOutliers; // flag to apply cut on tracklets vs. centrality for 2011 data
+  Bool_t fKinkReject; // flag to reject kink daughters
 
-  ClassDef(AliRDHFCuts,23);  // base class for cuts on AOD reconstructed heavy-flavour decays
+  ClassDef(AliRDHFCuts,24);  // base class for cuts on AOD reconstructed heavy-flavour decays
 };
 
 #endif