fOutList->Clear();
fRsnAnalysisManager.InitAllPairs(fOutList);
+ fOutList->SetOwner(kTRUE);
PostData(2, fOutList);
}
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// This cut is used to select PbPb events w.r. to their centrality class.
+// It uses the AliCentrality object, and specifically its method to get
+// the centrality percentile.
+// The centrality estimator is decided by the user, in a second string
+// in the constructor after the name.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliLog.h"
+
+#include "AliRsnCutCentrality.h"
+
+ClassImp(AliRsnCutCentrality)
+
+//__________________________________________________________________________________________________
+AliRsnCutCentrality::AliRsnCutCentrality(const char *name, const char *est, Double_t min, Double_t max) :
+ AliRsnCut(name, AliRsnTarget::kEvent, min, max)
+{
+//
+// Constructor
+//
+
+ SetTitle(est);
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutCentrality::AliRsnCutCentrality(const AliRsnCutCentrality& copy) :
+ AliRsnCut(copy)
+{
+//
+// Copy constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnCutCentrality& AliRsnCutCentrality::operator=(const AliRsnCutCentrality& copy)
+{
+//
+// Assignment operator
+//
+
+ AliRsnCut::operator=(copy);
+
+ return (*this);
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnCutCentrality::IsSelected(TObject *object)
+{
+//
+// Cut checking method.
+// Checks current event and compares the percentile centrality
+// with the allowed range.
+//
+
+ if (!TargetOK(object)) return kFALSE;
+
+ AliESDEvent *esd = fEvent->GetRefESD();
+ AliAODEvent *aod = fEvent->GetRefAOD();
+
+ // esd
+ if (esd) {
+ AliDebug(AliLog::kDebug + 2, "Centrality for ESDs");
+ AliCentrality *centrality = esd->GetCentrality();
+ if (centrality) {
+ fCutValueD = centrality->GetCentralityPercentile(fTitle.Data());
+ return OkRangeD();
+ } else {
+ AliError("Centrality object is not present");
+ return kFALSE;
+ }
+ }
+ else {
+ AliError("Currently the implementation works only with ESDs");
+ return kFALSE;
+ }
+}
--- /dev/null
+#ifndef ALIRSNCUTCENTRALITY_H
+#define ALIRSNCUTCENTRALITY_H
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Centrality cut
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliRsnCut.h"
+
+class AliRsnCutCentrality : public AliRsnCut {
+
+public:
+
+ AliRsnCutCentrality(const char *name = "cut", const char *est = "VOM", Double_t min = 0, Double_t max = 100.0);
+ AliRsnCutCentrality(const AliRsnCutCentrality& copy);
+ AliRsnCutCentrality& operator=(const AliRsnCutCentrality& copy);
+ virtual ~AliRsnCutCentrality() { }
+
+ void SetEstimator(const char *est) {SetTitle(est);}
+ virtual Bool_t IsSelected(TObject *object);
+
+private:
+
+ ClassDef(AliRsnCutCentrality,1)
+};
+
+#endif
//
////////////////////////////////////////////////////////////////////////////////
+#include <Riostream.h>
#include "AliESDtrackCuts.h"
#include "AliESDpid.h"
#include "AliAODPid.h"
+#include "AliCentrality.h"
#include "AliRsnEvent.h"
#include "AliRsnDaughter.h"
case kEventMultMC: return "EventMultMC";
case kEventMultESDCuts: return "EventMultESDCuts";
case kEventVz: return "EventVz";
+ case kEventCentralityV0: return "EventCentralityV0";
+ case kEventCentralityTrack: return "EventCentralityTrack";
+ case kEventCentralityCL1: return "EventCentralityCL1";
default: return "Undefined";
}
}
case kPairY:
// pair:
// rapidity (requires an AliRsnPairDef to get mass hypothesis)
- if (!pairDef) {
+ if (pairDef) {
pRec.SetXYZM(pRec.X(), pRec.Y(), pRec.Z(), pairDef->GetMotherMass());
pSim.SetXYZM(pSim.X(), pSim.Y(), pSim.Z(), pairDef->GetMotherMass());
fComputedValue = useMC ? pSim.Rapidity() : pRec.Rapidity();
// Z position of primary vertex
fComputedValue = fgCurrentEvent->GetRef()->GetPrimaryVertex()->GetZ();
return kTRUE;
+ case kEventCentralityV0:
+ // event:
+ // centrality using V0 method
+ if (esdev) {
+ AliCentrality *centrality = esdev->GetCentrality();
+ fComputedValue = centrality->GetCentralityPercentile("V0M");
+ return kTRUE;
+ } else {
+ AliError(Form("[%s] Centrality computation is implemented for ESDs only up to now", GetName()));
+ return kFALSE;
+ }
+ case kEventCentralityTrack:
+ // event:
+ // centrality using tracks method
+ if (esdev) {
+ AliCentrality *centrality = esdev->GetCentrality();
+ fComputedValue = centrality->GetCentralityPercentile("TRK");
+ return kTRUE;
+ } else {
+ AliError(Form("[%s] Centrality computation is implemented for ESDs only up to now", GetName()));
+ return kFALSE;
+ }
+ case kEventCentralityCL1:
+ // event:
+ // centrality using CL1 method
+ if (esdev) {
+ AliCentrality *centrality = esdev->GetCentrality();
+ fComputedValue = centrality->GetCentralityPercentile("CL1");
+ return kTRUE;
+ } else {
+ AliError(Form("[%s] Centrality computation is implemented for ESDs only up to now", GetName()));
+ return kFALSE;
+ }
default:
AliError(Form("[%s] Invalid value type for this computation", GetName()));
return kFALSE;
kEventMultMC, // multiplicity from MC
kEventMultESDCuts, // multiplicity computed as the number of track passing an ESD quality cut (need this cut defined)
kEventVz, // Z position of event primary vertex
+ kEventCentralityV0, // event centrality (V0 method)
+ kEventCentralityTrack, // event centrality (tracks method)
+ kEventCentralityCL1, // event centrality (CL1 method)
kValueTypes // --- last value (used to have a meaningless enum value) ---------------
};