AliFlatESDTrack *GetNextTrackPointer(){
- AliFlatESDTrack * t = reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
- new(t) AliFlatESDTrack(kTRUE);
- return t;
+ return reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
}
void StoreLastTrack(){
}
AliFlatESDV0 *GetNextV0Pointer(){
- AliFlatESDV0 * t = reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
- new(t) AliFlatESDV0(kTRUE);
- return t;
+ return reinterpret_cast<AliFlatESDV0*> (fContent + fSize);
}
void StoreLastV0(){
const AliFlatESDVertex* GetPrimaryVertexSPD() const {
if (fPrimaryVertexMask & 0x1){
- AliFlatESDVertex * t = reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent));
- new(t) AliFlatESDVertex(kTRUE);
- return t;
+ return reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent));
}
else return NULL;
}
const AliFlatESDVertex* GetPrimaryVertexTracks() const {
if (fPrimaryVertexMask & 0x2){
- AliFlatESDVertex * t = reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent)) + CountBits(fPrimaryVertexMask, 0x1);
- new(t) AliFlatESDVertex(kTRUE);
- return t;
+ return reinterpret_cast< AliFlatESDVertex*> (const_cast<Byte_t*>(fContent)) + CountBits(fPrimaryVertexMask, 0x1);
}
else return NULL;
}
Int_t GetNumberOfTracks() const {return fNTracks;}
AliFlatESDTrack *GetTracks() {
- AliFlatESDTrack * t = reinterpret_cast<AliFlatESDTrack*> (fContent + fTracksPointer);
- new(t) AliFlatESDTrack(kTRUE);
- return t;
+ return reinterpret_cast<AliFlatESDTrack*> (fContent + fTracksPointer);
}
const AliVVvertex* GetPrimaryVertex() const {return NULL;}
AliFlatESDTrack *GetNextTrack()
{
- AliFlatESDTrack * t = reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
- new(t) AliFlatESDTrack(kTRUE);
- return t;
+ return reinterpret_cast<AliFlatESDTrack*> (fContent + fSize);
}
// --------------------------------------------------------------------------------
#include "AliESDEvent.h"
#include "AliESD.h"
#include "AliESDfriend.h"
+#include "AliESDfriendTrack.h"
+#include "../TPC/Rec/AliTPCseed.h"
#include <TFile.h>
#include <TTree.h>
#include <TSystem.h>
#include "Riostream.h"
#endif
-void FlatESDConverter(const char* filename="AliESDs.root", const char* filenameFriends="AliESDfriends.root",const char* filenameOut="out.dat", Bool_t useESDFriends = kTRUE, Bool_t useHLTtree = kFALSE) {
+void FlatESDConverter(const char* filename="AliESDs.root", const char* filenameFriends="AliESDfriends.root",const char* filenameOut="out.dat", Bool_t useESDFriends = kTRUE, Bool_t useHLTtree = kFALSE,Int_t verbose = 0) {
// -- Convert AliESDEvent to AliFlatESDEvent
ofstream outFile(Form("%s",filenameOut), std::ifstream::binary | std::ifstream::out);
// -- Event Loop
for (Int_t idxEvent = 0; idxEvent < esdTree->GetEntries(); idxEvent++) {
+
+ AliSysInfo::AddStamp("getEntry",0,0,edxEvent);
esdTree->GetEntry(idxEvent);
// -- Book memory for AliFlatESDEvent
// -- TEST >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Byte_t *mem = new Byte_t[AliFlatESDEvent::EstimateSize(esd, useESDFriends)];
-
+
+AliSysInfo::AddStamp("DoEvent.Start",0,0,edxEvent);
flatEsd = reinterpret_cast<AliFlatESDEvent*>(mem);
new (flatEsd) AliFlatESDEvent(1);
// -- Fill AliFlatESDEvent
flatEsd->Fill(esd, useESDFriends);
- #if 0
+
+
+AliSysInfo::AddStamp("DoEvent.Start",0,0,edxEvent);
+if(verbose){
Printf("TEST: Event %d || Tracks %d | FRIEND Tracks %d || estimated size %llu || sizeof(AliFlatESDEvent) %llu",
idxEvent, esd->GetNumberOfTracks(), esdFriend->GetNumberOfTracks(),
AliFlatESDEvent::EstimateSize(esd, useESDFriends), flatEsd->GetSize());
AliFlatESDTrack *track = flatEsd->GetTracks();
for (Int_t idxTrack = 0; idxTrack < flatEsd->GetNumberOfTracks(); ++idxTrack) {
- AliESDtrack *esdTrack = esd->GetTrack(idxTrack);
+ AliESDtrack *esdTrack = esd->GetTrack(idxTrack);
+ AliESDfriendTrack *friendTrack = esdFriend->GetTrack(idxTrack) ;
if (track && !esdTrack) {
Printf("ERROR THIS SHOULD NOT HAPPEN AT ALL !!! TRACK %d HAS NO ESD TRACK!!!", idxTrack);
return;
}
- if (track) {
+ 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]);
+*/
- Printf(" TEST: FlatTrack %d has %d FlatClusters", idxTrack, track->GetNumberOfTPCClusters());
+Int_t nCl = track->GetNumberOfTPCClusters();
+ Printf(" TEST: FlatTrack %d has %d FlatClusters", idxTrack, nCl );
+ if(nCl && verbose > 1){
+
+ TObject* calibObject = NULL;
+ AliTPCseed* seed = NULL;
+
+ for (Int_t idx = 0; (calibObject = friendTrack->GetCalibObject(idx)); ++idx) {
+ if ((seed = dynamic_cast<AliTPCseed*>(calibObject))) break;
+ }
- for (Int_t idxCluster = 0; idxCluster < track->GetNumberOfTPCClusters(); ++idxCluster)
- Printf(" TEST: FlatTrack %d > FlatCluster %d has row %d", idxTrack, idxCluster, track->GetTPCCluster(idxCluster).GetPadRow());
+ // -- Fill cluster
+ if (seed) {
+ 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;
+
+ AliTPCclusterMI* cl2 =seed->GetClusterPointer( cl->GetPadRow());
+
+ if (cl2) {
+ //cout<<" normalCl fX fY fZ fPadRow fSigmaY2 fSigmaZ2 fCharge fQMax" <<endl;
+ cout<< idxRow <<" "<< cl2->GetX()<<" "<< cl2->GetY()<<" "<< cl2->GetZ()<<" "<< cl2->GetSigmaY2()<<" "<< cl2->GetSigmaZ2()<<" "<< cl2->GetQ()<<" "<< cl2->GetMax()<<" "<< cl2->GetRow()<<" "<< cl2->GetPad() <<endl<<endl;
+ }
+ else
+ cout<<idxRow<<"---------------------------------"<<endl<<endl;
+ }
+ }
+ }
+
+
+
+/*
+ for (Int_t idxCluster = 0; idxCluster < track->GetNumberOfTPCClusters(); ++idxCluster){
+
+ }
+ */
}
track = track->GetNextTrack();
}
- // -- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< TEST
-#endif
+}
outFile.write(reinterpret_cast<char*>(mem), flatEsd->GetSize());
#include "Riostream.h"
#endif
-void ReadFlatESD(const char* filename="outFlatESD.dat") {
+void ReadFlatESD(const char* filename="outFlatESD.dat", Bool_t verbose=kFALSE) {
ifstream is(filename, std::ifstream::binary | std::ifstream::in);
if (is){
+ std::cout << "ifstream available"<<endl;
is.seekg (0, is.end);
int length = is.tellg();
is.seekg (0, is.beg);
+ std::cout << "length"<<length<<endl;
char * buffer = new char [length];
std::cout << "Reading " << length << " characters... ";
char *endBuff = buffer+length;
int iEvent = 0;
while( curr < endBuff ){
+ cout<<"Reading event "<<iEvent<<":"<<endl;
AliFlatESDEvent *flatEsd = reinterpret_cast<AliFlatESDEvent *>(curr);
new (flatEsd) AliFlatESDEvent(1);
- cout<<"Reading event "<<iEvent<<":"<<endl;
cout<<"vtx SPD: "<<(Bool_t) flatEsd->GetPrimaryVertexSPD()
<<" vtx tracks: "<<(Bool_t) flatEsd->GetPrimaryVertexTracks()
<<" ntracks: "<<flatEsd->GetNumberOfTracks()
<<" nV0's: "<<flatEsd->GetNumberOfV0s()
<<endl;
+
+
+
+
+// compare tracks
+if(verbose){
+ static const int nExt = 4;
+ AliFlatESDTrack *track = flatEsd->GetTracks();
+ for (Int_t idxTrack = 0; idxTrack < flatEsd->GetNumberOfTracks() && track; ++idxTrack) {
+
+ AliFlatExternalTrackParam* ext[nExt] ={
+
+ track->GetTrackParamRefitted(),
+ track->GetTrackParamIp(),
+ track->GetTrackParamTPCInner(),
+ track->GetTrackParamOp(),
+
+ };
+
+ //Printf(" TEST: FlatTrack1 %d > FlatExternalTrackParam1 > %p %p %p %p", idxTrack, exp11, exp21, exp31, exp41);
+ //Printf(" TEST: FlatTrack2 %d > FlatExternalTrackParam2 > %p %p %p %p", idxTrack, exp12, exp22, exp32, exp42);
+
+
+ for(int iExt=0; iExt<nExt; ++iExt){
+cout<<endl<<iExt<<endl;
+ if(!ext[iExt]){
+ // cout<<"DIFFERENCE!: ";
+ cout<<" ext"<<iExt<<" not set"<<endl;
+ }
+
+
+ cout<<" alpha"<<iExt<<" :" << (ext[iExt] ? ext[iExt]->GetAlpha() : -9999) <<endl;
+
+
+
+cout<<" GetX"<<iExt<<" :" << (ext[iExt] ? ext[iExt]->GetX(): -9999) <<endl;
+
+
+
+ cout<<" 1/pt"<<iExt<<" :" << (ext[iExt] ? ext[iExt]->GetSigned1Pt(): -9999) <<endl;
+
+
+}
+
+ cout<<" nTPCclusters: "<<track->GetNumberOfTPCClusters()<< endl;
+
+ cout<<" nITSclusters: "<<track->GetNumberOfITSClusters()<< endl;
+
+
+// compare clusters
+ if( track->GetNumberOfTPCClusters()){
+ for (Int_t idxCluster = 0; idxCluster < track->GetNumberOfTPCClusters(); ++idxCluster){
+ AliFlatTPCCluster * cl = track->GetTPCCluster(idxCluster);
+
+ cout<<" clusterNr fX fY fZ fPadRow fSigmaY2 fSigmaZ2 fCharge fQMax" <<endl;
+ cout<< idxCluster<<" "<< cl->GetX()<<" "<< cl->GetY()<<" "<< cl->GetZ()<<" "<< cl->GetPadRow()<<" "<< cl->GetSigmaY2()<<" "<< cl->GetSigmaZ2()<<" "<< cl->GetCharge()<<" "<< cl->GetQMax() <<endl;
+
+ }
+ }
+
+ track = track->GetNextTrack();
+
+
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
curr=curr+ flatEsd->GetSize();
iEvent++;
}
+
+
+
+
+
+
+
+
+
+
delete[] buffer;
}
else {
class AliVVkink
{
-
+ public:
+ virtual ~AliVVkink() {}
// ClassDef(AliVVkink, 0) // base class for kink data
};
virtual Double_t GetY() const { return 0; }
virtual Double_t GetZ() const { return 0; }
virtual void GetXYZ(Double_t pos[3]) const {if (pos[0]<0) return;}
- virtual void GetCovarianceMatrix(Double_t covmatrix[6]) const { return ; }
+ virtual void GetCovarianceMatrix(Double_t /*covmatrix*/[6]) const { return ; }
virtual Double_t GetChi2perNDF() const { return 0; }
virtual Double_t GetChi2() const { return 0; }
virtual Int_t GetNDF() const{ return 0; }
virtual void PrintIndices() const { return ; }
- virtual void Print(Option_t* option = "") const { return ; }
+ virtual void Print(Option_t* /*option = ""*/) const { return ; }
virtual Int_t GetBC() const{ return 0; }
- virtual void Clear(Option_t* /*option*/) const { return ; }
+ virtual void Clear(Option_t* /*option*/) { return ; }
virtual Int_t GetNContributors() const { return 0; }
ClassDef(AliVVvertex, 1) // base class for vertex data