AliPhysics  56f1704 (56f1704)
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,
187  kHybridTracks2011woNoRefit
188  };
189 
196 
204 
212  AliEmcalTrackSelection &operator=(const AliEmcalTrackSelection &ref);
213 
221  virtual ~AliEmcalTrackSelection();
222 
236  TObjArray *GetAcceptedTracks(const TClonesArray * const tracks);
237 
251  TObjArray *GetAcceptedTracks(const AliVEvent *const event);
252 
267  virtual PWG::EMCAL::AliEmcalTrackSelResultPtr IsTrackAccepted(AliVTrack * const trk) = 0;
268 
286  virtual void GenerateTrackCuts(ETrackFilterType_t type, const char* period = "") = 0;
287 
294  void AddTrackCuts(AliVCuts *cuts);
295 
302  void AddTrackCuts(PWG::EMCAL::AliEmcalCutBase *cuts);
303 
310  void AddTrackCuts(TObjArray *cuts);
311 
316  Int_t GetNumberOfCutObjects() const;
317 
323  PWG::EMCAL::AliEmcalCutBase *GetTrackCuts(Int_t icut);
324 
331  void SetSelectionModeAny() { fSelectionModeAny = kTRUE ; }
332 
339  void SetSelectionModeAll() { fSelectionModeAny = kFALSE; }
340 
345  virtual void SaveQAObjects(TList *outputList) {}
346 
347 protected:
351 
353 
355 };
356 
357 #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)
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