added special constructor flag enum for special constructor, public Reinitialize...
authorsgweber <steffen.georg.weber@cern.ch>
Sat, 5 Jul 2014 17:30:51 +0000 (19:30 +0200)
committersgweber <steffen.georg.weber@cern.ch>
Sat, 5 Jul 2014 17:30:51 +0000 (19:30 +0200)
18 files changed:
HLT/CMakelibAliHLTGlobal.pkg
HLT/global/AliFlatESDEvent.cxx
HLT/global/AliFlatESDEvent.h
HLT/global/AliFlatESDMisc.cxx [new file with mode: 0644]
HLT/global/AliFlatESDMisc.h [new file with mode: 0644]
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 [new file with mode: 0644]
HLT/global/AliFlatExternalTrackParam.h
HLT/global/AliFlatTPCCluster.cxx [new file with mode: 0644]
HLT/global/AliFlatTPCCluster.h
HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx
HLT/global/FlatESDConverter.C
HLT/global/ReadFlatESD.C

index 0be9963..26d961e 100644 (file)
@@ -45,6 +45,7 @@ set ( CLASS_HDRS
     AliHLTVertexFinderBase.h
     AliHLTPrimaryVertexFinderComponent.h
     AliHLTV0FinderComponent.h
+   # AliFlatESDMisc.h
     AliFlatESDEvent.h
     AliFlatESDVertex.h
     AliFlatESDTrack.h
index 72eb87d..ead5ae7 100644 (file)
@@ -73,26 +73,30 @@ AliFlatESDEvent::AliFlatESDEvent() :
 }
 
 // _______________________________________________________________________________________________________
-AliFlatESDEvent::AliFlatESDEvent(Bool_t):AliVVevent()
+AliFlatESDEvent::AliFlatESDEvent(AliFlatESDSpecialConstructorFlag f)
 {
   //special constructor, used to restore the vtable pointer
   //uses the special dummy constructors of contained objects
-  AliFlatESDVertex* vertexSPD = const_cast<AliFlatESDVertex*>(GetPrimaryVertexSPD());
-  if (vertexSPD ) { new (vertexSPD) AliFlatESDVertex(1); }
-  AliFlatESDVertex* vertexTracks = const_cast<AliFlatESDVertex*>(GetPrimaryVertexTracks());
-  if (vertexTracks ) { new (vertexTracks) AliFlatESDVertex(1); }
-  AliFlatESDTrack* track = GetTracks();
-  for (Int_t i=0; i<GetNumberOfTracks(); i++)
-  {
-    new (track) AliFlatESDTrack(1);
-    track = track->GetNextTrack();
-  }
-  AliFlatESDV0* v0 = GetV0s();
-  for (Int_t i=0; i<GetNumberOfV0s(); i++)
-  {
-    new (v0) AliFlatESDV0(1);
-    v0 ++;
-  }
+  
+       if(f == AliFlatESDReinitialize){
+               AliFlatESDVertex* vertexSPD = const_cast<AliFlatESDVertex*>(GetPrimaryVertexSPD());
+               if (vertexSPD ) { new (vertexSPD) AliFlatESDVertex(f); }
+               AliFlatESDVertex* vertexTracks = const_cast<AliFlatESDVertex*>(GetPrimaryVertexTracks());
+               if (vertexTracks ) { new (vertexTracks) AliFlatESDVertex(f); }
+               AliFlatESDTrack* track = GetTracks();
+               for (Int_t i=0; i<GetNumberOfTracks(); i++)
+               {
+                       new (track++) AliFlatESDTrack(f);
+               }
+       AliFlatESDV0* v0 = GetV0s();
+       for (Int_t i=0; i<GetNumberOfV0s(); i++)
+       {
+                       new (v0++) AliFlatESDV0(f);
+               }
+       }
+       else{
+               AliFlatESDEvent();
+       }
 }
 
 /*
index 8ca307d..b79b69f 100644 (file)
@@ -14,6 +14,7 @@
 #include "AliFlatESDV0.h"
 #include "AliVVevent.h"
 #include "AliFlatESDVertex.h"
+#include "AliFlatESDMisc.h"
 
 class AliESDEvent;
 class AliESDVertex;
@@ -28,10 +29,6 @@ class AliFlatESDEvent: public AliVVevent {
   // -- Constructor / Destructors
   AliFlatESDEvent();   
 
-// 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(Bool_t);
 
   AliFlatESDEvent(AliESDEvent *esd);   
   AliFlatESDEvent(AliESDEvent *esd, Bool_t useESDFriends);   
@@ -58,7 +55,7 @@ class AliFlatESDEvent: public AliVVevent {
   }
 
   AliFlatESDV0 *GetNextV0Pointer(){
-       return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
+               return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
 }
 
   void StoreLastV0(){ 
@@ -88,11 +85,11 @@ class AliFlatESDEvent: public AliVVevent {
   Int_t GetNumberOfTracks() const {return fNTracks;}
   
   AliFlatESDV0* GetV0s() {
-  AliFlatESDV0* v = reinterpret_cast<AliFlatESDV0*> (fContent + fV0Pointer);
+       return reinterpret_cast<AliFlatESDV0*> (fContent + fV0Pointer);
   }
 
   AliFlatESDTrack *GetTracks() {
-       return reinterpret_cast<AliFlatESDTrack*> (fContent + fTracksPointer);
+               return reinterpret_cast<AliFlatESDTrack*> (fContent + fTracksPointer);
   }
 
   const AliVVvertex* GetPrimaryVertex() const {return NULL;}
@@ -118,11 +115,26 @@ class AliFlatESDEvent: public AliVVevent {
          ULong64_t GetSize()    {return fContent - reinterpret_cast<Byte_t*>(this) + fSize;}
 
 
+//
+// Initializing function
+//
+// to be called after event is received via reinterpret_cast from memory
+
+void Reinitialize()
+  {
+    new (this) AliFlatESDEvent(AliFlatESDReinitialize);
+  }
+
 
 
  private:
   AliFlatESDEvent(const AliFlatESDEvent&);
   AliFlatESDEvent& operator=(const AliFlatESDEvent&);
+  
+// 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);
 
   void FillPrimaryVertex(const AliESDVertex *v, Byte_t flag);
   Int_t FillNextTrack( const AliESDtrack* esdTrack,  AliESDfriendTrack* friendTrack);
diff --git a/HLT/global/AliFlatESDMisc.cxx b/HLT/global/AliFlatESDMisc.cxx
new file mode 100644 (file)
index 0000000..fec343a
--- /dev/null
@@ -0,0 +1,2 @@
+#include "AliFlatESDMisc.h"
+
diff --git a/HLT/global/AliFlatESDMisc.h b/HLT/global/AliFlatESDMisc.h
new file mode 100644 (file)
index 0000000..8d0217b
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef ALIFLATESDMISC_H
+#define ALIFLATESDMISC_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               *
+ * Primary Authors : Steffen Weber     */
+
+
+
+enum AliFlatESDSpecialConstructorFlag{AliFlatESDReinitialize};
+
+typedef enum AliFlatESDSpecialConstructorFlag AliFlatESDSpecialConstructorFlag;
+
+
+#endif
index d760813..3394e4c 100644 (file)
@@ -56,30 +56,30 @@ AliFlatESDTrack::AliFlatESDTrack() :
 }
 
 // _______________________________________________________________________________________________________
-AliFlatESDTrack::AliFlatESDTrack(Bool_t)
+AliFlatESDTrack::AliFlatESDTrack(AliFlatESDSpecialConstructorFlag f)
 {
   //special contructor
   //use to restore the vtable pointer
   
-  AliFlatExternalTrackParam* trackParam = GetTrackParamRefitted();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  trackParam = GetTrackParamIp();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  trackParam = GetTrackParamTPCInner();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  trackParam = GetTrackParamOp();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  trackParam = GetTrackParamCp();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  trackParam = GetTrackParamITSOut();
-  if (trackParam) { new (trackParam) AliFlatExternalTrackParam(1); }
-  
-  AliFlatTPCCluster* clusterTPC = GetTPCClusters();
-  for (Int_t i=0; i<fNTPCClusters; i++)
-  {
-    new (clusterTPC) AliFlatTPCCluster(1);
-    clusterTPC++;
-  }
+  if(f == AliFlatESDReinitialize){
+               AliFlatExternalTrackParam* trackParam = GetTrackParamRefitted();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               trackParam = GetTrackParamIp();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               trackParam = GetTrackParamTPCInner();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               trackParam = GetTrackParamOp();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               trackParam = GetTrackParamCp();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               trackParam = GetTrackParamITSOut();
+               if (trackParam) { new (trackParam) AliFlatExternalTrackParam(f); }
+               
+               AliFlatTPCCluster* clusterTPC = GetTPCClusters();
+               for (Int_t i=0; i<fNTPCClusters; i++)
+                 new (clusterTPC++) AliFlatTPCCluster(f);
+       }
+       else AliFlatESDTrack();
 }
 
 // _______________________________________________________________________________________________________
@@ -170,16 +170,17 @@ Int_t AliFlatESDTrack::Fill(const AliESDtrack* track, AliESDfriendTrack* friendT
       for (Int_t idxRow = 0; idxRow < 160; idxRow++){
        AliTPCclusterMI* currentCl = seed->GetClusterPointer(idxRow);
        if (currentCl) {
-         AliFlatTPCCluster &tmpCl = *GetNextTPCClusterPointer();
-         tmpCl.fX = currentCl->GetX();
-         tmpCl.fY = currentCl->GetY();
-         tmpCl.fZ = currentCl->GetZ();   
-        // tmpCl.fPadRow  = idxRow; // TO BE CHECKED IF THIS NEEDED or currentCl->GetRow();
-         tmpCl.fPadRow  = currentCl->GetRow();
-         tmpCl.fSigmaY2 = currentCl->GetSigmaY2();
-         tmpCl.fSigmaZ2 = currentCl->GetSigmaZ2();
-         tmpCl.fCharge  = currentCl->GetQ();
-         tmpCl.fQMax    = currentCl->GetMax();
+         AliFlatTPCCluster* tmpCl = GetNextTPCClusterPointer();
+         new(tmpCl) AliFlatTPCCluster;
+         tmpCl->SetX(currentCl->GetX());
+         tmpCl->SetY(currentCl->GetY());
+         tmpCl->SetZ(currentCl->GetZ());         
+        // tmpCl->SetPadRow(idxRow); // TO BE CHECKED IF THIS NEEDED or currentCl->GetRow();
+         tmpCl->SetPadRow(currentCl->GetRow());
+         tmpCl->SetSigmaY2(currentCl->GetSigmaY2());
+         tmpCl->SetSigmaZ2(currentCl->GetSigmaZ2());
+         tmpCl->SetCharge(currentCl->GetQ());
+         tmpCl->SetQMax(currentCl->GetMax());
          StoreLastTPCCluster();
        }
        //      else
@@ -275,7 +276,7 @@ Int_t AliFlatESDTrack::FillExternalTrackParam(const AliExternalTrackParam* param
   //Printf("  DEBUG: CONTENT %d >> %p + 0x%07llx = %p", flag, fContent, fSize, fContent + fSize);
 
   AliFlatExternalTrackParam * current = reinterpret_cast<AliFlatExternalTrackParam*> (fContent + fSize);
-  new (current) AliFlatExternalTrackParam(1);
+  new (current) AliFlatExternalTrackParam;
   current->SetAlpha(param->GetAlpha());
   current->SetX(param->GetX());
   current->SetY(param->GetY());
index 255c318..46b10f2 100644 (file)
@@ -21,17 +21,18 @@ Op - Track parameters estimated at the point of maximal radial coordinate reache
 #include "AliFlatTPCCluster.h"
 #include "AliFlatExternalTrackParam.h"
 #include "AliVVtrack.h"
+#include "AliFlatESDMisc.h"
 
 class AliESDtrack;
 class AliESDfriendTrack;
 class AliExternalTrackParam;
 
 class AliFlatESDTrack: public AliVVtrack {
+ friend class AliFlatESDEvent;
  public:
   // --------------------------------------------------------------------------------
   // -- Constructor / Destructors
   AliFlatESDTrack();
-  AliFlatESDTrack(Bool_t);
   AliFlatESDTrack(const AliESDtrack* track, AliESDfriendTrack* friendTrack); 
   virtual ~AliFlatESDTrack();  
 
@@ -125,6 +126,7 @@ class AliFlatESDTrack: public AliVVtrack {
  private:
   AliFlatESDTrack(const AliFlatESDTrack&);
   AliFlatESDTrack& operator=(const AliFlatESDTrack&);
+  AliFlatESDTrack(AliFlatESDSpecialConstructorFlag);
 
   Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
 
index cb7f653..7505283 100644 (file)
 
 #include "AliFlatESDV0.h"
 
+AliFlatESDV0::AliFlatESDV0(AliFlatESDSpecialConstructorFlag f){
+       if(f == AliFlatESDReinitialize);
+  else AliFlatESDV0();
+}
+
+
+AliFlatESDV0::AliFlatESDV0():
+// Default constructor
+       fNegTrackID(0),
+       fPosTrackID(0){
+}
+
+
+
 
index 67dc531..4df221c 100644 (file)
 
 #include "Rtypes.h"
 #include "AliVVv0.h"
+#include "AliFlatESDMisc.h"
 
 class AliFlatESDV0: public AliVVv0
 {
-  public:
-  AliFlatESDV0(Bool_t){}
+ friend class AliFlatESDEvent;
+ public:
+  AliFlatESDV0();
   virtual ~AliFlatESDV0() {}
   Int_t fNegTrackID;
   Int_t fPosTrackID;
+ private:
+       AliFlatESDV0(AliFlatESDSpecialConstructorFlag f );
 };
 
 //typedef struct AliFlatESDV0 AliFlatESDV0;
index a24b52f..faf57f0 100644 (file)
@@ -11,4 +11,7 @@ void AliFlatESDVertex::Set(const AliESDVertex &v )
   fNContributors = v.GetNContributors();
   fChi2 = v.GetChi2();
 }
-
+AliFlatESDVertex::AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f){
+       if(f == AliFlatESDReinitialize);
+  else AliFlatESDVertex();
+}
index 8961b4b..00d62bd 100644 (file)
 #include "Rtypes.h"
 #include "AliVVvertex.h"
 #include "AliESDVertex.h"
+#include "AliFlatESDMisc.h"
 
 class AliFlatESDVertex: public AliVVvertex
 //class AliFlatESDVertex
 {
-  public:
+ friend class AliFlatESDEvent;
+ public:
   Double32_t fPosition[3];    // vertex position
   Double32_t fCov[6];  // vertex covariance matrix
   Int_t    fNContributors;  // # of tracklets/tracks used for the estimate   
@@ -27,7 +29,6 @@ class AliFlatESDVertex: public AliVVvertex
     Char_t fBCID;     // BC ID assigned to vertex
   */
 
-       AliFlatESDVertex(Bool_t){}
   virtual ~AliFlatESDVertex() {}
 
   AliFlatESDVertex() :fNContributors(0), fChi2(0){
@@ -94,7 +95,9 @@ class AliFlatESDVertex: public AliVVvertex
   Double_t GetWDist(const AliESDVertex* v) const;
   */
 
-
+ private:
+  
+       AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f);
  
 };
 
diff --git a/HLT/global/AliFlatExternalTrackParam.cxx b/HLT/global/AliFlatExternalTrackParam.cxx
new file mode 100644 (file)
index 0000000..59c08fb
--- /dev/null
@@ -0,0 +1,27 @@
+/* $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 98b1a6c..e922191 100644 (file)
 
 #include "Rtypes.h"
 #include "AliVVexternalTrackParam.h"
+#include "AliFlatESDMisc.h"
+
 
 class AliFlatExternalTrackParam: public AliVVexternalTrackParam
 {
-  public:
+ friend class AliFlatESDTrack;
+ public:
   AliFlatExternalTrackParam() {}
-  AliFlatExternalTrackParam(Bool_t) {}
   virtual ~AliFlatExternalTrackParam() {}
   Float_t fAlpha;     // azimuthal angle of reference frame
   Float_t fX;         // x: radial distance
@@ -45,6 +47,10 @@ class AliFlatExternalTrackParam: public AliVVexternalTrackParam
   Float_t  GetSigned1Pt()         const {return fSigned1Pt;}
   Float_t* GetCov()               const {return const_cast<Float_t*>(fC);}
   Float_t  GetCovEntry(Int_t idx) const {return (idx >= 0 && idx < 15) ? fC[idx] : 0.;}
+  
+ private:
+       AliFlatExternalTrackParam(AliFlatESDSpecialConstructorFlag f);
+  
 };
 
 //typedef struct AliFlatExternalTrackParam AliFlatExternalTrackParam;
diff --git a/HLT/global/AliFlatTPCCluster.cxx b/HLT/global/AliFlatTPCCluster.cxx
new file mode 100644 (file)
index 0000000..0daebdb
--- /dev/null
@@ -0,0 +1,28 @@
+/* $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 b824c2f..beb4fc4 100644 (file)
 
 #include "Rtypes.h"
 #include "AliVVcluster.h"
+#include "AliFlatESDMisc.h"
 
 class AliFlatTPCCluster: public AliVVcluster
 {
-  public:
-  AliFlatTPCCluster(Bool_t) {}
-  virtual ~AliFlatTPCCluster() {}
-  Float_t fX;       // X coordinate in local coordinates
-  Float_t fY;       // Y coordinate in local coordinates
-  Float_t fZ;       // Z coordinate in local coordinates
-  UChar_t fPadRow;  // Pad row number
-  Float_t fSigmaY2; // error (former width) of the clusters
-  Float_t fSigmaZ2; // error (former width) of the clusters
-  UInt_t  fCharge;  // total charge of cluster
-  UInt_t  fQMax;    // QMax of cluster
-
+ friend class AliFlatESDTrack;
   public:
   void SetX(Float_t x)             {fX = x;}
   void SetY(Float_t y)             {fY = y;}
@@ -54,6 +44,21 @@ class AliFlatTPCCluster: public AliVVcluster
     Int_t padrowsecond = second.GetPadRow();
     return (padrowfirst < padrowsecond);
   }
+  
+  private:
+  AliFlatTPCCluster(AliFlatESDSpecialConstructorFlag) {}
+  virtual ~AliFlatTPCCluster() {}
+  Float_t fX;       // X coordinate in local coordinates
+  Float_t fY;       // Y coordinate in local coordinates
+  Float_t fZ;       // Z coordinate in local coordinates
+  UChar_t fPadRow;  // Pad row number
+  Float_t fSigmaY2; // error (former width) of the clusters
+  Float_t fSigmaZ2; // error (former width) of the clusters
+  UInt_t  fCharge;  // total charge of cluster
+  UInt_t  fQMax;    // QMax of cluster
+  
+  
+  
 };
 
 #endif
index 1964581..274bc4f 100644 (file)
@@ -286,7 +286,7 @@ AliSysInfo::AddStamp("DoEvent.Start");
   size = 0;
 
   AliFlatESDEvent *flatEsd = reinterpret_cast<AliFlatESDEvent*>(outputPtr); 
-  new (flatEsd) AliFlatESDEvent(); //standard ctor to initialize an empty event   
+  new (flatEsd) AliFlatESDEvent; //standard ctor to initialize an empty event   
 
   /*
   pESD->Reset(); 
@@ -606,15 +606,15 @@ AliSysInfo::AddStamp("DoEvent.Start");
              const AliHLTTPCSpacePointData &cIn = clusterBlock->fSpacePoints[iCluster];
 
              AliFlatTPCCluster *c= flatTrack->GetTPCCluster( flatTrack->GetNumberOfTPCClusters() );;
-        new (c) AliFlatTPCCluster(1);
-             c->fX = cIn.GetX();
-             c->fY = cIn.GetY();
-             c->fZ = cIn.GetZ();
-             c->fPadRow  = cIn.GetPadRow() + AliHLTTPCTransform::GetFirstRow(iPatch);
-             c->fSigmaY2 = cIn.GetSigmaY2();
-             c->fSigmaZ2 = cIn.GetSigmaZ2();
-             c->fCharge  = cIn.GetCharge();
-             c->fQMax    = cIn.GetQMax();
+        new (c) AliFlatTPCCluster;
+             c->SetX(cIn.GetX());
+             c->SetY(cIn.GetY());
+             c->SetZ(cIn.GetZ());
+             c->SetPadRow(cIn.GetPadRow() + AliHLTTPCTransform::GetFirstRow(iPatch));
+             c->SetSigmaY2(cIn.GetSigmaY2());
+             c->SetSigmaZ2(cIn.GetSigmaZ2());
+             c->SetCharge(cIn.GetCharge());
+             c->SetQMax(cIn.GetQMax());
              flatTrack->StoreLastTPCCluster();
           }
        }
index 8be3570..98be7ec 100644 (file)
@@ -55,6 +55,8 @@ void FlatESDConverter(const char* filename="AliESDs.root", const char* filenameF
 
   // -- Event Loop
   for (Int_t idxEvent = 0; idxEvent < esdTree->GetEntries(); idxEvent++) {
+  Printf("Processing event nr %d", idxEvent);
+  
   
   AliSysInfo::AddStamp("getEntry",0,0,idxEvent);
     esdTree->GetEntry(idxEvent);
@@ -64,14 +66,23 @@ void FlatESDConverter(const char* filename="AliESDs.root", const char* filenameF
     Byte_t *mem = new Byte_t[AliFlatESDEvent::EstimateSize(esd, useESDFriends)];
     
 AliSysInfo::AddStamp("DoEvent.Start",0,0,idxEvent);
-    flatEsd = reinterpret_cast<AliFlatESDEvent*>(mem);    
-       new (flatEsd) AliFlatESDEvent(1);
 
+
+  Printf("getting event from memory");
+    flatEsd = reinterpret_cast<AliFlatESDEvent*>(mem);
+  Printf("calling special constructor");    
+       new (flatEsd) AliFlatESDEvent;
+
+  Printf("filling event");    
     // -- Fill AliFlatESDEvent
     flatEsd->Fill(esd, useESDFriends);  
     
     
 AliSysInfo::AddStamp("DoEvent.Stop",0,flatEsd->GetSize(),idxEvent);
+
+
+
+
 if(verbose){
      Printf("TEST: Event %d || Tracks %d | FRIEND Tracks %d || estimated size %llu || sizeof(AliFlatESDEvent) %llu", 
           idxEvent, esd->GetNumberOfTracks(), esdFriend->GetNumberOfTracks(), 
@@ -90,7 +101,7 @@ if(verbose){
 
       if (track ) {
        
-       /*
+       
        AliFlatExternalTrackParam* exp1 = track->GetTrackParamCp();
        AliFlatExternalTrackParam* exp2 = track->GetTrackParamIp();
        AliFlatExternalTrackParam* exp3 = track->GetTrackParamTPCInner();
@@ -113,11 +124,11 @@ if(verbose){
        Printf("  TEST: Old Track %d > Alpha %f %f %f %f", idxTrack, alphaOLD[0], alphaOLD[1], alphaOLD[2], alphaOLD[3]);
        Printf("  TEST: Diff      %d > Alpha %f %f %f %f", idxTrack, 
               alphaFLAT[0]-alphaOLD[0], alphaFLAT[1]-alphaOLD[1], alphaFLAT[2]-alphaOLD[2], alphaFLAT[3]-alphaOLD[3]);
-*/
+
 
 Int_t nCl = track->GetNumberOfTPCClusters();
        Printf("  TEST: FlatTrack %d has %d FlatClusters", idxTrack,  nCl );
-       if(nCl && verbose > 1){
+       if(nCl && useESDFriends && verbose > 1){
        
          TObject* calibObject = NULL;
     AliTPCseed* seed = NULL;
@@ -132,11 +143,13 @@ Int_t nCl = track->GetNumberOfTPCClusters();
     Int_t idxRow2=0;
       for (Int_t idxRow = 0; idxRow <  nCl; idxRow++){
       AliFlatTPCCluster * cl = track->GetTPCCluster(idxRow);
-      
-
                                cout<<" idx fX fY fZ  fSigmaY2 fSigmaZ2 fCharge fQMax fPadRow" <<endl;
-                               cout<< idxRow <<" "<< cl->GetX()<<" "<< cl->GetY()<<" "<< cl->GetZ()<<" "<< cl->GetSigmaY2()<<" "<< cl->GetSigmaZ2()<<" "<< cl->GetCharge()<<" "<< cl->GetQMax() <<" "<< cl->GetPadRow()<<endl;
-                               
+                               if(cl){
+                                       cout<< idxRow <<" "<< cl->GetX()<<" "<< cl->GetY()<<" "<< cl->GetZ()<<" "<< cl->GetSigmaY2()<<" "<< cl->GetSigmaZ2()<<" "<< cl->GetCharge()<<" "<< cl->GetQMax() <<" "<< cl->GetPadRow()<<endl;
+                                       }
+                               else{
+                                       cout<<idxRow<<"---------------------------------"<<endl<<endl;          
+                               }
                                AliTPCclusterMI* cl2 = NULL; 
       while(!cl2 && idxRow2<160){
        cl2 = seed->GetClusterPointer(idxRow2++);
index 3e2321b..a6b4c3f 100644 (file)
@@ -52,7 +52,7 @@ void ReadFlatESD(const char* filename="outFlatESD.dat", Int_t verbose=0) {
       cout<<endl<<"Reading event "<<iEvent<<":"<<endl;
     Printf("curr: %p \t endBuff: %p \t diff %p ", curr, endBuff, endBuff-curr);
       AliFlatESDEvent *flatEsd = reinterpret_cast<AliFlatESDEvent *>(curr);
-                       new (flatEsd) AliFlatESDEvent(1);
+                       flatEsd->Reinitialize();
 
       
 cout<<"vtx SPD: "<<(Bool_t) flatEsd->GetPrimaryVertexSPD()