]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Added threshold for spline systematics and different sys. scale factors below and...
authorbhess <bhess@cern.ch>
Thu, 30 Jan 2014 11:42:42 +0000 (12:42 +0100)
committermvl <marco.van.leeuwen@cern.ch>
Thu, 30 Jan 2014 12:52:41 +0000 (13:52 +0100)
PWGJE/UserTasks/AliAnalysisTaskPID.cxx
PWGJE/UserTasks/AliAnalysisTaskPID.h

index 660b573aa2e5a6cbf1b4d7afb62c549b4f62312c..b8499e8931f82221f1b8f7a44e10101bad9f92a0 100644 (file)
@@ -71,7 +71,9 @@ AliAnalysisTaskPID::AliAnalysisTaskPID()
   , fEtaAbsCutLow(0.0)
   , fEtaAbsCutUp(0.9)
   , fDoAnySystematicStudiesOnTheExpectedSignal(kFALSE)
-  , fSystematicScalingSplines(1.0)
+  , fSystematicScalingSplinesThreshold(50.)
+  , fSystematicScalingSplinesBelowThreshold(1.0)
+  , fSystematicScalingSplinesAboveThreshold(1.0)
   , fSystematicScalingEtaCorrectionMomentumThr(0.35)
   , fSystematicScalingEtaCorrectionLowMomenta(1.0)
   , fSystematicScalingEtaCorrectionHighMomenta(1.0)
@@ -196,7 +198,9 @@ AliAnalysisTaskPID::AliAnalysisTaskPID(const char *name)
   , fEtaAbsCutLow(0.0)
   , fEtaAbsCutUp(0.9)
   , fDoAnySystematicStudiesOnTheExpectedSignal(kFALSE)
-  , fSystematicScalingSplines(1.0)
+  , fSystematicScalingSplinesThreshold(50.)
+  , fSystematicScalingSplinesBelowThreshold(1.0)
+  , fSystematicScalingSplinesAboveThreshold(1.0)
   , fSystematicScalingEtaCorrectionMomentumThr(0.35)
   , fSystematicScalingEtaCorrectionLowMomenta(1.0)
   , fSystematicScalingEtaCorrectionHighMomenta(1.0)
@@ -1089,7 +1093,9 @@ void AliAnalysisTaskPID::CheckDoAnyStematicStudiesOnTheExpectedSignal()
   
   fDoAnySystematicStudiesOnTheExpectedSignal = kFALSE;
   
-  if (TMath::Abs(fSystematicScalingSplines - 1.0) > fgkEpsilon) {
+  
+  if ((TMath::Abs(fSystematicScalingSplinesBelowThreshold - 1.0) > fgkEpsilon) ||
+      (TMath::Abs(fSystematicScalingSplinesAboveThreshold - 1.0) > fgkEpsilon)) {
     fDoAnySystematicStudiesOnTheExpectedSignal = kTRUE;
     return;
   }
@@ -2072,7 +2078,9 @@ void AliAnalysisTaskPID::PrintSystematicsSettings() const
   // Print current settings for systematic studies.
   
   printf("\n\nSettings for systematics for task %s:\n", GetName());
-  printf("Splines:\t%f\n", GetSystematicScalingSplines());
+  printf("SplinesThr:\t%f\n", GetSystematicScalingSplinesThreshold());
+  printf("SplinesBelowThr:\t%f\n", GetSystematicScalingSplinesBelowThreshold());
+  printf("SplinesAboveThr:\t%f\n", GetSystematicScalingSplinesAboveThreshold());
   printf("EtaCorrMomThr:\t%f\n", GetSystematicScalingEtaCorrectionMomentumThr());
   printf("EtaCorrLowP:\t%f\n", GetSystematicScalingEtaCorrectionLowMomenta());
   printf("EtaCorrHighP:\t%f\n", GetSystematicScalingEtaCorrectionHighMomenta());
@@ -2169,12 +2177,47 @@ Bool_t AliAnalysisTaskPID::ProcessTrack(const AliVTrack* track, Int_t particlePD
     dEdxPr = fPIDResponse->GetTPCResponse().GetExpectedSignal(track, AliPID::kProton, AliTPCPIDResponse::kdEdxDefault, kFALSE, kFALSE);
     
     // Scale splines, if desired
-    if (TMath::Abs(fSystematicScalingSplines - 1.0) > fgkEpsilon) {
-      dEdxEl *= fSystematicScalingSplines;
-      dEdxKa *= fSystematicScalingSplines;
-      dEdxPi *= fSystematicScalingSplines;
-      dEdxMu *= fTakeIntoAccountMuons ? fSystematicScalingSplines : 1.;
-      dEdxPr *= fSystematicScalingSplines;
+    if ((TMath::Abs(fSystematicScalingSplinesBelowThreshold - 1.0) > fgkEpsilon) ||
+        (TMath::Abs(fSystematicScalingSplinesAboveThreshold - 1.0) > fgkEpsilon)) {
+       
+      // Tune turn-on of correction for pions (not so relevant for the other species, since at very large momenta)
+      const Double_t pTPC = track->GetTPCmomentum();
+      Double_t bg = 0;
+      Double_t scaleFactor = 1.;
+      Double_t usedSystematicScalingSplines = 1.;
+        
+      bg = pTPC / AliPID::ParticleMass(AliPID::kElectron);
+      scaleFactor = 0.5 * (1. + TMath::Erf((bg - fSystematicScalingSplinesThreshold) / 4.));
+      usedSystematicScalingSplines = fSystematicScalingSplinesBelowThreshold * (1 - scaleFactor)
+                                            + fSystematicScalingSplinesAboveThreshold * scaleFactor;
+      dEdxEl *= usedSystematicScalingSplines;
+      
+      bg = pTPC / AliPID::ParticleMass(AliPID::kKaon);
+      scaleFactor = 0.5 * (1. + TMath::Erf((bg - fSystematicScalingSplinesThreshold) / 4.));
+      usedSystematicScalingSplines = fSystematicScalingSplinesBelowThreshold * (1 - scaleFactor)
+                                            + fSystematicScalingSplinesAboveThreshold * scaleFactor;
+      dEdxKa *= usedSystematicScalingSplines;
+      
+      bg = pTPC / AliPID::ParticleMass(AliPID::kPion);
+      scaleFactor = 0.5 * (1. + TMath::Erf((bg - fSystematicScalingSplinesThreshold) / 4.));
+      usedSystematicScalingSplines = fSystematicScalingSplinesBelowThreshold * (1 - scaleFactor)
+                                            + fSystematicScalingSplinesAboveThreshold * scaleFactor;
+      dEdxPi *= usedSystematicScalingSplines;
+      
+      if (fTakeIntoAccountMuons) {
+        bg = pTPC / AliPID::ParticleMass(AliPID::kMuon);
+        scaleFactor = 0.5 * (1. + TMath::Erf((bg - fSystematicScalingSplinesThreshold) / 4.));
+        usedSystematicScalingSplines = fSystematicScalingSplinesBelowThreshold * (1 - scaleFactor)
+                                              + fSystematicScalingSplinesAboveThreshold * scaleFactor;
+        dEdxMu *= usedSystematicScalingSplines;
+      }
+      
+      
+      bg = pTPC / AliPID::ParticleMass(AliPID::kProton);
+      scaleFactor = 0.5 * (1. + TMath::Erf((bg - fSystematicScalingSplinesThreshold) / 4.));
+      usedSystematicScalingSplines = fSystematicScalingSplinesBelowThreshold * (1 - scaleFactor)
+                                            + fSystematicScalingSplinesAboveThreshold * scaleFactor;
+      dEdxPr *= usedSystematicScalingSplines;
     }
     
     // Get the eta correction factors for the (modified) expected dEdx
index 00e125573d2919b30351a2e0d68a8cc13c471114..0dbb3c7ea5996b76be8f6bdda5ee3ef83cea966d 100644 (file)
@@ -181,9 +181,16 @@ class AliAnalysisTaskPID : public AliAnalysisTaskPIDV0base {
   
   Bool_t IsInAcceptedEtaRange(Double_t etaAbs) const { return (etaAbs >= fEtaAbsCutLow && etaAbs <= fEtaAbsCutUp); };
   
-  Double_t GetSystematicScalingSplines() const { return fSystematicScalingSplines; };
-  void SetSystematicScalingSplines(Double_t scaleFactor) 
-    { fSystematicScalingSplines = scaleFactor; CheckDoAnyStematicStudiesOnTheExpectedSignal(); };
+  Double_t GetSystematicScalingSplinesThreshold() const { return fSystematicScalingSplinesThreshold; };
+  void SetSystematicScalingSplinesThreshold(Double_t threshold) { fSystematicScalingSplinesThreshold = threshold; };
+  
+  Double_t GetSystematicScalingSplinesBelowThreshold() const { return fSystematicScalingSplinesBelowThreshold; };
+  void SetSystematicScalingSplinesBelowThreshold(Double_t scaleFactor) 
+    { fSystematicScalingSplinesBelowThreshold = scaleFactor; CheckDoAnyStematicStudiesOnTheExpectedSignal(); };
+    
+  Double_t GetSystematicScalingSplinesAboveThreshold() const { return fSystematicScalingSplinesAboveThreshold; };
+  void SetSystematicScalingSplinesAboveThreshold(Double_t scaleFactor) 
+    { fSystematicScalingSplinesAboveThreshold = scaleFactor; CheckDoAnyStematicStudiesOnTheExpectedSignal(); };
   
   Double_t GetSystematicScalingEtaCorrectionMomentumThr() const { return fSystematicScalingEtaCorrectionMomentumThr; };
   void SetSystematicScalingEtaCorrectionMomentumThr(Double_t threshold) { fSystematicScalingEtaCorrectionMomentumThr = threshold; };
@@ -280,7 +287,9 @@ class AliAnalysisTaskPID : public AliAnalysisTaskPIDV0base {
   
   // For systematic studies
   Bool_t   fDoAnySystematicStudiesOnTheExpectedSignal; // Internal flag indicating whether any systematic studies are going to be performed
-  Double_t fSystematicScalingSplines;        // Systematic scale factor for the splines (1. = no systematics) 
+  Double_t fSystematicScalingSplinesThreshold;         // beta-gamma threshold for the systematic spline scale factor
+  Double_t fSystematicScalingSplinesBelowThreshold;        // Systematic scale factor for the splines (1. = no systematics) below threshold
+  Double_t fSystematicScalingSplinesAboveThreshold;        // Systematic scale factor for the splines (1. = no systematics) above threshold
   Double_t fSystematicScalingEtaCorrectionMomentumThr;  // Momentum threshold for the systematic scale factor for the eta correction (separates low-p from high-p
   Double_t fSystematicScalingEtaCorrectionLowMomenta;   // Systematic scale factor for the eta correction (1. = no systematics) at low momenta
   Double_t fSystematicScalingEtaCorrectionHighMomenta;  // Systematic scale factor for the eta correction (1. = no systematics) at high momenta
@@ -369,7 +378,7 @@ class AliAnalysisTaskPID : public AliAnalysisTaskPIDV0base {
   AliAnalysisTaskPID(const AliAnalysisTaskPID&); // not implemented
   AliAnalysisTaskPID& operator=(const AliAnalysisTaskPID&); // not implemented
   
-  ClassDef(AliAnalysisTaskPID, 15);
+  ClassDef(AliAnalysisTaskPID, 16);
 };