AliPhysics  27f281d (27f281d)
AliEmcalTrackSelection.h
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #ifndef ALIEMCALTRACKSELECTION_H_
28 #define ALIEMCALTRACKSELECTION_H_
29 
30 #include <TObject.h>
31 #include <TBits.h>
33 
34 class TClonesArray;
35 class TList;
36 class TObjArray;
37 class AliVCuts;
38 class AliVEvent;
39 class AliVTrack;
40 
41 namespace PWG {
42 namespace EMCAL {
43 
44 class AliEmcalCutBase;
45 
46 }
47 }
48 
65 public:
70 
76  AliEmcalManagedObject(TObject *object, bool owner = true);
77 
86 
94  AliEmcalManagedObject &operator=(const AliEmcalManagedObject &ref);
95 
99  virtual ~AliEmcalManagedObject() { Cleanup(); }
100 
105  operator bool() const { return fManagedObject != NULL; }
106 
111  bool IsOwner() const { return fOwner; }
112 
117  void SetOwner(bool owner = true) { fOwner = owner; }
118 
126  void SetObject(TObject *managedObject, bool owner = true) {
127  Cleanup();
128  fManagedObject = managedObject;
129  fOwner = owner;
130  }
131 
136  TObject *GetObject() { return fManagedObject; }
137 
138 protected:
139 
143  void Cleanup();
144 
145 private:
148 
150  ClassDef(AliEmcalManagedObject, 1);
152 };
153 
172 public:
173 
179  kNoTrackFilter = 0,
188  kHybridTracks2018TRD
189  };
190 
197 
205 
213  AliEmcalTrackSelection &operator=(const AliEmcalTrackSelection &ref);
214 
222  virtual ~AliEmcalTrackSelection();
223 
237  TObjArray *GetAcceptedTracks(const TClonesArray * const tracks);
238 
252  TObjArray *GetAcceptedTracks(const AliVEvent *const event);
253 
268  virtual PWG::EMCAL::AliEmcalTrackSelResultPtr IsTrackAccepted(AliVTrack * const trk) = 0;
269 
287  virtual void GenerateTrackCuts(ETrackFilterType_t type, const char* period = "") = 0;
288 
295  void AddTrackCuts(AliVCuts *cuts);
296 
303  void AddTrackCuts(PWG::EMCAL::AliEmcalCutBase *cuts);
304 
311  void AddTrackCuts(TObjArray *cuts);
312 
317  Int_t GetNumberOfCutObjects() const;
318 
324  PWG::EMCAL::AliEmcalCutBase *GetTrackCuts(Int_t icut);
325 
332  void SetSelectionModeAny() { fSelectionModeAny = kTRUE ; }
333 
340  void SetSelectionModeAll() { fSelectionModeAny = kFALSE; }
341 
346  virtual void SaveQAObjects(TList *outputList) {}
347 
348 protected:
352 
354 
356 };
357 
358 #endif /* ALIEMCALTRACKSELECTION_H_ */
Interface for virtual track selection.
TObject * GetObject()
Providing access to managed object.
TObjArray * fListOfCuts
List of track cut objects.
virtual void SaveQAObjects(TList *outputList)
Structure containing the result of a given track selection step.
TObject * fManagedObject
Pointer to object handled by the smart pointer.
void SetSelectionModeAny()
Set selection mode to any.
void SetOwner(bool owner=true)
Specifying ownership over object.
Bool_t fOwner
Switch defining ownership over object.
Namespace for EMCAL framework classes and task.
bool IsOwner() const
Checks whether the object is set.
Hybrid tracks using the 2011 definition including NoITSrefit tracks (ESD-only)
Hybrid tracks using the 2010 definition including NoITSrefit tracks (ESD-only)
void SetObject(TObject *managedObject, bool owner=true)
Set new managed object with ownership.
int Int_t
Definition: External.C:63
Hybrid tracks using the 2010 definition excluding NoITSrefit tracks (ESD-only)
Hybrid tracks using the 2011 definition excluding NoITSrefit tracks (ESD-only)
Namespace for PWG framework classes.
TObjArray * fListOfTracks
TObjArray with accepted tracks.
Bool_t fSelectionModeAny
Accept track if any of the cuts is fulfilled.
ETrackFilterType_t
Pre-defined track filters.
void SetSelectionModeAll()
Set selection mode to all.
Smart pointer implementation for objects inheriting from TObject.
Interface for a cut class returning selection status and user information.
bool Bool_t
Definition: External.C:53