ClassImp(AliRsnCutPIDNSigma)
+//_________________________________________________________________________________________________
+AliRsnCutPIDNSigma::AliRsnCutPIDNSigma() :
+ AliRsnCut("cut", AliRsnTarget::kDaughter),
+ fSpecies(AliPID::kUnknown),
+ fDetector(kDetectors),
+ fRejectUnmatched(kFALSE),
+ fMomMin(0.0),
+ fMomMax(1E20),
+ fNSigma(1E20)
+{
+//
+// Main constructor.
+//
+}
+
//_________________________________________________________________________________________________
AliRsnCutPIDNSigma::AliRsnCutPIDNSigma
(const char *name, AliPID::EParticleType species, EDetector det, Double_t nsigma) :
- AliRsnCut(name, AliRsnCut::kDaughter, -nsigma, nsigma),
+ AliRsnCut(name, AliRsnTarget::kDaughter),
fSpecies(species),
fDetector(det),
+ fRejectUnmatched(kFALSE),
fMomMin(0.0),
fMomMax(1E20),
- fRejectUnmatched(kFALSE)
+ fNSigma(nsigma)
{
//
// Main constructor.
AliRsnCut(copy),
fSpecies(copy.fSpecies),
fDetector(copy.fDetector),
+ fRejectUnmatched(copy.fRejectUnmatched),
fMomMin(copy.fMomMin),
fMomMax(copy.fMomMax),
- fRejectUnmatched(copy.fRejectUnmatched)
+ fNSigma(copy.fNSigma)
{
//
// Copy constructor.
fSpecies = copy.fSpecies;
fDetector = copy.fDetector;
+ fRejectUnmatched = copy.fRejectUnmatched;
fMomMin = copy.fMomMin;
fMomMax = copy.fMomMax;
- fRejectUnmatched = copy.fRejectUnmatched;
+ fNSigma = copy.fNSigma;
return (*this);
}
// get reference momentum, for range cut
Double_t momentum = -1.0;
- if (!fDaughter->Ref2Vtrack()) {
+ AliVTrack *vtrack = fDaughter->Ref2Vtrack();
+ if (!vtrack) {
AliDebugClass(2, "Referenced daughter is not a track");
return kFALSE;
}
if (fDetector == kTPC)
- momentum = fDaughter->Ref2Vtrack()->GetTPCmomentum();
+ momentum = vtrack->GetTPCmomentum();
else
- momentum = fDaughter->GetRef()->P();
+ momentum = vtrack->P();
- // check momentum range, if required
+ // check momentum range
if (momentum < fMomMin || momentum > fMomMax) {
AliDebugClass(2, Form("Track momentum = %.5f, outside allowed range [%.2f - %.2f]", momentum, fMomMin, fMomMax));
return kFALSE;
}
- // matching check, if required
- if (fRejectUnmatched) {
- switch (fDetector) {
- case kITS:
- if (!IsITS(fDaughter->Ref2Vtrack())) {
- AliDebug(3, "Rejecting track not matched in ITS");
- return kFALSE;
- }
- break;
- case kTPC:
- if (!IsTPC(fDaughter->Ref2Vtrack())) {
- AliDebug(3, "Rejecting track not matched in TPC");
- return kFALSE;
- }
- break;
- case kTOF:
- if (!IsTOF(fDaughter->Ref2Vtrack())) {
- AliDebug(3, "Rejecting track not matched in TOF");
- return kFALSE;
- }
- break;
- default:
- AliWarning("Required to reject unmatched tracks, but no detector defined. Track rejected");
- return kFALSE;
- }
- }
-
// check PID
- // the number of sigmas is set as cut value, which is then checked
- // using the basic functions available in AliRsnCut
+ Bool_t matched;
+ Double_t nsigma;
switch (fDetector) {
case kITS:
- fCutValueD = pid->NumberOfSigmasITS(fDaughter->GetRef(), fSpecies);
+ matched = IsITS(vtrack);
+ nsigma = pid->NumberOfSigmasITS(vtrack, fSpecies);
break;
case kTPC:
- fCutValueD = pid->NumberOfSigmasTPC(fDaughter->GetRef(), fSpecies);
+ matched = IsTPC(vtrack);
+ nsigma = pid->NumberOfSigmasTPC(vtrack, fSpecies);
break;
case kTOF:
- fCutValueD = pid->NumberOfSigmasTOF(fDaughter->GetRef(), fSpecies);
+ matched = IsTOF(vtrack);
+ nsigma = pid->NumberOfSigmasTOF(vtrack, fSpecies);
break;
default:
+ AliError("Bad detector chosen. Rejecting track");
return kFALSE;
}
- return OkRangeD();
+ // determine cut result
+ if (fRejectUnmatched && (matched == kFALSE)) {
+ AliDebugClass(2, "Required to reject unmatched traks, and this track is not matched in the detector");
+ return kFALSE;
+ } else {
+ AliDebugClass(2, Form("Nsigma = %.5f, maximum allowed = %.2f", nsigma, fNSigma));
+ if (TMath::Abs(nsigma) <= fNSigma) {
+ AliDebugClass(2, "Track accepted");
+ return kTRUE;
+ } else {
+ AliDebugClass(2, "Track rejected");
+ return kFALSE;
+ }
+ }
}
//_________________________________________________________________________________________________
#define ALIRSNCUTPIDNSIGMA_H
//
-// Class for generalized n-sigma PID cuts with detectors.
-// Allows to choose the detector to check and define a momentum range
-// in order to permit different cuts in different ranges.
+// Class for n-sigma PID cuts.
+// ---
+// Requires:
//
+// 1) the used detector, chosen from an enumeration
+// 2) the reference charged particle species, chosen from AliPID enumeration
+// 3) a momentum range: outside it, the cut is never passed
+//
+
+#include <TMath.h>
#include "AliPID.h"
kDetectors
};
- AliRsnCutPIDNSigma(const char *name = "cutPIDNsigma", AliPID::EParticleType species = AliPID::kUnknown, EDetector det = kDetectors, Double_t nsigma = 3.0);
+ AliRsnCutPIDNSigma();
+ AliRsnCutPIDNSigma(const char *name, AliPID::EParticleType species, EDetector det, Double_t nsigma);
AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy);
AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy);
virtual ~AliRsnCutPIDNSigma() { }
- void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;}
- void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;}
- void SetNSigmaRange(Double_t min, Double_t max) {AliRsnCut::SetRangeD(min, max);}
void SetSpecies(AliPID::EParticleType type) {fSpecies = type;}
+ void SetDetector(EDetector det) {fDetector = det;}
+ void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;}
+ void SetNSigma(Double_t nsigma) {fNSigma = nsigma;}
+ void SetMomentumRange(Double_t min, Double_t max);
Bool_t IsITS(const AliVTrack *vtrack) const;
Bool_t IsTPC(const AliVTrack *vtrack) const;
AliPID::EParticleType fSpecies; // particle species
EDetector fDetector; // detector used for PID
- Double_t fMomMin; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
- Double_t fMomMax; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut?
+ Double_t fMomMin; // momentum range (ITS/TOF: vertex momentum, TPC: mom at inner wall)
+ Double_t fMomMax; // momentum range (ITS/TOF: vertex momentum, TPC: mom at inner wall)
+ Double_t fNSigma; // nsigma range
ClassDef(AliRsnCutPIDNSigma, 1)
};
+inline void AliRsnCutPIDNSigma::SetMomentumRange(Double_t min, Double_t max)
+{
+//
+// Assigns the range in total momentum used for check
+// For ITS and TOF, it is used to check momentum at vertex,
+// for TPC it is used to check momentum at TPC inner barrel
+//
+
+ fMomMin = TMath::Min(min, max);
+ fMomMax = TMath::Max(min, max);
+}
+
inline Bool_t AliRsnCutPIDNSigma::IsITS(const AliVTrack *vtrack) const
{
//
--- /dev/null
+//
+// Analysis task for 'mini' sub-package
+// Contains all definitions needed for running an analysis:
+// -- global event cut
+// -- a list of track cuts (any number)
+// -- definitions of output histograms
+// -- values to be computed.
+// Each one must be defined using the "CREATE" methods, which
+// add directly a new element in the task collections, and don't
+// need an external object to be passed to the task itself.
+//
+
+#include <Riostream.h>
+
+#include <TH1.h>
+#include <TList.h>
+#include <TTree.h>
+
+#include "AliLog.h"
+#include "AliEventplane.h"
+#include "AliMultiplicity.h"
+#include "AliTriggerAnalysis.h"
+#include "AliAnalysisManager.h"
+#include "AliInputEventHandler.h"
+
+#include "AliESDtrackCuts.h"
+#include "AliESDUtils.h"
+
+#include "AliAODEvent.h"
+#include "AliAODMCParticle.h"
+
+#include "AliRsnCutSet.h"
+#include "AliRsnMiniPair.h"
+#include "AliRsnMiniEvent.h"
+#include "AliRsnMiniParticle.h"
+
+#include "AliRsnMiniMonitorTask.h"
+
+ClassImp(AliRsnMiniMonitorTask)
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitorTask::AliRsnMiniMonitorTask() :
+ AliAnalysisTaskSE(),
+ fUseMC(kFALSE),
+ fEvNum(0),
+ fUseCentrality(kFALSE),
+ fCentralityType("QUALITY"),
+ fOutput(0x0),
+ fHistograms("AliRsnMiniMonitor", 0),
+ fEventCuts(0x0),
+ fTrackCuts(0),
+ fRsnEvent(),
+ fBigOutput(kFALSE)
+{
+//
+// Dummy constructor ALWAYS needed for I/O.
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const char *name, Bool_t useMC) :
+ AliAnalysisTaskSE(name),
+ fUseMC(useMC),
+ fEvNum(0),
+ fUseCentrality(kFALSE),
+ fCentralityType("QUALITY"),
+ fOutput(0x0),
+ fHistograms("AliRsnMiniMonitor", 0),
+ fEventCuts(0x0),
+ fTrackCuts(0),
+ fRsnEvent(),
+ fBigOutput(kFALSE)
+{
+//
+// Default constructor.
+// Define input and output slots here (never in the dummy constructor)
+// Input slot #0 works with a TChain - it is connected to the default input container
+// Output slot #1 writes into a TH1 container
+//
+
+ DefineOutput(1, TList::Class());
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask& copy) :
+ AliAnalysisTaskSE(copy),
+ fUseMC(copy.fUseMC),
+ fEvNum(0),
+ fUseCentrality(copy.fUseCentrality),
+ fCentralityType(copy.fCentralityType),
+ fOutput(0x0),
+ fHistograms(copy.fHistograms),
+ fEventCuts(copy.fEventCuts),
+ fTrackCuts(copy.fTrackCuts),
+ fRsnEvent(),
+ fBigOutput(copy.fBigOutput)
+{
+//
+// Copy constructor.
+// Implemented as requested by C++ standards.
+// Can be used in PROOF and by plugins.
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitorTask& AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorTask& copy)
+{
+//
+// Assignment operator.
+// Implemented as requested by C++ standards.
+// Can be used in PROOF and by plugins.
+//
+
+ AliAnalysisTaskSE::operator=(copy);
+
+ fUseMC = copy.fUseMC;
+ fUseCentrality = copy.fUseCentrality;
+ fCentralityType = copy.fCentralityType;
+ fHistograms = copy.fHistograms;
+ fEventCuts = copy.fEventCuts;
+ fTrackCuts = copy.fTrackCuts;
+ fBigOutput = copy.fBigOutput;
+
+ return (*this);
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitorTask::~AliRsnMiniMonitorTask()
+{
+//
+// Destructor.
+// Clean-up the output list, but not the histograms that are put inside
+// (the list is owner and will clean-up these histograms). Protect in PROOF case.
+//
+
+
+ if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
+ delete fOutput;
+ }
+}
+
+//__________________________________________________________________________________________________
+Int_t AliRsnMiniMonitorTask::AddTrackCuts(AliRsnCutSet *cuts)
+{
+//
+// Add a new cut set for a new criterion for track selection.
+// A user can add as many as he wants, and each one corresponds
+// to one of the available bits in the AliRsnMiniParticle mask.
+// The only check is the following: if a cut set with the same name
+// as the argument is there, this is not added.
+// Return value is the array position of this set.
+//
+
+ TObject *obj = fTrackCuts.FindObject(cuts->GetName());
+
+ if (obj) {
+ AliInfo(Form("A cut set named '%s' already exists", cuts->GetName()));
+ return fTrackCuts.IndexOf(obj);
+ } else {
+ fTrackCuts.AddLast(cuts);
+ return fTrackCuts.IndexOf(cuts);
+ }
+}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniMonitorTask::UserCreateOutputObjects()
+{
+//
+// Initialization of outputs.
+// This is called once per worker node.
+//
+
+ // reset counter
+ fEvNum = 0;
+
+ // message
+ AliInfo(Form("Selected event characterization: %s (%s)", (fUseCentrality ? "centrality" : "multiplicity"), fCentralityType.Data()));
+
+ // create list and set it as owner of its content (MANDATORY)
+ if (fBigOutput) OpenFile(1);
+ fOutput = new TList();
+ fOutput->SetOwner();
+
+ // create one histogram per each stored definition (event histograms)
+ Int_t i, ndef = fHistograms.GetEntries();
+ AliRsnMiniMonitor *def = 0x0;
+ for (i = 0; i < ndef; i++) {
+ def = (AliRsnMiniMonitor*)fHistograms[i];
+ if (!def) continue;
+ if (!def->Init(GetName(), fOutput)) {
+ AliError(Form("Def '%s': failed initialization", def->GetName()));
+ continue;
+ }
+ }
+
+ // post data for ALL output slots >0 here, to get at least an empty histogram
+ PostData(1, fOutput);
+}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniMonitorTask::UserExec(Option_t *)
+{
+//
+// Computation loop.
+// In this case, it checks if the event is acceptable, and eventually
+// creates the corresponding mini-event and stores it in the buffer.
+// The real histogram filling is done at the end, in "FinishTaskOutput".
+//
+
+ // event counter
+ fEvNum++;
+
+ // check current event
+ Char_t check = CheckCurrentEvent();
+ if (!check) return;
+
+ // setup PID response
+ AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+ AliInputEventHandler *inputHandler = (AliInputEventHandler*)man->GetInputEventHandler();
+ fRsnEvent.SetPIDResponse(inputHandler->GetPIDResponse());
+
+ // loop on monitors and fill them
+ Int_t it, icut, nTracks = fRsnEvent.GetAbsoluteSum(), nCuts = fTrackCuts.GetEntriesFast();
+ AliRsnDaughter cursor;
+ AliRsnCutSet *cut = 0x0;
+ AliRsnMiniMonitor *mon = 0x0;
+ TObjArrayIter next(&fHistograms);
+ for (it = 0; it < nTracks; it++) {
+ fRsnEvent.SetDaughter(cursor, it, fUseMC);
+ next.Reset();
+ while ( (mon = (AliRsnMiniMonitor*)next()) ) {
+ icut = mon->GetCutID();
+ if (icut >= 0 && icut < nCuts) {
+ cut = (AliRsnCutSet*)fTrackCuts[icut];
+ if (!cut) {
+ AliError("Cut not found");
+ continue;
+ }
+ if (!cut->IsSelected(&cursor)) continue;
+ }
+ mon->Fill(&cursor, &fRsnEvent);
+ }
+ }
+
+ // post data for computed stuff
+ PostData(1, fOutput);
+}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniMonitorTask::Terminate(Option_t *)
+{
+//
+// Draw result to screen, or perform fitting, normalizations
+// Called once at the end of the query
+//
+
+ fOutput = dynamic_cast<TList*>(GetOutputData(1));
+ if (!fOutput) {
+ AliError("Could not retrieve TList fOutput");
+ return;
+ }
+}
+
+//__________________________________________________________________________________________________
+Char_t AliRsnMiniMonitorTask::CheckCurrentEvent()
+{
+//
+// This method checks if current event is OK for analysis.
+// In case it is, the pointers of the local AliRsnEvent data member
+// will point to it, in order to allow cut checking, otherwise the
+// function exits with a failure message.
+// ---
+// ESD events must pass the physics selection, AOD are supposed to do.
+// ---
+// While checking the event, a histogram is filled to count the number
+// of CINT1B, V0AND and CANDLE events, which are needed for normalization
+// ---
+// Return values can be:
+// -- 'E' if the event is accepted and is ESD
+// -- 'A' if the event is accepted and is AOD
+// -- 0 if the event is not accepted
+//
+
+ // string to sum messages
+ TString msg("");
+
+ // check input type
+ // exit points are provided in all cases an event is bad
+ // if this block is passed, an event can be rejected only
+ // if it does not pass the set of event cuts defined in the task
+ Char_t output = 0;
+ Bool_t isSelected;
+ if (fInputEvent->InheritsFrom(AliESDEvent::Class())) {
+ // type ESD
+ output = 'E';
+ // ESD specific check: Physics Selection
+ // --> if this is failed, the event is rejected
+ isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
+ if (!isSelected) {
+ AliDebugClass(2, "Event does not pass physics selections");
+ fRsnEvent.SetRef(0x0);
+ fRsnEvent.SetRefMC(0x0);
+ return 0;
+ }
+ // set reference to input
+ fRsnEvent.SetRef(fInputEvent);
+ // add MC if requested and available
+ if (fUseMC) {
+ if (fMCEvent)
+ fRsnEvent.SetRefMC(fMCEvent);
+ else {
+ AliWarning("MC event requested but not available");
+ fRsnEvent.SetRefMC(0x0);
+ }
+ }
+ } else if (fInputEvent->InheritsFrom(AliAODEvent::Class())) {
+ // type AOD
+ output = 'A';
+ // set reference to input
+ fRsnEvent.SetRef(fInputEvent);
+ // add MC if requested and available (it is in the same object)
+ if (fUseMC) {
+ fRsnEvent.SetRefMC(fInputEvent);
+ if (!fRsnEvent.GetAODList()) {
+ AliWarning("MC event requested but not available");
+ fRsnEvent.SetRefMC(0x0);
+ }
+ }
+ } else {
+ AliError(Form("Bad input event class: %s", fInputEvent->ClassName()));
+ // reset pointers in local AliRsnEvent object
+ fRsnEvent.SetRef(0x0);
+ fRsnEvent.SetRefMC(0x0);
+ return 0;
+ }
+
+ // if event cuts are defined, they are checked here
+ // final decision on the event depends on this
+ isSelected = kTRUE;
+ if (fEventCuts) {
+ if (!fEventCuts->IsSelected(&fRsnEvent)) {
+ msg += " -- Local cuts = REJECTED";
+ isSelected = kFALSE;
+ } else {
+ msg += " -- Local cuts = ACCEPTED";
+ isSelected = kTRUE;
+ }
+ } else {
+ msg += " -- Local cuts = NONE";
+ isSelected = kTRUE;
+ }
+
+ // if the above exit point is not taken, the event is accepted
+ AliDebugClass(2, Form("Stats for event %d: %s", fEvNum, msg.Data()));
+ if (isSelected) {
+ return output;
+ } else {
+ return 0;
+ }
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniMonitorTask::ComputeCentrality(Bool_t isESD)
+{
+//
+// Computes event centrality/multiplicity according to the criterion defined
+// by two elements: (1) choice between multiplicity and centrality and
+// (2) the string defining what criterion must be used for specific computation.
+//
+
+ if (fUseCentrality) {
+ AliCentrality *centrality = fInputEvent->GetCentrality();
+ if (!centrality) {
+ AliError("Cannot compute centrality!");
+ return -1.0;
+ }
+ return centrality->GetCentralityPercentile(fCentralityType.Data());
+ } else {
+ if (!fCentralityType.CompareTo("TRACKS"))
+ return fInputEvent->GetNumberOfTracks();
+ else if (!fCentralityType.CompareTo("QUALITY"))
+ if (isESD)
+ return AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent*)fInputEvent, kTRUE);
+ else {
+ Double_t count = 0.;
+ Int_t iTrack, ntracksLoop = fInputEvent->GetNumberOfTracks();
+ for (iTrack = 0; iTrack < ntracksLoop; iTrack++) {
+ AliVTrack *track = (AliVTrack*)fInputEvent->GetTrack(iTrack);
+ AliAODTrack *aodt = dynamic_cast<AliAODTrack*>(track);
+ if (!aodt) continue;
+ if (!aodt->TestFilterBit(5)) continue;
+ count++;
+ }
+ return count;
+ }
+ else if (!fCentralityType.CompareTo("TRACKLETS")) {
+ if (isESD) {
+ const AliMultiplicity *mult = ((AliESDEvent*)fInputEvent)->GetMultiplicity();
+ Float_t nClusters[6] = {0.0,0.0,0.0,0.0,0.0,0.0};
+ for(Int_t ilay = 0; ilay < 6; ilay++) nClusters[ilay] = (Float_t)mult->GetNumberOfITSClusters(ilay);
+ return AliESDUtils::GetCorrSPD2(nClusters[1], fInputEvent->GetPrimaryVertex()->GetZ());
+ } else {
+ AliWarning("Cannot compute multiplicity with SPD tracklets from AOD");
+ return 1E20;
+ }
+ } else {
+ AliError(Form("String '%s' does not define a possible multiplicity/centrality computation", fCentralityType.Data()));
+ return -1.0;
+ }
+ }
+}
--- /dev/null
+#ifndef ALIRSNMINIMonitorTask_H
+#define ALIRSNMINIMonitorTask_H
+
+//
+// Analysis task for 'mini' sub-package
+// Contains all definitions needed for running an analysis:
+// -- global event cut
+// -- a list of track cuts (any number)
+// -- definitions of output histograms
+// -- values to be computed.
+//
+
+#include <TString.h>
+#include <TClonesArray.h>
+
+#include "AliAnalysisTaskSE.h"
+
+#include "AliRsnEvent.h"
+#include "AliRsnMiniMonitor.h"
+
+class TList;
+
+class AliTriggerAnalysis;
+class AliRsnMiniEvent;
+class AliRsnCutSet;
+
+class AliRsnMiniMonitorTask : public AliAnalysisTaskSE {
+
+public:
+
+ AliRsnMiniMonitorTask();
+ AliRsnMiniMonitorTask(const char *name, Bool_t isMC = kFALSE);
+ AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask ©);
+ AliRsnMiniMonitorTask& operator=(const AliRsnMiniMonitorTask ©);
+ virtual ~AliRsnMiniMonitorTask();
+
+ void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;}
+ void UseCentrality(const char *type) {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();}
+ void UseMultiplicity(const char *type) {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();}
+ void SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;}
+ Int_t AddTrackCuts(AliRsnCutSet *cuts);
+ TClonesArray *Outputs() {return &fHistograms;}
+
+ virtual void UserCreateOutputObjects();
+ virtual void UserExec(Option_t*);
+ virtual void Terminate(Option_t*);
+
+ AliRsnMiniMonitor *CreateMonitor(const char *name, AliRsnMiniMonitor::EType type, Int_t cutID);
+
+private:
+
+ Char_t CheckCurrentEvent();
+ Double_t ComputeCentrality(Bool_t isESD);
+
+ Bool_t fUseMC; // use or not MC info
+ Int_t fEvNum; //! absolute event counter
+ Bool_t fUseCentrality; // if true, use centrality for event, otherwise use multiplicity
+ TString fCentralityType; // definition used to choose what centrality or multiplicity to use
+
+ TList *fOutput; // output list
+ TClonesArray fHistograms; // list of histogram definitions
+
+ AliRsnCutSet *fEventCuts; // cuts on events
+ TObjArray fTrackCuts; // list of single track cuts
+ AliRsnEvent fRsnEvent; //! interface object to the event
+ Bool_t fBigOutput; // flag if open file for output list
+
+ ClassDef(AliRsnMiniMonitorTask, 1); // AliRsnMiniMonitorTask
+};
+
+inline AliRsnMiniMonitor* AliRsnMiniMonitorTask::CreateMonitor
+(const char *name, AliRsnMiniMonitor::EType type, Int_t cutID)
+{
+//
+// Create a new histogram definition in the task,
+// which is then returned to the user for its configuration
+//
+
+ Int_t n = fHistograms.GetEntries();
+ AliRsnMiniMonitor *newDef = new (fHistograms[n]) AliRsnMiniMonitor(name, type, cutID);
+
+ return newDef;
+}
+
+#endif