AliPhysics  vAN-20150429 (ffa5c54)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEMCalPtTaskVTrackSelection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2014, 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 <TObjArray.h>
16 #include "AliVCuts.h"
18 
22 
23 namespace EMCalTriggerPtAnalysis {
24 
28 AliEMCalPtTaskVTrackSelection::AliEMCalPtTaskVTrackSelection() :
29  TObject(),
30  fListOfTracks(NULL),
31  fListOfCuts(NULL)
32 {
33 }
34 
40  TObject(ref),
41  fListOfTracks(NULL),
42  fListOfCuts(NULL)
43 {
44  if(ref.fListOfTracks) fListOfTracks = new TObjArray(*(ref.fListOfTracks));
45  if(ref.fListOfCuts){
46  fListOfCuts = new TObjArray;
47  fListOfCuts->SetOwner(false);
48  for(TIter cutIter = TIter(ref.fListOfCuts).Begin(); cutIter != TIter::End(); ++cutIter)
49  fListOfCuts->Add(*cutIter);
50  }
51 }
52 
59  TObject::operator=(ref);
60  if(this != &ref){
62  if(ref.fListOfTracks) fListOfTracks = new TObjArray(*(ref.fListOfTracks));
63  if(ref.fListOfCuts){
64  fListOfCuts = new TObjArray;
65  fListOfCuts->SetOwner(false);
66  for(TIter cutIter = TIter(ref.fListOfCuts).Begin(); cutIter != TIter::End(); ++cutIter)
67  fListOfCuts->Add(*cutIter);
68  } else fListOfCuts = NULL;
69  }
70  return *this;
71 }
72 
78  if(fListOfTracks) delete fListOfTracks;
79  if(fListOfCuts) delete fListOfCuts;
80 }
81 
87  if(!fListOfCuts){
88  fListOfCuts = new TObjArray;
89  fListOfCuts->SetOwner(true);
90  }
91  fListOfCuts->Add(cuts);
92 }
93 
99  if(!fListOfCuts) return 0;
100  return fListOfCuts->GetEntries();
101 }
102 
109  if(!fListOfCuts) return NULL;
110  if(icut < fListOfCuts->GetEntries())
111  return static_cast<AliVCuts *>(fListOfCuts->At(icut));
112  return NULL;
113 }
114 
115 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
AliEMCalPtTaskVTrackSelection & operator=(const AliEMCalPtTaskVTrackSelection &ref)
TObjArray * fListOfTracks
TObjArray with accepted tracks.
Declartion of class AliEMCalPtTaskVTrackSelection.