AliPhysics  vAN-20150924 (e816f45)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEmcalTrackSelection.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 <AliEmcalTrackSelection.h>
16 #include <TObjArray.h>
17 #include "AliVCuts.h"
18 
22 
28  TObject(),
29  fListOfTracks(NULL),
30  fListOfCuts(NULL),
31  fSelectionModeAny(kFALSE)
32 {
33 }
34 
40  TObject(ref),
41  fListOfTracks(NULL),
42  fListOfCuts(NULL),
43  fSelectionModeAny(kFALSE)
44 {
45  if(ref.fListOfTracks) fListOfTracks = new TObjArray(*(ref.fListOfTracks));
46  if(ref.fListOfCuts){
47  fListOfCuts = new TObjArray;
48  fListOfCuts->SetOwner(false);
49  for(TIter cutIter = TIter(ref.fListOfCuts).Begin(); cutIter != TIter::End(); ++cutIter)
50  fListOfCuts->Add(*cutIter);
51  }
52 }
53 
60  TObject::operator=(ref);
61  if(this != &ref){
63  if(ref.fListOfTracks) fListOfTracks = new TObjArray(*(ref.fListOfTracks));
64  if(ref.fListOfCuts){
65  fListOfCuts = new TObjArray;
66  fListOfCuts->SetOwner(false);
67  for(TIter cutIter = TIter(ref.fListOfCuts).Begin(); cutIter != TIter::End(); ++cutIter)
68  fListOfCuts->Add(*cutIter);
69  } else fListOfCuts = NULL;
70  }
71  return *this;
72 }
73 
79  if(fListOfTracks) delete fListOfTracks;
80  if(fListOfCuts) delete fListOfCuts;
81 }
82 
88  if(!fListOfCuts){
89  fListOfCuts = new TObjArray;
90  fListOfCuts->SetOwner(true);
91  }
92  fListOfCuts->Add(cuts);
93 }
94 
100  if(!fListOfCuts) return 0;
101  return fListOfCuts->GetEntries();
102 }
103 
110  if(!fListOfCuts) return NULL;
111  if(icut < fListOfCuts->GetEntries())
112  return static_cast<AliVCuts *>(fListOfCuts->At(icut));
113  return NULL;
114 }
Interface for virtual track selection.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
AliEmcalTrackSelection & operator=(const AliEmcalTrackSelection &ref)
TObjArray * fListOfCuts
List of track cut objects.
AliVCuts * GetTrackCuts(Int_t icut)
void AddTrackCuts(AliVCuts *cuts)
TObjArray * fListOfTracks
TObjArray with accepted tracks.
Declartion of class AliEmcalTrackSelection.