]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGCF/Correlations/Base/AliUEHistograms.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGCF / Correlations / Base / AliUEHistograms.h
index 828319341239d13dddf53febba4fad6fabea9624..8748088a2f195cdd3e30919361152cdd5576e53e 100644 (file)
@@ -13,7 +13,6 @@
 #include "TMath.h"
 #include "THn.h" // in cxx file causes .../THn.h:257: error: conflicting declaration ‘typedef class THnT<float> THnF’
 
-
 class AliVParticle;
 
 class TList;
@@ -26,7 +25,7 @@ class TH3F;
 class AliUEHistograms : public TNamed
 {
  public:
-  AliUEHistograms(const char* name = "AliUEHistograms", const char* histograms = "");
+  AliUEHistograms(const char* name = "AliUEHistograms", const char* histograms = "", const char* binning = 0);
   virtual ~AliUEHistograms();
   
   void Fill(Int_t eventType, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* toward, TList* away, TList* min, TList* max);
@@ -34,7 +33,7 @@ class AliUEHistograms : public TNamed
   void Fill(AliVParticle* leadingMC, AliVParticle* leadingReco);
   void FillEvent(Int_t eventType, Int_t step);
   void FillEvent(Double_t centrality, Int_t step);
-  void FillTrackingEfficiency(TObjArray* mc, TObjArray* recoPrim, TObjArray* recoAll, TObjArray* fake, Int_t particleType, Double_t centrality = 0, Double_t zVtx = 0);
+  void FillTrackingEfficiency(TObjArray* mc, TObjArray* recoPrim, TObjArray* recoAll, TObjArray* recoPrimPID, TObjArray* recoAllPID, TObjArray* fake, Int_t particleType, Double_t centrality = 0, Double_t zVtx = 0);
   void FillFakePt(TObjArray* fake, Double_t centrality);
  
   void CopyReconstructedData(AliUEHistograms* from);
@@ -52,7 +51,8 @@ class AliUEHistograms : public TNamed
   
   void SetRunNumber(Long64_t runNumber) { fRunNumber = runNumber; }
   
-  void SetEfficiencyCorrection(THnF* hist) { fEfficiencyCorrection = hist; }
+  void SetEfficiencyCorrectionTriggers(THnF* hist)   { fEfficiencyCorrectionTriggers = hist;   }
+  void SetEfficiencyCorrectionAssociated(THnF* hist) { fEfficiencyCorrectionAssociated = hist; }
   
   TH2F* GetCorrelationpT()  { return fCorrelationpT; }
   TH2F* GetCorrelationEta() { return fCorrelationEta; }
@@ -60,29 +60,39 @@ class AliUEHistograms : public TNamed
   TH2F* GetCorrelationR()   { return fCorrelationR; }
   TH2F* GetCorrelationLeading2Phi() { return fCorrelationLeading2Phi; }
   TH2F* GetCorrelationMultiplicity() { return fCorrelationMultiplicity; }
+  TH3F* GetYield() { return fYields; }
+  TH2F* GetInvYield() { return fInvYield2; }
   
   TH2F* GetEventCount()     { return fEventCount; }
   TH3F* GetEventCountDifferential() { return fEventCountDifferential; }
   TH1F* GetVertexContributors() { return fVertexContributors; }
   TH1F* GetCentralityDistribution() { return fCentralityDistribution; }
+  TH2F* GetCentralityCorrelation() { return fCentralityCorrelation; }
   Long64_t GetRunNumber() { return fRunNumber; }
   Int_t GetMergeCount() { return fMergeCount; }
   TH3F* GetTwoTrackDistance(Int_t i) { return fTwoTrackDistancePt[i]; }
+  Bool_t GetWeightPerEvent() { return fWeightPerEvent; }
   
   void Correct(AliUEHistograms* corrections);
   
   void SetEtaRange(Float_t etaMin, Float_t etaMax);
   void SetPtRange(Float_t ptMin, Float_t ptMax);
+  void SetPartSpecies(Int_t species);
   void SetZVtxRange(Float_t min, Float_t max);
   void SetContaminationEnhancement(TH1F* hist);
   void SetCombineMinMax(Bool_t flag);
   void SetTrackEtaCut(Float_t value);
+  void SetWeightPerEvent(Bool_t flag);
   void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
   void SetSelectTriggerCharge(Int_t selectCharge) { fTriggerSelectCharge = selectCharge; }
+  void SetSelectAssociatedCharge(Int_t selectCharge) { fAssociatedSelectCharge = selectCharge; }
   void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
   void SetEtaOrdering(Bool_t flag) { fEtaOrdering = flag; }
   void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
+  void SetRejectResonanceDaughters(Int_t value) { fRejectResonanceDaughters = value; }
   void SetOnlyOneEtaSide(Int_t flag)    { fOnlyOneEtaSide = flag; }
+  void SetPtOrder(Bool_t flag) { fPtOrder = flag; }
+  void SetTwoTrackCutMinRadius(Float_t min) { fTwoTrackCutMinRadius = min; }
   
   void ExtendTrackingEfficiency(Bool_t verbose = kFALSE);
   void Reset();
@@ -98,7 +108,8 @@ 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);
+  inline Float_t GetInvMassSquared(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2);
+  inline Float_t GetInvMassSquaredCheap(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2);
   inline Float_t GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign);
   
   static const Int_t fgkUEHists; // number of histograms
@@ -114,6 +125,7 @@ protected:
   TH2F* fCorrelationLeading2Phi;// delta phi (true vs reco) vs pT,lead,MC
   TH2F* fCorrelationMultiplicity; // number of mc particls vs reco particles (for pT > 0.5 GeV/c)
   TH3F* fYields;                // centrality vs pT vs eta
+  TH2F* fInvYield2;            // invariant yield as cross check of tracking
   
   TH2F* fEventCount;            // event count as function of step, (for pp: event type (plus additional step -1 for all events without vertex range even in MC)) (for PbPb: centrality)
   TH3F* fEventCountDifferential;// event count as function of leading pT, step, event type
@@ -125,22 +137,29 @@ protected:
   TH3F* fITSClusterMap;          // its cluster map vs centrality vs pT
   
   TH3F* fTwoTrackDistancePt[2];    // control histograms for two-track efficiency study: dphi*_min vs deta (0 = before cut, 1 = after cut)
+  TH2F* fControlConvResoncances; // control histograms for cuts on conversions and resonances
   
-  THnF* fEfficiencyCorrection;   // if non-0 this efficiency correction is applied on the fly to the filling for associated particles. The factor is multiplicative, i.e. should contain 1/efficiency
+  THnF* fEfficiencyCorrectionTriggers;   // if non-0 this efficiency correction is applied on the fly to the filling for trigger particles. The factor is multiplicative, i.e. should contain 1/efficiency
+  THnF* fEfficiencyCorrectionAssociated;   // if non-0 this efficiency correction is applied on the fly to the filling for associated particles. The factor is multiplicative, i.e. should contain 1/efficiency
   
   Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
   Int_t fTriggerSelectCharge;    // select charge of trigger particle
+  Int_t fAssociatedSelectCharge; // select charge of associated particle
   Float_t fTriggerRestrictEta;   // restrict eta range for trigger particle (default: -1 [off])
   Bool_t fEtaOrdering;           // activate eta ordering to prevent shape distortions. see FillCorrelation for the details
   Bool_t fCutConversions;        // cut on conversions (inv mass)
   Bool_t fCutResonances;         // cut on resonances (inv mass)
+  Int_t fRejectResonanceDaughters; // reject all daughters of all resonance candidates (1: test method (cut at m_inv=0.9); 2: k0; 3: lambda)
   Int_t fOnlyOneEtaSide;       // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
+  Bool_t fWeightPerEvent;      // weight with the number of trigger particles per event
+  Bool_t fPtOrder;             // apply pT,a < pT,t condition
+  Float_t fTwoTrackCutMinRadius; // min radius for TTR cut
   
   Long64_t fRunNumber;           // run number that has been processed
   
   Int_t fMergeCount;           // counts how many objects have been merged together
   
-  ClassDef(AliUEHistograms, 19)  // underlying event histogram container
+  ClassDef(AliUEHistograms, 29)  // underlying event histogram container
 };
 
 Float_t AliUEHistograms::GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign)
@@ -169,4 +188,83 @@ Float_t AliUEHistograms::GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1,
   return dphistar;
 }
 
+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_1, Float_t m0_2)
+{
+  // 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)
+  {
+    Float_t expTmp = TMath::Exp(-eta1);
+    tantheta1 = 2.0 * expTmp / ( 1.0 - expTmp*expTmp);
+  }
+  
+  Float_t tantheta2 = 1e10;
+  if (eta2 < -1e-10 || eta2 > 1e-10)
+  {
+    Float_t expTmp = TMath::Exp(-eta2);
+    tantheta2 = 2.0 * expTmp / ( 1.0 - expTmp*expTmp);
+  }
+  
+  Float_t e1squ = m0_1 * m0_1 + pt1 * pt1 * (1.0 + 1.0 / tantheta1 / tantheta1);
+  Float_t e2squ = m0_2 * m0_2 + pt2 * pt2 * (1.0 + 1.0 / tantheta2 / tantheta2);
+  
+  Float_t mass2 = m0_1 * m0_1 + m0_2 * m0_2 + 2 * ( TMath::Sqrt(e1squ * e2squ) - ( pt1 * pt2 * ( TMath::Cos(phi1 - phi2) + 1.0 / tantheta1 / tantheta2 ) ) );
+  
+//   Printf(Form("%f %f %f %f %f %f %f %f %f", pt1, eta1, phi1, pt2, eta2, phi2, m0_1, m0_2, mass2));
+  
+  return mass2;
+}
+
+Float_t AliUEHistograms::GetInvMassSquaredCheap(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2)
+{
+  // calculate inv mass squared approximately
+  
+  Float_t tantheta1 = 1e10;
+  
+  if (eta1 < -1e-10 || eta1 > 1e-10)
+  {
+    Float_t expTmp = 1.0-eta1+eta1*eta1/2-eta1*eta1*eta1/6+eta1*eta1*eta1*eta1/24;
+    tantheta1 = 2.0 * expTmp / ( 1.0 - expTmp*expTmp);
+  }
+  
+  Float_t tantheta2 = 1e10;
+  if (eta2 < -1e-10 || eta2 > 1e-10)
+  {
+    Float_t expTmp = 1.0-eta2+eta2*eta2/2-eta2*eta2*eta2/6+eta2*eta2*eta2*eta2/24;
+    tantheta2 = 2.0 * expTmp / ( 1.0 - expTmp*expTmp);
+  }
+  
+  Float_t e1squ = m0_1 * m0_1 + pt1 * pt1 * (1.0 + 1.0 / tantheta1 / tantheta1);
+  Float_t e2squ = m0_2 * m0_2 + pt2 * pt2 * (1.0 + 1.0 / tantheta2 / tantheta2);
+  
+  // fold onto 0...pi
+  Float_t deltaPhi = TMath::Abs(phi1 - phi2);
+  while (deltaPhi > TMath::TwoPi())
+    deltaPhi -= TMath::TwoPi();
+  if (deltaPhi > TMath::Pi())
+    deltaPhi = TMath::TwoPi() - deltaPhi;
+  
+  Float_t cosDeltaPhi = 0;
+  if (deltaPhi < TMath::Pi()/3)
+    cosDeltaPhi = 1.0 - deltaPhi*deltaPhi/2 + deltaPhi*deltaPhi*deltaPhi*deltaPhi/24;
+  else if (deltaPhi < 2*TMath::Pi()/3)
+    cosDeltaPhi = -(deltaPhi - TMath::Pi()/2) + 1.0/6 * TMath::Power((deltaPhi - TMath::Pi()/2), 3);
+  else
+    cosDeltaPhi = -1.0 + 1.0/2.0*(deltaPhi - TMath::Pi())*(deltaPhi - TMath::Pi()) - 1.0/24.0 * TMath::Power(deltaPhi - TMath::Pi(), 4);
+  
+  Float_t mass2 = m0_1 * m0_1 + m0_2 * m0_2 + 2 * ( TMath::Sqrt(e1squ * e2squ) - ( pt1 * pt2 * ( cosDeltaPhi + 1.0 / tantheta1 / tantheta2 ) ) );
+  
+//   Printf(Form("%f %f %f %f %f %f %f %f %f", pt1, eta1, phi1, pt2, eta2, phi2, m0_1, m0_2, mass2));
+  
+  return mass2;
+}
+
 #endif