Coverty fixes from Ruediger
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Jul 2013 05:36:07 +0000 (05:36 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Jul 2013 05:36:07 +0000 (05:36 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskChargedJetsPA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskChargedJetsPA.h
PWGJE/EMCALJetTasks/macros/AddTaskChargedJetsPA.C

index e01ac73..8f296f7 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "AliAnalysisTaskChargedJetsPA.h"
 using std::min;
+
 //TODO: Not accessing the particles when using MC
 //TODO: FillHistogram can be done better with virtual TH1(?)
 ClassImp(AliAnalysisTaskChargedJetsPA)
@@ -949,7 +950,9 @@ void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensityAll(Int_t numberExclude
   if (rhoCMSJetCount > 0)
     rhoCMS = TMath::Median(rhoCMSJetCount, tmpRhoCMS) * tmpCoveredArea/tmpSummedArea;
   if (rhoImprovedCMSJetCount > 0)
+  {
     rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
+  }
   if (rhoMeanJetCount > 0)
     rhoMean = TMath::Mean(rhoMeanJetCount, tmpRhoMean);
 
@@ -1022,9 +1025,7 @@ void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLea
 
   if (rhoImprovedCMSJetCount > 0)
   {
-    rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/11.9381;
-    //cout << "Clusterized area: " << tmpSummedArea << endl;
-    //11.9381
+    rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
   }
   #ifdef DEBUGMODE
     AliInfo("Got KT background density.");
@@ -1032,93 +1033,6 @@ void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLea
 }
 
 
-
-//________________________________________________________________________
-Int_t AliAnalysisTaskChargedJetsPA::GetRCBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& rhoMedian, Double_t etaMin, Double_t etaMax, Int_t numberRandCones)
-{
-  #ifdef DEBUGMODE
-    AliInfo("Getting RC background density.");
-  #endif
-
-  if(numberRandCones == 0)
-    numberRandCones = fNumberRandCones;
-
-  std::vector<AliEmcalJet> tmpCones(numberRandCones);
-
-  // Setting invalid values
-  rhoMean = 0.0;
-  rhoMedian = 0.0;
-
-  // Exclude UP TO numberExcludeLeadingJets
-  if(numberExcludeLeadingJets==-1)
-    numberExcludeLeadingJets = fNumberSignalJets;
-  if (fNumberSignalJets < numberExcludeLeadingJets)
-    numberExcludeLeadingJets = fNumberSignalJets;
-
-  // Search given amount of RCs
-  Int_t numAcceptedRCs = 0;
-  for(Int_t i=0;i<numberRandCones;i++)
-  {
-    Double_t tmpRandConeEta = 0.0;
-    Double_t tmpRandConePhi = 0.0;
-
-    // Search random cone in acceptance with no overlap with already excluded jets (leading jets and random cones)
-
-    // Check if etaMin/etaMax is given correctly
-    if(etaMin < -fSignalJetEtaWindow)
-      etaMin = -fSignalJetEtaWindow;
-    if(etaMax > fSignalJetEtaWindow)
-      etaMax = fSignalJetEtaWindow;
-
-    // Set the random cone position
-    if ((etaMin == 0) && (etaMax == 0))
-      tmpRandConeEta = (fTrackEtaWindow-fRandConeRadius)*(2.0*fRandom->Rndm()-1.0); // full RC is in acceptance
-    else
-      tmpRandConeEta = etaMin + fRandom->Rndm()*(etaMax-etaMin);
-
-    tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
-
-    // Exclude signal jets
-    Bool_t coneValid = kFALSE;
-    for(Int_t j=0;j<numberExcludeLeadingJets;j++)
-    {
-      AliEmcalJet* signalJet = fSignalJets[j];
-
-      Double_t tmpDeltaPhi = GetDeltaPhi(tmpRandConePhi, signalJet->Phi());
-      
-      if ( tmpDeltaPhi*tmpDeltaPhi + TMath::Abs(signalJet->Eta()-tmpRandConeEta)*TMath::Abs(signalJet->Eta()-tmpRandConeEta) <= (fRandConeRadius+fPhysicalJetRadius)*(fRandConeRadius+fPhysicalJetRadius))
-      {
-        coneValid = kFALSE;
-        break;
-      }
-    }
-
-    // RC is accepted, so save it
-    if(coneValid)
-    {
-      AliEmcalJet tmpJet(GetConePt(tmpRandConeEta, tmpRandConePhi, fRandConeRadius), tmpRandConeEta, tmpRandConePhi, 0.0);
-      tmpCones[numAcceptedRCs] = tmpJet;
-      numAcceptedRCs++;
-    }
-  }
-
-  // Calculate Rho and the mean from the RCs (no excluded jets are considered!)
-  if(numAcceptedRCs > 0)
-  {
-    std::vector<Double_t> tmpRho(numAcceptedRCs);
-    for (Int_t i=0; i<numAcceptedRCs;i++)
-      tmpRho[i] = tmpCones[i].Pt()/(fRandConeRadius*fRandConeRadius*TMath::Pi());
-
-    rhoMean = TMath::Mean(tmpRho.begin(), tmpRho.end());
-    rhoMedian = 0.0; // NOT IMPLEMENTED because TMath::Median is not working with iterators
-  }
-    
-  #ifdef DEBUGMODE
-    AliInfo("Got RC background density.");
-  #endif
-  return numAcceptedRCs;
-}
-
 //________________________________________________________________________
 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion)
 {
index 7d31db3..1e07146 100644 (file)
@@ -18,7 +18,7 @@ class TRandom3;
 class AliAnalysisTaskChargedJetsPA : public AliAnalysisTaskSE {
  public:
   // ######### CONTRUCTORS/DESTRUCTORS AND STD FUNCTIONS
-  AliAnalysisTaskChargedJetsPA() : AliAnalysisTaskSE(), fOutputList(0), fAnalyzeJets(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseVertexCut(1), fUsePileUpCut(1), fJetArray(0), fTrackArray(0), fBackgroundJetArray(0), fJetArrayName(0), fTrackArrayName(0), fBackgroundJetArrayName(0), fNumPtHardBins(11), fUsePtHardBin(-1), fRhoTaskName(), fNcoll(6.88348), fRandConeRadius(0.4), fSignalJetRadius(0.4), fBackgroundJetRadius(0.4), fTRBackgroundConeRadius(0.6), fNumberRandCones(8), fNumberExcludedJets(-1), fDijetMaxAngleDeviation(10.0), fPhysicalJetRadius(0.6), fSignalJetEtaWindow(0.5), fBackgroundJetEtaWindow(0.5), fTrackEtaWindow(0.9), fMinTrackPt(0.150), fMinJetPt(1.0), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(100), fCentralityType("V0A"), fFirstLeadingJet(0), fSecondLeadingJet(0), fNumberSignalJets(0), fCrossSection(0.0), fTrials(0.0),  fRandom(0), fHelperClass(0), fInitialized(0), fTaskInstanceCounter(0), fHistList(0), fHistCount(0), fIsDEBUG(0)
+  AliAnalysisTaskChargedJetsPA() : AliAnalysisTaskSE(), fOutputList(0), fAnalyzeJets(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseVertexCut(1), fUsePileUpCut(1), fPartialAnalysisNParts(1), fPartialAnalysisIndex(0), fJetArray(0), fTrackArray(0), fBackgroundJetArray(0), fJetArrayName(0), fTrackArrayName(0), fBackgroundJetArrayName(0), fNumPtHardBins(11), fUsePtHardBin(-1), fRhoTaskName(), fNcoll(6.88348), fRandConeRadius(0.4), fSignalJetRadius(0.4), fBackgroundJetRadius(0.4), fTRBackgroundConeRadius(0.6), fNumberRandCones(8), fNumberExcludedJets(-1), fDijetMaxAngleDeviation(10.0), fPhysicalJetRadius(0.6), fSignalJetEtaWindow(0.5), fBackgroundJetEtaWindow(0.5), fTrackEtaWindow(0.9), fMinTrackPt(0.150), fMinJetPt(1.0), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(100), fCentralityType("V0A"), fFirstLeadingJet(0), fSecondLeadingJet(0), fNumberSignalJets(0), fCrossSection(0.0), fTrials(0.0),  fRandom(0), fHelperClass(0), fInitialized(0), fTaskInstanceCounter(0), fHistList(0), fHistCount(0), fIsDEBUG(0), fEventCounter(0)
   {
     for(Int_t i=0;i<1024;i++)
       fSignalJets[i] = NULL;
@@ -70,7 +70,6 @@ class AliAnalysisTaskChargedJetsPA : public AliAnalysisTaskSE {
   void        GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike);
   void        GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS);
 
-  Int_t       GetRCBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& rhoMedian, Double_t etaMin = 0, Double_t etaMax = 0, Int_t numberRandCones = 0);
   void        GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion);
   void        GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular);
   Double_t    GetConePt(Double_t eta, Double_t phi, Double_t radius);
index c9d15b6..81885f7 100644 (file)
@@ -10,7 +10,7 @@ AliAnalysisTaskChargedJetsPA* AddTaskChargedJetsPA(
   const char*         centralityType          = "V0A",
   Double_t            trackEtaWindow          = 0.9,
   Double_t            minJetPt                = 5.0, // signal jet min pt
-  Double_t            minBackgroundJetPt      = 0.15, // background jet min pt
+  Double_t            minBackgroundJetPt      = 0.0, // background jet min pt
   Double_t            dijetLeadingMinPt       = 10.0,
   Double_t            dijetMaxAngleDev        = 10.0,
   Int_t               numberOfPtHardBins      = 0,
@@ -83,7 +83,6 @@ AliAnalysisTaskChargedJetsPA* AddTaskChargedJetsPA(
       minBackgroundJetPt = 0.15;
   }
 
-
   jetFinderTaskKT->SetMinJetPt(minBackgroundJetPt);
 
   // #### Define extern rho task