]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
flat esd friend update
authorsgorbuno <Sergey.Gorbunov@cern.ch>
Sun, 31 Aug 2014 21:56:45 +0000 (23:56 +0200)
committersgorbuno <Sergey.Gorbunov@cern.ch>
Sun, 31 Aug 2014 21:56:45 +0000 (23:56 +0200)
14 files changed:
HLT/CMakelibAliHLTGlobal.pkg
HLT/global/AliFlatESDFriend.cxx
HLT/global/AliFlatESDFriend.h
HLT/global/AliFlatESDFriendTrack.cxx
HLT/global/AliFlatESDFriendTrack.h
HLT/global/AliFlatESDTrack.cxx
HLT/global/AliFlatESDTrack.h
HLT/global/AliFlatExternalTrackParam.h
HLT/global/AliFlatTPCseed.cxx [new file with mode: 0644]
HLT/global/AliFlatTPCseed.h [new file with mode: 0644]
STEER/ESD/AliESDfriend.h
STEER/ESD/AliESDfriendTrack.h
STEER/STEERBase/AliVfriendEvent.h
STEER/STEERBase/AliVfriendTrack.h

index efd42a3b9fb810ec729c600501b88effec912b12..6bca13f4b4415a2d2117888b5c72fb0b431e3266 100644 (file)
@@ -54,6 +54,7 @@ set ( CLASS_HDRS
     AliFlatESDV0.h
     AliFlatESDFriend.h
     AliFlatESDFriendTrack.h
+    AliFlatTPCseed.h
     physics/AliHLTV0HistoComponent.h
     physics/AliHLTCaloHistoComponent.h
     physics/AliHLTCaloHistoProducer.h
index dfe44a1866d04efed5a6003f02958c6eb7ee629b..2705a1f1a07290b6c723cd18fc7cc7996fb0b445 100644 (file)
@@ -36,6 +36,7 @@
 #include "AliFlatESDFriend.h"
 #include "AliFlatESDFriendTrack.h"
 #include "Riostream.h"
+#include "AliESDfriend.h"
 
 // _______________________________________________________________________________________________________
 AliFlatESDFriend::AliFlatESDFriend() :
@@ -101,3 +102,61 @@ void AliFlatESDFriend::Ls() const
   cout<<"  N tracks: "<<fNTracks<<endl;
   cout<<"  N track entries: "<<fNTrackEntries<<endl;
 }
+
+
+// _______________________________________________________________________________________________________
+Int_t AliFlatESDFriend::SetFromESDfriend( const size_t allocatedMemorySize, const AliESDfriend *esdFriend )
+{
+  // Fill flat ESD friend from ALiESDfriend
+  if( allocatedMemorySize < sizeof(AliFlatESDFriend ) ) return -1;
+
+  Reset();
+  
+  if( !esdFriend ) return 0;
+  
+  Int_t err = 0;
+  size_t freeSpace = allocatedMemorySize - GetSize();
+
+  // fill event info
+  {
+    SetSkipBit( esdFriend->TestSkipBit() );
+    for( int iSector=0; iSector<72; iSector++ ){
+      SetNclustersTPC( iSector, esdFriend->GetNclustersTPC(iSector) );
+      SetNclustersTPCused( iSector, esdFriend->GetNclustersTPCused(iSector) );
+    }
+  }
+  // fill track friends
+  {
+   size_t trackSize = 0;
+   int nTracks = 0;
+   int nTrackEntries = 0;
+   Long64_t *table = NULL;
+   AliFlatESDFriendTrack *flatTrack = NULL;
+   err = SetTracksStart( flatTrack, table, esdFriend->GetNumberOfTracks(), freeSpace );
+   if( err!=0 ) return err;
+   freeSpace = allocatedMemorySize - GetSize();
+   
+   for (Int_t idxTrack = 0; idxTrack < esdFriend->GetNumberOfTracks(); ++idxTrack) {
+     const AliESDfriendTrack *esdTrack = esdFriend->GetTrack(idxTrack);
+     table[idxTrack] = -1;
+     if (esdTrack) {
+       table[idxTrack] = trackSize;
+       if( freeSpace<flatTrack->EstimateSize() ) return -1;
+       new (flatTrack) AliFlatESDFriendTrack;       
+       //flatTrack->SetFromESDTrack( esdTrack );
+       trackSize += flatTrack->GetSize();
+       freeSpace -= flatTrack->GetSize();
+       nTrackEntries++;
+       flatTrack = flatTrack->GetNextTrackNonConst();
+     }
+     nTracks++;
+    }
+   
+   SetTracksEnd( nTracks, nTrackEntries, trackSize );
+  }
+
+  return 0;
+}
+
index 885a1d33c4ffca90ff46c4959c5d0b5fe99b1433..1071f14bd660c238a86b53a7015032c2dbb7680b 100644 (file)
 #include "AliVfriendEvent.h"
 #include "AliFlatESDFriendTrack.h"
 
-class AliVVVZEROfriend;
-class AliVVTZEROfriend;
+
+class AliESDfriend;
+//class AliESDVZEROfriend;
+//class AliESDTZEROfriend;
+
 
 //_____________________________________________________________________________
 class AliFlatESDFriend : public AliVfriendEvent {
 public:
   AliFlatESDFriend();
   ~AliFlatESDFriend() {}
+   // constructor and method for reinitialisation of virtual table
+   AliFlatESDFriend( AliVConstructorReinitialisationFlag );
+   void Reinitialize(){ new (this) AliFlatESDFriend(AliVReinitialize); }
 
   // Implementation of virtual methods of AliVfriend
 
   Int_t GetNumberOfTracks() const { return fNTracks; }
-  Int_t GetEntriesInTracks() const { return fNTrackEntries; }
   const AliVfriendTrack* GetTrack(Int_t i) const {return GetFlatTrack(i); }
-  
-  AliVVVZEROfriend *GetVZEROfriend(){ return NULL; }
-  AliVVTZEROfriend *GetTZEROfriend(){ return NULL; }
+  Int_t GetEntriesInTracks() const { return fNTrackEntries; }
+  //AliESDVZEROfriend *GetVZEROfriend(){ return NULL; }
+  //AliESDTZEROfriend *GetTZEROfriend(){ return NULL; }
 
   void Ls() const;
-
   void Reset();
-  
+
+  // bit manipulation for filtering
+  void SetSkipBit(Bool_t skip){ fBitFlags = skip; }
   Bool_t TestSkipBit() const { return (fBitFlags!=0); }
 
+  //TPC cluster occupancy
   Int_t GetNclustersTPC(UInt_t sector) const { return (sector<72)?fNclustersTPC[sector]:0; }
   Int_t GetNclustersTPCused(UInt_t sector) const { return (sector<72)?fNclustersTPCused[sector]:0; }
   
-  //virtual void AddTrack(const AliVfriendTrack *t) {}
-  //virtual void AddTrackAt(const AliVfriendTrack* /*t*/, Int_t /*i*/) {}
-  //virtual void SetVZEROfriend(AliESDVZEROfriend* /*obj*/) {}
-  //virtual void SetTZEROfriend(AliESDTZEROfriend * obj) {}
-  //void SetSkipBit(Bool_t skip){}
+  // -- Own methods  -- 
 
-  // Own methods   
-  
-  void SetSkipBit(Bool_t skip){ fBitFlags = skip; }
+  // Set methods
+
+  Int_t SetFromESDfriend( size_t allocatedMemorySize, const AliESDfriend *esdFriend );
+    
   void SetNclustersTPC(UInt_t sector, Int_t occupancy ) { if (sector<72) fNclustersTPC[sector]=occupancy; }
   void SetNclustersTPCused(UInt_t sector, Int_t occupancy ) {if (sector<72) fNclustersTPCused[sector]=occupancy; }
 
+  Int_t SetTracksStart( AliFlatESDFriendTrack* &t, Long64_t* &table, Int_t nTracks, size_t freeMem );
+  void  SetTracksEnd( Int_t nTracks, Int_t nTrackEntries, size_t tracksSize );
+
+  // other methods
+
   const AliFlatESDFriendTrack  *GetFlatTrack( Int_t i ) const { 
     const Long64_t *table = reinterpret_cast<const Long64_t*> (fContent + fTrackTablePointer);
     if( i<0 || i>fNTracks || table[i]<0 ) return NULL;
@@ -63,21 +74,12 @@ public:
 
   ULong64_t  GetSize()  const { return fContent - reinterpret_cast<const Byte_t*>(this) + fContentSize; }
 
-  void Reinitialize()
-  {
-    new (this) AliFlatESDFriend(AliVReinitialize);
-  }
 
 private: 
 
   AliFlatESDFriend(const AliFlatESDFriend&);
   AliFlatESDFriend& operator=(const AliFlatESDFriend& );  
 
-  // special constructor, to be called by placement new,
-  // when accessing information after reinterpret_cast
-  // so that vtable is generated, but values are not overwritten
-  AliFlatESDFriend(AliVConstructorReinitialisationFlag);
   AliFlatESDFriendTrack  *GetFlatTrackNonConst( Int_t i ){ 
     const Long64_t *table = reinterpret_cast<const Long64_t*> (fContent + fTrackTablePointer);
     if( i<0 || i>fNTracks || table[i]<0 ) return NULL;
@@ -93,7 +95,7 @@ private:
  
   // Pointers to specific data in fContent
   
-  size_t fTrackTablePointer;         // position of the first track in fContent
+  size_t fTrackTablePointer;     // position of the first track in fContent
   size_t fTracksPointer;         // position of the first track in fContent
 
   // -- Variable Size Object
@@ -101,4 +103,28 @@ private:
   Byte_t fContent[1];                  // Variale size object, which contains all data
 };
 
+
+inline Int_t AliFlatESDFriend::SetTracksStart( AliFlatESDFriendTrack* &t, Long64_t* &table, Int_t nTracks, size_t freeMem)
+{
+  fNTracks = 0;
+  fNTrackEntries = 0;
+  if( nTracks*sizeof(Long64_t)  > freeMem ) return -1;
+  fTrackTablePointer = fContentSize;
+  fContentSize += nTracks*sizeof(Long64_t);
+  fTracksPointer = fContentSize;
+  table = reinterpret_cast< Long64_t* >( fContent + fTrackTablePointer );
+  t = reinterpret_cast< AliFlatESDFriendTrack* >( fContent + fTracksPointer );
+  return 0;
+}
+
+inline void AliFlatESDFriend::SetTracksEnd( Int_t nTracks, Int_t nTrackEntries, size_t tracksSize )
+{
+  if( nTracks<0 ) return;
+  Long64_t *table = reinterpret_cast< Long64_t*> (fContent + fTrackTablePointer);
+  for( int i=0; i<nTracks; i++ ) table[i]+=fTracksPointer;
+  fNTracks = nTracks;
+  fNTrackEntries = nTrackEntries;
+  fContentSize += tracksSize;
+}
+
 #endif
index a65ce13267617a85dca9bea994eb7684b361d006..1089f1698605f40cf1bb51415d32ec191205d1bd 100644 (file)
 
 #include "AliFlatESDFriendTrack.h"
 #include "AliExternalTrackParam.h"
+#include "AliESDfriendTrack.h"
+#include "AliTPCseed.h"
 #include "Riostream.h"
 
 // _______________________________________________________________________________________________________
-AliFlatESDFriendTrack::AliFlatESDFriendTrack() :
-  AliVfriendTrack()
+ AliFlatESDFriendTrack::AliFlatESDFriendTrack()
+:
+ AliVfriendTrack(),
+ fContentSize(0),
+ fTPCOutPointer(-1),
+ fITSOutPointer(-1),
+ fTRDInPointer(-1),
+ fTPCseedPointer(-1),
+ fBitFlags(0)
 {
   // Default constructor
+  fContent[0]=0;
 }
 
-AliFlatESDFriendTrack::AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag f ) :
-AliVfriendTrack( f )
+ AliFlatESDFriendTrack::AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag f ) 
+:
+ AliVfriendTrack( f ),
+ fContentSize(fContentSize),
+ fTPCOutPointer(fTPCOutPointer),
+ fITSOutPointer(fITSOutPointer),
+ fTRDInPointer(fTRDInPointer),
+ fTPCseedPointer(fTPCseedPointer),
+ fBitFlags(fBitFlags)
 {
   // constructor for reinitialisation of vtable
 }
+
+void AliFlatESDFriendTrack::Reset()
+{
+  // reset
+  fContentSize = 0;
+  fTPCOutPointer = -1;
+  fITSOutPointer = -1;
+  fTRDInPointer = -1;
+  fTPCseedPointer = -1;
+  fBitFlags = 0; 
+}
+
+Int_t AliFlatESDFriendTrack::SetFromESDfriendTrack( const AliESDfriendTrack* track, size_t allocatedMemory )
+{
+  if( allocatedMemory < EstimateSize() ) return -1;
+  Reset();
+  if( !track ) return 0;
+  SetSkipBit(track->TestSkipBit() );
+  SetTrackParamTPCOut( track->GetTPCOut() );
+  SetTrackParamITSOut( track->GetITSOut() );
+  SetTrackParamTRDIn( track->GetTRDIn() );
+  const AliTPCseed* seedP = NULL;
+  {
+    TObject* calibObject = NULL;
+    for (Int_t idx = 0; (calibObject = track->GetCalibObject(idx)); ++idx) {
+      if ((seedP = dynamic_cast<const AliTPCseed*>(calibObject))) {
+       break;
+      }
+    }
+  }
+  SetTPCseed( seedP );
+  return 0;
+}
index 3b90be6dd27e9ffaf13a0e79a5530a9ea5ce0c16..450dd2b8c8c95502f43c789b6c470bf64209fd37 100644 (file)
@@ -9,18 +9,14 @@
  * See implementation file for documentation
  */
 
-/*
-Cp - Track parameters constrained to the primary vertex
-Ip - Track parameters estimated at the inner wall of TPC
-TPCInner - Track parameters estimated at the inner wall of TPC using the TPC stand-alone 
-Op - Track parameters estimated at the point of maximal radial coordinate reached during the tracking
-*/
 
 #include "Rtypes.h"
 
 #include "AliFlatTPCCluster.h"
 #include "AliVfriendTrack.h"
 #include "AliVMisc.h"
+#include "AliFlatExternalTrackParam.h"
+#include "AliFlatTPCseed.h"
 
 class AliESDtrack;
 class AliESDfriendTrack;
@@ -31,35 +27,108 @@ class AliTPCseed;
 class AliFlatESDFriendTrack :public AliVfriendTrack 
 {
  public:
+
+  // --------------------------------------------------------------------------------
+  // -- Constructor / Destructors
   AliFlatESDFriendTrack();
   ~AliFlatESDFriendTrack() {}
-  // constructor for reinitialisation of virtual table
+  // constructor and method for reinitialisation of virtual table  
   AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag );
+  void Reinitialize() { new (this) AliFlatESDFriendTrack( AliVReinitialize ); }
+
+  // --------------------   AliVfriendTrack interface    ---------------------------------
 
-  //implementation of AliVfriendTrack methods 
   Int_t GetTPCseed( AliTPCseed &) const {return -1;}
+  Int_t GetTrackParamTPCOut( AliExternalTrackParam &p ) const { return GetTrackParam( fTPCOutPointer, p ); }
+  Int_t GetTrackParamITSOut( AliExternalTrackParam &p ) const { return GetTrackParam( fITSOutPointer, p ); }
+  Int_t GetTrackParamTRDIn( AliExternalTrackParam &p )  const { return GetTrackParam( fTRDInPointer,  p ); }
 
-  //AliVVTPCseed* GetTPCseed() const {return NULL;}
-  AliTPCseed* GetTPCseed() const { return NULL; }
-  //AliVVTRDseed* GetTRDseed() const {return NULL;}
-  const AliVVtrackPointArray *GetTrackPointArray() const { return NULL; }
-  //const AliExternalTrackParam * GetITSOut() const { return NULL; } 
-  //const AliExternalTrackParam * GetTPCOut() const { return  NULL; } 
-  //const AliExternalTrackParam * GetTRDIn()  const { return NULL; } 
-  //const AliVVtrack * GetITSOut() const { return NULL; } 
-  //const AliVVtrack * GetTPCOut() const { return  NULL; } 
-  //const AliVVtrack * GetTRDIn()  const { return NULL; } 
+  //virtual const AliVtrackPointArray *GetTrackPointArray() const {return NULL;}
 
-  // own methods
+  
+  // bit manipulation for filtering
 
-  void Reinitialize() { new (this) AliFlatESDFriendTrack( AliVReinitialize ); }
+  void SetSkipBit(Bool_t skip){ fBitFlags = skip; }
+  Bool_t TestSkipBit() const { return (fBitFlags!=0); }
   
+  // ------------------- Own methods  ---------------------------------------------------------
+
+  // -- Set methods
+  void Reset();
+
+  Int_t SetFromESDfriendTrack( const AliESDfriendTrack* track, size_t allocatedMemory );
+
+  void SetTrackParamTPCOut( const AliExternalTrackParam *p ){ SetTrackParam( fTPCOutPointer, p ); }
+  void SetTrackParamITSOut( const AliExternalTrackParam *p ){ SetTrackParam( fITSOutPointer, p ); }
+  void SetTrackParamTRDIn ( const AliExternalTrackParam *p ){ SetTrackParam( fTRDInPointer,  p );  }
+  void SetTPCseed         ( const AliTPCseed *p );
+
+  // -- 
+  
+  const AliFlatESDFriendTrack *GetNextTrack() const { return reinterpret_cast<const AliFlatESDFriendTrack*>(fContent+fContentSize); }
+  AliFlatESDFriendTrack *GetNextTrackNonConst() { return reinterpret_cast<AliFlatESDFriendTrack*>(fContent+fContentSize); }
+  // --------------------------------------------------------------------------------
+  // -- Size methods
+
+  static size_t EstimateSize(){
+    return sizeof(AliFlatESDFriendTrack) + 3*sizeof(AliFlatExternalTrackParam) + AliFlatTPCseed::EstimateSize();
+  }
+
+  size_t GetSize() const { return fContent -  reinterpret_cast<const Byte_t*>(this) + fContentSize; }
+
  private: 
 
   AliFlatESDFriendTrack(const AliFlatESDFriendTrack &);
   AliFlatESDFriendTrack& operator=(const AliFlatESDFriendTrack& ); 
 
+  Int_t GetTrackParam( Long64_t ptr, AliExternalTrackParam &param ) const;
+  void  SetTrackParam( Long64_t &ptr, const AliExternalTrackParam *p );
+
+  // --------------------------------------------------------------------------------
+
+  ULong64_t fContentSize;                      // Size of this object
+  Long64_t  fTPCOutPointer;        // pointer to TPCOut track param in fContent
+  Long64_t  fITSOutPointer;        // pointer to ITSOut track param in fContent
+  Long64_t  fTRDInPointer;        // pointer to TRDIn track param in fContent
+  Long64_t  fTPCseedPointer;       // pointer to TPCseed in fContent
+  Bool_t    fBitFlags; // bit flags
+
+  // --------------------------------------------------------------------------------
+  
+  Byte_t fContent[1];                  // Variale size object, which contains all data
+
 };
 
+inline Int_t AliFlatESDFriendTrack::GetTrackParam( Long64_t ptr, AliExternalTrackParam &param ) const
+{
+  if( ptr<0 ) return -1;
+  const AliFlatExternalTrackParam *fp = reinterpret_cast< const AliFlatExternalTrackParam* >( fContent + ptr );
+  fp->GetExternalTrackParam( param );
+}
+
+inline void AliFlatESDFriendTrack::SetTrackParam( Long64_t &ptr, const AliExternalTrackParam *p )
+{
+  if(!p ) return;
+  if( ptr<0 ){
+    ptr = fContentSize;
+    fContentSize += sizeof(AliFlatExternalTrackParam);
+  }
+  AliFlatExternalTrackParam *fp = reinterpret_cast< AliFlatExternalTrackParam* >( fContent + ptr );
+  fp->SetExternalTrackParam( p );
+}
+
+inline void AliFlatESDFriendTrack::SetTPCseed( const AliTPCseed *p )
+{
+  fTPCseedPointer = -1;
+  if(!p ) return;
+  fTPCseedPointer = fContentSize;
+  AliFlatTPCseed *fp = reinterpret_cast< AliFlatTPCseed* >( fContent + fTPCseedPointer );
+  fp->SetFromTPCseed( p );
+  fContentSize += fp->GetSize();  
+}
 
 #endif
index 9c2a487572381ec088b14513c056964fb66927cd..7ea14eaf1a6538b962eb07551f9140bf5a2a3de9 100644 (file)
 #include "AliExternalTrackParam.h"
 #include "Riostream.h"
 
-// _______________________________________________________________________________________________________
-AliFlatESDTrack::AliFlatESDTrack() :
-  // Default constructor
-  AliVVtrack(),
-  fTrackParamMask(0),
-  fNTPCClusters(0),
-  fNITSClusters(0),
-  fContentSize(0)
-{
-}
 
-AliFlatESDTrack::AliFlatESDTrack( AliVConstructorReinitialisationFlag f )
-  :
-  AliVVtrack( f ),
-  fTrackParamMask(fTrackParamMask ),
-  fNTPCClusters( fNTPCClusters ),
-  fNITSClusters( fNITSClusters ),
-  fContentSize( fContentSize )
-{
-  // Constructor for reinitialisation of vtable
-}
+
 
 // _______________________________________________________________________________________________________
 
@@ -125,24 +106,12 @@ Int_t AliFlatESDTrack::SetExternalTrackParam(
 Int_t AliFlatESDTrack::FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag) {
   // Fill external track parameters
 
-  if (!param) 
-    return -1;
+  if (!param) return -1;
 
   Printf("  DEBUG: CONTENT %d >> %p + 0x%07llx = %p", flag, fContent, fContentSize, fContent + fContentSize);
 
   AliFlatExternalTrackParam * current = reinterpret_cast<AliFlatExternalTrackParam*> (fContent + fContentSize);
-  current->SetAlpha(param->GetAlpha());
-  current->SetX(param->GetX());
-  current->SetY(param->GetY());
-  current->SetZ(param->GetZ());
-  current->SetSnp(param->GetSnp());
-  current->SetTgl(param->GetTgl());
-  current->SetSigned1Pt(param->GetSigned1Pt());
-  
-  const Double_t *cov = param->GetCovariance();
-  for (Int_t idx = 0; idx <15; ++idx)
-    current->fC[idx] = cov[idx];
-    
+  current->SetExternalTrackParam( param );    
   fTrackParamMask |= flag;
   fContentSize += sizeof(AliFlatExternalTrackParam);
 
index 59e47d234474da909a88821cc8d4d75f14f527b0..9a346fd06b1a9c471a068dcb477e1dad1a931529 100644 (file)
@@ -100,7 +100,7 @@ class AliFlatESDTrack :public AliVVtrack {
     return sizeof(AliFlatESDTrack) + 6*sizeof(AliFlatExternalTrackParam);
   }
 
-  size_t GetSize() { return fContent -  reinterpret_cast<Byte_t*>(this) + fContentSize; }
+  size_t GetSize() const { return fContent -  reinterpret_cast<const Byte_t*>(this) + fContentSize; }
     
  private:
 
@@ -135,6 +135,28 @@ class AliFlatESDTrack :public AliVVtrack {
 
 };
 
+// _______________________________________________________________________________________________________
+inline AliFlatESDTrack::AliFlatESDTrack() :
+  AliVVtrack(),
+  fTrackParamMask(0),
+  fNTPCClusters(0),
+  fNITSClusters(0),
+  fContentSize(0)
+{
+  // Default constructor
+}
+
+inline AliFlatESDTrack::AliFlatESDTrack( AliVConstructorReinitialisationFlag f )
+  :
+  AliVVtrack( f ),
+  fTrackParamMask(fTrackParamMask ),
+  fNTPCClusters( fNTPCClusters ),
+  fNITSClusters( fNITSClusters ),
+  fContentSize( fContentSize )
+{
+  // Constructor for reinitialisation of vtable
+}
+
 inline UInt_t AliFlatESDTrack::CountBits(Byte_t field, UInt_t mask) {
   // Count bits in field
   UInt_t count = 0, reg = field & mask;
@@ -146,9 +168,8 @@ inline Int_t AliFlatESDTrack::GetExternalTrackParam( AliExternalTrackParam &p, U
 {
   // Get external track parameters  
   const AliFlatExternalTrackParam *f = GetFlatParam ( flag );
-  if( !f ) return -1;  
-  Float_t par[5] = { f->GetY(), f->GetZ(), f->GetSnp(), f->GetTgl(), f->GetSigned1Pt() };
-  p.Set( f->GetX(), f->GetAlpha(), par, f->GetCov() );
+  if( !f ) return -1;
+  f->GetExternalTrackParam( p );
   return 0;
 }
 
index 0a0a85b435f3d914377eaec2f8ba9fd40df989e8..7df4941f6740e7aab9bc15a753d79dabb417bfb6 100644 (file)
@@ -44,10 +44,32 @@ struct AliFlatExternalTrackParam
   Float_t  GetPt()                const {
     Double_t pt1 = fabs( fSigned1Pt );
     return (pt1>kAlmost0) ? 1./pt1 : kVeryBig;
-  } 
+  }
   void GetExternalTrackParam( AliExternalTrackParam &p ) const;
+  void SetExternalTrackParam( const AliExternalTrackParam *p );
 };
 
 typedef struct AliFlatExternalTrackParam AliFlatExternalTrackParam;
 
+inline void AliFlatExternalTrackParam::GetExternalTrackParam( AliExternalTrackParam &p ) const
+{
+ // Get external track parameters  
+  Float_t par[5] = { fY, fZ, fSnp, fTgl, fSigned1Pt };
+  p.Set( fX, fAlpha, par, fC );
+}
+
+inline void AliFlatExternalTrackParam::SetExternalTrackParam( const AliExternalTrackParam *p ) 
+{
+  // Set external track parameters
+  if( !p ) return;
+  fAlpha = p->GetAlpha();
+  fX = p->GetX();
+  fY = p->GetY();
+  fZ = p->GetZ();
+  fSnp = p->GetSnp();
+  fTgl = p->GetTgl();
+  fSigned1Pt = p->GetSigned1Pt();  
+  for (Int_t idx = 0; idx <15; ++idx) fC[idx] = p->GetCovariance()[idx];
+}
+
 #endif
diff --git a/HLT/global/AliFlatTPCseed.cxx b/HLT/global/AliFlatTPCseed.cxx
new file mode 100644 (file)
index 0000000..112f082
--- /dev/null
@@ -0,0 +1,48 @@
+/* $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.                  *
+ **************************************************************************/
+
+/**
+ * >> Flat structure representing a TPC seed <<
+ *
+ * To be used in the online and offline calibration schema.
+ *
+ *
+ * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
+ *
+ **************************************************************************/
+
+#include "AliFlatTPCseed.h"
+#include "Riostream.h"
+
+AliFlatTPCseed::AliFlatTPCseed()
+  :
+  fContentSize(0)
+{
+  // constructor
+  fContent[0]=0;
+}
+
+void AliFlatTPCseed::Reset()
+{
+  // Reset
+}
+
+void AliFlatTPCseed::SetFromTPCseed( const AliTPCseed *p )
+{
+  // initialise from AliTPCseed
+
+}
diff --git a/HLT/global/AliFlatTPCseed.h b/HLT/global/AliFlatTPCseed.h
new file mode 100644 (file)
index 0000000..8c88ae8
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef ALIFLATTPCSEED_H
+#define ALIFLATTPCSEED_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               *
+ * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli     */
+
+/*
+ * See implementation file for documentation
+ */
+
+
+#include "Rtypes.h"
+
+#include "AliFlatTPCCluster.h"
+#include "AliVfriendTrack.h"
+#include "AliVMisc.h"
+#include "AliFlatExternalTrackParam.h"
+#include "AliFlatTPCseed.h"
+
+class AliESDtrack;
+class AliESDfriendTrack;
+class AliExternalTrackParam;
+class AliTrackPointArray;
+class AliTPCseed;
+
+class AliFlatTPCseed  
+{
+ public:
+
+  // --------------------------------------------------------------------------------
+  // -- Constructor / Destructors
+  AliFlatTPCseed();
+  ~AliFlatTPCseed() {}
+  // constructor and method for reinitialisation of virtual table  
+  AliFlatTPCseed( AliVConstructorReinitialisationFlag );
+  void Reinitialize() { new (this) AliFlatTPCseed( AliVReinitialize ); }
+
+  // -- Set methods
+  void Reset();
+
+  void SetFromTPCseed( const AliTPCseed *p );
+
+  
+  // --------------------------------------------------------------------------------
+  // -- Size methods
+
+  static size_t EstimateSize(){
+    return sizeof(AliFlatTPCseed) + 6*sizeof(AliFlatExternalTrackParam);
+  }
+
+  size_t GetSize() const { return fContent -  reinterpret_cast<const Byte_t*>(this) + fContentSize; }
+
+ private: 
+
+  AliFlatTPCseed(const AliFlatTPCseed &);
+  AliFlatTPCseed& operator=(const AliFlatTPCseed& ); 
+
+  // --------------------------------------------------------------------------------
+
+  ULong64_t fContentSize;                      // Size of this object
+
+  // --------------------------------------------------------------------------------
+  
+  Byte_t fContent[1];                  // Variale size object, which contains all data
+
+};
+
+
+#endif
index 78d7e6b4003b7df7365facb22f3ab9ca6f1ad777..cf5aa87fdba04fd458bcb21a26697992817782d6 100644 (file)
@@ -42,7 +42,7 @@ public:
   void SetTZEROfriend(AliESDTZEROfriend * obj);
   AliESDTZEROfriend *GetTZEROfriend(){ return fESDTZEROfriend; }
 
-  void Ls(){
+  void Ls() const {
          return fTracks.ls();
   }
 
index d20701d8ab4000af1267665dc24a82b5f9b539f7..12bebd2514aa7482b35e722a84ac14644d2c9eb0 100644 (file)
@@ -68,7 +68,7 @@ public:
   
   // bit manipulation for filtering
   void SetSkipBit(Bool_t skip){SetBit(23,skip);}
-  Bool_t TestSkipBit() {return TestBit(23);}
+  Bool_t TestSkipBit() const {return TestBit(23);}
 
   // VfriendTrack interface
 
index 32ec30a10e035e83419fd1bd98e5fd230695a924..32d6d625c838525f6cfd75e3b03da476dbd91174 100644 (file)
@@ -10,21 +10,29 @@ public:
   AliVfriendEvent() {}
   virtual ~AliVfriendEvent() {}
 
-  virtual Int_t GetNclustersTPC(UInt_t /*sector*/) const = 0;
-  virtual Int_t GetNclustersTPCused(UInt_t /*sector*/) const = 0;
-
-  //used in calibration
-  virtual Bool_t TestSkipBit() const = 0;
   virtual Int_t GetNumberOfTracks() const = 0;
   virtual const AliVfriendTrack *GetTrack(Int_t /*i*/) const = 0;
+  virtual Int_t GetEntriesInTracks() const = 0;
+
+  // AliESDVZEROfriend *GetVZEROfriend();
+  // AliESDTZEROfriend *GetTZEROfriend();
+
+  virtual void Ls() const = 0;
+  virtual void Reset() = 0;
+
+  // bit manipulation for filtering
+  virtual void SetSkipBit(Bool_t skip) = 0;
+  virtual Bool_t TestSkipBit() const = 0;
+
+ //TPC cluster occupancy
+  virtual Int_t GetNclustersTPC(UInt_t /*sector*/) const = 0;
+  virtual Int_t GetNclustersTPCused(UInt_t /*sector*/) const = 0;
 
 private: 
-  AliVfriendEvent(const AliVfriendEvent &);
-  AliVfriendEvent& operator=(const AliVfriendEvent& esd);  
 
-//  ClassDef(AliVfriendEvent,0);
+  AliVfriendEvent(const AliVfriendEvent &);
+  AliVfriendEvent& operator=(const AliVfriendEvent& esd);
 };
 
 #endif
 
-
index 7ce8020b9dbbd1b7d0d00e63f17f29d8c0973a68..956d5bdfff4ea501ae952713929aa69cc13917fc 100644 (file)
@@ -15,25 +15,29 @@ public:
   AliVfriendTrack(){}
   // constructor for reinitialisation of vtable
   AliVfriendTrack( AliVConstructorReinitialisationFlag ){}
-
   virtual ~AliVfriendTrack(){}
 
   //used in calibration
   
   virtual Int_t GetTPCseed( AliTPCseed &) const = 0;
+  
+  /*
+  Int_t GetTrackParamTPCOut( AliExternalTrackParam &p ) const { return GetExternalTrackParam( p, 0x0  ); }
+  Int_t GetTrackParamITSOut( AliExternalTrackParam &p ) const { return GetExternalTrackParam( p, 0x0  ); }
+  Int_t GetTrackParamTRDIn( AliExternalTrackParam &p ) const { return GetExternalTrackParam( p, 0x0  ); }
+  */
+
   //virtual const AliVtrackPointArray *GetTrackPointArray() const {return NULL;}
-  //virtual const AliVtrack * GetITSOut() const {return NULL;} 
-  //virtual const AliVtrack * GetTPCOut() const {return  NULL;} 
-  //virtual const AliVtrack * GetTRDIn()  const {return NULL;} 
-  // virtual TObject* GetCalibObject(Int_t /*index*/) const = 0;
+
+  // bit manipulation for filtering
+  virtual void SetSkipBit(Bool_t skip) = 0;
+  virtual Bool_t TestSkipBit() const = 0;
 
 private: 
   AliVfriendTrack(const AliVfriendTrack &);
   AliVfriendTrack& operator=(const AliVfriendTrack& esd);  
 
-  //ClassDef(AliVfriendTrack,0);
 };
 
 #endif
 
-