LCOV - code coverage report
Current view: top level - HLT/TPCLib - AliHLTTPCHWCFSpacePointContainer.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 21 4.8 %
Date: 2016-06-14 17:26:59 Functions: 1 29 3.4 %

          Line data    Source code
       1             : //-*- Mode: C++ -*-
       2             : // $Id$
       3             : #ifndef ALIHLTTPCHWCFSPACEPOINTCONTAINER_H
       4             : #define ALIHLTTPCHWCFSPACEPOINTCONTAINER_H
       5             : //* This file is property of and copyright by the ALICE HLT Project        * 
       6             : //* ALICE Experiment at CERN, All rights reserved.                         *
       7             : //* See cxx source for full Copyright notice                               *
       8             : 
       9             : /// @file   AliHLTTPCHWCFSpacePointContainer.h
      10             : /// @author Matthias Richter
      11             : /// @date   2011-08-08
      12             : /// @brief  Helper class for handling of HLT TPC cluster data blocks from the
      13             : ///         HW ClusterFinder
      14             : /// @note   Class is a duplicate of AliHLTTPCHWCFSpacePointContainer and should
      15             : ///         be merged with it in a generic way
      16             : 
      17             : #include "AliHLTSpacePointContainer.h"
      18             : #include "AliHLTTPCHWCFData.h"
      19             : #include <map>
      20             : #include <vector>
      21             : using namespace std;
      22             : 
      23             : /**
      24             :  * @class AliHLTTPCHWCFSpacePointContainer
      25             :  * Handler class for HLT TPC hardware ClusterFinder space point data blocks.
      26             :  *
      27             :  * @ingroup alihlt_tpc
      28             :  */
      29             : class AliHLTTPCHWCFSpacePointContainer : public AliHLTSpacePointContainer
      30             : {
      31             :  public:
      32             :   /// standard constructor
      33             :   AliHLTTPCHWCFSpacePointContainer(int mode=0);
      34             :   /// copy constructor
      35             :   AliHLTTPCHWCFSpacePointContainer(const AliHLTTPCHWCFSpacePointContainer& c);
      36             :   /// assignment operator
      37             :   AliHLTTPCHWCFSpacePointContainer& operator=(const AliHLTTPCHWCFSpacePointContainer& c);
      38             :   /// destructor
      39             :   ~AliHLTTPCHWCFSpacePointContainer();
      40             : 
      41             :   enum {
      42             :     kModeSingle = 0x1,
      43             :     kModeCreateMap = 0x2,
      44             :     kModeDifferentialPadTime = 0x4
      45             :   };
      46             : 
      47             :   virtual bool Check(AliHLTUInt32_t clusterID) const;
      48             :   virtual int GetClusterIDs(vector<AliHLTUInt32_t>& tgt) const;
      49             :   virtual const vector<AliHLTUInt32_t>* GetClusterIDs(AliHLTUInt32_t mask);
      50             :   virtual float GetX(AliHLTUInt32_t clusterID) const;
      51             :   virtual float GetXWidth(AliHLTUInt32_t clusterID) const;
      52             :   virtual float GetY(AliHLTUInt32_t clusterID) const;
      53             :   virtual float GetYWidth(AliHLTUInt32_t clusterID) const;
      54             :   virtual float GetZ(AliHLTUInt32_t clusterID) const;
      55             :   virtual float GetZWidth(AliHLTUInt32_t clusterID) const;
      56             :   virtual float GetCharge(AliHLTUInt32_t clusterID) const;
      57             :   virtual float GetQMax(AliHLTUInt32_t clusterID) const;
      58           0 :   virtual float GetMaxSignal(AliHLTUInt32_t clusterID) const {return GetQMax(clusterID);}
      59             :   virtual float GetPhi(AliHLTUInt32_t clusterID) const;
      60             : 
      61             :   /// add input block to the collection
      62             :   virtual int AddInputBlock(const AliHLTComponentBlockData* pDesc);
      63             : 
      64             :   virtual int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTUInt32_t mask) const;
      65             :   int PopulateAccessGrid(AliHLTSpacePointPropertyGrid* pGrid, AliHLTTPCHWCFData* pDecoder, int slice, int partition) const;
      66             :   virtual const AliHLTSpacePointPropertyGrid* GetSpacePointPropertyGrid(AliHLTUInt32_t mask) const;
      67             :   virtual int SetSpacePointPropertyGrid(AliHLTUInt32_t mask, AliHLTSpacePointPropertyGrid*);
      68             : 
      69             :   /// clear the object and reset pointer references
      70             :   virtual void Clear(Option_t * option ="");
      71             : 
      72             :   /// print information
      73             :   virtual void Print(ostream& out, Option_t *option="") const;
      74             : 
      75             :   /// create a collection of clusters for a space point mask
      76             :   virtual AliHLTSpacePointContainer* SelectByMask(AliHLTUInt32_t mask, bool bAlloc=false) const;
      77             : 
      78             :   /// create a collection of clusters for a specific track
      79             :   virtual AliHLTSpacePointContainer* SelectByTrack(int trackId, bool bAlloc=false) const;
      80             : 
      81             :   /// create a collection of clusters for a specific MC track
      82             :   virtual AliHLTSpacePointContainer* SelectByMC(int mcId, bool bAlloc=false) const;
      83             : 
      84             :   /// create a collection of all used clusters
      85             :   virtual AliHLTSpacePointContainer* UsedClusters(bool bAlloc=false) const;
      86             : 
      87             :   /// create a collection of all unused clusters
      88             :   virtual AliHLTSpacePointContainer* UnusedClusters(bool bAlloc=false) const;
      89             : 
      90             :   virtual int MarkUsed(const AliHLTUInt32_t* clusterIDs, int arraySize);
      91             :   virtual int SetTrackID(int trackID, const AliHLTUInt32_t* clusterIDs, int arraySize);
      92             :   virtual int GetTrackID(AliHLTUInt32_t clusterID) const;
      93             :   virtual int SetMCID(int clusterID, const AliHLTUInt32_t* clusterIDs, int arraySize);
      94             : 
      95             :   virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size,
      96             :                     vector<AliHLTComponentBlockData>& outputBlocks,
      97             :                     AliHLTDataDeflater* pDeflater,
      98             :                     const char* option="") const;
      99             :   virtual int Write(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
     100             :                     vector<AliHLTComponentBlockData>& outputBlocks,
     101             :                     AliHLTDataDeflater* pDeflater,
     102             :                     const char* option="") const;
     103             : 
     104             :   int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
     105             :                   vector<AliHLTComponentBlockData>& outputBlocks,
     106             :                   AliHLTDataDeflater* pDeflater,
     107             :                   const char* option="") const;
     108             : 
     109             :   int WriteSorted(AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
     110             :                   AliHLTTPCHWCFData* pDecoder, AliHLTSpacePointPropertyGrid* pGrid,
     111             :                   AliHLTUInt32_t mask,
     112             :                   vector<AliHLTComponentBlockData>&  outputBlocks,
     113             :                   AliHLTDataDeflater* pDeflater,
     114             :                   const char* option) const;
     115             : 
     116             :   /// allocate index grid, one single point to define the dimensions
     117             :   static AliHLTSpacePointPropertyGrid* AllocateIndexGrid();
     118             : 
     119             :   class AliHLTTPCHWCFSpacePointProperties {
     120             :   public:
     121             :     AliHLTTPCHWCFSpacePointProperties();
     122             :     AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFData* pDecoder, int index);
     123             :     AliHLTTPCHWCFSpacePointProperties(const AliHLTTPCHWCFSpacePointProperties& src);
     124             :     AliHLTTPCHWCFSpacePointProperties& operator=(const AliHLTTPCHWCFSpacePointProperties& src);
     125             : 
     126           0 :     ~AliHLTTPCHWCFSpacePointProperties() {}
     127             : 
     128           0 :     const AliHLTTPCHWCFData* Decoder() const {return fDecoder;}
     129             :     int GetSpacepointIndex() const {return fIndex;}
     130           0 :     bool IsUsed() const {return fUsed;}
     131           0 :     void MarkUsed(bool used=true) {fUsed=used;}
     132           0 :     int GetTrackId() const {return fTrackId;}
     133           0 :     void SetTrackId(int trackId) {fTrackId=trackId;}
     134           0 :     int GetMCId() const {return fMCId;}
     135           0 :     void SetMCId(int mcId) {fMCId=mcId;}
     136             : 
     137             :     void Print(ostream& out, Option_t *option="") const;
     138             : 
     139             :   private:
     140             :     const AliHLTTPCHWCFData* fDecoder; //! decoder for data block
     141             :     int fIndex; //! index within the decoder block
     142             :     bool fUsed; //! transient
     143             :     int fTrackId; //! track id from reconstruction
     144             :     int fMCId; //! MC id
     145             :   };
     146             : 
     147             :   class AliHLTTPCHWCFSpacePointBlock {
     148             :   public:
     149             :     AliHLTTPCHWCFSpacePointBlock(AliHLTUInt32_t id=0, AliHLTTPCHWCFData* pDecoder=NULL, AliHLTSpacePointPropertyGrid* pGrid=NULL)
     150           0 :       : fDecoder(pDecoder), fGrid(pGrid), fId(id) {}
     151             :     AliHLTTPCHWCFSpacePointBlock(const AliHLTTPCHWCFSpacePointBlock& s) 
     152             :       : fDecoder(s.fDecoder), fGrid(s.fGrid), fId(s.fId) {}
     153             :     AliHLTTPCHWCFSpacePointBlock& operator=(const AliHLTTPCHWCFSpacePointBlock& s) {
     154           0 :       if (this==&s) return *this;
     155           0 :       fDecoder=s.fDecoder; fGrid=s.fGrid; fId=s.fId; return *this;
     156           0 :     }
     157           0 :     ~AliHLTTPCHWCFSpacePointBlock() {}
     158             : 
     159             :     int GetNofSpacepoints() const {return fDecoder?fDecoder->GetNumberOfClusters():0;}
     160           0 :     AliHLTUInt32_t GetId() const {return fId;}
     161           0 :     void SetId(AliHLTUInt32_t id) {fId=id;}
     162           0 :     AliHLTTPCHWCFData* GetDecoder() const {return fDecoder;} 
     163           0 :     void SetDecoder(AliHLTTPCHWCFData* pDecoder) {fDecoder=pDecoder;}
     164           0 :     AliHLTSpacePointPropertyGrid* GetGrid() const {return fGrid;}
     165           0 :     void SetGrid(AliHLTSpacePointPropertyGrid* pGrid) {fGrid=pGrid;}
     166             : 
     167             :   protected:
     168             :   private:
     169             :     AliHLTTPCHWCFData* fDecoder; //!
     170             :     AliHLTSpacePointPropertyGrid* fGrid; //!
     171             :     AliHLTUInt32_t fId; //!
     172             :   };
     173             : 
     174             :  protected:
     175             : 
     176             :  private:
     177             :   /// map of clusters
     178             :   std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointProperties> fClusters; //!
     179             : 
     180             :   /// map of cluster id collection for different masks
     181             :   std::map<AliHLTUInt32_t, vector<AliHLTUInt32_t>*> fSelections; //!
     182             : 
     183             :   /// array of decoders
     184             :   std::map<AliHLTUInt32_t, AliHLTTPCHWCFSpacePointBlock> fBlocks; //!
     185             : 
     186             :   /// the one instance for mode single (=1)
     187             :   AliHLTTPCHWCFSpacePointBlock fSingleBlock;
     188             : 
     189             :   /// mode
     190             :   int fMode; //!
     191             : 
     192             :   /// vector of cluster ids for writing
     193             :   vector<AliHLTUInt32_t>* fWrittenClusterIds; //!
     194             : 
     195           6 :   ClassDef(AliHLTTPCHWCFSpacePointContainer, 0)
     196             : };
     197             : 
     198             : ostream& operator<<(ostream &out, const AliHLTTPCHWCFSpacePointContainer::AliHLTTPCHWCFSpacePointProperties& p);
     199             : 
     200             : #endif

Generated by: LCOV version 1.11