]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/CALO/AliHLTCaloRawAnalyzerComponentv3.h
New CMake build implementation
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloRawAnalyzerComponentv3.h
index 84e87950788d94b7c6afc4b8e46ef267a404bf25..2330be251ed568c91ee594c1e3bbf5b225812a7a 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
@@ -25,7 +27,7 @@
  * @file   AliHLTCaloRawAnalyzerComponentv3.h
  * @author Oystein Djuvsland
  * @date   
- * @brief  A clusterizer component for PHOS HLT
+ * @brief Extraction of Amplitude and Peak position for PHOS/EMCAL HLT
 */
 
 // see below for class documentation
@@ -34,8 +36,6 @@
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
-//#include "AliHLTCaloRcuProcessor.h"
-
 
 class AliCaloRawAnalyzer;
 class AliHLTCaloRcuCellEnergyDataStruct;
@@ -96,64 +96,41 @@ class AliAltroRawStreamV3;
  */ 
 
 
+// #include "AliHLTProcessor.h"
+// #include "AliHLTCaloDefinitions.h"
 
-#include "AliHLTProcessor.h"
-#include "AliHLTCaloDefinitions.h"
 #include "AliHLTCaloConstantsHandler.h"
-#include "AliHLTCaloRcuProcessor.h"
+#include "AliHLTCaloProcessor.h"
+#include "AliCaloRawAnalyzer.h"
+
 
-//#include "TObject.h"
+#include "AliCaloConstants.h"
+using namespace Algo;
 
 class AliHLTCaloMapper;
 
 
-class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, public AliHLTCaloRcuProcessor
+class AliHLTCaloRawAnalyzerComponentv3 :  public AliHLTCaloProcessor, protected AliHLTCaloConstantsHandler
 {
  public:
 
   /** Constructor must be initialized to specific calorimeter */
-  AliHLTCaloRawAnalyzerComponentv3(TString det);
-  
-  /** Destructor */
+  AliHLTCaloRawAnalyzerComponentv3(TString det, fitAlgorithm algo );
   virtual ~AliHLTCaloRawAnalyzerComponentv3();
-
-  // virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0;
-
-  /** interface function, see @ref AliHLTComponent for description */
   virtual int DoInit(int argc =0, const char** argv  = 0) ;
-
-  /** interface function, see @ref AliHLTComponent for description */
   virtual int DoDeinit();
-
-  /** interface function, see @ref AliHLTComponent for description */
   virtual const char* GetComponentID() = 0;
-
-  /** interface function, see @ref AliHLTComponent for description */
-  //  virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
   virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list) = 0; 
-
-  /** interface function, see @ref AliHLTComponent for description */
-  //  virtual AliHLTComponentDataType GetOutputDataType();
   virtual AliHLTComponentDataType GetOutputDataType() = 0;
-
-  /** interface function, see @ref AliHLTComponent for description */
-  //  virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-  virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) = 0 ;
-
-  /** interface function, see @ref AliHLTComponent for description */
+  virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
   virtual AliHLTComponent* Spawn() = 0; 
 
  protected:
-
-  //virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0;
-  /** interface function, see @ref AliHLTComponent for description */
-
-  using AliHLTCaloRcuProcessor::DoEvent;
-
-  /** interface function, see @ref AliHLTComponent for description */
+  bool CheckInputDataType(const AliHLTComponentDataType &datatype);
   virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
-                    AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
-                      AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks ) = 0;  
+                      AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
+                      AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );  
+
 
   /** 
    * Do the real processing in the component 
@@ -163,39 +140,23 @@ class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, publ
    * @param totSize is the total size used for output
    * @return the size output size used
    */
-  virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize); 
-
+  virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, 
+                    const AliHLTUInt32_t size, UInt_t& totSize); 
 
-  // unsigned long fCaloEventCount;
-
-  /** Pointer to an analyzer object used for raw data anlysis */ 
+  
+ protected:
+  virtual void InitMapping(const int specification ) = 0;
+  void PrintDebugInfo();
   AliCaloRawAnalyzer *fAnalyzerPtr;   //COMMENT
-
-  //** Pointer to a mapper opbject */
   AliHLTCaloMapper *fMapperPtr;          //COMMENT
-
-  virtual void InitMapping(const int specification ) = 0;
+  AliHLTUInt32_t fCurrentSpec;    // Data specification (RCU)
+  bool fDebug;    // Turn on to enable debug info
 
  private:
-
-/** Keep default constructor private since it should not be used */
   AliHLTCaloRawAnalyzerComponentv3();
-
-  /** Keep the copy constructor private since it should not be used */
   AliHLTCaloRawAnalyzerComponentv3(const AliHLTCaloRawAnalyzerComponentv3 & );
-
-  /** Keep the assignement operator private since it should not be used */
   AliHLTCaloRawAnalyzerComponentv3 & operator = (const AliHLTCaloRawAnalyzerComponentv3 &);
-
-  //virtual void InitMapping(const int specification ) = 0;
-  
-  /** Mapping from harware address to geometrical address */
-  //  AliHLTCaloMapper *fMapperPtr;                       //!transient 
-
-
-
-  /** Pointer to object which may check the integrity of the data */
-  AliHLTCaloSanityInspector *fSanityInspectorPtr;     //!transient
+  AliHLTCaloSanityInspector *fSanityInspectorPtr;     //!transient  /** Pointer to object which may check the integrity of the data */
 
   /** Pointer to the raw data reader which reads from memory */
   AliRawReaderMemory* fRawReaderMemoryPtr;            //!transient
@@ -203,6 +164,9 @@ class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, publ
   /** Pointer to the raw stream */
   AliAltroRawStreamV3* fAltroRawStreamPtr;              //!transient
 
+  /** detector */
+  TString fDetector;                                  // detector string id
+
   /** Describing which algorithm we are using */
   Short_t fAlgorithm;                                 //COMMENT
 
@@ -218,49 +182,41 @@ class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, publ
   /** The maximum position a peak can have to be considered */
   Int_t fMaxPeakPosition;                             //COMMENT
   
-  // AliHLTCaloMapper *fMapperPtr;
-
-  /** Should we push the raw data when the channel is crazy? */
+   /** Should we push the raw data when the channel is crazy? */
   Bool_t fDoPushBadRawData;                             //COMMENT
       
   /** Should we push all raw data (using the raw data writer) */
-  Bool_t fDoPushRawData;                              //COMMENT
-
-  class RawDataWriter 
+  Bool_t fDoPushRawData; //COMMENT 
+  
+  class RawDataWriter  
   {
   public:
     RawDataWriter(AliHLTCaloConstants* cConst);
-    ~RawDataWriter();
-    //   void WriteChannelId(const UShort_t channeldid );
+    virtual ~RawDataWriter();
     void NewChannel( );
     void WriteBunchData(const UShort_t *bunchdata,  const int length,   const UInt_t starttimebin );
     void ResetBuffer();
     void SetChannelId( const UShort_t channeldid );
-    //void CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused );
     int CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused );
     void NewEvent();
-   
   private:
-    
-    //Default constructor, should not be used. 
     RawDataWriter();    
     RawDataWriter (const RawDataWriter  & );
     RawDataWriter & operator = (const RawDataWriter &);
     void Init();
-    //    bool fIsFirstChannel;
-    UShort_t* fRawDataBuffer;
-    int fCurrentChannelSize;
-    int fBufferIndex;
-    int fBufferSize;
-    UShort_t *fCurrentChannelIdPtr;
-    UShort_t *fCurrentChannelSizePtr; 
-    UShort_t *fCurrentChannelDataPtr; 
-    int fTotalSize;
+    UShort_t* fRawDataBuffer; // Buffer for storing of rawdata
+    int fCurrentChannelSize;  //Comment
+    int fBufferIndex;         //Position in buffer
+    int fBufferSize;          //Comment
+    UShort_t *fCurrentChannelIdPtr; //Channel ID (module, row, column)
+    UShort_t *fCurrentChannelSizePtr;  //Comment
+    UShort_t *fCurrentChannelDataPtr; //Comment 
+    int fTotalSize; //Comment
   };
 
   RawDataWriter *fRawDataWriter; 
-
-  //  ClassDef(AliHLTCaloRawAnalyzerComponentv3, 1)
+  ClassDef(AliHLTCaloRawAnalyzerComponentv3, 0)
 
 };