flat classes now have Reinitialize functions, which call special constructor, removed...
authorsgweber <steffen.georg.weber@cern.ch>
Mon, 7 Jul 2014 10:55:39 +0000 (12:55 +0200)
committersgweber <steffen.georg.weber@cern.ch>
Mon, 7 Jul 2014 10:55:39 +0000 (12:55 +0200)
13 files changed:
HLT/CMakelibAliHLTGlobal.pkg
HLT/global/AliFlatESDEvent.cxx
HLT/global/AliFlatESDEvent.h
HLT/global/AliFlatESDTrack.cxx
HLT/global/AliFlatESDTrack.h
HLT/global/AliFlatESDV0.cxx
HLT/global/AliFlatESDV0.h
HLT/global/AliFlatESDVertex.cxx
HLT/global/AliFlatESDVertex.h
HLT/global/AliFlatExternalTrackParam.cxx [deleted file]
HLT/global/AliFlatExternalTrackParam.h
HLT/global/AliFlatTPCCluster.cxx [deleted file]
HLT/global/AliFlatTPCCluster.h

index 378b1b7..0be9963 100644 (file)
@@ -49,8 +49,6 @@ set ( CLASS_HDRS
     AliFlatESDVertex.h
     AliFlatESDTrack.h
     AliFlatESDV0.h
-    AliFlatExternalTrackParam.h
-    AliFlatTPCCluster.h
     physics/AliHLTV0HistoComponent.h
     physics/AliHLTCaloHistoComponent.h
     physics/AliHLTCaloHistoProducer.h
index f2e6859..2df570b 100644 (file)
@@ -73,34 +73,33 @@ AliFlatESDEvent::AliFlatESDEvent() :
 }
 
 // _______________________________________________________________________________________________________
-AliFlatESDEvent::AliFlatESDEvent(AliFlatESDSpecialConstructorFlag f)
+void AliFlatESDEvent::Reinitialize()
 {
-  //special constructor, used to restore the vtable pointer
-  //uses the special dummy constructors of contained objects
+//
+// Initializing function
+//
+// to be called after event is received via reinterpret_cast from memory
   
-       if(f == AliFlatESDReinitialize){
+  
+       new (this) AliFlatESDEvent(AliFlatESDReinitialize);
                AliFlatESDVertex* vertexSPD = const_cast<AliFlatESDVertex*>(GetPrimaryVertexSPD());
-               if (vertexSPD ) { new (vertexSPD) AliFlatESDVertex(f); }
+               if (vertexSPD ) {vertexSPD->Reinitialize(); }
                AliFlatESDVertex* vertexTracks = const_cast<AliFlatESDVertex*>(GetPrimaryVertexTracks());
-               if (vertexTracks ) { new (vertexTracks) AliFlatESDVertex(f); }
+               if (vertexTracks ) { vertexTracks->Reinitialize(); }
                AliFlatESDTrack* track = GetTracks();
                
                for (Int_t i=0; i<GetNumberOfTracks(); i++)
                {
-                       new (track) AliFlatESDTrack(f);
+                       track->Reinitialize();
                        track= track->GetNextTrack();
                }
        AliFlatESDV0* v0 = GetV0s();
        for (Int_t i=0; i<GetNumberOfV0s(); i++)
        {
-                       new (v0) AliFlatESDV0(f);
+                       v0->Reinitialize();
                        v0++;
                }
        }
-       else{
-               AliFlatESDEvent();
-       }
-}
 
 /*
 AliFlatESDEvent::AliFlatESDEvent(const AliFlatESDEvent& ev) :
index b79b69f..4f276bf 100644 (file)
@@ -120,12 +120,7 @@ class AliFlatESDEvent: public AliVVevent {
 //
 // to be called after event is received via reinterpret_cast from memory
 
-void Reinitialize()
-  {
-    new (this) AliFlatESDEvent(AliFlatESDReinitialize);
-  }
-
-
+void Reinitialize();
 
  private:
   AliFlatESDEvent(const AliFlatESDEvent&);
@@ -134,7 +129,7 @@ void Reinitialize()
 // special constructor, to be called by placement new,
 // when accessing information after reinterpret_cast
 // so that vtable is generated, but values are not overwritten
-       AliFlatESDEvent(AliFlatESDSpecialConstructorFlag);
+       AliFlatESDEvent(AliFlatESDSpecialConstructorFlag){}
 
   void FillPrimaryVertex(const AliESDVertex *v, Byte_t flag);
   Int_t FillNextTrack( const AliESDtrack* esdTrack,  AliESDfriendTrack* friendTrack);
index 1f41149..32a5465 100644 (file)
@@ -56,32 +56,33 @@ AliFlatESDTrack::AliFlatESDTrack() :
 }
 
 // _______________________________________________________________________________________________________
-AliFlatESDTrack::AliFlatESDTrack(AliFlatESDSpecialConstructorFlag f)
+void AliFlatESDTrack::Reinitialize()
 {
-  //special contructor
-  //use to restore the vtable pointer
+//
+// Initializing function
+//
+// to be called after track is received via reinterpret_cast from memory
   
-  if(f == AliFlatESDReinitialize){
+  
+       new (this) AliFlatESDTrack(AliFlatESDReinitialize);
                AliFlatExternalTrackParam* trackParam = GetTrackParamRefitted();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                trackParam = GetTrackParamIp();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                trackParam = GetTrackParamTPCInner();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                trackParam = GetTrackParamOp();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                trackParam = GetTrackParamCp();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                trackParam = GetTrackParamITSOut();
-               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               if (trackParam) { trackParam->Reinitialize(); }
                
                AliFlatTPCCluster* clusterTPC = GetTPCClusters();
                for (Int_t i=0; i<fNTPCClusters; i++){
-                 new (clusterTPC) AliFlatTPCCluster(f);
+                 clusterTPC->Reinitialize();
                  clusterTPC++;
                 }
-       }
-       else AliFlatESDTrack();
 }
 
 // _______________________________________________________________________________________________________
index 46b10f2..89f3bb4 100644 (file)
@@ -28,7 +28,6 @@ class AliESDfriendTrack;
 class AliExternalTrackParam;
 
 class AliFlatESDTrack: public AliVVtrack {
- friend class AliFlatESDEvent;
  public:
   // --------------------------------------------------------------------------------
   // -- Constructor / Destructors
@@ -121,12 +120,14 @@ class AliFlatESDTrack: public AliVVtrack {
   // -- Size methods
   static ULong64_t EstimateSize(Bool_t useESDFriends = kTRUE, Int_t nTPCClusters = 160 );
          ULong64_t GetSize()  {return fContent -  reinterpret_cast<Byte_t*>(this) + fSize;}
-    
+         
+         
+  void Reinitialize();
 
  private:
   AliFlatESDTrack(const AliFlatESDTrack&);
-  AliFlatESDTrack& operator=(const AliFlatESDTrack&);
-  AliFlatESDTrack(AliFlatESDSpecialConstructorFlag);
+  AliFlatESDTrack& operator=(const AliFlatESDTrack&);  
+  AliFlatESDTrack(AliFlatESDSpecialConstructorFlag){}
 
   Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
 
index 7505283..6897d84 100644 (file)
 
 #include "AliFlatESDV0.h"
 
-AliFlatESDV0::AliFlatESDV0(AliFlatESDSpecialConstructorFlag f){
-       if(f == AliFlatESDReinitialize);
-  else AliFlatESDV0();
-}
-
-
-AliFlatESDV0::AliFlatESDV0():
-// Default constructor
-       fNegTrackID(0),
-       fPosTrackID(0){
-}
-
-
-
-
index 4df221c..91d19ec 100644 (file)
 
 class AliFlatESDV0: public AliVVv0
 {
- friend class AliFlatESDEvent;
  public:
   AliFlatESDV0();
   virtual ~AliFlatESDV0() {}
+  void Reinitialize(){
+       new (this) AliFlatESDV0(AliFlatESDReinitialize);
+  }
   Int_t fNegTrackID;
   Int_t fPosTrackID;
  private:
-       AliFlatESDV0(AliFlatESDSpecialConstructorFlag f );
+       AliFlatESDV0(AliFlatESDSpecialConstructorFlag){}
 };
-
 //typedef struct AliFlatESDV0 AliFlatESDV0;
 
 #endif
index faf57f0..b8ae416 100644 (file)
@@ -11,7 +11,3 @@ void AliFlatESDVertex::Set(const AliESDVertex &v )
   fNContributors = v.GetNContributors();
   fChi2 = v.GetChi2();
 }
-AliFlatESDVertex::AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f){
-       if(f == AliFlatESDReinitialize);
-  else AliFlatESDVertex();
-}
index 00d62bd..c49130c 100644 (file)
@@ -17,7 +17,6 @@
 class AliFlatESDVertex: public AliVVvertex
 //class AliFlatESDVertex
 {
- friend class AliFlatESDEvent;
  public:
   Double32_t fPosition[3];    // vertex position
   Double32_t fCov[6];  // vertex covariance matrix
@@ -37,7 +36,11 @@ class AliFlatESDVertex: public AliVVvertex
   }
 
   void Set(const AliESDVertex &v );
-
+  
+  void Reinitialize(){
+       new (this) AliFlatESDVertex(AliFlatESDReinitialize);
+  }
+  
   Double32_t GetX() const { return fPosition[0]; }
   Double32_t GetY() const { return fPosition[1]; }
   Double32_t GetZ() const { return fPosition[2]; }
@@ -97,8 +100,7 @@ class AliFlatESDVertex: public AliVVvertex
 
  private:
   
-       AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f);
+       AliFlatESDVertex(AliFlatESDSpecialConstructorFlag){}
 };
 
 #endif
diff --git a/HLT/global/AliFlatExternalTrackParam.cxx b/HLT/global/AliFlatExternalTrackParam.cxx
deleted file mode 100644 (file)
index 59c08fb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $Id$ */
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-#include "AliFlatExternalTrackParam.h"
-AliFlatExternalTrackParam::AliFlatExternalTrackParam(AliFlatESDSpecialConstructorFlag f){
-       if(f == AliFlatESDReinitialize);
-  else AliFlatExternalTrackParam();
-
-}
-
-
-
-
index e922191..3ec69cc 100644 (file)
@@ -16,7 +16,6 @@
 
 class AliFlatExternalTrackParam: public AliVVexternalTrackParam
 {
- friend class AliFlatESDTrack;
  public:
   AliFlatExternalTrackParam() {}
   virtual ~AliFlatExternalTrackParam() {}
@@ -37,6 +36,10 @@ class AliFlatExternalTrackParam: public AliVVexternalTrackParam
   void SetTgl(Float_t tgl)                 {fTgl = tgl;}
   void SetSigned1Pt(Float_t signed1Pt)     {fSigned1Pt = signed1Pt;}
   void SetCovEntry(Int_t idx, Float_t cov) {(idx >= 0 && idx < 15) ? fC[idx] = cov : 0.;}
+  
+  void Reinitialize(){
+       new (this) AliFlatExternalTrackParam(AliFlatESDReinitialize);
+  }
 
   Float_t  GetAlpha()             const {return fAlpha;}
   Float_t  GetX()                 const {return fX;}
@@ -49,8 +52,7 @@ class AliFlatExternalTrackParam: public AliVVexternalTrackParam
   Float_t  GetCovEntry(Int_t idx) const {return (idx >= 0 && idx < 15) ? fC[idx] : 0.;}
   
  private:
-       AliFlatExternalTrackParam(AliFlatESDSpecialConstructorFlag f);
-  
+       AliFlatExternalTrackParam(AliFlatESDSpecialConstructorFlag){}
 };
 
 //typedef struct AliFlatExternalTrackParam AliFlatExternalTrackParam;
diff --git a/HLT/global/AliFlatTPCCluster.cxx b/HLT/global/AliFlatTPCCluster.cxx
deleted file mode 100644 (file)
index 0daebdb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $Id$ */
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-#include "AliFlatTPCCluster.h"
-
-AliFlatTPCCluster::AliFlatTPCCluster(AliFlatESDSpecialConstructorFlag f){
-       if(f == AliFlatESDReinitialize);
-  else AliFlatTPCCluster();
-
-}
-
-
-
-
index f3ba516..843bab5 100644 (file)
@@ -15,7 +15,6 @@
 
 class AliFlatTPCCluster: public AliVVcluster
 {
- friend class AliFlatESDTrack;
   public:
   void SetX(Float_t x)             {fX = x;}
   void SetY(Float_t y)             {fY = y;}
@@ -25,6 +24,10 @@ class AliFlatTPCCluster: public AliVVcluster
   void SetSigmaZ2(Float_t sigmaZ2) {fSigmaZ2 = sigmaZ2;}
   void SetCharge(UShort_t charge)  {fCharge = charge;}
   void SetQMax(UShort_t qmax)      {fQMax = qmax;}
+  
+  void Reinitialize(){
+       new (this) AliFlatTPCCluster(AliFlatESDReinitialize);
+  }
 
   Float_t  GetX()       const      {return fX;}
   Float_t  GetY()       const      {return fY;}
@@ -46,7 +49,7 @@ class AliFlatTPCCluster: public AliVVcluster
   }
   
   private:
-  AliFlatTPCCluster(AliFlatESDSpecialConstructorFlag);
+  AliFlatTPCCluster(AliFlatESDSpecialConstructorFlag){}
   virtual ~AliFlatTPCCluster() {}
   Float_t fX;       // X coordinate in local coordinates
   Float_t fY;       // Y coordinate in local coordinates