Allow swapping the sign of eta in case of asymmetric collision systems
authormfasel <mfasel@lbl.gov>
Thu, 4 Sep 2014 07:35:21 +0000 (09:35 +0200)
committermverweij <marta.verweij@cern.ch>
Thu, 4 Sep 2014 07:50:48 +0000 (09:50 +0200)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTrigger.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTrigger.h

index 31549f0..6601610 100644 (file)
@@ -71,7 +71,8 @@ namespace EMCalTriggerPtAnalysis {
                                fHistos(NULL),
                                fListTrackCuts(NULL),
                                fEtaRange(),
-                               fPtRange()
+                               fPtRange(),
+                               fSwapEta(kFALSE)
        {
                /*
                 * Main constructor, setting default values for eta and zvertex cut
@@ -522,7 +523,8 @@ namespace EMCalTriggerPtAnalysis {
                 * @param isPileup: flag event as pileup event
                 * @param cut: id of the cut (0 = no cut)
                 */
-        double data[6] = {track->Pt(), track->Eta(), track->Phi(), vz, 0, static_cast<double>(cut)};
+               double etasign = fSwapEta ? -1. : 1.;
+        double data[6] = {track->Pt(), etasign * track->Eta(), track->Phi(), vz, 0, static_cast<double>(cut)};
                char histname[1024];
                sprintf(histname, "hTrackHist%s", trigger);
                try{
index 6582d6d..5f10ff4 100644 (file)
@@ -36,6 +36,7 @@ public:
        void AddTrackCuts(AliESDtrackCuts *trackCuts) { fListTrackCuts->Add(trackCuts); }
        void SetEtaRange(double etamin, double etamax) { fEtaRange.SetLimits(etamin, etamax); }
        void SetPtRange(double ptmin, double ptmax) { fPtRange.SetLimits(ptmin, ptmax); }
+       void SetSwapEta() { fSwapEta = kTRUE; }
 
 private:
        AliAnalysisTaskPtEMCalTrigger(const AliAnalysisTaskPtEMCalTrigger &);
@@ -56,6 +57,7 @@ private:
        // Cuts
        AliCutValueRange<double>      fEtaRange;              // Eta Selection Range
        AliCutValueRange<double>          fPtRange;                               // Pt Selection Range
+       Bool_t                                            fSwapEta;                               // Allow swapping of the eta sign in asymmetric collision systems
 
        ClassDef(AliAnalysisTaskPtEMCalTrigger, 1);           // Analysis of EMCal triggered events
 };