From c312b0881ff353e809e4b16ffc26f4669657af65 Mon Sep 17 00:00:00 2001 From: sgorbuno Date: Wed, 6 Aug 2014 22:16:59 +0200 Subject: [PATCH] Inheritance AliVEvent : virtual public AliVVevent added, since root interpretor can not properly handle double inheritance AliESDEvent: public AliVEvent, public AliVVevent w/o this inheritance VV->V --- STEER/ESD/AliESDEvent.cxx | 4 +-- STEER/ESD/AliESDEvent.h | 2 +- STEER/ESD/AliESDtrack.cxx | 1 - STEER/STEERBase/AliVEvent.cxx | 2 +- STEER/STEERBase/AliVEvent.h | 12 +++++++- STEER/STEERBase/AliVVevent.cxx | 1 - STEER/STEERBase/AliVVevent.h | 55 ++++++++++++++++++++-------------- 7 files changed, 48 insertions(+), 29 deletions(-) diff --git a/STEER/ESD/AliESDEvent.cxx b/STEER/ESD/AliESDEvent.cxx index edb2d2cb428..1c1172818d4 100644 --- a/STEER/ESD/AliESDEvent.cxx +++ b/STEER/ESD/AliESDEvent.cxx @@ -124,8 +124,8 @@ ClassImp(AliESDEvent) //______________________________________________________________________________ AliESDEvent::AliESDEvent(): - AliVEvent(), AliVVevent(), + AliVEvent(), fESDObjects(new TList()), fESDRun(0), fHeader(0), @@ -178,8 +178,8 @@ AliESDEvent::AliESDEvent(): } //______________________________________________________________________________ AliESDEvent::AliESDEvent(const AliESDEvent& esd): - AliVEvent(esd), AliVVevent(), + AliVEvent(esd), fESDObjects(new TList()), fESDRun(new AliESDRun(*esd.fESDRun)), fHeader(new AliESDHeader(*esd.fHeader)), diff --git a/STEER/ESD/AliESDEvent.h b/STEER/ESD/AliESDEvent.h index e0e1c3fd3f2..0c8d7972a68 100644 --- a/STEER/ESD/AliESDEvent.h +++ b/STEER/ESD/AliESDEvent.h @@ -77,7 +77,7 @@ class AliESDCosmicTrack; class TList; class TString; -class AliESDEvent : public AliVEvent, public AliVVevent { +class AliESDEvent : public AliVEvent, virtual public AliVVevent { public: diff --git a/STEER/ESD/AliESDtrack.cxx b/STEER/ESD/AliESDtrack.cxx index c239a588ab2..3862c80c8c1 100644 --- a/STEER/ESD/AliESDtrack.cxx +++ b/STEER/ESD/AliESDtrack.cxx @@ -3303,4 +3303,3 @@ Double_t AliESDtrack::GetdEdxInfo(Int_t regionID, Int_t calibID, Int_t qID, Int return fTPCdEdxInfo->GetdEdxInfo(fIp, regionID, calibID, qID, valueID); } -AliESDtrack tmpp; diff --git a/STEER/STEERBase/AliVEvent.cxx b/STEER/STEERBase/AliVEvent.cxx index d9b85238139..cd7c9674c95 100644 --- a/STEER/STEERBase/AliVEvent.cxx +++ b/STEER/STEERBase/AliVEvent.cxx @@ -24,7 +24,7 @@ AliVEvent::AliVEvent(const AliVEvent& vEvnt) : - TObject(vEvnt) { } // Copy constructor + AliVVevent(), TObject(vEvnt) { } // Copy constructor AliVEvent& AliVEvent::operator=(const AliVEvent& vEvnt) { if (this!=&vEvnt) { diff --git a/STEER/STEERBase/AliVEvent.h b/STEER/STEERBase/AliVEvent.h index f943ebe206d..8bfebff07a5 100644 --- a/STEER/STEERBase/AliVEvent.h +++ b/STEER/STEERBase/AliVEvent.h @@ -13,6 +13,7 @@ // Origin: Markus Oldenburg, CERN, Markus.Oldenburg@cern.ch //------------------------------------------------------------------------- +#include "AliVVevent.h" #include #include #include @@ -32,7 +33,16 @@ class AliVVZERO; class AliVZDC; class AliVMFT; // AU -class AliVEvent : public TObject { +class AliVEvent : public TObject, virtual public AliVVevent { + private: + // disable some methods from AliVEvent interface + + UInt_t GetTimeStamp() const { return 0; } + UInt_t GetEventSpecie() const { return 0; } + Int_t GetNumberOfKinks() const { return 0; } + + AliVVtrack* GetVVTrack(Int_t /*i*/) const { return NULL; } + AliESDkink* GetKink(Int_t /*i*/) const { return NULL; } public: enum EOfflineTriggerTypes { diff --git a/STEER/STEERBase/AliVVevent.cxx b/STEER/STEERBase/AliVVevent.cxx index cf9f28a449f..85c8690d7cd 100644 --- a/STEER/STEERBase/AliVVevent.cxx +++ b/STEER/STEERBase/AliVVevent.cxx @@ -33,4 +33,3 @@ #include "AliVVevent.h" -ClassImp( AliVVevent ) diff --git a/STEER/STEERBase/AliVVevent.h b/STEER/STEERBase/AliVVevent.h index cbe8574e9de..b5b9f151a97 100644 --- a/STEER/STEERBase/AliVVevent.h +++ b/STEER/STEERBase/AliVVevent.h @@ -10,42 +10,56 @@ */ #include "Rtypes.h" #include "TString.h" - class TList; //class AliVVvertex; class AliVVtrack; class AliMultiplicity; -class AliVVkink; class AliVVfriendEvent; class AliESDkink; class TTree; -class AliVVevent { - public: +class AliVVevent{ + public: + // -------------------------------------------------------------------------------- + // -- Constructor / Destructor // -------------------------------------------------------------------------------- - // -- Constructor / Destructors + AliVVevent() {} - virtual ~AliVVevent() {} - - // -------------------------------------------------------------------------------- - virtual void Reset() = 0; + protected: + + ~AliVVevent() {} + public: + // -------------------------------------------------------------------------------- + // -- Methods, common for AliVEvent and AliVVevent interface // -------------------------------------------------------------------------------- - // Access methods - virtual Double_t GetMagneticField() const = 0; + // Access methods + + virtual Double_t GetMagneticField() const = 0; virtual UInt_t GetPeriodNumber() const = 0; virtual Int_t GetRunNumber() const = 0; virtual UInt_t GetOrbitNumber() const = 0; virtual UShort_t GetBunchCrossNumber() const = 0; - virtual UInt_t GetTimeStamp() const = 0; virtual ULong64_t GetTriggerMask() const = 0; - virtual TString GetFiredTriggerClasses() const = 0; - virtual UInt_t GetEventSpecie() const = 0; + virtual TString GetFiredTriggerClasses() const = 0; virtual Int_t GetNumberOfTracks() const = 0; virtual Int_t GetNumberOfV0s() const = 0; + + // Other methods + + virtual void Reset() = 0; + virtual void ConnectTracks() = 0; + + // -------------------------------------------------------------------------------- + // -- Methods, specific for AliVVevent (are disabled in AliVEvent interface) + // -------------------------------------------------------------------------------- + + virtual UInt_t GetTimeStamp() const = 0; + virtual UInt_t GetEventSpecie() const = 0; + virtual Int_t GetNumberOfKinks() const = 0; /* @@ -54,22 +68,19 @@ class AliVVevent { virtual const AliVVvertex* GetPrimaryVertexTracks() const {return NULL;} virtual const AliVVvertex* GetPrimaryVertexTPC() const {return NULL;} */ + virtual AliVVtrack* GetVVTrack(Int_t /*i*/) const = 0; virtual AliESDkink* GetKink(Int_t /*i*/) const = 0; //virtual AliVVtrack* GetV0(Int_t /*i*/) const = 0; - virtual void ConnectTracks() = 0; - - // ESD interfaces, not yet implemented in flat esd (may be not needed, may be need some changes) + + // some ESD interfaces, not yet implemented in flat esd (may be not needed, may be need some changes) //virtual Int_t GetEventNumberInFile() const = 0; - //virtual const AliMultiplicity* GetMultiplicity() const = 0; //by default SPDmult - //virtual TObject* FindListObject(const char* /*name*/) const = 0; + //virtual const AliMultiplicity* GetMultiplicity() const = 0; //by default SPDmult //virtual AliVVfriendEvent* FindFriend() const = 0; - //virtual void ReadFromTree(TTree* /*tree*/, Option_t* /*opt*/) = 0; - //virtual TList* GetList() const = 0; - ClassDef(AliVVevent,0) // base class for event data + ClassDef(AliVVevent, 1) }; #endif -- 2.43.0