allowing also to measure sum pt
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Jul 2011 14:16:48 +0000 (14:16 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Jul 2011 14:16:48 +0000 (14:16 +0000)
PWG4/JetTasks/AliAnalysisTaskPhiCorrelations.cxx
PWG4/JetTasks/AliAnalysisTaskPhiCorrelations.h
PWG4/JetTasks/AliEventPoolManager.cxx
PWG4/JetTasks/AliUEHistograms.cxx

index 3e8bd53..a8338d9 100644 (file)
@@ -109,7 +109,8 @@ fPtMin(0.5),
 fFilterBit(0xFF),
 fSelectBit(0),
 fUseChargeHadrons(kFALSE),
-fSelectCharge(0)
+fSelectCharge(0),
+fFillpT(kFALSE)
 {
   // Default constructor
   // Define input and output slots here
@@ -268,11 +269,16 @@ void  AliAnalysisTaskPhiCorrelations::AddSettingsTree()
 {
   //Write settings to output list
   TTree *settingsTree   = new TTree("UEAnalysisSettings","Analysis Settings in UE estimation");
-  settingsTree->Branch("fFilterBit", &fFilterBit,"FilterBit/I");
-  settingsTree->Branch("fSelectBit", &fSelectBit,"EventSelectionBit/I");
+  settingsTree->Branch("fnTracksVertex", &fnTracksVertex,"nTracksVertex/I");
+  settingsTree->Branch("fZVertex", &fZVertex,"ZVertex/D");
+  //settingsTree->Branch("fCentralityMethod", fCentralityMethod.Data(),"CentralityMethod/C");
   settingsTree->Branch("fTrackEtaCut", &fTrackEtaCut, "TrackEtaCut/D");
   settingsTree->Branch("fPtMin", &fPtMin, "PtMin/D");
+  settingsTree->Branch("fFilterBit", &fFilterBit,"FilterBit/I");
+  settingsTree->Branch("fSelectBit", &fSelectBit,"EventSelectionBit/I");
   settingsTree->Branch("fUseChargeHadrons", &fUseChargeHadrons,"UseChHadrons/O");
+  settingsTree->Branch("fSelectCharge", &fSelectCharge,"SelectCharge/I");
+  settingsTree->Branch("fFillpT", &fFillpT,"FillpT/O");
   settingsTree->Branch("fkTrackingEfficiency", "TH1D", &fkTrackingEfficiency);
   settingsTree->Fill();
   fListOfHistos->Add(settingsTree);
@@ -325,13 +331,16 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
     return;
   
   Float_t zVtx = fMcEvent->GetPrimaryVertex()->GetZ();
+  Float_t weight = 1;
+  if (fFillpT)
+    weight = -1;
     
   // Get MC primaries
   TObjArray* tracksMC = fAnalyseUE->GetAcceptedParticles(mc, 0, kTRUE, -1, kTRUE);
   
   // (MC-true all particles)
   // STEP 0
-  fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepAll, tracksMC);
+  fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepAll, tracksMC, 0, weight);
   
   // Trigger selection ************************************************
   if (fAnalyseUE->TriggerSelection(fInputHandler))
@@ -339,7 +348,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
     // (MC-true all particles)
     // STEP 1
     if (!fReduceMemoryFootprint)
-      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTriggered, tracksMC);
+      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTriggered, tracksMC, 0, weight);
     else
       fHistos->FillEvent(centrality, AliUEHist::kCFStepTriggered);
       
@@ -372,7 +381,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
       // (MC-true all particles)
       // STEP 2
       if (!fReduceMemoryFootprint)
-       fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepVertex, tracksMC);
+       fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepVertex, tracksMC, 0, weight);
       else
        fHistos->FillEvent(centrality, AliUEHist::kCFStepVertex);
       
@@ -381,21 +390,21 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
       
       // (RECO-matched (quantities from MC particle) primary particles)
       // STEP 4
-      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTrackedOnlyPrim, tracksRecoMatchedPrim);
+      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTrackedOnlyPrim, tracksRecoMatchedPrim, 0, weight);
       
       // Get MC primaries + secondaries that match reconstructed track
       TObjArray* tracksRecoMatchedAll = fAnalyseUE->GetAcceptedParticles(inputEvent, mc, kFALSE, -1, kTRUE);
       
       // (RECO-matched (quantities from MC particle) all particles)
       // STEP 5
-      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTracked, tracksRecoMatchedAll);
+      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepTracked, tracksRecoMatchedAll, 0, weight);
       
       // Get RECO tracks
       TObjArray* tracks = fAnalyseUE->GetAcceptedParticles(inputEvent, 0, kTRUE, -1, kTRUE);
       
       // (RECO all tracks)
       // STEP 6
-      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepReconstructed, tracks);
+      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepReconstructed, tracks, 0, weight);
       
       if (0 && !fReduceMemoryFootprint)
       {
@@ -406,10 +415,10 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
             tracksRecoMatchedSecondaries->Add(tracksRecoMatchedAll->At(i));
       
         // Study: Use only secondaries as trigger particles and plot the correlation vs. all particles; store in step 9
-        fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy2, tracksRecoMatchedSecondaries, tracksRecoMatchedAll);
+        fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy2, tracksRecoMatchedSecondaries, tracksRecoMatchedAll, weight);
         
         // Study: Use only primaries as trigger particles and plot the correlation vs. secondaries; store in step 8
-        fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy, tracksRecoMatchedPrim, tracksRecoMatchedSecondaries);
+        fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy, tracksRecoMatchedPrim, tracksRecoMatchedSecondaries, weight);
       
         // plot delta phi vs process id of secondaries
         // trigger particles: primaries in 4 < pT < 10
@@ -521,6 +530,10 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
   const AliVVertex* vertex = inputEvent->GetPrimaryVertex();
   Double_t zVtx = vertex->GetZ();
   
+  Float_t weight = 1;
+  if (fFillpT)
+    weight = -1;
+
   // fill two different centralities (syst study)
   // the zvtx axis is used to distinguish the results of both centralities: configured centrality in zvtx = 0, SPD in zvtx = 2
   if (fCompareCentralities)
@@ -528,14 +541,14 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
   
   // Fill containers at STEP 6 (reconstructed)
   if (centrality >= 0)
-    fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepReconstructed, tracks);
+    fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepReconstructed, tracks, 0, weight);
 
   // Two-track effect study
   if (fTwoTrackEfficiencyStudy)
   {
     TObjArray* reduced = fHistos->ApplyTwoTrackCut(tracks);
-    if (centrality >= 0)
-      fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy, reduced);
+    //if (centrality >= 0)
+    //  fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepBiasStudy, reduced, 0, weight);
     delete reduced;
   }
   
@@ -544,7 +557,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
   {
     centrality = centralityObj->GetCentralityPercentile("CL1");
     if (centrality >= 0)
-      fHistos->FillCorrelations(centrality, 2, AliUEHist::kCFStepReconstructed, tracks);
+      fHistos->FillCorrelations(centrality, 2, AliUEHist::kCFStepReconstructed, tracks, 0, weight);
   }
     
   if (fFillMixed)
@@ -581,7 +594,8 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
       //cout << "nMix = " << nMix << endl;
     
       // Fill mixed-event histos here  
-      for (Int_t jMix=0; jMix<nMix; jMix++) {
+      for (Int_t jMix=0; jMix<nMix; jMix++) 
+      {
        TObjArray* bgTracks = pool->GetEvent(jMix);
        fHistosMixed->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepReconstructed, tracks, bgTracks, 1.0 / nMix, (jMix == 0));
       }
index de66816..8a010db 100644 (file)
@@ -82,6 +82,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     void   SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
     void   SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
     void   SetCentralityMethod(const char* method) { fCentralityMethod = method; }
+    void   SetFillpT(Bool_t flag) { fFillpT = flag; }
 
     
   private:
@@ -124,7 +125,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     TList*              fListOfHistos;    //  Output list of containers 
     
     // Event QA cuts
-    Int_t              fnTracksVertex;        // QA tracks pointing to principal vertex (= 3 default) 
+    Int_t              fnTracksVertex;        // QA tracks pointing to principal vertex
     Double_t           fZVertex;              // Position of Vertex in Z direction
     TString             fCentralityMethod;     // Method to determine centrality
     
@@ -136,6 +137,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     Bool_t             fUseChargeHadrons;     // Only use charge hadrons
     
     Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
+    Bool_t fFillpT;                // fill sum pT instead of number density
     
     ClassDef( AliAnalysisTaskPhiCorrelations, 1); // Analysis task for Underlying Event analysis w.r.t. leading track
   };
index c1d615e..87e5dfd 100644 (file)
@@ -76,6 +76,8 @@ Int_t AliEventPool::UpdatePool(TObjArray *trk)
 {
   // A rolling buffer (a double-ended queue) is updated by removing
   // the oldest event, and appending the newest.
+  //
+  // the ownership of <trk> is delegated to this class
 
   static Int_t iEvent = -1; 
   iEvent++;
index d7b9fc0..1d88e08 100644 (file)
@@ -403,6 +403,11 @@ void AliUEHistograms::FillCorrelations(Double_t centrality, Float_t zVtx, AliUEH
   // this function need a list of AliVParticles which contain the particles/tracks to be filled
   //
   // if mixed is non-0, mixed events are filled, the trigger particle is from particles, the associated from mixed
+  // if weight < 0, then the pt of the associated particle is filled as weight
+  
+  Bool_t fillpT = kFALSE;
+  if (weight < 0)
+    fillpT = kTRUE;
   
   // Eta() is extremely time consuming, therefore cache it for the inner loop here:
   TObjArray* input = (mixed) ? mixed : particles;
@@ -474,6 +479,9 @@ void AliUEHistograms::FillCorrelations(Double_t centrality, Float_t zVtx, AliUEH
         if (vars[4] < -0.5 * TMath::Pi())
           vars[4] += TMath::TwoPi();
        vars[5] = zVtx;
+       
+       if (fillpT)
+         weight = particle->Pt();
     
         // fill all in toward region and do not use the other regions
         fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->Fill(vars, step, weight);