2 // *** Class AliRsnPair ***
4 // "Core" method for defining the work on a pari of particles.
5 // For one analysis, one must setup one of this for each pair he wants to analyze,
6 // adding to it all analysis which he desires to do.
7 // Here he defines the cuts, and the particle types and charges, and can add
8 // functions which do different operations on the same pair, and some binning
9 // with respect to some kinematic variables (eta, momentum)
11 // authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
12 // M. Vala (email: martin.vala@cern.ch)
15 #include "AliRsnLoopEff.h"
17 ClassImp(AliRsnLoopEff)
19 //_____________________________________________________________________________
20 AliRsnLoopEff::AliRsnLoopEff(const char *name, Int_t nSteps) :
26 // Default constructor
30 //_____________________________________________________________________________
31 AliRsnLoopEff::AliRsnLoopEff(const AliRsnLoopEff& copy) :
33 fAddSteps(copy.fAddSteps),
41 //_____________________________________________________________________________
42 AliRsnLoopEff& AliRsnLoopEff::operator=(const AliRsnLoopEff& copy)
44 AliRsnLoop::operator=(copy);
46 fAddSteps = copy.fAddSteps;
52 //_____________________________________________________________________________
53 AliRsnLoopEff::~AliRsnLoopEff()
62 //_____________________________________________________________________________
63 void AliRsnLoopEff::CreateOutput()
66 // Create the unique output object of this loop
69 if (!fOutputs.IsEmpty()) {
70 AliInfo("Clearing container of this efficiency loop.");
74 AliRsnListOutput out(Form("%s_out", GetName()), AliRsnListOutput::kCFContainer);
75 out.SetSteps(NStepsAll());
80 //_____________________________________________________________________________
81 void AliRsnLoopEff::AddStep(TObject *cuts)
84 // Add a step on reconstruction
90 //_____________________________________________________________________________
91 Bool_t AliRsnLoopEff::Init(const char *prefix, TList *list)
94 // Initialization function.
95 // Loops on all functions and eventual the ntuple, to initialize output objects.
99 return AliRsnLoop::Init(Form("%s_%s", prefix, GetName()), list);
102 //_____________________________________________________________________________
103 Int_t AliRsnLoopEff::FindTrack(Int_t label, AliVEvent *event)
106 // Loops an event and find all tracks which have a label
107 // equal to that passed as first argument.
111 Int_t ntracks = event->GetNumberOfTracks();
114 for (i = 0; i < ntracks; i++) {
115 AliVParticle *track = event->GetTrack(i);
116 if (TMath::Abs(track->GetLabel()) != label) continue;