AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalTrackSelResultPtr.cxx
Go to the documentation of this file.
1  /**************************************************************************
2  * Copyright(c) 1998-2016, 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 <iostream>
17 #include "AliVTrack.h"
18 
22 
24  TObject(),
25  fTrack(nullptr),
26  fSelectionResult(false),
27  fFlag(0)
28 {
29 
30 }
31 
33  TObject(),
34  fTrack(trk),
35  fSelectionResult(selectionStatus),
36  fFlag(flag)
37 {
38 
39 }
40 
42  TObject(ref),
43  fTrack(ref.fTrack),
44  fSelectionResult(ref.fSelectionResult),
45  fFlag(ref.fFlag)
46 {
47 
48 }
49 
51  TObject(ref),
52  fTrack(ref.fTrack),
53  fSelectionResult(ref.fSelectionResult),
54  fFlag(ref.fFlag)
55 {
56  ref.fTrack = nullptr;
57 }
58 
60  TObject::operator =(ref);
61  if(this != &ref){
62  fTrack = ref.fTrack;
64  fFlag = ref.fFlag;
65  }
66  return *this;
67 }
68 
70  TObject::operator =(ref);
71  if(this != &ref){
72  fTrack = ref.fTrack;
73  fSelectionResult = ref.fSelectionResult;
74  fFlag = ref.fFlag;
75 
76  delete ref.fTrack;
77  }
78  return *this;
79 }
80 
82  return fTrack == other.fTrack;
83 }
84 
86  return fTrack < other.fTrack;
87 }
88 
90  const AliEmcalTrackSelResultPtr *otherobj = static_cast<const AliEmcalTrackSelResultPtr *>(o);
91  if(!otherobj) return false;
92  return *this == *otherobj;
93 }
94 
96  const AliEmcalTrackSelResultPtr *otherobj = static_cast<const AliEmcalTrackSelResultPtr *>(o);
97  if(!otherobj) return 1;
98  if (*this == *otherobj) return 0;
99  if (*this < *otherobj) return -1;
100  return 1;
101 }
102 
104  return fTrack;
105 }
106 
108  return fTrack;
109 }
110 
111 void AliEmcalTrackSelResultPtr::PrintStream(std::ostream &stream) const {
112  stream << "Track selection result for track with address " << fTrack
113  << ": Selection status: " << (fSelectionResult ? "true" : "false")
114  << ", flag: " << fFlag;
115 }
116 
117 std::ostream &operator<<(std::ostream &stream, const AliEmcalTrackSelResultPtr &o){
118  o.PrintStream(stream);
119  return stream;
120 }
Structure containing the result of a given track selection step.
Bool_t fSelectionResult
Result of the track selection (true - selected, false - rejected)
virtual Int_t Compare(const TObject *o) const
AliVTrack * fTrack
Pointer to selected track.
virtual Bool_t IsEqual(const TObject *o) const
int Int_t
Definition: External.C:63
Bool_t operator<(const AliEmcalTrackSelResultPtr &other) const
unsigned long ULong_t
Definition: External.C:38
ULong_t fFlag
Selection flag (optional)
void PrintStream(std::ostream &stream) const
Bool_t operator==(const AliEmcalTrackSelResultPtr &other) const
AliEmcalTrackSelResultPtr & operator=(const AliEmcalTrackSelResultPtr &ref)
bool Bool_t
Definition: External.C:53
std::ostream & operator<<(std::ostream &stream, const AliEmcalTrackSelResultPtr &o)