Changes in DeltaPhi histrograms; usage of all possible trigger particles instead...
authoresicking <esicking@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Mar 2011 09:10:24 +0000 (09:10 +0000)
committeresicking <esicking@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Mar 2011 09:10:24 +0000 (09:10 +0000)
PWG4/JetTasks/AliAnalysisTaskMinijet.cxx
PWG4/JetTasks/AliAnalysisTaskMinijet.h

index df16b43..d5ca7a9 100644 (file)
@@ -47,13 +47,18 @@ ClassImp(AliAnalysisTaskMinijet)
       fMode(0),
       fVertexZCut(10.),
       fEtaCut(0.9),
-      fEtaCutSeed(0.2),
-      fSelectParticles(2),
+      fEtaCutSeed(0.9),
+      fSelectParticles(1),
+      fSelectParticlesAssoc(1),
       fESDEvent(0),
       fAODEvent(0),
+      fNMcPrimAccept(0),
+      fVzEvent(0),
       fHists(0),
       fHistPt(0),
       fHistPtMC(0),
+      fNmcNch(0),
+      pNmcNch(0),
       fChargedPi0(0)
 {
   for(Int_t i = 0;i< 4;i++){
@@ -62,20 +67,24 @@ ClassImp(AliAnalysisTaskMinijet)
     fPt[i]                    =  0;
     fEta[i]                   =  0;
     fPhi[i]                   =  0;
+    fDcaXY[i]                 =  0;
+    fDcaZ[i]                  =  0;
 
     fPtSeed[i]                =  0;
     fEtaSeed[i]               =  0;
     fPhiSeed[i]               =  0;
 
-    fPtOthers[i]                =  0;
-    fEtaOthers[i]               =  0;
-    fPhiOthers[i]               =  0;
-    fPtEtaOthers[i]               =  0;
+    fPtOthers[i]              =  0;
+    fEtaOthers[i]             =  0;
+    fPhiOthers[i]             =  0;
+    fPtEtaOthers[i]           =  0;
 
     fPhiEta[i]                =  0;
 
     fDPhiDEtaEventAxis[i]     =  0;
+    fDPhiDEtaEventAxisSeeds[i]=  0;
     fTriggerNch[i]            =  0;
+    fTriggerNchSeeds[i]       =  0;
     fTriggerTracklet[i]       =  0;
     
     fNch07Nch[i]              =  0;
@@ -83,6 +92,7 @@ ClassImp(AliAnalysisTaskMinijet)
     fNch07Tracklet[i]         =  0;
     fNchTracklet[i]           =  0;
     pNch07Tracklet[i]         =  0;
+    fDPhiEventAxis[i]   = 0;
     for(Int_t j=0;j<150;j++){
       fDPhiEventAxisNchBin[i][j]   = 0;
       fDPhiEventAxisNchBinTrig[i][j]   = 0;
@@ -109,17 +119,21 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
   // Called once
   if(fDebug) Printf("In User Create Output Objects.");
    
-  fHistPt = new TH1F("fHistPt", "P_{T} distribution REC", 15, 0.1, 3.1);
+  fHistPt = new TH1F("fHistPt", "P_{T} distribution REC", 150, 0.1, 3.1);
   fHistPt->GetXaxis()->SetTitle("P_{T} (GeV/c)");
   fHistPt->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
   fHistPt->SetMarkerStyle(kFullCircle);
 
   
   if (fUseMC) {
-    fHistPtMC = new TH1F("fHistPtMC", "P_{T} distribution MC", 15, 0.1, 3.1);
+    fHistPtMC = new TH1F("fHistPtMC", "P_{T} distribution MC", 150, 0.1, 3.1);
     fHistPtMC->GetXaxis()->SetTitle("P_{T} (GeV/c)");
     fHistPtMC->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
     fHistPtMC->SetMarkerStyle(kFullCircle);
+
+    fNmcNch = new TH2F("fNmcNch", "fNmcNch", 100,-0.5,99.5,100,-0.5,99.5);
+    pNmcNch = new TProfile("pNmcNch", "pNmcNch", 100,-0.5,99.5);
+
   }
 
   fChargedPi0 = new TH2F("fChargedPi0", "fChargedPi0", 200, -0.5, 199.5, 200, -0.5, 199.5);
@@ -134,20 +148,26 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
                                            200, -10., 10.);
     fPt[i]                       = new TH1F(Form("fPt%s",labels[i].Data()),
                                            Form("fPt%s",labels[i].Data()) ,  
-                                           500, 0., 50);
+                                           200, 0., 50);
     fEta[i]                      = new TH1F (Form("fEta%s",labels[i].Data()),
                                             Form("fEta%s",labels[i].Data()) ,  
-                                            100, -1., 1);
+                                            100, -2., 2);
     fPhi[i]                      = new TH1F(Form("fPhi%s",labels[i].Data()),
                                            Form("fPhi%s",labels[i].Data()) ,  
                                            360, 0.,2*TMath::Pi());
-
+    fDcaXY[i]                    = new TH1F(Form("fDcaXY%s",labels[i].Data()),
+                                           Form("fDcaXY%s",labels[i].Data()) ,  
+                                           200, -3,3);
+    fDcaZ[i]                     = new TH1F(Form("fDcaZ%s",labels[i].Data()),
+                                           Form("fDcaZ%s",labels[i].Data()) ,  
+                                           200, -10,10);
+    
     fPtSeed[i]                       = new TH1F(Form("fPSeedt%s",labels[i].Data()),
                                            Form("fPtSeed%s",labels[i].Data()) ,  
                                            500, 0., 50);
     fEtaSeed[i]                      = new TH1F (Form("fEtaSeed%s",labels[i].Data()),
                                             Form("fEtaSeed%s",labels[i].Data()) ,  
-                                            100, -1., 1);
+                                            100, -2., 2);
     fPhiSeed[i]                      = new TH1F(Form("fPhiSeed%s",labels[i].Data()),
                                            Form("fPhiSeed%s",labels[i].Data()) ,  
                                            360, 0.,2*TMath::Pi());
@@ -157,7 +177,7 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
                                            500, 0., 50);
     fEtaOthers[i]                      = new TH1F (Form("fEtaOthers%s",labels[i].Data()),
                                             Form("fEtaOthers%s",labels[i].Data()) ,  
-                                            100, -1., 1);
+                                            100, -2., 2);
     fPhiOthers[i]                      = new TH1F(Form("fPhiOthers%s",labels[i].Data()),
                                            Form("fPhiOthers%s",labels[i].Data()) ,  
                                            360, 0.,2*TMath::Pi());
@@ -170,10 +190,13 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
                                            180, 0., 2*TMath::Pi(), 100, -1.,1.);
     fDPhiDEtaEventAxis[i]        = new TH2F(Form("fDPhiDEtaEventAxis%s",labels[i].Data()),
                                            Form("fDPhiDEtaEventAxis%s",labels[i].Data()) ,  
-                                           180, -1., 2*TMath::Pi()-1, 200, -2.,2.);
+                                           180, -0.5* TMath::Pi(), 1.5*TMath::Pi(), 200, -4.,4.);
     fTriggerNch[i]               = new TH1F(Form("fTriggerNch%s",labels[i].Data()),
                                            Form("fTriggerNch%s",labels[i].Data()) ,  
                                            250, -0.5, 249.5);
+    fTriggerNchSeeds[i]          = new TH2F(Form("fTriggerNchSeeds%s",labels[i].Data()),
+                                           Form("fTriggerNchSeeds%s",labels[i].Data()) ,  
+                                           250, -0.5, 249.5, 100, -0.5, 99.5);
     fTriggerTracklet[i]          = new TH1F(Form("fTriggerTracklet%s",labels[i].Data()),
                                            Form("fTriggerTracklet%s",labels[i].Data()) ,  
                                            250, -0.5, 249.5);
@@ -192,28 +215,35 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
     pNch07Tracklet[i]            = new TProfile(Form("pNch07Tracklet%s",labels[i].Data()),
                                                Form("pNch07Tracklet%s",labels[i].Data()) ,  
                                                250, -2.5, 247.5);
+    fDPhiEventAxis[i]          = new TH1F(Form("fDPhiEventAxis%s",
+                                              labels[i].Data()),
+                                         Form("fDPhiEventAxis%s",
+                                              labels[i].Data()) ,  
+                                         180, -0.5*TMath::Pi(), 1.5*TMath::Pi());
+    
     for(Int_t j=0;j<150;j++){
       fDPhiEventAxisNchBin[i][j]          = new TH1F(Form("fDPhiEventAxisNchBin%s%02d",
                                                          labels[i].Data(),j),
                                                     Form("fDPhiEventAxisNchBin%s%02d",
                                                          labels[i].Data(),j) ,  
-                                                    180, 0., TMath::Pi());
+                                                    180, -0.5*TMath::Pi(), 1.5*TMath::Pi());
       fDPhiEventAxisNchBinTrig[i][j]          = new TH1F(Form("fDPhiEventAxisNchBinTrig%s%02d",
                                                              labels[i].Data(),j),
                                                         Form("fDPhiEventAxisNchBinTrig%s%02d",
                                                              labels[i].Data(),j) ,  
-                                                        180, 0., TMath::Pi());
+                                                         180, -0.5*TMath::Pi(), 1.5*TMath::Pi());
       
       fDPhiEventAxisTrackletBin[i][j]     = new TH1F(Form("fDPhiEventAxisTrackletBin%s%02d",
                                                          labels[i].Data(),j),
                                                     Form("fDPhiEventAxisTrackletBin%s%02d",
                                                          labels[i].Data(),j) ,  
-                                                    180, 0., TMath::Pi());
+                                                    180, -0.5*TMath::Pi(), 1.5*TMath::Pi());
+
       fDPhiEventAxisTrackletBinTrig[i][j]     = new TH1F(Form("fDPhiEventAxisTrackletBinTrig%s%02d",
                                                              labels[i].Data(),j),
                                                         Form("fDPhiEventAxisTrackletBinTrig%s%02d",
                                                              labels[i].Data(),j) ,  
-                                                        180, 0., TMath::Pi());
+                                                        180, -0.5*TMath::Pi(), 1.5*TMath::Pi());
     }
   }
 
@@ -221,7 +251,11 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
   fHists->SetOwner();
 
   fHists->Add(fHistPt);
-  if(fUseMC)fHists->Add(fHistPtMC); 
+  if(fUseMC){
+    fHists->Add(fHistPtMC); 
+    fHists->Add(fNmcNch); 
+    fHists->Add(pNmcNch); 
+  }
   fHists->Add(fChargedPi0);
 
   //for(Int_t i=2*fMode+fMcOnly;i<1+2*fMode+fUseMC;i++){
@@ -230,6 +264,8 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
     fHists->Add(fPt[i]);
     fHists->Add(fEta[i]);
     fHists->Add(fPhi[i]);
+    fHists->Add(fDcaXY[i]);
+    fHists->Add(fDcaZ[i]);
     fHists->Add(fPtSeed[i]);
     fHists->Add(fEtaSeed[i]);
     fHists->Add(fPhiSeed[i]);
@@ -240,12 +276,14 @@ void AliAnalysisTaskMinijet::UserCreateOutputObjects()
     fHists->Add(fPhiEta[i]);
     fHists->Add(fDPhiDEtaEventAxis[i]);
     fHists->Add(fTriggerNch[i]);
+    fHists->Add(fTriggerNchSeeds[i]);
     fHists->Add(fTriggerTracklet[i]);
     fHists->Add(fNch07Nch[i]);
     fHists->Add(pNch07Nch[i]);
     fHists->Add(fNch07Tracklet[i]);
     fHists->Add(fNchTracklet[i]);
     fHists->Add(pNch07Tracklet[i]);
+    fHists->Add(fDPhiEventAxis[i]);
     for(Int_t j=0;j<150;j++){
       fHists->Add(fDPhiEventAxisNchBin[i][j]);
       fHists->Add(fDPhiEventAxisNchBinTrig[i][j]);
@@ -264,6 +302,8 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
   // Main loop
   // Called for each event
 
+  //Printf("Event starts");
+
   AliVEvent *event = InputEvent();
   if (!event) {
     Error("UserExec", "Could not retrieve event");
@@ -279,6 +319,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
   Float_t *pt  = 0;
   Float_t *eta = 0;
   Float_t *phi = 0;
+  Short_t *charge=0; 
   //number of accepted tracks and tracklets
   Int_t ntracks = 0;  //return value for reading functions for ESD and AOD
   Int_t *nTracksTracklets = 0; // [0]=nAccepted,1=ntracklets,2=nall(also neutral in case of mc, 
@@ -288,58 +329,62 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
   //read data and analyse. Implemented for ESD, ESDmc, AOD, AODmc
   //-------------------------------------------------------------
   if (fESDEvent && fMode==0) {//ESDs
+    //ESD MC reading and analysis
+    //------
+    if (fUseMC){
+      ntracks = LoopESDMC(&pt, &eta, &phi, &charge, &nTracksTracklets); //read mc particles
+      if(ntracks>0){
+       Analyse(pt, eta, phi, charge, ntracks, nTracksTracklets[1], nTracksTracklets[2], 1);//analyse
+      }
+      if(pt || eta || phi || charge || nTracksTracklets)
+       CleanArrays(pt, eta, phi, charge, nTracksTracklets);// clean up array memory
+    }
+    //------
+    
     //ESD reading and analysis
     //------
     if(!fMcOnly){
-      ntracks = LoopESD(&pt, &eta, &phi, &nTracksTracklets); //read tracks
+      ntracks = LoopESD(&pt, &eta, &phi,&charge,  &nTracksTracklets); //read tracks
       if(ntracks>0){
        if(fDebug){
          Printf("ntracks=%d", nTracksTracklets[0]);
          Printf("ntracklets=%d", nTracksTracklets[1]);
        }
-       Analyse(pt, eta, phi, ntracks, nTracksTracklets[1], nTracksTracklets[2], 0); //analyse tracks
+       Analyse(pt, eta, phi, charge, ntracks, nTracksTracklets[1], nTracksTracklets[2], 0); //analyse tracks
       }
-      CleanArrays(pt, eta, phi, nTracksTracklets); // clean up array memory
+      if(pt || eta || phi || charge || nTracksTracklets)
+       CleanArrays(pt, eta, phi, charge, nTracksTracklets); // clean up array memory
     }
     //------
+  }
+  
+  if (fAODEvent && fMode==1) {//AODs
 
-    //ESD MC reading and analysis
+    //AOD MCreading and analysis
     //------
     if (fUseMC){
-      ntracks = LoopESDMC(&pt, &eta, &phi, &nTracksTracklets); //read mc particles
+      ntracks = LoopAODMC(&pt, &eta, &phi, &charge, &nTracksTracklets);//read tracks
       if(ntracks>0){
-       Analyse(pt, eta, phi, ntracks, nTracksTracklets[1], nTracksTracklets[2], 1);//analyse
+       Analyse(pt, eta, phi, charge, ntracks, nTracksTracklets[1],nTracksTracklets[2], 3);//analyse
       }
-      CleanArrays(pt, eta, phi, nTracksTracklets);// clean up array memory
+      if(pt || eta || phi || charge || nTracksTracklets)
+       CleanArrays(pt, eta, phi, charge, nTracksTracklets);// clean up array memory
     }
     //------
-  }
-  
-  if (fAODEvent && fMode==1) {//AODs
-
+    
     //AOD reading and analysis
-    //   //------
+    //------
     if(!fMcOnly){
-      ntracks = LoopAOD(&pt, &eta, &phi, &nTracksTracklets);//read tracks
+      ntracks = LoopAOD(&pt, &eta, &phi, &charge, &nTracksTracklets);//read tracks
       if(ntracks>0){
        if(fDebug){
          Printf("ntracks=%d", nTracksTracklets[0]);
          Printf("ntracklets=%d", nTracksTracklets[1]);
        }
-       Analyse(pt, eta, phi, ntracks, nTracksTracklets[1], nTracksTracklets[2], 2);//analyse
-      }
-      CleanArrays(pt, eta, phi, nTracksTracklets);// clean up array memory
-    }
-        //------
-    
-    //AOD MCreading and analysis
-    //------
-    if (fUseMC){
-      ntracks = LoopAODMC(&pt, &eta, &phi, &nTracksTracklets);//read tracks
-      if(ntracks>0){
-       Analyse(pt, eta, phi, ntracks, nTracksTracklets[1],nTracksTracklets[2], 3);//analyse
+       Analyse(pt, eta, phi, charge, ntracks, nTracksTracklets[1], nTracksTracklets[2], 2);//analyse
       }
-      CleanArrays(pt, eta, phi, nTracksTracklets);// clean up array memory
+      if(pt || eta || phi || charge || nTracksTracklets)
+       CleanArrays(pt, eta, phi, charge, nTracksTracklets);// clean up array memory
     }
     //------
   }
@@ -354,62 +399,142 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
 
 //________________________________________________________________________
 Int_t AliAnalysisTaskMinijet::LoopESD(Float_t **ptArray, Float_t ** etaArray, 
-                                     Float_t ** phiArray, Int_t **nTracksTracklets )
+                                     Float_t ** phiArray, Short_t ** chargeArray, 
+                                     Int_t **nTracksTracklets )
 {
   // gives back the number of esd tracks and pointer to arrays with track
   // properties (pt, eta, phi)
+  // Uses TPC tracks with SPD vertex from now on
   
   // Retreive the number of all tracks for this event.
   Int_t ntracks = fESDEvent->GetNumberOfTracks();
   if(fDebug)Printf("all ESD tracks: %d", ntracks);
 
+  const AliESDVertex *vtxSPD = fESDEvent->GetPrimaryVertexSPD();
 
   //first loop to check how many tracks are accepted
   //------------------
   Int_t nAcceptedTracks=0;
   for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
-    AliESDtrack *track = (AliESDtrack *)fESDEvent->GetTrack(iTracks);
-    if (!track) {
+   AliESDtrack *esdTrack = (AliESDtrack *)fESDEvent->GetTrack(iTracks);
+    if (!esdTrack) {
       Error("UserExec", "Could not receive track %d", iTracks);
       continue;
     }
-    if (fCuts->AcceptTrack(track) && TMath::Abs(track->Eta())<fEtaCut) ++nAcceptedTracks;
+    //if(!fCuts->AcceptTrack(esdTrack)) continue;
+
+
+    // use TPC only tracks with non default SPD vertex
+    AliESDtrack *track = AliESDtrackCuts::
+      GetTPCOnlyTrack(dynamic_cast<AliESDEvent*>(fESDEvent),esdTrack->GetID());
+    if(!track) continue;
+    if(!fCuts->AcceptTrack(track)) continue;// apply TPC track cuts before constrain to SPD vertex
+    if(track->Pt()>0.){
+      // only constrain tracks above threshold
+      AliExternalTrackParam exParam;
+      // take the B-field from the ESD, no 3D fieldMap available at this point
+      Bool_t relate = false;
+      relate = track->RelateToVertexTPC(vtxSPD,fESDEvent->GetMagneticField(),
+                                       kVeryBig,&exParam);
+      if(!relate){
+       delete track;
+       continue;
+      }
+      track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),
+                exParam.GetCovariance());
+    }
+    else continue;// only if tracks have pt<=0
+    
+
+    if (TMath::Abs(track->Eta())<fEtaCut && track->Pt()>0.2 && track->Pt()<200.) 
+      ++nAcceptedTracks;
+    
+    // TPC only track memory needs to be cleaned up
+    if(track)
+      delete track;
+
   }
-  //------------------
-  
+
+
   //generate arrays
   *ptArray = new Float_t[nAcceptedTracks]; 
   *etaArray = new Float_t[nAcceptedTracks]; 
   *phiArray = new Float_t[nAcceptedTracks]; 
+  *chargeArray = new Short_t[nAcceptedTracks]; 
   *nTracksTracklets = new Int_t[3]; //ntracksAccepted, ntracklets
 
   //check if event is pile up or no tracks are accepted, return to user exec
-  // if(fESDEvent->IsPileupFromSPD(3,0,8)) return 0;  
+  if(fESDEvent->IsPileupFromSPD(3,0,8)) return 0;  
   if(nAcceptedTracks==0) return 0;
 
   //accept event only, if vertex is good and is within fVertexZcut region
-  const AliESDVertex*  vertexESD   = fESDEvent->GetPrimaryVertex();
-  if(vertexESD->GetNContributors()==0)return 0;
+  const AliESDVertex*  vertexESD   = fESDEvent->GetPrimaryVertex(); // uses track or SPD vertexer
+
+  if(!vertexESD) return 0;
+  if(vertexESD->GetNContributors()<=0)return 0;
   Float_t fVz= vertexESD->GetZ();
   if(TMath::Abs(fVz)>fVertexZCut) return 0;
   fVertexZ[0]->Fill(fVz);
-  
-  
+
+  //variables for DCA QA check per track
+  Float_t fXY = 0.;
+  Float_t  fZ = 0.;
+
   // Track loop
   Int_t iAcceptedTrack=0;
   for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
-    AliESDtrack *track = (AliESDtrack *)fESDEvent->GetTrack(iTracks);
-    if (!track) {
+    AliESDtrack *esdTrack = (AliESDtrack *)fESDEvent->GetTrack(iTracks);
+    if (!esdTrack) {
       Error("UserExec", "Could not receive track %d", iTracks);
       continue;
     }
-    if (fCuts->AcceptTrack(track) && TMath::Abs(track->Eta())<fEtaCut){
+    //if(!fCuts->AcceptTrack(esdTrack)) continue;
+
+    // create a tpc only track with SPD vertex
+    AliESDtrack *track = AliESDtrackCuts::
+      GetTPCOnlyTrack(dynamic_cast<AliESDEvent*>(fESDEvent),esdTrack->GetID());
+    if(!track) continue;
+    if(!fCuts->AcceptTrack(track)) continue; // apply TPC track cuts before constrain to SPD vertex
+
+    if(track->Pt()>0.){
+      // only constrain tracks above threshold
+      AliExternalTrackParam exParam;
+      // take the B-field from the ESD, no 3D fieldMap available at this point
+      Bool_t relate = false;
+      relate = track->RelateToVertexTPC(vtxSPD,fESDEvent->GetMagneticField(),
+                                       kVeryBig,&exParam);
+      if(!relate){
+       delete track;
+       continue;
+      }
+      track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),
+                exParam.GetCovariance());
+    }
+    else continue;
+    
+    
+    if (TMath::Abs(track->Eta())<fEtaCut && track->Pt()>0.2 && track->Pt()<200.){
       (*ptArray)[iAcceptedTrack]  = track->Pt();
       (*etaArray)[iAcceptedTrack] = track->Eta();
-      (*phiArray)[iAcceptedTrack++] = track->Phi();
+      (*phiArray)[iAcceptedTrack] = track->Phi();
+      (*chargeArray)[iAcceptedTrack++] = track->Charge();
       fHistPt->Fill(track->Pt());
+
+      fXY = 0.;
+      fZ = 0.;
+      track->GetImpactParameters(fXY,fZ);
+      fDcaXY[0]->Fill(fXY);
+      fDcaZ[0]->Fill(fZ);
+
     }
+    
+    // TPC only track memory needs to be cleaned up
+    if(track)
+      delete track;
+
   }
+  
 
 
   //tracklet loop
@@ -427,13 +552,24 @@ Int_t AliAnalysisTaskMinijet::LoopESD(Float_t **ptArray, Float_t ** etaArray,
   (*nTracksTracklets)[2] = nAcceptedTracks;//in order to be compatible with mc analysis 
                                            //where here also neutral particles are counted.
 
-  return nAcceptedTracks;
 
+  if(fUseMC){
+    //Printf("Number of MC particles from ESDMC = %d",fNMcPrimAccept);
+    //Printf("Number of tracks from ESD = %d",nAcceptedTracks);
+    fNmcNch->Fill(fNMcPrimAccept,nAcceptedTracks);
+    pNmcNch->Fill(fNMcPrimAccept,nAcceptedTracks);
+    return fNMcPrimAccept; // also possible to use reconstructed Nch ->  return nAcceptedTracks;
+  }
+  else{
+    fVzEvent=fVz; // needed for correction maps
+    return nAcceptedTracks;
+  }
 }   
 
 //________________________________________________________________________
 Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray, 
-                                       Float_t ** phiArray, Int_t ** nTracksTracklets)
+                                       Float_t ** phiArray, Short_t ** chargeArray,
+                                       Int_t ** nTracksTracklets)
 {
   // gives back the number of charged prim MC particle and pointer to arrays 
   // with particle properties (pt, eta, phi)
@@ -446,8 +582,8 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
     return 0;
   }
 
-  AliStack* stack = 0x0;
-  if(fUseMC) stack = MCEvent()->Stack();
+  AliStack* stack = MCEvent()->Stack();
+  if(!stack) return 0;
   
   Int_t ntracks = mcEvent->GetNumberOfTracks();
   if(fDebug)Printf("MC particles: %d", ntracks);
@@ -503,11 +639,13 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
     *ptArray = new Float_t[nAllPrimaries]; 
     *etaArray = new Float_t[nAllPrimaries]; 
     *phiArray = new Float_t[nAllPrimaries]; 
+    *chargeArray = new Short_t[nAllPrimaries]; 
   }
   else{
     *ptArray = new Float_t[nAllPrimaries-nChargedPrimaries]; 
     *etaArray = new Float_t[nAllPrimaries-nChargedPrimaries]; 
     *phiArray = new Float_t[nAllPrimaries-nChargedPrimaries]; 
+    *chargeArray = new Short_t[nAllPrimaries-nChargedPrimaries]; 
   }
 
   *nTracksTracklets = new Int_t[3];
@@ -520,6 +658,7 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
   AliGenEventHeader*  header = MCEvent()->GenEventHeader();
   TArrayF mcV;
   header->PrimaryVertex(mcV);
+  if(TMath::Abs(mcV[0])<1e-8 && TMath::Abs(mcV[0])<1e-8 && TMath::Abs(mcV[0])<1e-8) return 0;
   Float_t vzMC = mcV[2];
   if(TMath::Abs(vzMC)>fVertexZCut) return 0;
   fVertexZ[1]->Fill(vzMC);
@@ -544,7 +683,8 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
 
     
     //same cuts as on ESDtracks
-    if(TMath::Abs(track->Eta())>fEtaCut || track->Pt()<0.2 || track->Pt()>200) continue;
+    if(TMath::Abs(track->Eta())>fEtaCut || track->Pt()<0.2 
+       || track->Pt()>200) continue;
    
     // Printf("After: PDG=%d, IsPrim=%d",  track->PdgCode(),stack->IsPhysicalPrimary(track->Label()) );
 
@@ -553,7 +693,8 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
     //fills arrays with track properties
     (*ptArray)[iChargedPiK]  = track->Pt(); 
     (*etaArray)[iChargedPiK] = track->Eta();
-    (*phiArray)[iChargedPiK++] = track->Phi();
+    (*phiArray)[iChargedPiK] = track->Phi();
+    (*chargeArray)[iChargedPiK++] = track->Charge();
 
   } //track loop
 
@@ -565,13 +706,17 @@ Int_t AliAnalysisTaskMinijet::LoopESDMC(Float_t **ptArray, Float_t ** etaArray,
   else{
     (*nTracksTracklets)[2] = nAllPrimaries-nChargedPrimaries; // only neutral
   }
+
+  // Printf("Number of MC particles = %d",nChargedPrimaries);
+  fNMcPrimAccept=nChargedPrimaries;
   return nChargedPrimaries;
   
 }
 
 //________________________________________________________________________
 Int_t AliAnalysisTaskMinijet::LoopAOD(Float_t **ptArray, Float_t ** etaArray, 
-                                     Float_t ** phiArray, Int_t ** nTracksTracklets)
+                                     Float_t ** phiArray, Short_t ** chargeArray,
+                                     Int_t ** nTracksTracklets)
 {
   // gives back the number of AOD tracks and pointer to arrays with track 
   // properties (pt, eta, phi)
@@ -589,12 +734,15 @@ Int_t AliAnalysisTaskMinijet::LoopAOD(Float_t **ptArray, Float_t ** etaArray,
       Error("UserExec", "Could not receive track %d", iTracks);
       continue;
     }
-    if(track->TestFilterBit(16) && TMath::Abs(track->Eta())<fEtaCut) nAcceptedTracks++;
+    // filter bit needs to be ajusted to TPC only tracks with SPD vertex as soon as AOD are available (so far ESD track cuts ITS TPC 2010)
+    if(track->TestFilterBit(16) && TMath::Abs(track->Eta())<fEtaCut  
+       && track->Pt()>0.2 && track->Pt()<200.) nAcceptedTracks++;
   }
   
   *ptArray = new Float_t[nAcceptedTracks];
   *etaArray = new Float_t[nAcceptedTracks]; 
   *phiArray = new Float_t[nAcceptedTracks]; 
+  *chargeArray = new Short_t[nAcceptedTracks]; 
   *nTracksTracklets = new Int_t[3]; //here, third entry only copy of first (compatibility for MC)
 
  
@@ -607,7 +755,7 @@ Int_t AliAnalysisTaskMinijet::LoopAOD(Float_t **ptArray, Float_t ** etaArray,
 
   if(!vertex) return 0;
   Double_t vzAOD=vertex->GetZ();
-  //if(vertex->GetNContributors()==0) return 0;
+  if(vertex->GetNContributors()<=0) return 0;
   if(TMath::Abs(vzAOD)<1e-9) return 0;
 
   if(TMath::Abs(vzAOD)>fVertexZCut) return 0;
@@ -621,13 +769,15 @@ Int_t AliAnalysisTaskMinijet::LoopAOD(Float_t **ptArray, Float_t ** etaArray,
       Error("UserExec", "Could not receive track %d", iTracks);
       continue;
     }
-    if(!track->TestFilterBit(16) || TMath::Abs(track->Eta())>fEtaCut) continue;
+    if(!track->TestFilterBit(16) || TMath::Abs(track->Eta())>fEtaCut
+       || track->Pt()<0.2 || track->Pt()>200.) continue;
     fHistPt->Fill(track->Pt());
 
     //fills arrays with track properties
     (*ptArray)[iAcceptedTracks]  = track->Pt();
     (*etaArray)[iAcceptedTracks] = track->Eta();
-    (*phiArray)[iAcceptedTracks++] = track->Phi();
+    (*phiArray)[iAcceptedTracks] = track->Phi();
+    (*chargeArray)[iAcceptedTracks++] = track->Charge();
 
   } //track loop 
 
@@ -644,13 +794,19 @@ Int_t AliAnalysisTaskMinijet::LoopAOD(Float_t **ptArray, Float_t ** etaArray,
   (*nTracksTracklets)[1] = ntrackletsAccept;
   (*nTracksTracklets)[2] = nAcceptedTracks;
   
-  return nAcceptedTracks;
+  if(fUseMC){
+    fNmcNch->Fill(fNMcPrimAccept,nAcceptedTracks);
+    return fNMcPrimAccept;
+  }
+  else 
+    return nAcceptedTracks;
 
 }   
 
 //________________________________________________________________________
 Int_t AliAnalysisTaskMinijet::LoopAODMC(Float_t **ptArray, Float_t ** etaArray, 
-                                       Float_t ** phiArray, Int_t ** nTracksTracklets)
+                                       Float_t ** phiArray, Short_t ** chargeArray,
+                                       Int_t ** nTracksTracklets)
 {
   // gives back the number of AOD MC particles and pointer to arrays with particle 
   // properties (pt, eta, phi)
@@ -692,7 +848,7 @@ Int_t AliAnalysisTaskMinijet::LoopAODMC(Float_t **ptArray, Float_t ** etaArray,
     // if(TMath::Abs(track->Eta())<1e-9 && TMath::Abs(track->Phi())<1e-9)continue;
 
     //same cuts as in ESD filter
-    if(!track->TestBit(16))continue; //cuts set in ESD filter during AOD generation
+    //if(!track->TestBit(16))continue; //cuts set in ESD filter during AOD generation
 
     nAllPrim++;
     if(track->Charge()!=0) nChargedPrim++;
@@ -711,18 +867,20 @@ Int_t AliAnalysisTaskMinijet::LoopAODMC(Float_t **ptArray, Float_t ** etaArray,
     *ptArray = new Float_t[nAllPrim]; 
     *etaArray = new Float_t[nAllPrim]; 
     *phiArray = new Float_t[nAllPrim]; 
+    *chargeArray = new Short_t[nAllPrim]; 
   }
   else{
     *ptArray = new Float_t[nAllPrim-nChargedPrim]; 
     *etaArray = new Float_t[nAllPrim-nChargedPrim]; 
     *phiArray = new Float_t[nAllPrim-nChargedPrim]; 
+    *chargeArray = new Short_t[nAllPrim-nChargedPrim]; 
   }
 
 
   *nTracksTracklets = new Int_t[3]; 
   
-  Printf("nAllPrim=%d", nAllPrim);
-  Printf("nChargedPrim=%d", nChargedPrim);
+  //Printf("nAllPrim=%d", nAllPrim);
+  //Printf("nChargedPrim=%d", nChargedPrim);
 
   if(nAllPrim==0) return 0;
   if(nChargedPrim==0) return 0;
@@ -754,14 +912,15 @@ Int_t AliAnalysisTaskMinijet::LoopAODMC(Float_t **ptArray, Float_t ** etaArray,
     //if(TMath::Abs(track->Eta())<1e-8 && TMath::Abs(track->Phi())<1e-8)continue;
 
     //Printf("eta=%f,phi=%f,pt=%f",track->Eta(),track->Phi(),track->Pt());
-    Printf("prim=%d,pdg=%d,charge=%d",track->IsPhysicalPrimary(),track->PdgCode(),track->Charge());
+    //Printf("prim=%d,pdg=%d,charge=%d",track->IsPhysicalPrimary(),track->PdgCode(),track->Charge());
 
     //if(track->TestBit(16))continue;
     
     fHistPtMC->Fill(track->Pt());
     (*ptArray)[iChargedPrim]  = track->Pt();
     (*etaArray)[iChargedPrim] = track->Eta();
-    (*phiArray)[iChargedPrim++] = track->Phi();
+    (*phiArray)[iChargedPrim] = track->Phi();
+    (*chargeArray)[iChargedPrim++] = track->Charge();
     
   }
 
@@ -774,14 +933,15 @@ Int_t AliAnalysisTaskMinijet::LoopAODMC(Float_t **ptArray, Float_t ** etaArray,
     (*nTracksTracklets)[2] = nAllPrim-nChargedPrim; // only neutral
   }
   
-  
+  fNMcPrimAccept=nChargedPrim;
   return nChargedPrim;
   //  Printf("ntracks=%d", nChargedPrim);
 
 } 
 
 //________________________________________________________________________
-void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, Int_t ntracksCharged, 
+void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, 
+                                    Short_t *charge,Int_t ntracksCharged, 
                                     Int_t ntracklets, Int_t nAll, Int_t mode)
 {
 
@@ -813,10 +973,11 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
     fEta[mode]   -> Fill(eta[i]);
     fPhi[mode]   -> Fill(phi[i]);
     fPhiEta[mode]-> Fill(phi[i], eta[i]);
-    
+
     pindexInnerEta[i]=0; //set all values to zero
     //fill new array for eta check
     ptInnerEta[i]= pt[i];
+
     
   }
    
@@ -824,17 +985,21 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
   // ---------------------------------------
   Int_t highPtTracks=0;
   Int_t highPtTracksInnerEta=0;
-
+  Int_t mult09=0;
 
   //count high pt tracks and high pt tracks in acceptance for seeds
   for(Int_t i=0;i<nAll;i++){
 
+    if(TMath::Abs(eta[i])<0.9){
+      mult09++;
+    }
+
     if(pt[i]>fTriggerPtCut) {
       highPtTracks++;
     }
 
     // seed should be place in middle of acceptance, that complete cone is in acceptance
-    if(pt[i]>fTriggerPtCut && TMath::Abs(eta[i])<fEtaCutSeed){
+    if(pt[i]>fTriggerPtCut && TMath::Abs(eta[i])<fEtaCutSeed && charge[i]!=0){
       
       // Printf("eta=%f", eta[i]);
       highPtTracksInnerEta++;
@@ -851,12 +1016,12 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
 
 
   //  plot of multiplicity distributions
-  fNch07Nch[mode]->Fill(ntracksCharged, highPtTracks);     
-  pNch07Nch[mode]->Fill(ntracksCharged, highPtTracks);     
+  fNch07Nch[mode]->Fill(ntracksCharged, highPtTracksInnerEta);     
+  pNch07Nch[mode]->Fill(ntracksCharged, highPtTracksInnerEta);     
   if(ntracklets){
-    fNch07Tracklet[mode]->Fill(ntracklets, highPtTracks);     
-    fNchTracklet[mode]->Fill(ntracklets, ntracksCharged);     
-    pNch07Tracklet[mode]->Fill(ntracklets, highPtTracks);     
+    fNch07Tracklet[mode]->Fill(ntracklets, highPtTracksInnerEta);//only counts tracks which can be used as seeds
+    fNchTracklet[mode]->Fill(ntracklets, ntracksCharged);      
+    pNch07Tracklet[mode]->Fill(ntracklets, highPtTracksInnerEta);//only counts tracks which can be used as seeds
   }
  
   //analysis can only be performed with event axis, defined by high pt track
@@ -868,18 +1033,23 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
     //check setter of event axis 
     //default option: random=1, 
     //second option:leading=0
-    Int_t axis=-1;
-    if(fLeadingOrRandom==0)axis=0;
-    else if (fLeadingOrRandom==1)axis= Int_t((highPtTracksInnerEta)*gRandom->Rndm());
-    else Printf("Wrong settings for event axis.");
-
-    if(fDebug){
-      Printf("Axis tracks has pT=%f, test=%f", ptInnerEta[pindexInnerEta[axis]], pt[pindexInnerEta[axis]]);
-      Printf("Axis tracks has eta=%f", eta[pindexInnerEta[axis]]);
-    }
 
+    //  Int_t axis=-1;
+    //     if(fLeadingOrRandom==0)axis=0;
+    //     else if (fLeadingOrRandom==1)axis= Int_t((highPtTracksInnerEta)*gRandom->Rndm());
+    //     else Printf("Wrong settings for event axis.");
+    
+    //     if(fDebug){
+    //       Printf("Axis tracks has pT=%f, test=%f", ptInnerEta[pindexInnerEta[axis]], pt[pindexInnerEta[axis]]);
+    //       Printf("Axis tracks has eta=%f", eta[pindexInnerEta[axis]]);
+    //     }
+    
     //---------------------------------------
+    //Printf("Number of seeds = %d",highPtTracksInnerEta);
+
 
+    // loop over all possible trigger particles (defined by pt_trig and eta_acceptance)
+    for(Int_t axis=0;axis<highPtTracksInnerEta; axis++){
 
     if(ntracksCharged>1){ // require at least two tracks (leading and prob. accosicates)
       
@@ -893,17 +1063,28 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
 
       //track loop for event propoerties around event axis with pt>triggerPtCut
       //loop only over already accepted tracks except event axis 
+      //   if(ptEventAxis>fTriggerPtCut && ptEventAxis < 0.8){
       if(ptEventAxis>fTriggerPtCut){
 
        for (Int_t iTrack = 0; iTrack < nAll; iTrack++) {
          
          if(pindexInnerEta[axis]==iTrack)continue; // no double counting
+
+         if(fSelectParticlesAssoc==1){
+           if(charge[iTrack]==0)continue;
+         }
+         if(fSelectParticlesAssoc==2){
+           if(charge[iTrack]!=0)continue;
+         }
+         // Printf("Charge=%d", charge[iTrack]);
          
+
          ptOthers   = pt [iTrack];
          etaOthers  = eta[iTrack];
          phiOthers  = phi[iTrack];
 
-         //if(ptOthers>fAssociatePtCut && ptOthers<fTriggerPtCut){ // only tracks which fullfill associate pt cut
+         
+         //if(ptOthers>0.4 && ptOthers<0.5){ // only tracks which fullfill associate pt cut
          if(ptOthers>fAssociatePtCut){ // only tracks which fullfill associate pt cut
 
            //plot only properties of tracks with pt>ptassoc
@@ -912,41 +1093,46 @@ void AliAnalysisTaskMinijet::Analyse(Float_t *pt, Float_t *eta, Float_t *phi, In
            fPhiOthers[mode]   -> Fill(phiOthers);
            fPtEtaOthers[mode]   -> Fill(ptOthers, etaOthers);
            
-           Float_t dPhi=TMath::Abs(phiOthers-phiEventAxis);
-           if(dPhi>TMath::Pi())      dPhi=2*TMath::Pi()-dPhi;
+           Float_t dPhi = phiOthers-phiEventAxis;
+           if(dPhi>1.5*TMath::Pi()) dPhi = dPhi-2*TMath::Pi();
+           else if(dPhi<-0.5*TMath::Pi())dPhi=dPhi+2*TMath::Pi();
            Float_t dEta=etaOthers-etaEventAxis;
-                   
-           Float_t dphiplot = phiOthers-phiEventAxis;
-           if(dphiplot>2*TMath::Pi()-1) dphiplot = dphiplot-2*TMath::Pi();
-           else if(dphiplot<-1)dphiplot=dphiplot+2*TMath::Pi();
-           fDPhiDEtaEventAxis[mode]->Fill(dphiplot, dEta);
+
+           fDPhiDEtaEventAxis[mode]->Fill(dPhi, dEta);
            
-           if(ntracksCharged<150){
+           fDPhiEventAxis[mode]->Fill(dPhi);
+           if(ntracksCharged<150){ // in case of MC data, ntracksCharged represents Nmcprim for ESD and MC loop
              fDPhiEventAxisNchBin[mode][ntracksCharged]->Fill(dPhi);
-             if(ptOthers>fTriggerPtCut)
+             if(ptOthers>fTriggerPtCut && TMath::Abs(etaOthers)<fEtaCutSeed)
                fDPhiEventAxisNchBinTrig[mode][ntracksCharged]->Fill(dPhi);
            }
 
            if(ntracklets<150){
              fDPhiEventAxisTrackletBin[mode][ntracklets]->Fill(dPhi);
-             if(ptOthers>fTriggerPtCut)
+             if(ptOthers>fTriggerPtCut && TMath::Abs(etaOthers)<fEtaCutSeed )
                fDPhiEventAxisTrackletBinTrig[mode][ntracklets]->Fill(dPhi);
            }
-
+           
          }//tracks fulfill assoc track cut
          
-       }// end track loop
+       }// end of inner track loop
 
 
        // fill histogram with number of tracks (pt>fAssociatePtCut) around event axis
        // how often is there a trigger particle at a certain Nch bin
-       fTriggerNch[mode]->Fill(ntracksCharged); 
-       fTriggerTracklet[mode]->Fill(ntracklets); 
+
 
       }//if track pt is at least trigger pt
 
+    }//loop over all highPtInnerEta tracks
+
+   
     } //if there are more than 1 track
 
+    fTriggerNch[mode]->Fill(ntracksCharged,highPtTracksInnerEta); 
+    fTriggerNchSeeds[mode]->Fill(ntracksCharged,highPtTracksInnerEta); 
+    fTriggerTracklet[mode]->Fill(ntracklets); 
+
   }//if there is at least one high pt track
 
  
@@ -1040,7 +1226,8 @@ Bool_t AliAnalysisTaskMinijet::SelectParticle(Short_t charge, Int_t pdg, Bool_t
 }
 
 //________________________________________________________________________
-void AliAnalysisTaskMinijet::CleanArrays(Float_t* pt, Float_t* eta, Float_t* phi,Int_t* nTracksTracklets)
+void AliAnalysisTaskMinijet::CleanArrays(Float_t* pt, Float_t* eta, Float_t* phi, 
+                                        Short_t * charge, Int_t* nTracksTracklets)
 {
   //clean up of memory used for arrays of track properties
 
@@ -1056,6 +1243,10 @@ void AliAnalysisTaskMinijet::CleanArrays(Float_t* pt, Float_t* eta, Float_t* phi
     delete[] phi; 
     phi=0; 
   }
+  if(charge){
+    delete[] charge; 
+    charge=0; 
+  }
   if(nTracksTracklets){
     delete[] nTracksTracklets; 
     nTracksTracklets=0; 
index 5118032..df8af3b 100644 (file)
@@ -23,12 +23,12 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
   virtual void   UserExec(Option_t* option);\r
   virtual void   Terminate(Option_t *);\r
   \r
-  Int_t LoopESD  (Float_t **pt, Float_t **eta, Float_t **phi, Int_t **nTracksTracklets);\r
-  Int_t LoopESDMC(Float_t **pt, Float_t **eta, Float_t **phi, Int_t **nTracksTracklets);\r
-  Int_t LoopAOD  (Float_t **pt, Float_t **eta, Float_t **phi, Int_t **nTracksTracklets);\r
-  Int_t LoopAODMC(Float_t **pt, Float_t **eta, Float_t **phi, Int_t **nTracksTracklets);\r
-  void  Analyse  (Float_t* pt, Float_t* eta, Float_t* phi, Int_t ntacks, Int_t ntacklets=0,Int_t nAll=0, Int_t mode=0);\r
-  void  CleanArrays(Float_t* pt, Float_t* eta, Float_t* phi, Int_t* nTracksTracklets=0);\r
+  Int_t LoopESD  (Float_t **pt, Float_t **eta, Float_t **phi, Short_t **charge, Int_t **nTracksTracklets);\r
+  Int_t LoopESDMC(Float_t **pt, Float_t **eta, Float_t **phi, Short_t **charge,  Int_t **nTracksTracklets);\r
+  Int_t LoopAOD  (Float_t **pt, Float_t **eta, Float_t **phi, Short_t **charge,  Int_t **nTracksTracklets);\r
+  Int_t LoopAODMC(Float_t **pt, Float_t **eta, Float_t **phi, Short_t **charge,  Int_t **nTracksTracklets);\r
+  void  Analyse  (Float_t* pt, Float_t* eta, Float_t* phi,  Short_t *charge, Int_t ntacks, Int_t ntacklets=0,Int_t nAll=0, Int_t mode=0);\r
+  void  CleanArrays(Float_t* pt, Float_t* eta, Float_t* phi,  Short_t *charge, Int_t* nTracksTracklets=0);\r
   Bool_t SelectParticlePlusCharged(Short_t charge, Int_t pdg, Bool_t prim);\r
   Bool_t SelectParticle(Short_t charge, Int_t pdg, Bool_t prim);\r
 \r
@@ -37,16 +37,17 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
 \r
   virtual void   SetCuts(AliESDtrackCuts* cuts)           {fCuts = cuts;}\r
 \r
-  void   SetRadiusCut(Float_t radiusCut)           {fRadiusCut = radiusCut;}  \r
-  void   SetTriggerPtCut(Float_t triggerPtCut)     {fTriggerPtCut = triggerPtCut;}  \r
-  void   SetAssociatePtCut(Float_t associatePtCut) {fAssociatePtCut = associatePtCut;} \r
-  void   SetEventAxis(Int_t leadingOrRandom)       {fLeadingOrRandom = leadingOrRandom;}  \r
-  void   SetMode(Int_t mode)                       {fMode = mode;}\r
-  void   SetMaxVertexZ(Float_t vertexZCut)         {fVertexZCut = vertexZCut;}\r
-  void   SetMaxEta(Float_t etaCut)                 {fEtaCut = etaCut;}\r
-  void   SetMaxEtaSeed(Float_t etaCutSeed)         {fEtaCutSeed = etaCutSeed;}\r
+  void   SetRadiusCut(Float_t radiusCut)                  {fRadiusCut = radiusCut;}  \r
+  void   SetTriggerPtCut(Float_t triggerPtCut)            {fTriggerPtCut = triggerPtCut;}  \r
+  void   SetAssociatePtCut(Float_t associatePtCut)        {fAssociatePtCut = associatePtCut;} \r
+  void   SetEventAxis(Int_t leadingOrRandom)              {fLeadingOrRandom = leadingOrRandom;}  \r
+  void   SetMode(Int_t mode)                              {fMode = mode;}\r
+  void   SetMaxVertexZ(Float_t vertexZCut)                {fVertexZCut = vertexZCut;}\r
+  void   SetMaxEta(Float_t etaCut)                        {fEtaCut = etaCut;}\r
+  void   SetMaxEtaSeed(Float_t etaCutSeed)                {fEtaCutSeed = etaCutSeed;}\r
 \r
-  void   SelectParticles(Int_t selectParticles)    {fSelectParticles = selectParticles;}\r
+  void   SelectParticles(Int_t selectParticles)           {fSelectParticles = selectParticles;}\r
+  void   SelectParticlesAssoc(Int_t selectParticlesAssoc) {fSelectParticlesAssoc = selectParticlesAssoc;}\r
 \r
 \r
  private:\r
@@ -63,19 +64,26 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
   Float_t      fEtaCut;                     // eta acceptance cut\r
   Float_t      fEtaCutSeed;                 // eta acceptance cut for seed\r
   Int_t        fSelectParticles;            // only in cas of MC: use also neutral particles or not \r
+  Int_t        fSelectParticlesAssoc;       // only in cas of MC: use also neutral particles or not \r
 \r
   AliESDEvent *fESDEvent;                   //! esd event\r
   AliAODEvent *fAODEvent;                   //! aod event\r
+  Int_t        fNMcPrimAccept;              // global variable for mc multiplucity\r
+  Float_t      fVzEvent;                    // global variable for rec vertex position\r
   \r
-  TList              *fHists;                      // output list\r
-  TH1F        *fHistPt;                     // Pt spectrum ESD\r
-  TH1F        *fHistPtMC;                   // Pt spectrum MC\r
-  TH2F        *fChargedPi0;                 // charged versus charged+Pi0\r
+  TList             *fHists;                      // output list\r
+  TH1F       *fHistPt;                     // Pt spectrum ESD\r
+  TH1F       *fHistPtMC;                   // Pt spectrum MC\r
+  TH2F       *fNmcNch;                     // N mc - N ch rec\r
+  TProfile   *pNmcNch;                     // N mc - N ch rec\r
+  TH2F       *fChargedPi0;                 // charged versus charged+Pi0\r
   TH1F       * fVertexZ[4];                 // z of vertex\r
 \r
   TH1F       * fPt[4];                      // pt\r
   TH1F       * fEta[4];                     // et\r
   TH1F       * fPhi[4];                     // phi\r
+  TH1F       * fDcaXY[4];                   // dca xy direction\r
+  TH1F       * fDcaZ[4];                    // dca z direction\r
 \r
   TH1F       * fPtSeed[4];                  // pt of seed (event axis)\r
   TH1F       * fEtaSeed[4];                 // eta of seed \r
@@ -89,7 +97,9 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
 \r
   TH2F       * fPhiEta[4];                  // eta - phi\r
   TH2F       * fDPhiDEtaEventAxis[4];       // correlation dEta-dPhi towards event axis\r
+  TH2F       * fDPhiDEtaEventAxisSeeds[4];  // correlation dEta-dPhi towards event axis of trigger particles\r
   TH1F       * fTriggerNch[4];              // number of triggers with accepted-track number\r
+  TH2F       * fTriggerNchSeeds[4];         // number of triggers with accepted-track number\r
   TH1F       * fTriggerTracklet[4];         // number of triggers with accepted-tracklet number\r
   TH2F       * fNch07Nch[4];                // nCharged with pT>fTriggerPtCut vs nCharged\r
   TProfile   * pNch07Nch[4];                // nCharged with pT>fTriggerPtCut vs nCharged\r
@@ -97,6 +107,7 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
   TH2F       * fNchTracklet[4];             // nCharged vs nTracklet\r
   TProfile   * pNch07Tracklet[4];           // nCharged with pT>fTriggerPtCut vs nTracklet\r
 \r
+  TH1F       * fDPhiEventAxis[4];           // delta phi of associate tracks to event axis\r
   TH1F       * fDPhiEventAxisNchBin[4][150];// delta phi of associate tracks to event axis per Nch bin\r
   TH1F       * fDPhiEventAxisNchBinTrig[4][150];// "" for all possoble trigger particles\r
 \r