AliRoot Core  3dc7879 (3dc7879)
AliESDTrackSelection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include <AliESDTrackSelection.h>
16 #include <TBits.h>
17 #include <TClonesArray.h>
18 #include <TObjArray.h>
19 #include <memory>
20 
21 #include "AliESDEvent.h"
22 #include "AliESDtrack.h"
23 #include "AliESDtrackCuts.h"
24 #include "AliLog.h"
25 #include "AliVCuts.h"
26 
27 ClassImp(AliESDTrackSelection)
28 
29 
34 {
35 }
36 
42 {
43  this->AddTrackCuts(cuts);
44 }
45 
53  if (!fListOfCuts) return kTRUE;
54  AliESDtrack *esdt = dynamic_cast<AliESDtrack *>(trk);
55  if(!esdt){
56  AliError("Failed getting ESD track");
57  return kFALSE;
58  }
59  fTrackBitmap.ResetAllBits();
60  Int_t cutcounter = 0;
61  for (TIter cutIter = TIter(fListOfCuts).Begin(); cutIter != TIter::End(); ++cutIter){
62  if((static_cast<AliVCuts *>(*cutIter))->IsSelected(esdt)) fTrackBitmap.SetBitNumber(cutcounter);
63  cutcounter++;
64  }
65  // In case of ANY at least one bit has to be set, while in case of ALL all bits have to be set
66  if (fSelectionModeAny){
67  return fTrackBitmap.CountBits() > 0 || cutcounter == 0;
68  } else {
69  return fTrackBitmap.CountBits() == cutcounter;
70  }
71 }
virtual bool IsTrackAccepted(AliVTrack *const trk)
void AddTrackCuts(AliVCuts *cuts)
TBits fTrackBitmap
Bitmap of last accepted/rejected track.
Declartion of class AliVTrackSelection.
Bool_t fSelectionModeAny
Accept track if any of the cuts is fulfilled.
Declaration of class AliESDTrackSelection.
TObjArray * fListOfCuts
List of track cut objects.
#define AliError(message)
Definition: AliLog.h:591