AliPhysics  17bbbac (17bbbac)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTrackContainer.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 ALITRACKCONTAINER_H
28 #define ALITRACKCONTAINER_H
29 
30 class AliVEvent;
31 class AliVParticle;
32 class AliVCuts;
34 
35 #include <TArrayC.h>
36 
37 #include "AliVTrack.h"
38 #include "AliEmcalTrackSelection.h"
40 #include "AliParticleContainer.h"
41 
42 #if !(defined(__CINT__) || defined(__MAKECINT__))
45 #endif
46 
55  public:
56 
67  class TrackOwnerHandler : public TObject {
68  public:
70  TrackOwnerHandler(TObjArray *managedobject, Bool_t ownership);
73  virtual ~TrackOwnerHandler();
74 
75  void SetObject(TObjArray *obj);
76  void SetOwner(Bool_t owner);
77 
78  TObjArray *GetData() const { return fManagedObject; }
79  Bool_t IsOwner() const { return fOwnership; }
80 
83 
84  private:
87 
89  ClassDef(TrackOwnerHandler, 1);
91  };
92 
94 
99  enum ETrackType_t {
100  kRejected = -1,
105  };
106 
108  AliTrackContainer(const char *name, const char *period = "");
109  virtual ~AliTrackContainer(){;}
110 
111  virtual Bool_t ApplyTrackCuts(const AliVTrack* vp, UInt_t &rejectionReason) const;
112  virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const { return AcceptTrack(i, rejectionReason) ; }
113  virtual Bool_t AcceptObject(const TObject* obj, UInt_t &rejectionReason) const { return AcceptTrack(dynamic_cast<const AliVTrack*>(obj), rejectionReason); }
114  virtual Bool_t AcceptParticle(Int_t i, UInt_t &rejectionReason) const { return AcceptTrack(i, rejectionReason); }
115  virtual Bool_t AcceptParticle(const AliVParticle* vp, UInt_t &rejectionReason) const { return AcceptTrack(dynamic_cast<const AliVTrack*>(vp), rejectionReason); }
116  virtual AliVParticle *GetParticle(Int_t i=-1) const { return GetTrack(i) ; }
117  virtual AliVParticle *GetAcceptParticle(Int_t i=-1) const { return GetAcceptTrack(i) ; }
118  virtual AliVParticle *GetNextAcceptParticle() { return GetNextAcceptTrack() ; }
119  virtual AliVParticle *GetNextParticle() { return GetNextTrack() ; }
120  virtual Bool_t AcceptTrack(const AliVTrack* vp, UInt_t &rejectionReason) const;
121  virtual Bool_t AcceptTrack(Int_t i, UInt_t &rejectionReason) const;
122  virtual AliVTrack *GetLeadingTrack(const char* opt="") { return static_cast<AliVTrack*>(GetLeadingParticle(opt)); }
123  virtual AliVTrack *GetTrack(Int_t i=-1) const;
124  virtual AliVTrack *GetAcceptTrack(Int_t i=-1) const;
125  virtual AliVTrack *GetNextAcceptTrack() ;
126  virtual AliVTrack *GetNextTrack() ;
127  Char_t GetTrackType(const AliVTrack* track) const;
128  virtual Bool_t GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack* track, Double_t mass) const;
129  virtual Bool_t GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack* track) const;
130  virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const;
131  virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const;
132  virtual Bool_t GetNextMomentum(TLorentzVector &mom);
133  virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom);
134  Int_t GetNTracks() const { return GetNParticles() ; }
137  Char_t GetTrackType(Int_t i) const { return i >= 0 && i < fTrackTypes.GetSize() ? fTrackTypes[i] : (Char_t)kUndefined ; }
138 
139  void SetArray(const AliVEvent *event);
140 
144 
145  void SetTrackCutsPeriod(const char* period) { fTrackCutsPeriod = period; }
146  void AddTrackCuts(AliVCuts *cuts);
148  AliVCuts *GetTrackCuts(Int_t icut);
149  void SetAODFilterBits(UInt_t bits) { fAODFilterBits = bits ; }
150  void AddAODFilterBit(UInt_t bit) { fAODFilterBits |= bit ; }
153 
156 
157  void NextEvent(const AliVEvent* event);
158 
159  static void SetDefTrackCutsPeriod(const char* period) { fgDefTrackCutsPeriod = period; }
161 
162  const char* GetTitle() const;
163 
164 #if !(defined(__CINT__) || defined(__MAKECINT__))
165  const AliTrackIterableContainer all() const;
166  const AliTrackIterableContainer accepted() const;
167 
170 #endif
171 
172  protected:
181  virtual TString GetDefaultArrayName(const AliVEvent * const ev) const;
182 
184 
186 
195  TArrayC fTrackTypes;
196 
197  private:
198  AliTrackContainer(const AliTrackContainer& obj); // copy constructor
199  AliTrackContainer& operator=(const AliTrackContainer& other); // assignment
200 
202  ClassDef(AliTrackContainer,1);
204 };
205 
206 #endif
207 
Interface for virtual track selection.
void SetTrackCutsPeriod(const char *period)
double Double_t
Definition: External.C:58
Int_t GetNTracks() const
static TString fgDefTrackCutsPeriod
! default period string used to generate track cuts
const AliTrackIterableContainer accepted() const
Double_t mass
TrackOwnerHandler & operator=(const TrackOwnerHandler &other)
Int_t GetNParticles() const
Container with name, TClonesArray and cuts for particles.
EMCALIterableContainer::AliEmcalIterableContainerT< AliVTrack, EMCALIterableContainer::operator_star_object< AliVTrack > > AliTrackIterableContainer
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
char Char_t
Definition: External.C:18
Track selected under the constrained hybrid track cuts.
UInt_t fAODFilterBits
track filter bits
void NextEvent(const AliVEvent *event)
Structure containing the result of a given track selection step.
const AliTrackIterableContainer all() const
void ReceiveOwnershipFrom(TrackOwnerHandler &source)
AliVCuts * GetTrackCuts(Int_t icut)
virtual Bool_t GetNextMomentum(TLorentzVector &mom)
Char_t GetTrackType(Int_t i) const
AliEmcalTrackSelection * fEmcalTrackSelection
! track selection object
virtual Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
ETrackFilterType_t fTrackFilterType
track filter type
TString fTrackCutsPeriod
period string used to generate track cuts
Container for particles within the EMCAL framework.
Track selected under the constrained hybrid track cuts without ITS refit.
UInt_t GetAODFilterBits() const
PWG::EMCAL::AliEmcalTrackSelResultHybrid::HybridType_t GetHybridDefinition(const PWG::EMCAL::AliEmcalTrackSelResultPtr &selectionResult) const
Bool_t fITSHybridTrackDistinction
Distinct hybrid tracks via SPD information.
void SetITSHybridTrackDistinction(Bool_t doUse)
virtual Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
virtual Bool_t GetMomentumFromTrack(TLorentzVector &mom, const AliVTrack *track, Double_t mass) const
ETrackType_t
Status of a track after track selection.
virtual Bool_t AcceptParticle(Int_t i, UInt_t &rejectionReason) const
void SetAODFilterBits(UInt_t bits)
TrackOwnerHandler fFilteredTracks
! tracks filtered using fEmcalTrackSelection
virtual Bool_t ApplyTrackCuts(const AliVTrack *vp, UInt_t &rejectionReason) const
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
int Int_t
Definition: External.C:63
TObjArray * fManagedObject
Object managed by the handler.
virtual AliVParticle * GetParticle(Int_t i=-1) const
unsigned int UInt_t
Definition: External.C:33
EMCALIterableContainer::AliEmcalIterableContainerT< AliVTrack, EMCALIterableContainer::operator_star_pair< AliVTrack > > AliTrackIterableMomentumContainer
virtual Bool_t AcceptTrack(const AliVTrack *vp, UInt_t &rejectionReason) const
Int_t GetNumberOfCutObjects() const
static void SetDefTrackCutsPeriod(const char *period)
void SetFilterHybridTracks(Bool_t f)
virtual AliVParticle * GetLeadingParticle(const char *opt="")
static TString GetDefTrackCutsPeriod()
TArrayC fTrackTypes
! track types
TObjArray * fListOfCuts
list of track cut objects
void AddAODFilterBit(UInt_t bit)
virtual AliVParticle * GetNextParticle()
ETrackFilterType_t GetTrackFilterType() const
virtual AliVTrack * GetNextTrack()
virtual ~AliTrackContainer()
virtual Bool_t AcceptObject(const TObject *obj, UInt_t &rejectionReason) const
Bool_t fSelectionModeAny
accept track if any of the cuts is fulfilled
virtual AliVTrack * GetTrack(Int_t i=-1) const
Track selected under the global hybrid track cuts.
virtual AliVTrack * GetLeadingTrack(const char *opt="")
Bool_t fOwnership
Ownership implementation.
virtual AliVTrack * GetNextAcceptTrack()
AliEmcalTrackSelection::ETrackFilterType_t ETrackFilterType_t
Char_t GetTrackType(const AliVTrack *track) const
void AddTrackCuts(AliVCuts *cuts)
ETrackFilterType_t
Pre-defined track filters.
virtual TString GetDefaultArrayName(const AliVEvent *const ev) const
void SetArray(const AliVEvent *event)
virtual AliVTrack * GetAcceptTrack(Int_t i=-1) const
virtual Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
const AliTrackIterableMomentumContainer accepted_momentum() const
const char * GetTitle() const
void SetTrackFilterType(ETrackFilterType_t f)
virtual AliVParticle * GetNextAcceptParticle()
bool Bool_t
Definition: External.C:53
void TransferOwnershipTo(TrackOwnerHandler &target)
Int_t GetNAcceptedParticles() const
Unique_ptr implementation for ROOT5 compatibility.
virtual Bool_t AcceptObject(Int_t i, UInt_t &rejectionReason) const
AliTrackContainer & operator=(const AliTrackContainer &other)
Track status undefined.
const AliTrackIterableMomentumContainer all_momentum() const
Bool_t IsHybridTrackSelection() const