Possibility to remove the contribution of D meson daughters to the number of tracklet...
authorfprino <fprino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Nov 2012 08:21:00 +0000 (08:21 +0000)
committerfprino <fprino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Nov 2012 08:21:00 +0000 (08:21 +0000)
PWGHF/vertexingHF/AliAnalysisTaskSEDvsMultiplicity.cxx
PWGHF/vertexingHF/AliAnalysisTaskSEDvsMultiplicity.h
PWGHF/vertexingHF/macros/AddTaskDvsMultiplicity.C

index db96d34..521ed23 100644 (file)
@@ -92,6 +92,7 @@ AliAnalysisTaskSE(),
   fReadMC(kFALSE),
   fMCOption(0),
   fUseBit(kTRUE),
+  fSubtractTrackletsFromDau(kFALSE),
   fRefMult(9.26),
   fPdgMeson(411)
 {
@@ -142,6 +143,7 @@ AliAnalysisTaskSEDvsMultiplicity::AliAnalysisTaskSEDvsMultiplicity(const char *n
   fReadMC(kFALSE),
   fMCOption(0),
   fUseBit(kTRUE),
+  fSubtractTrackletsFromDau(kFALSE),
   fRefMult(9.26),
   fPdgMeson(pdgMeson)
 {
@@ -522,6 +524,16 @@ void AliAnalysisTaskSEDvsMultiplicity::UserExec(Option_t */*option*/)
       nSelectedPID++;
       fHistNEvents->Fill(10);
     }
+    Double_t multForCand=countTreta1corr;
+    if(fSubtractTrackletsFromDau){
+      for(Int_t iDau=0; iDau<nDau; iDau++){
+       AliAODTrack *t = (AliAODTrack*)d->GetDaughter(iDau);
+       if(!t) continue;
+       if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
+         if(multForCand>0) multForCand-=1;
+       }
+      }
+    }
     Bool_t isPrimary=kTRUE;
     Int_t labD=-1;
     Double_t trueImpParXY=9999.;
@@ -548,7 +560,7 @@ void AliAnalysisTaskSEDvsMultiplicity::UserExec(Option_t */*option*/)
     for(Int_t iHyp=0; iHyp<2; iHyp++){
       if(mass[iHyp]<0.) continue; // for D+ and D* we have 1 mass hypothesis
       Double_t invMass=mass[iHyp];
-      Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,countTreta1corr};
+      Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
 
       if(fReadMC){
        
@@ -568,7 +580,7 @@ void AliAnalysisTaskSEDvsMultiplicity::UserExec(Option_t */*option*/)
            }else if(fPdgMeson==413){
              trueImpParXY=0.; /// FIXME
            }
-           Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,countTreta1corr};
+           Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
            if(fillHisto && passAllCuts){
              fHistMassPtImpPar[2]->Fill(arrayForSparse);
              fHistMassPtImpPar[3]->Fill(arrayForSparseTrue);
@@ -590,22 +602,22 @@ void AliAnalysisTaskSEDvsMultiplicity::UserExec(Option_t */*option*/)
        if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as D0bar
       }
 
-      fPtVsMassVsMultNoPid->Fill(countTreta1corr,invMass,ptCand);
+      fPtVsMassVsMultNoPid->Fill(multForCand,invMass,ptCand);
 
       if(fPdgMeson==421){
        if(iHyp==0 && !(passAllCuts&1)) continue; // candidate not passing as D0
        if(iHyp==1 && !(passAllCuts&2)) continue; // candidate not passing as D0bar
       }
       if(passAllCuts){
-       fPtVsMassVsMult->Fill(countTreta1corr,invMass,ptCand);                
+       fPtVsMassVsMult->Fill(multForCand,invMass,ptCand);                    
        fPtVsMassVsMultUncorr->Fill(countTreta1,invMass,ptCand);
        // Add separation between part antipart
        if(fPdgMeson==411){
-         if(d->GetCharge()>0) fPtVsMassVsMultPart->Fill(countTreta1corr,invMass,ptCand);
-         else fPtVsMassVsMultAntiPart->Fill(countTreta1corr,invMass,ptCand);
+         if(d->GetCharge()>0) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand);
+         else fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand);
        }else if(fPdgMeson==421){
-         if(passAllCuts&1) fPtVsMassVsMultPart->Fill(countTreta1corr,invMass,ptCand);
-         if(passAllCuts&2) fPtVsMassVsMultAntiPart->Fill(countTreta1corr,invMass,ptCand);
+         if(passAllCuts&1) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand);
+         if(passAllCuts&2) fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand);
        }else if(fPdgMeson==413){
          // FIXME ADD Dstar!!!!!!!!
        }
index 402a317..4d9a185 100644 (file)
@@ -47,6 +47,7 @@ class AliAnalysisTaskSEDvsMultiplicity : public AliAnalysisTaskSE
   Double_t GetLowerMassLimit() const {return fLowmasslimit;}
   void SetNMassBins(Int_t nbins){fNMassBins=nbins;}
   Int_t GetNMassBins() const{return fNMassBins;}
+  Bool_t GetSubtractTrackletsFromDaughters() const {return fSubtractTrackletsFromDau;}
 
   void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax){
     fNImpParBins=nbins;
@@ -76,7 +77,7 @@ class AliAnalysisTaskSEDvsMultiplicity : public AliAnalysisTaskSE
     fMultEstimatorAvg[3]=new TProfile(*hprof);
   }
   void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
-
+  void SetSubtractTrackletsFromDaughters(Bool_t opt){fSubtractTrackletsFromDau=opt;}
   Int_t CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
 
   // Implementation of interface methods
@@ -146,13 +147,14 @@ class AliAnalysisTaskSEDvsMultiplicity : public AliAnalysisTaskSE
   Bool_t fReadMC;    //flag for access to MC
   Int_t  fMCOption;  // 0=keep all cand, 1=keep only signal, 2= keep only back
   Bool_t fUseBit;    // flag to use bitmask
+  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
   
   TProfile* fMultEstimatorAvg[4]; // TProfile with mult vs. Z per period
   Double_t fRefMult;   // refrence multiplcity (period b)
   Int_t fPdgMeson;   // pdg code of analyzed meson
 
   
-  ClassDef(AliAnalysisTaskSEDvsMultiplicity,4); // D vs. mult task
+  ClassDef(AliAnalysisTaskSEDvsMultiplicity,5); // D vs. mult task
 };
 
 #endif
index dee71c9..2bb0252 100644 (file)
@@ -6,7 +6,8 @@ AliAnalysisTaskSEDvsMultiplicity *AddTaskDvsMultiplicity(Int_t system=0,
                                                         TString filename="",
                                                         TString finAnObjname="AnalysisCuts", 
                                                         TString estimatorFilename="",
-                                                        Double_t refMult=9.26)
+                                                        Double_t refMult=9.26,
+                                                        Bool_t subtractDau=kTRUE)
 {
   //
   // Test macro for the AliAnalysisTaskSE for D+ candidates
@@ -69,6 +70,7 @@ AliAnalysisTaskSEDvsMultiplicity *AddTaskDvsMultiplicity(Int_t system=0,
   dMultTask->SetDebugLevel(0);
   dMultTask->SetUseBit(kTRUE);
   dMultTask->SetDoImpactParameterHistos(kFALSE);
+  dMultTask->SetSubtractTrackletsFromDaughters(subtractDau);
 
   if(pdgMeson==421) { 
     dMultTask->SetMassLimits(1.5648,2.1648);