4 //* This file is property of and copyright by the ALICE Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
6 //* See cxx source for full Copyright notice *
8 /// @file AliDxHFEParticleSelection.h
9 /// @author Sedat Altinpinar, Hege Erdal, Matthias Richter
11 /// @brief Base class for particle selection
14 #ifndef ALIDXHFEPARTICLESELECTION_H
15 #define ALIDXHFEPARTICLESELECTION_H
26 * @class AliDxHFEParticleSelection
27 * This is the base class for particle selections for the D0 - HFE
28 * correlation studies.
31 * - configurable particle selection
32 * - eventually histogramming of particle properties before vs. after
35 * Might be that there is already something similar, then this class
36 * can be merged with some other class.
38 class AliDxHFEParticleSelection : public TNamed {
41 AliDxHFEParticleSelection(const char* name=NULL, const char* opt="");
43 virtual ~AliDxHFEParticleSelection();
53 void SetOption(const char* opt) { fOption = opt; }
54 /// overloaded from TObject: get option
55 virtual Option_t* GetOption() const { return fOption;}
57 /// init the control objects
58 virtual int InitControlObjects();
60 /// create selection from 'Tracks' member of the event,
61 /// array contains only pointers but does not own the objects
62 /// object array needs to be deleted by caller
63 virtual TObjArray* Select(const AliVEvent* pEvent);
64 /// create selection from the array of particles,
65 /// array contains only pointers but does not own the objects
66 /// object array needs to be deleted by caller
67 virtual TObjArray* Select(TObjArray* particles, const AliVEvent* pEvent);
69 // Get the list fControlObjects.
70 const TList* GetControlObjects() const {return fControlObjects;}
72 /// histogram event properties
73 virtual int HistogramEventProperties(int bin);
75 /// check and add track to internal array
76 int CheckAndAdd(AliVParticle* p);
78 /// set cuts object: general TObject pointer is used as argument to support
79 // different types; a type cast check is implemented in the method
80 virtual void SetCuts(TObject* /*cuts*/, int /*level*/=0) {}
82 Bool_t GetUseMC() const {return fUseMC;}
84 /// get selected tracks
85 const TObjArray* GetSelected() const {return fSelectedTracks;}
87 /// check particle if it passes the selection criteria
88 virtual int IsSelected(AliVParticle* p, const AliVEvent *pEvent=NULL);
90 /// inherited from TObject: cleanup
91 virtual void Clear(Option_t * option ="");
92 /// inherited from TObject: print info
93 virtual void Print(Option_t *option="") const;
94 /// inherited from TObject: safe selection criteria
95 virtual void SaveAs(const char *filename="", Option_t *option="") const;
96 /// inherited from TObject: draw content
97 virtual void Draw(Option_t *option="");
98 /// inherited from TObject: find object by name
99 virtual TObject* FindObject(const char *name) const;
100 /// inherited from TObject: find object by pointer
101 virtual TObject* FindObject(const TObject *obj) const;
104 void SetVerbosity(int verbosity) {fVerbosity=verbosity;}
106 int GetVerbosity() const {return fVerbosity;}
109 /// add control object to list, the base class becomes owner of the object
110 int AddControlObject(TObject* pObj);
112 /// histogram particle properties
113 virtual int HistogramParticleProperties(AliVParticle* p, int selected=1);
115 /// set from the specific child class implementation
116 /// TODO: think about removing this function
117 /// in principle that should not be necessary, the analysis should
118 /// be blind after the particle selection
119 void SetUseMC(bool useMC=true) {fUseMC=useMC;}
122 /// copy contructor prohibited
123 AliDxHFEParticleSelection(const AliDxHFEParticleSelection&);
124 /// assignment operator prohibited
125 AliDxHFEParticleSelection& operator=(const AliDxHFEParticleSelection&);
127 TString fOption; // option
128 TObjArray* fSelectedTracks; //! array of selected tracks
130 // control histograms, note: only the list is saved, pointers only used for fast access
131 TList* fControlObjects; // list of control objects
132 TH1* fhEventControl; //! event control histogram
133 TH1* fhTrackControl; //! track control histogram
134 bool fUseMC; // specific implementation for MC selection
135 int fVerbosity; //! verbosity
137 static const char* fgkEventControlBinNames[]; //! bin labels for event control histogram
139 ClassDef(AliDxHFEParticleSelection, 2);