updated HFE & e-h correlation with EMCal
authorssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Sep 2012 13:09:00 +0000 (13:09 +0000)
committerssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Sep 2012 13:09:00 +0000 (13:09 +0000)
PWGHF/hfe/AliAnalysisTaskElecHadronCorrel.cxx
PWGHF/hfe/AliAnalysisTaskHFECal.cxx
PWGHF/hfe/AliAnalysisTaskHFECal.h

index 19ce646..7ec53dd 100644 (file)
@@ -432,13 +432,6 @@ void AliAnalysisTaskElecHadronCorrel::UserExec(Option_t*)
     return;
   }
 
-  //---------------CENTRALITY SELECTION-----------------------    
-  SetCentralityParameters(0., 10., "V0M");
-  Bool_t pass = kFALSE; //to select centrality
-  CheckCentrality(fESD,pass);
-
-  if(!pass)return;
-
   if(!fPID->IsInitialized()){ 
     // Initialize PID with the given run number
     AliWarning("PID not initialised, get from Run no");
@@ -455,7 +448,14 @@ void AliAnalysisTaskElecHadronCorrel::UserExec(Option_t*)
 
   if(!(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kCentral))) return;
 
-/*  AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
+  //---------------CENTRALITY SELECTION-----------------------    
+  SetCentralityParameters(0., 10., "V0M");
+  Bool_t pass = kFALSE; //to select centrality
+  CheckCentrality(fESD,pass);
+
+  if(!pass)return;
+
+  /*  AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
 
   Float_t centvalue = fCentrality->GetCentralityPercentile("V0M");
   fcentrality->Fill(centvalue);    
@@ -1073,9 +1073,11 @@ void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliES
 
   fTrackCuts1->SetAcceptKinkDaughters(kFALSE);
   fTrackCuts1->SetRequireTPCRefit(kTRUE);
+  fTrackCuts1->SetRequireITSRefit(kTRUE);
   fTrackCuts1->SetEtaRange(-0.9,0.9);
   fTrackCuts1->SetRequireSigmaToVertex(kTRUE);
-  fTrackCuts1->SetMaxChi2PerClusterTPC(3.5);
+  //fTrackCuts1->SetMaxChi2PerClusterTPC(3.5);
+  fTrackCuts1->SetMaxChi2PerClusterTPC(4);
   fTrackCuts1->SetMinNClustersTPC(80);
 
   //  const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
@@ -1083,12 +1085,13 @@ void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliES
   Bool_t flagPhotonicElec = kFALSE;
   Int_t NLS_plus=0, NLS_minus=0, NULS=0;
 
-  for(Int_t jTracks = itrack+1; jTracks<fESD->GetNumberOfTracks(); jTracks++){
+  for(Int_t jTracks = 0; jTracks<fESD->GetNumberOfTracks(); jTracks++){
     AliESDtrack* trackAsso = fESD->GetTrack(jTracks);
     if (!trackAsso) {
       printf("ERROR: Could not receive track %d\n", jTracks);
       continue;
     }
+    if(jTracks==itrack) continue;
 
     Double_t dEdxAsso = -999., ptAsso=-999., openingAngle = -999.,nsigma=-999.0;
     Double_t mass=-999., width = -999;
@@ -1102,10 +1105,10 @@ void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliES
 
     if(ptAsso <0.3) continue;
     if(trackAsso->Eta()<-0.9 || trackAsso->Eta()>0.9) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackAsso)) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackAsso)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackAsso)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackAsso)) continue;
 
-    //    if(!fTrackCuts1->AcceptTrack(trackAsso)) continue;
+    if(!fTrackCuts1->AcceptTrack(trackAsso)) continue;
     //    if(dEdxAsso <70 || dEdxAsso>100) continue; //11a pass1
     if(nsigma < -3 || nsigma > 3) continue;
 
@@ -1194,7 +1197,8 @@ void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrel(Int_t itrack, AliESDtrac
   fTrackCuts2->SetRequireITSRefit(kTRUE);
   fTrackCuts2->SetEtaRange(-0.9,0.9);
   fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
-  fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
+//  fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
+  fTrackCuts2->SetMaxChi2PerClusterTPC(4);
   fTrackCuts2->SetMinNClustersTPC(80);
 
   for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
@@ -1220,10 +1224,10 @@ void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrel(Int_t itrack, AliESDtrac
 //    if(ptHad <2) continue;
     if(ptHad > ptEle) continue;
     if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
 
-//    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
+    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
   
    // fHadronIPxy->Fill(IPxy);
    // fHadronIPz->Fill(IPz);
@@ -1257,7 +1261,8 @@ void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrelNoPartner(Int_t itrack,In
   fTrackCuts2->SetRequireITSRefit(kTRUE);
   fTrackCuts2->SetEtaRange(-0.9,0.9);
   fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
-  fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
+ // fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
+  fTrackCuts2->SetMaxChi2PerClusterTPC(4);
   fTrackCuts2->SetMinNClustersTPC(80);
 
   for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
@@ -1284,10 +1289,10 @@ void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrelNoPartner(Int_t itrack,In
 //    if(ptHad <2) continue;
     if(ptHad > ptEle) continue;
     if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
 
-//    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
+    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
 //    if(TMath::Abs(IPxy)>2.5) continue;
 
     phiEle = track->Phi();
@@ -1418,7 +1423,8 @@ void AliAnalysisTaskElecHadronCorrel::HadronInfo(Int_t itrack)
   fTrackCuts2->SetRequireITSRefit(kTRUE);                                                
   fTrackCuts2->SetEtaRange(-0.9,0.9);
   fTrackCuts2->SetRequireSigmaToVertex(kTRUE);                                           
-  fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);                                             
+ // fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);                                             
+  fTrackCuts2->SetMaxChi2PerClusterTPC(4);                                             
   fTrackCuts2->SetMinNClustersTPC(80);                                                   
 
   for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){                  
@@ -1436,10 +1442,10 @@ void AliAnalysisTaskElecHadronCorrel::HadronInfo(Int_t itrack)
     trackHad->GetImpactParameters(IPxy,IPz);
     
     if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
-    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
+//    if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
 
-//    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;                                    
+    if(!fTrackCuts2->AcceptTrack(trackHad)) continue;                                    
     if(ptHad<2) continue;
 
     fHadronPhi->Fill(trackHad->Phi());
index 6db6553..5a08dc6 100644 (file)
@@ -148,9 +148,13 @@ AliAnalysisTaskHFECal::AliAnalysisTaskHFECal(const char *name)
   ,fPhoElecPtMCM20(0)
   ,fSameElecPtMC(0)
   ,fSameElecPtMCM20(0)
+  ,fIncpTMCM20pho_pi0e(0)      
+  ,fPhoElecPtMCM20_pi0e(0)
+  ,fSameElecPtMCM20_pi0e(0)
   ,CheckNclust(0)
   ,CheckNits(0)
   ,Hpi0pTcheck(0)
+  ,HphopTcheck(0)
 {
   //Named constructor
   
@@ -234,9 +238,13 @@ AliAnalysisTaskHFECal::AliAnalysisTaskHFECal()
   ,fPhoElecPtMCM20(0)
   ,fSameElecPtMC(0)
   ,fSameElecPtMCM20(0)
+  ,fIncpTMCM20pho_pi0e(0)      
+  ,fPhoElecPtMCM20_pi0e(0)
+  ,fSameElecPtMCM20_pi0e(0)
   ,CheckNclust(0)
   ,CheckNits(0)
   ,Hpi0pTcheck(0)
+  ,HphopTcheck(0)
 {
        //Default constructor
        fPID = new AliHFEpid("hfePid");
@@ -321,14 +329,18 @@ void AliAnalysisTaskHFECal::UserExec(Option_t*)
       if(!MChijing)iHijing = 0;
       if(fPDG==111)Hpi0pTcheck->Fill(pTMC,iHijing);
 
+      if(particle->GetFirstMother()>-1 && fPDG==22)
+        {
+        int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();  
+         if(parentPID==111 || parentPID==221)HphopTcheck->Fill(pTMC,iHijing); // pi0->g & eta->g
+        } 
+
       if(particle->GetFirstMother()>-1 && fabs(fPDG)==11)
         {
            int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();  
             if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(fPDG)==11)mcInDtoE = kTRUE;
             if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(fPDG)==11)mcInBtoE = kTRUE;
             if((mcInBtoE || mcInDtoE) && fabs(mcZvertex)<10.0)fInputHFEMC->Fill(cent,pTMC);
-
-
          }
 
          if(proR<7.0 && fabs(fPDG)==11)fInputAlle->Fill(cent,pTMC);
@@ -404,6 +416,8 @@ void AliAnalysisTaskHFECal::UserExec(Option_t*)
     double mcele = -1.;
     double mcpT = 0.0;
     double mcMompT = 0.0;
+    //double mcGrandMompT = 0.0;
+    double mcWeight = -10.0;
 
     int iHijing = 1;
 
@@ -420,11 +434,46 @@ void AliAnalysisTaskHFECal::UserExec(Option_t*)
        //printf("MCpid = %d",mcpid);
        if(particle->GetFirstMother()>-1)
          {
+          int parentlabel = particle->GetFirstMother();
           int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
           mcMompT = stack->Particle(particle->GetFirstMother())->Pt();
           if((parentPID==22 || parentPID==111 || parentPID==221)&& fabs(mcpid)==11)mcPho = kTRUE;
           if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(mcpid)==11)mcDtoE = kTRUE;
           if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(mcpid)==11)mcBtoE = kTRUE;
+
+          // pi->e (Da;itz)
+          if(parentPID==111 && fabs(mcpid)==11)
+              {
+                 if(mcMompT>0.0 && mcMompT<5.0)
+                   {
+                    mcWeight = 0.323*mcMompT/(TMath::Exp(-1.6+0.767*mcMompT+0.0285*mcMompT*mcMompT));
+                   }
+                 else
+                   {
+                    mcWeight = 115.0/(0.718*mcMompT*TMath::Power(mcMompT,3.65));
+                   }
+              }
+
+          // access grand parent pi0->g->e
+          TParticle* particle_parent = stack->Particle(parentlabel); // get parent pointer
+          if(particle_parent->GetFirstMother()>-1 && parentPID==22 && fabs(mcpid)==11) // get grand parent g->e
+            {
+             int grand_parentPID = stack->Particle(particle_parent->GetFirstMother())->GetPdgCode();
+             if(grand_parentPID==111)
+                {
+                 //mcGrandMompT = stack->Particle(particle_parent->GetFirstMother())->Pt();
+                 double pTtmp = stack->Particle(particle_parent->GetFirstMother())->Pt();
+                 //if(mcGrandMompT>0.0 && mcGrandMompT<5.0)
+                 if(pTtmp>0.0 && pTtmp<5.0)
+                   {
+                    mcWeight = 0.323*pTtmp/(TMath::Exp(-1.6+0.767*pTtmp+0.0285*pTtmp*pTtmp));
+                   }
+                 else
+                   {
+                    mcWeight = 115.0/(0.718*pTtmp*TMath::Power(pTtmp,3.65));
+                   }
+                }
+            }
          } 
        if(fabs(mcpid)==11 && mcDtoE)mcele= 1.; 
        if(fabs(mcpid)==11 && mcBtoE)mcele= 2.; 
@@ -571,18 +620,19 @@ void AliAnalysisTaskHFECal::UserExec(Option_t*)
      }
     
     // MC
-    if(mcele>0)
+    if(mcele>0) // select MC electrons
       {
 
           fIncpTMChfeAll->Fill(cent,pt);    
           if(m20>0.0 && m20<0.3)fIncpTMCM20hfeAll->Fill(cent,pt);    
 
-       if(mcBtoE || mcDtoE)
+       if(mcBtoE || mcDtoE) // select B->e & D->e
          {
           fIncpTMChfe->Fill(cent,pt);    
           if(m20>0.0 && m20<0.3)fIncpTMCM20hfe->Fill(cent,pt);    
          }
-       if(mcPho)
+      
+       if(mcPho) // select photonic electrons
         {
          double phoval[4];
          phoval[0] = cent;
@@ -599,6 +649,13 @@ void AliAnalysisTaskHFECal::UserExec(Option_t*)
             fIncpTMCM20pho->Fill(phoval);    
             if(fFlagPhotonicElec) fPhoElecPtMCM20->Fill(phoval);
             if(fFlagConvinatElec) fSameElecPtMCM20->Fill(phoval);
+            // pi0->g->e
+            if(mcWeight>-1)
+              {
+               fIncpTMCM20pho_pi0e->Fill(phoval,mcWeight);    
+               if(fFlagPhotonicElec) fPhoElecPtMCM20_pi0e->Fill(phoval,mcWeight);
+               if(fFlagConvinatElec) fSameElecPtMCM20_pi0e->Fill(phoval,mcWeight);
+              }
            }
         } 
       } 
@@ -852,6 +909,15 @@ void AliAnalysisTaskHFECal::UserCreateOutputObjects()
   fSameElecPtMCM20 = new THnSparseD("fSameElecPtMCM20", "MC Same-inclusive electron pt with M20",4,nBinspho2,minpho2,maxpho2);
   fOutputList->Add(fSameElecPtMCM20);
 
+  fIncpTMCM20pho_pi0e = new THnSparseD("fIncpTMCM20pho_pi0e","MC Pho pi0->e pid electro vs. centrality with M20",4,nBinspho2,minpho2,maxpho2);
+  fOutputList->Add(fIncpTMCM20pho_pi0e);
+
+  fPhoElecPtMCM20_pi0e = new THnSparseD("fPhoElecPtMCM20_pi0e", "MC Pho-inclusive electron pt with M20 pi0->e",4,nBinspho2,minpho2,maxpho2);
+  fOutputList->Add(fPhoElecPtMCM20_pi0e);
+
+  fSameElecPtMCM20_pi0e = new THnSparseD("fSameElecPtMCM20_pi0e", "MC Same-inclusive electron pt pi0->e",4,nBinspho2,minpho2,maxpho2);
+  fOutputList->Add(fSameElecPtMCM20_pi0e);
+
   CheckNclust = new TH1D("CheckNclust","cluster check",200,0,200);
   fOutputList->Add(CheckNclust);
 
@@ -861,6 +927,9 @@ void AliAnalysisTaskHFECal::UserCreateOutputObjects()
   Hpi0pTcheck = new TH2D("Hpi0pTcheck","Pi0 pT from Hijing",100,0,50,3,-0.5,2.5);
   fOutputList->Add(Hpi0pTcheck);
 
+  HphopTcheck = new TH2D("HphopTcheck","Pho pT from Hijing",100,0,50,3,-0.5,2.5);
+  fOutputList->Add(HphopTcheck);
+
 
   PostData(1,fOutputList);
 }
index 63abfdf..8aa4900 100644 (file)
@@ -135,9 +135,13 @@ class AliAnalysisTaskHFECal : public AliAnalysisTaskSE {
  THnSparseD            *fPhoElecPtMCM20;               //! Pho inclusive ele pt
  THnSparseD            *fSameElecPtMC;         //! Same inclusive ele pt
  THnSparseD            *fSameElecPtMCM20;              //! Same inclusive ele pt
+ THnSparseD            *fIncpTMCM20pho_pi0e;   //! MC HFE pid electron vs centrality
+ THnSparseD            *fPhoElecPtMCM20_pi0e;          //! Pho inclusive ele pt
+ THnSparseD            *fSameElecPtMCM20_pi0e;         //! Same inclusive ele pt
  TH1D                   *CheckNclust;  
  TH1D                   *CheckNits;  
  TH2D                   *Hpi0pTcheck; 
+ TH2D                   *HphopTcheck; 
  
   AliAnalysisTaskHFECal(const AliAnalysisTaskHFECal&); // not implemented
   AliAnalysisTaskHFECal& operator=(const AliAnalysisTaskHFECal&); // not implemented