31 #include "AliVTrack.h" 45 fSelectionResult(false),
51 AliEmcalTrackSelResultPtr::AliEmcalTrackSelResultPtr(AliVTrack *trk,
Bool_t selectionStatus,
TObject * userinfo) :
54 fSelectionResult(selectionStatus),
80 TObject::operator =(ref);
90 TObject::operator =(ref);
111 if(!otherobj)
return false;
112 return *
this == *otherobj;
117 if(!otherobj)
return 1;
118 if (*
this == *otherobj)
return 0;
119 if (*
this < *otherobj)
return -1;
132 stream <<
"Track selection result for track with address " <<
fTrack 211 if(ref.fUserStorage) {
214 ref.fUserStorage =
nullptr;
219 TObject::operator=(ref);
236 TObject::operator=(ref);
244 if(ref.fUserStorage) {
247 ref.fUserStorage =
nullptr;
262 return TestOperatorBool() && TestUserInfo() && TestCopyConstructor() && TestOperatorAssign();
268 bool testresult(
true);
269 if(!(testtrue ==
true)) testresult =
false;
270 if(testfalse ==
true) testresult =
false;
276 for(
int i = 0; i < 10; i++) {
277 TNamed *payloadTrue =
new TNamed(
"truewith",
"true, with object"),
278 *payloadFalse =
new TNamed(
"falsewith",
"false, with user object");
280 truewithout(
nullptr,
true),
281 falsewith(
nullptr,
false, payloadFalse),
282 falsewithout(
nullptr,
false);
284 AliEmcalTrackSelResultPtr cpytruewith(truewith), cpyfalsewith(falsewith), cpytruewithout(truewithout), cpyfalsewithout(falsewithout);
285 if(!(AssertBool(cpytruewith,
true) && AssertBool(cpytruewithout,
true) && AssertBool(cpyfalsewith,
false) && AssertBool(cpyfalsewithout,
false))) failure++;
286 if(!(AssertPayload(cpytruewith, payloadTrue) && AssertPayload(cpytruewithout,
nullptr) && AssertPayload(cpyfalsewith, payloadFalse) && AssertPayload(cpyfalsewithout,
nullptr))) failure++;
293 for(
int i = 0; i < 10; i++) {
294 TNamed *payloadTrue =
new TNamed(
"truewith",
"true, with object"),
295 *payloadFalse =
new TNamed(
"falsewith",
"false, with user object");
297 truewithout(
nullptr,
true),
298 falsewith(
nullptr,
false, payloadFalse),
299 falsewithout(
nullptr,
false);
301 AliEmcalTrackSelResultPtr asgtruewith = truewith, asgfalsewith = falsewith, asgtruewithout = truewithout, asgfalsewithout = falsewithout;
302 if(!(AssertBool(asgtruewith,
true) && AssertBool(asgtruewithout,
true) && AssertBool(asgfalsewith,
false) && AssertBool(asgfalsewithout,
false))) failure++;
303 if(!(AssertPayload(asgtruewith, payloadTrue) && AssertPayload(asgtruewithout,
nullptr) && AssertPayload(asgfalsewith, payloadFalse) && AssertPayload(asgfalsewithout,
nullptr))) failure++;
310 for(
int i = 0; i < 10; i++) {
Bool_t fSelectionResult
Result of the track selection (true - selected, false - rejected)
Bool_t operator<(const AliEmcalTrackSelResultPtr &other) const
bool TestOperatorBool() const
Test for operator bool.
AliEmcalTrackSelResultPtr & operator=(const AliEmcalTrackSelResultPtr &ref)
TObject * fData
User data.
AliEmcalTrackSelResultUserStorage * fUserStorage
Underlying user storage for reference counting.
bool TestCopyConstructor() const
Test copy constructor with user information.
Structure containing the result of a given track selection step.
TObject * GetData() const
Get the object handled by the storage.
Namespace for EMCAL framework classes and task.
Helper class handling the lifetime of the user object handled by AliEmcalTrackSelResultUserPtr.
virtual ~AliEmcalTrackSelResultUserPtr()
Destructor.
bool TestOperatorAssign() const
Tests assignment operatator with user info.
AliVTrack * operator->() const
virtual Bool_t IsEqual(const TObject *o) const
virtual Int_t Compare(const TObject *o) const
Unit test for class AliEmcalTrackSelResultPtr.
AliEmcalTrackSelResultPtr()
AliEmcalTrackSelResultUserPtr()
Dummy constructor.
AliVTrack * operator*() const
Namespace for PWG framework classes.
void Release()
Release user pointer from the storage.
bool RunAllTests() const
Run test suite.
const TObject * GetUserInfo() const
virtual ~AliEmcalTrackSelResultUserStorage()
Destructor.
AliEmcalTrackSelResultUserStorage()
void Connect()
Connect new user pointer instance to the storage.
Int_t fReferenceCount
Reference counter.
bool TestUserInfo() const
Test handling of user storage.
std::ostream & operator<<(std::ostream &stream, const AliEmcalTrackSelResultPtr &ref)
Bool_t operator==(const AliEmcalTrackSelResultPtr &other) const
bool AssertBool(const AliEmcalTrackSelResultPtr &test, bool testvalue) const
AliEmcalTrackSelResultUserPtr fUserInfo
Selection flag (optional)
void test(int runnumber=195345)
AliEmcalTrackSelResultUserPtr & operator=(const AliEmcalTrackSelResultUserPtr &ref)
Assignment operator.
bool AssertPayload(const AliEmcalTrackSelResultPtr &test, void *payload) const
Bool_t GetSelectionResult() const
Handler for user objects attached to the track selection result ptr.
AliVTrack * fTrack
Pointer to selected track.
void PrintStream(std::ostream &stream) const