cuts on resonances and conversions
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2012 15:28:35 +0000 (15:28 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2012 15:28:35 +0000 (15:28 +0000)
PWGCF/Correlations/Base/AliUEHist.cxx
PWGCF/Correlations/Base/AliUEHistograms.cxx
PWGCF/Correlations/Base/AliUEHistograms.h
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.h

index 31a937f..6b78237 100644 (file)
@@ -753,6 +753,8 @@ TH2* AliUEHist::GetSumOfRatios2(AliUEHist* mixed, AliUEHist::CFStep step, AliUEH
   TH1* eventSameAll = 0;
   TH1* eventMixedAll = 0;
   
+  Int_t totalEvents = 0;
+  
   GetHistsZVtx(step, region, ptLeadMin, ptLeadMax, multBinBegin, multBinEnd, &trackSameAll, &eventSameAll);
   mixed->GetHistsZVtx(step, region, ptLeadMin, ptLeadMax, multBinBegin, multBinEnd, &trackMixedAll, &eventMixedAll);
   
@@ -805,10 +807,11 @@ TH2* AliUEHist::GetSumOfRatios2(AliUEHist* mixed, AliUEHist::CFStep step, AliUEH
 
       delete tracksSame;
       delete tracksMixed;
+      
+      totalEvents += eventSameAll->GetBinContent(vertexBin);
     }
   }
 
-  Int_t totalEvents = eventSameAll->Integral();
   if (totalTracks) {
     Printf("Dividing %f tracks by %d events", totalTracks->Integral(), totalEvents);
     if (totalEvents > 0)
index c987ff7..d2c00ec 100644 (file)
@@ -33,6 +33,7 @@
 #include "TH1F.h"
 #include "TH3F.h"
 #include "TMath.h"
+#include "TLorentzVector.h"
 
 ClassImp(AliUEHistograms)
 
@@ -57,6 +58,8 @@ AliUEHistograms::AliUEHistograms(const char* name, const char* histograms) :
   fITSClusterMap(0),
   fSelectCharge(0),
   fTriggerRestrictEta(-1),
+  fCutConversions(kFALSE),
+  fCutResonances(kFALSE),
   fRunNumber(0)
 {
   // Constructor
@@ -155,6 +158,8 @@ AliUEHistograms::AliUEHistograms(const AliUEHistograms &c) :
   fITSClusterMap(0),
   fSelectCharge(0),
   fTriggerRestrictEta(-1),
+  fCutConversions(kFALSE),
+  fCutResonances(kFALSE),
   fRunNumber(0)
 {
   //
@@ -172,6 +177,11 @@ AliUEHistograms::~AliUEHistograms()
 {
   // Destructor
   
+  DeleteContainers();
+}
+
+void AliUEHistograms::DeleteContainers()
+{
   if (fNumberDensitypT)
   {
     delete fNumberDensitypT;
@@ -486,6 +496,24 @@ void AliUEHistograms::FillCorrelations(Double_t centrality, Float_t zVtx, AliUEH
             continue;
         }
         
+        // conversions
+       if (fCutConversions && particle->Charge() * triggerParticle->Charge() < 0)
+       {
+         Float_t mass = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.510e-3);
+
+         if (mass < 0.04*0.04) 
+           continue;
+       }
+       
+       // K0s, rhos
+       if (fCutResonances && particle->Charge() * triggerParticle->Charge() < 0)
+       {
+         Float_t mass = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.1396);
+         
+         if ((mass > 0.49*0.49 && mass < 0.51*0.51) || (mass > 0.765*0.765 && mass < 0.785*0.785))
+           continue;
+       }
+        
         Double_t vars[6];
         vars[0] = triggerEta - eta[j];
         vars[1] = particle->Pt();
@@ -643,6 +671,8 @@ AliUEHistograms &AliUEHistograms::operator=(const AliUEHistograms &c)
 {
   // assigment operator
 
+  DeleteContainers();
+
   if (this != &c)
     ((AliUEHistograms &) c).Copy(*this);
 
@@ -707,6 +737,8 @@ void AliUEHistograms::Copy(TObject& c) const
 
   target.fSelectCharge = fSelectCharge;
   target.fTriggerRestrictEta = fTriggerRestrictEta;
+  target.fCutConversions = fCutConversions;
+  target.fCutResonances = fCutResonances;
   target.fRunNumber = fRunNumber;
 }
 
@@ -941,3 +973,30 @@ void AliUEHistograms::TwoTrackEfficiency(TObjArray* tracks, TObjArray* mixed, Fl
     }
   }
 }
+
+Float_t AliUEHistograms::GetInvMassSquared(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0)
+{
+  // calculate inv mass squared
+  // same can be achieved, but with more computing time with
+  /*TLorentzVector photon, p1, p2;
+  p1.SetPtEtaPhiM(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), 0.510e-3);
+  p2.SetPtEtaPhiM(particle->Pt(), eta[j], particle->Phi(), 0.510e-3);
+  photon = p1+p2;
+  photon.M()*/
+  
+  Float_t tantheta1 = 1e10;
+  
+  if (eta1 < -1e-10 || eta1 > 1e-10)
+    tantheta1 = 2 * TMath::Exp(-eta1) / ( 1 - TMath::Exp(-2*eta1));
+  
+  Float_t tantheta2 = 1e10;
+  if (eta2 < -1e-10 || eta2 > 1e-10)
+    tantheta2 = 2 * TMath::Exp(-eta2) / ( 1 - TMath::Exp(-2*eta2));
+  
+  Float_t e1squ = m0 * m0 + pt1 * pt1 * (1.0 + 1.0 / tantheta1 / tantheta1);
+  Float_t e2squ = m0 * m0 + pt2 * pt2 * (1.0 + 1.0 / tantheta2 / tantheta2);
+  
+  Float_t mass2 = 2 * m0 * m0 + 2 * ( TMath::Sqrt(e1squ * e2squ) - ( pt1 * pt2 * ( TMath::Cos(phi1 - phi2) + 1.0 / tantheta1 / tantheta2 ) ) );
+  
+  return mass2;
+}
index 77dae2c..b5064ac 100644 (file)
@@ -72,6 +72,7 @@ class AliUEHistograms : public TNamed
   void SetCombineMinMax(Bool_t flag);
   void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
   void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
+  void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
   
   void ExtendTrackingEfficiency(Bool_t verbose = kFALSE);
   void Reset();
@@ -86,6 +87,8 @@ class AliUEHistograms : public TNamed
 protected:
   void FillRegion(AliUEHist::Region region, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* list, Int_t multiplicity);
   Int_t CountParticles(TList* list, Float_t ptMin);
+  void DeleteContainers();
+  Float_t GetInvMassSquared(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0);
   
   static const Int_t fgkUEHists; // number of histograms
 
@@ -113,10 +116,12 @@ protected:
   
   Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
   Float_t fTriggerRestrictEta;   // restrict eta range for trigger particle (default: -1 [off])
+  Bool_t fCutConversions;        // cut on conversions (inv mass)
+  Bool_t fCutResonances;         // cut on resonances (inv mass)
   
   Long64_t fRunNumber;           // run number that has been processed
   
-  ClassDef(AliUEHistograms, 11)  // underlying event histogram container
+  ClassDef(AliUEHistograms, 12)  // underlying event histogram container
 };
 
 #endif
index 9caefee..7231f8d 100644 (file)
@@ -112,6 +112,8 @@ fSelectBit(0),
 fUseChargeHadrons(kFALSE),
 fSelectCharge(0),
 fTriggerRestrictEta(-1),
+fCutConversions(kFALSE),
+fCutResonances(kFALSE),
 fFillpT(kFALSE)
 {
   // Default constructor
@@ -210,6 +212,9 @@ void  AliAnalysisTaskPhiCorrelations::CreateOutputObjects()
   fHistos->SetTriggerRestrictEta(fTriggerRestrictEta);
   fHistosMixed->SetTriggerRestrictEta(fTriggerRestrictEta);
   
+  fHistos->SetPairCuts(fCutConversions, fCutResonances);
+  fHistosMixed->SetPairCuts(fCutConversions, fCutResonances);
+  
   // add histograms to list
   fListOfHistos->Add(fHistos);
   fListOfHistos->Add(fHistosMixed);
@@ -218,6 +223,7 @@ void  AliAnalysisTaskPhiCorrelations::CreateOutputObjects()
   fListOfHistos->Add(new TH2F("processIDs", ";#Delta#phi;process id", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), kPNoProcess + 1, -0.5, kPNoProcess + 0.5));
   fListOfHistos->Add(new TH1F("eventStat", ";;events", 4, -0.5, 3.5));
   fListOfHistos->Add(new TH1F("mixedDist", ";tracks;events", 200, 0, fMixingTracks * 1.5));
+  fListOfHistos->Add(new TH1F("pids", ";pdg;tracks", 2001, -1000.5, 1000.5));
   
   PostData(0,fListOfHistos);
   
@@ -292,7 +298,9 @@ void  AliAnalysisTaskPhiCorrelations::AddSettingsTree()
   settingsTree->Branch("fSelectBit", &fSelectBit,"EventSelectionBit/I");
   settingsTree->Branch("fUseChargeHadrons", &fUseChargeHadrons,"UseChHadrons/O");
   settingsTree->Branch("fSelectCharge", &fSelectCharge,"SelectCharge/I");
-  settingsTree->Branch("fTriggerRestrictEta", &fTriggerRestrictEta,"SelectCharge/D");
+  settingsTree->Branch("fTriggerRestrictEta", &fTriggerRestrictEta,"TriggerRestrictEta/D");
+  settingsTree->Branch("fCutConversions", &fCutConversions,"CutConversions/O");
+  settingsTree->Branch("fCutResonances", &fCutResonances,"CutResonances/O");
   settingsTree->Branch("fFillpT", &fFillpT,"FillpT/O");
   settingsTree->Branch("fkTrackingEfficiency", "TH1D", &fkTrackingEfficiency);
   settingsTree->Branch("fMixingTracks", &fMixingTracks,"MixingTracks/I");
@@ -362,6 +370,17 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
   // Get MC primaries
   TObjArray* tracksMC = fAnalyseUE->GetAcceptedParticles(mc, 0, kTRUE, -1, kTRUE);
   
+  if (fAOD)
+  {
+    for (Int_t i=0; i<fArrayMC->GetEntriesFast(); i++)
+      ((TH1F*) fListOfHistos->FindObject("pids"))->Fill(((AliAODMCParticle*) fArrayMC->At(i))->PdgCode());
+  }
+  else
+  {
+    for (Int_t i=0; i<fMcEvent->GetNumberOfTracks(); i++)
+      ((TH1F*) fListOfHistos->FindObject("pids"))->Fill(fMcEvent->GetTrack(i)->PdgCode());
+  }
+  
   // (MC-true all particles)
   // STEP 0
   fHistos->FillCorrelations(centrality, zVtx, AliUEHist::kCFStepAll, tracksMC, 0, weight);
@@ -456,7 +475,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
       {
         // make list of secondaries (matched with MC)
         TObjArray* tracksRecoMatchedSecondaries = new TObjArray;
-        for (Int_t i=0; i<tracksRecoMatchedAll->GetEntries(); i++)
+        for (Int_t i=0; i<tracksRecoMatchedAll->GetEntriesFast(); i++)
           if (((AliAODMCParticle*)tracksRecoMatchedAll->At(i))->IsPhysicalPrimary() == kFALSE)
             tracksRecoMatchedSecondaries->Add(tracksRecoMatchedAll->At(i));
       
@@ -470,14 +489,14 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
         // trigger particles: primaries in 4 < pT < 10
         // associated particles: secondaries in 1 < pT < 10
         
-        for (Int_t i=0; i<tracksRecoMatchedPrim->GetEntries(); i++)
+        for (Int_t i=0; i<tracksRecoMatchedPrim->GetEntriesFast(); i++)
         {
           AliVParticle* triggerParticle = (AliVParticle*) tracksRecoMatchedPrim->At(i);
           
           if (triggerParticle->Pt() < 4 || triggerParticle->Pt() > 10)
             continue;
           
-          for (Int_t j=0; j<tracksRecoMatchedSecondaries->GetEntries(); j++)
+          for (Int_t j=0; j<tracksRecoMatchedSecondaries->GetEntriesFast(); j++)
           {
             AliAODMCParticle* particle = (AliAODMCParticle*) tracksRecoMatchedSecondaries->At(j);
             
@@ -698,7 +717,7 @@ TObjArray* AliAnalysisTaskPhiCorrelations::CloneAndReduceTrackList(TObjArray* tr
   TObjArray* tracksClone = new TObjArray;
   tracksClone->SetOwner(kTRUE);
   
-  for (Int_t i=0; i<tracks->GetEntries(); i++)
+  for (Int_t i=0; i<tracks->GetEntriesFast(); i++)
   {
     AliVParticle* particle = (AliVParticle*) tracks->At(i);
     tracksClone->Add(new AliDPhiBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge()));
index 0b028ae..089639f 100644 (file)
@@ -83,9 +83,9 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     void   SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
     void   SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
     void   SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
+    void   SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
     void   SetCentralityMethod(const char* method) { fCentralityMethod = method; }
     void   SetFillpT(Bool_t flag) { fFillpT = flag; }
-
     
   private:
     AliAnalysisTaskPhiCorrelations(const  AliAnalysisTaskPhiCorrelations &det);
@@ -97,8 +97,6 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     void            Initialize();                                      // initialize some common pointer
     TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
 
-
-
     // General configuration
     Int_t               fDebug;           //  Debug flag
     Int_t              fMode;            //  fMode = 0: data-like analysis 
@@ -143,10 +141,12 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     
     Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
     Float_t fTriggerRestrictEta;   // restrict eta range for trigger particle (default: -1 [off])
+    Bool_t fCutConversions;        // cut on conversions (inv mass)
+    Bool_t fCutResonances;         // cut on resonances (inv mass)
     
     Bool_t fFillpT;                // fill sum pT instead of number density
     
-    ClassDef( AliAnalysisTaskPhiCorrelations, 4); // Analysis task for Underlying Event analysis w.r.t. leading track
+    ClassDef( AliAnalysisTaskPhiCorrelations, 5); // Analysis task for delta phi correlations
   };
 
 class AliDPhiBasicParticle : public AliVParticle