]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnLoopEff.h
Adding macro to plot <Ncoll>
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnLoopEff.h
1 #ifndef ALIRSNLOOPEFF_H
2 #define ALIRSNLOOPEFF_H
3
4 //
5 // Class to compute an efficiency.
6 // Builds a 2-elements CF container
7 // to fill with resonances generated and passing some defined cuts.
8 //
9
10 #include "AliLog.h"
11
12 #include "AliRsnLoop.h"
13 #include "AliRsnListOutput.h"
14
15 class AliRsnLoopEff : public AliRsnLoop {
16 public:
17
18    AliRsnLoopEff(const char *name = "default", Int_t nSteps = 0, Double_t maxDistPV = 1E-2);
19    AliRsnLoopEff(const AliRsnLoopEff &copy);
20    AliRsnLoopEff &operator=(const AliRsnLoopEff &copy);
21    ~AliRsnLoopEff();
22
23    AliRsnListOutput *GetOutput()          {return fOutput;}
24    void              CreateOutput();
25    void              AddStep(TObject *set);
26    void              SetMaxDistanceFromPV(Double_t value) {fMaxDistPV = value;}
27    virtual void      AddOutput(TObject *) {AliWarning("In loops for efficiency it is not allowed to add outputs externally");}
28    virtual Bool_t    Init(const char *prefix, TList *list);
29
30 protected:
31
32    Int_t             FindTrack(Int_t label, const AliVEvent *event);
33    Int_t             GetMatchedDaughter(Int_t label, AliRsnEvent *event);
34    Double_t          DistanceFromPV(Double_t x, Double_t y, Double_t z);
35    Bool_t            CheckDistanceFromPV(Double_t x, Double_t y, Double_t z) {return (DistanceFromPV(x,y,z) <= fMaxDistPV);}
36
37    Int_t              fAddSteps;  //  number of additional steps
38    TObjArray          fSteps;     //  list of cuts for all steps with MC tracks
39    AliRsnListOutput  *fOutput;    //  unique list output
40    Double_t           fVertex[3]; //! primary vertex position
41    Double_t           fMaxDistPV; //  maximum allowed distance from primary vertex
42
43 private:
44
45    ClassDef(AliRsnLoopEff, 1)
46 };
47
48 #endif
49