AliHLTVertexFinderBase.h
AliHLTPrimaryVertexFinderComponent.h
AliHLTV0FinderComponent.h
+ # AliFlatESDMisc.h
AliFlatESDEvent.h
AliFlatESDVertex.h
AliFlatESDTrack.h
}
// _______________________________________________________________________________________________________
-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();
+ }
}
/*
#include "AliFlatESDV0.h"
#include "AliVVevent.h"
#include "AliFlatESDVertex.h"
+#include "AliFlatESDMisc.h"
class AliESDEvent;
class AliESDVertex;
// -- 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);
}
AliFlatESDV0 *GetNextV0Pointer(){
- return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
+ return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
}
void StoreLastV0(){
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;}
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);
--- /dev/null
+#include "AliFlatESDMisc.h"
+
--- /dev/null
+#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
}
// _______________________________________________________________________________________________________
-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();
}
// _______________________________________________________________________________________________________
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
//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());
#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();
private:
AliFlatESDTrack(const AliFlatESDTrack&);
AliFlatESDTrack& operator=(const AliFlatESDTrack&);
+ AliFlatESDTrack(AliFlatESDSpecialConstructorFlag);
Int_t FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag);
#include "AliFlatESDV0.h"
+AliFlatESDV0::AliFlatESDV0(AliFlatESDSpecialConstructorFlag f){
+ if(f == AliFlatESDReinitialize);
+ else AliFlatESDV0();
+}
+
+
+AliFlatESDV0::AliFlatESDV0():
+// Default constructor
+ fNegTrackID(0),
+ fPosTrackID(0){
+}
+
+
+
#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;
fNContributors = v.GetNContributors();
fChi2 = v.GetChi2();
}
-
+AliFlatESDVertex::AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f){
+ if(f == AliFlatESDReinitialize);
+ else AliFlatESDVertex();
+}
#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
Char_t fBCID; // BC ID assigned to vertex
*/
- AliFlatESDVertex(Bool_t){}
virtual ~AliFlatESDVertex() {}
AliFlatESDVertex() :fNContributors(0), fChi2(0){
Double_t GetWDist(const AliESDVertex* v) const;
*/
-
+ private:
+
+ AliFlatESDVertex(AliFlatESDSpecialConstructorFlag f);
};
--- /dev/null
+/* $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();
+
+}
+
+
+
+
#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
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;
--- /dev/null
+/* $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();
+
+}
+
+
+
+
#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;}
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
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();
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();
}
}
// -- 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);
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(),
if (track ) {
- /*
+
AliFlatExternalTrackParam* exp1 = track->GetTrackParamCp();
AliFlatExternalTrackParam* exp2 = track->GetTrackParamIp();
AliFlatExternalTrackParam* exp3 = track->GetTrackParamTPCInner();
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;
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++);
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()