]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
TPC calibration components added
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 May 2007 20:30:16 +0000 (20:30 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 May 2007 20:30:16 +0000 (20:30 +0000)
HLT/BASE/interface/AliHLTExternalInterface.cxx
HLT/BASE/interface/AliHLTExternalInterface.h
HLT/TPCLib/AliHLTTPCCalibPedestalComponent.cxx [new file with mode: 0755]
HLT/TPCLib/AliHLTTPCCalibPedestalComponent.h [new file with mode: 0755]
HLT/TPCLib/AliHLTTPCCalibSignalComponent.cxx [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCCalibSignalComponent.h [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDefinitions.cxx
HLT/TPCLib/AliHLTTPCDefinitions.h
HLT/libAliHLTTPC.pkg

index a770af940188737e4f22aba9b4f4b30ad55a5b03..a7a8b6ff95a1b185f869e39ffc9a0bc0de51cc58 100644 (file)
@@ -16,7 +16,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/** @file   AliHLT_C_Component_WrapperInterface.cxx
+/** @file   AliHLTExternalInterface.cxx
     @author Matthias Richter, Timm Steinbeck
     @date   
     @brief  Pure C interface to the AliRoot HLT component handler
index 010dca5a2e2df4ae4d4325b780bf2ea399147942..2cecbf4a1b44f14bdd705ead1ce20f6c7921b5a0 100644 (file)
@@ -5,7 +5,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/** @file   AliHLT_C_Component_WrapperInterface.h
+/** @file   AliHLTExternalInterface.h
     @author Matthias Richter, Timm Steinbeck
     @date   
     @brief  Pure and dynamic C interface to the AliRoot HLT component handler
diff --git a/HLT/TPCLib/AliHLTTPCCalibPedestalComponent.cxx b/HLT/TPCLib/AliHLTTPCCalibPedestalComponent.cxx
new file mode 100755 (executable)
index 0000000..dfdb3b6
--- /dev/null
@@ -0,0 +1,267 @@
+
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
+ *          for The ALICE Off-line Project.                               *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+/** @file   AliHLTTPCCalibPedestalComponent.cxx
+    @author Jochen Thaeder
+    @date   
+    @brief  A pedestal calibration component for the TPC.
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCLogging.h"
+#include "AliHLTTPCTransform.h"
+
+#include "AliHLTTPCCalibPedestalComponent.h"
+
+#include "AliRawDataHeader.h"
+#include "AliRawReaderMemory.h"
+#include "AliTPCRawStream.h"
+
+#include "AliTPCCalibPedestal.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include "TString.h"
+
+// this is a global object used for automatic component registration, do not use this
+AliHLTTPCCalibPedestalComponent gAliHLTTPCCalibPedestalComponent;
+
+ClassImp(AliHLTTPCCalibPedestalComponent)
+
+AliHLTTPCCalibPedestalComponent::AliHLTTPCCalibPedestalComponent()
+  :
+  fRawReader(NULL),
+  fRawStream(NULL),
+  fCalibPedestal(NULL),
+  fRCUFormat(kFALSE)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTTPCCalibPedestalComponent::AliHLTTPCCalibPedestalComponent(const AliHLTTPCCalibPedestalComponent&)
+  :
+  fRawReader(NULL),
+  fRawStream(NULL),
+  fCalibPedestal(NULL),
+  fRCUFormat(kFALSE)
+{
+  // see header file for class documentation
+  HLTFatal("copy constructor untested");
+}
+
+AliHLTTPCCalibPedestalComponent& AliHLTTPCCalibPedestalComponent::operator=(const AliHLTTPCCalibPedestalComponent&)
+{ 
+  // see header file for class documentation
+  HLTFatal("assignment operator untested");
+  return *this;
+}      
+
+AliHLTTPCCalibPedestalComponent::~AliHLTTPCCalibPedestalComponent()
+{
+  // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTTPCCalibPedestalComponent::GetComponentID()
+{
+  // see header file for class documentation
+  return "TPCCalibPedestal";
+}
+
+void AliHLTTPCCalibPedestalComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+  // see header file for class documentation
+  list.clear(); 
+  list.push_back( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+}
+
+AliHLTComponentDataType AliHLTTPCCalibPedestalComponent::GetOutputDataType()
+{
+  // see header file for class documentation
+  return AliHLTTPCDefinitions::fgkCalibPedestalDataType;
+}
+
+void AliHLTTPCCalibPedestalComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
+{
+  // see header file for class documentation
+  // XXX TODO: Find more realistic values.  
+  constBase = 0;
+  inputMultiplier = (2.0);
+}
+
+AliHLTComponent* AliHLTTPCCalibPedestalComponent::Spawn()
+{
+  // see header file for class documentation
+  return new AliHLTTPCCalibPedestalComponent();
+}  
+
+Int_t AliHLTTPCCalibPedestalComponent::DoInit( int argc, const char** argv ) {
+  // see header file for class documentation
+  
+  // ** Interprete commandline arguments
+  Int_t i = 0;
+  Char_t* cpErr;
+
+  while ( i < argc ) {      
+    
+    // -- rcu format option -- default in constructor: kFALSE => use new data format
+    if ( !strcmp( argv[i], "rcuformat" ) ) {
+      if ( argc <= i+1 ) {
+       HLTError( "Missing RCU format - RCU format not specified" );
+       return ENOTSUP;
+      }
+      
+      // Decodes the rcu format --  options: "old" or "new"
+      if ( !strcmp( argv[i+1], "old" ) ) {
+       fRCUFormat = kTRUE;
+      }
+      else if ( !strcmp( argv[i+1], "new" ) ) {
+       fRCUFormat = kFALSE;
+      }
+      else {
+       HLTError( "Missing RCU format - Cannot convert rcu format  specifier '%s'.", argv[i+1] );
+       return EINVAL;
+      }
+      
+      i += 2;
+      continue;
+    }
+
+    HLTError( "Unknown Option - Unknown option '%s'", argv[i] );
+    return EINVAL;
+    
+  }
+  
+  // ** Create pedestal calibration
+  if ( fCalibPedestal )
+    return EINPROGRESS;
+  
+  fCalibPedestal = new AliTPCCalibPedestal();
+
+  // **  Create AliRoot Memory Reader
+  if (fRawReader)
+    return EINPROGRESS;
+
+#if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H) 
+  fRawReader = new AliRawReaderMemory();
+#else
+  HLTFatal("AliRawReader  not available - check your build");
+  return -ENODEV;
+#endif
+
+  return 0;
+}
+
+Int_t AliHLTTPCCalibPedestalComponent::DoDeinit()
+{
+  // see header file for class documentation
+
+  if ( fRawReader )
+    delete fRawReader;
+  fRawReader = NULL;
+
+  if ( fCalibPedestal )
+    delete fCalibPedestal;
+  fCalibPedestal = NULL;
+
+  return 0;
+}
+
+/*
+ * --- will be changing with the Calibration Processor, -> Split DoEvent into 2 functions:
+ *    --- > Process event
+ *    --- > Ship Data to FXS
+ * --- setter for rcuformat need in AliTPCCalibPedestal class
+ */
+Int_t AliHLTTPCCalibPedestalComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
+  // see header file for class documentation
+  
+  const AliHLTComponentBlockData* iter = NULL;
+  AliHLTUInt32_t spec = 0;
+
+  Int_t slice, patch;
+  Int_t minPatch = 5;
+  Int_t maxPatch = 0;
+  Int_t DDLid = 0;
+    
+  // ** Loop over all input blocks and specify which data format should be read - only select Raw Data
+  iter = GetFirstInputBlock( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+  
+  while ( iter != NULL ) {
+    
+    // ** Print Debug output which data format was received
+    char tmp1[14], tmp2[14];
+    DataType2Text( iter->fDataType, tmp1 );
+    DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
+
+    HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+
+    // ** Get DDL ID in order to tell the memory reader which slice/patch to use
+    slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
+    patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+
+    if (patch < 2) DDLid = 768 + (2 * slice) + patch;
+    else DDLid = 838 + (4*slice) + patch;
+
+    HLTDebug ( "Input Raw Data - Slice/Patch: %d/%d - EquipmentID : %d.", slice, patch, DDLid );
+
+    // ** Get min and max patch, used for output specification
+    if ( patch < minPatch ) minPatch =  patch;
+    if ( patch > maxPatch ) maxPatch =  patch;
+
+    // ** Init TPCRawStream
+    fRawReader->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize );
+    fRawReader->SetEquipmentID(DDLid);
+
+    fRawStream = new AliTPCRawStream( fRawReader );
+    fRawStream->SetOldRCUFormat( fRCUFormat );
+
+    // ** Process actual Pedestal Calibration - Fill histograms
+    fCalibPedestal->ProcessEvent( fRawStream );
+  
+    // ** Delete TPCRawStream
+    if ( fRawStream )
+      delete fRawStream;
+    fRawStream = NULL;    
+
+    // ** Get next input block, with the same specification as defined in GetFirstInputBlock()
+    iter = GetNextInputBlock();
+
+  } //  while ( iter != NULL ) {
+  
+  // !!! HIGHLY DEBUG !!!
+  //  fCalibPedestal->DumpToFile("Pedestal.root");
+  // !!! HIGHLY DEBUG !!!
+
+  // ** Call only at "END OF RUN" event
+  //  fCalibPedestal->Analyse();
+  
+  // ** PushBack data to shared memory ... 
+  spec = AliHLTTPCDefinitions::EncodeDataSpecification( slice, slice, minPatch, maxPatch );
+  PushBack( (TObject*) fCalibPedestal, AliHLTTPCDefinitions::fgkCalibPedestalDataType, spec);
+  
+  return 0;
+} // Int_t AliHLTTPCCalibPedestalComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
diff --git a/HLT/TPCLib/AliHLTTPCCalibPedestalComponent.h b/HLT/TPCLib/AliHLTTPCCalibPedestalComponent.h
new file mode 100755 (executable)
index 0000000..c3dd068
--- /dev/null
@@ -0,0 +1,86 @@
+
+#ifndef ALIHLTTPCCALIBPEDESTALCOMPONENT_H
+#define ALIHLTTPCCALIBPEDESTALCOMPONENT_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/** @file   AliHLTTPCCalibPedestalComponent.h
+    @author Jochen Thaeder
+    @date   
+    @brief  A pedestal calibration component for the TPC.
+*/
+
+#include "AliHLTProcessor.h"
+#include "AliHLTTPCDefinitions.h"
+
+class AliTPCRawStream;
+class AliRawReaderMemory;
+class AliTPCCalibPedestal;
+
+/**
+ * @class AliHLTTPCCalibPedestalComponent
+ * 
+ * This class is the component for the AliTPCCalibPedestal class used for 
+ * pedestal calibration of the TPC. It uses the high-level interface and
+ * the output is the TObject of AliTPCCalibPedestal.
+ *
+ * The component has the following component arguments:
+ * -    The RCU format:  rcuformat  
+ *      which can be either 
+ *        - old ( used in the TPC Commissioning )
+ *        - new
+ *
+ * @ingroup alihlt_tpc
+ */
+class AliHLTTPCCalibPedestalComponent : public AliHLTProcessor
+    {
+    public:
+      /**
+       * constructor 
+       */
+      AliHLTTPCCalibPedestalComponent();
+      /** not a valid copy constructor, defined according to effective C++ style */
+      AliHLTTPCCalibPedestalComponent(const AliHLTTPCCalibPedestalComponent&);
+      /** not a valid assignment op, but defined according to effective C++ style */
+      AliHLTTPCCalibPedestalComponent& operator=(const AliHLTTPCCalibPedestalComponent&);
+      /** destructor */
+      virtual ~AliHLTTPCCalibPedestalComponent();
+      
+      // Public functions to implement AliHLTComponent's interface.
+      // These functions are required for the registration process
+
+      const char* GetComponentID();
+      void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+      AliHLTComponentDataType GetOutputDataType();
+      virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+      AliHLTComponent* Spawn();
+
+    protected:
+      
+      // Protected functions to implement AliHLTComponent's interface.
+      // These functions provide initialization as well as the actual processing
+      // capabilities of the component. 
+      
+      Int_t DoInit( int argc, const char** argv );
+      Int_t DoDeinit();
+      Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
+   
+    private:
+
+      /** the reader object for reading from memory */
+      AliRawReaderMemory* fRawReader;                                              //!transient
+
+      /** the reader object for reading TPC raw data */  
+      AliTPCRawStream* fRawStream;                                                 //!transient
+
+      /** Pedestal Calibration class */
+      AliTPCCalibPedestal * fCalibPedestal;                                        //!transient
+      
+      /** if use old RCU format */
+      Bool_t fRCUFormat;                                                           // see above
+
+      ClassDef(AliHLTTPCCalibPedestalComponent, 0)
+
+    };
+#endif
diff --git a/HLT/TPCLib/AliHLTTPCCalibSignalComponent.cxx b/HLT/TPCLib/AliHLTTPCCalibSignalComponent.cxx
new file mode 100644 (file)
index 0000000..cf9e1bf
--- /dev/null
@@ -0,0 +1,274 @@
+
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
+ *          Sorina Popescu <sorina.popescu@cern.ch                        *
+ *          for The ALICE Off-line Project.                               *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+/** @file   AliHLTTPCCalibSignallComponent.cxx
+    @author Jochen Thaeder, Sorina Popescu
+    @date   8 may 2007
+    @brief  HLT pulser calibration component for the TPC.
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCLogging.h"
+#include "AliHLTTPCTransform.h"
+
+#include "AliHLTTPCCalibSignalComponent.h"
+
+#include "AliRawDataHeader.h"
+#include "AliRawReaderMemory.h"
+#include "AliTPCRawStream.h"
+
+#include "AliTPCCalibSignal.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include "TString.h"
+
+// this is a global object used for automatic component registration, do not use this
+AliHLTTPCCalibSignalComponent gAliHLTTPCCalibSignalComponent;
+
+ClassImp(AliHLTTPCCalibSignalComponent)
+
+AliHLTTPCCalibSignalComponent::AliHLTTPCCalibSignalComponent()
+  :
+  fRawReader(NULL),
+  fRawStream(NULL),
+  fCalibSignal(NULL),
+  fRCUFormat(kFALSE)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTTPCCalibSignalComponent::AliHLTTPCCalibSignalComponent(const AliHLTTPCCalibSignalComponent&)
+  :
+  fRawReader(NULL),
+  fRawStream(NULL),
+  fCalibSignal(NULL),
+  fRCUFormat(kFALSE)
+{
+  // see header file for class documentation
+  HLTFatal("copy constructor to be tested");
+}
+
+AliHLTTPCCalibSignalComponent& AliHLTTPCCalibSignalComponent::operator=(const AliHLTTPCCalibSignalComponent&)
+{ 
+  // see header file for class documentation
+  HLTFatal("assignment operator to be tested");
+  return *this;
+}      
+
+AliHLTTPCCalibSignalComponent::~AliHLTTPCCalibSignalComponent()
+{
+  // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTTPCCalibSignalComponent::GetComponentID()
+{
+  // see header file for class documentation
+  return "TPCCalibSignal";
+}
+
+void AliHLTTPCCalibSignalComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+  // see header file for class documentation
+  list.clear(); 
+  list.push_back( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+}
+
+AliHLTComponentDataType AliHLTTPCCalibSignalComponent::GetOutputDataType()
+{
+  // see header file for class documentation
+  return AliHLTTPCDefinitions::fgkCalibSignalDataType;
+}
+
+void AliHLTTPCCalibSignalComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
+{
+  // see header file for class documentation
+  // XXX TODO: Find more realistic values.  
+  constBase = 0;
+  inputMultiplier = (2.0);
+}
+
+AliHLTComponent* AliHLTTPCCalibSignalComponent::Spawn()
+{
+  // see header file for class documentation
+  return new AliHLTTPCCalibSignalComponent();
+}  
+
+Int_t AliHLTTPCCalibSignalComponent::DoInit( int argc, const char** argv )
+{
+  // see header file for class documentation
+  
+  // ** Interprete commandline arguments
+  Int_t i = 0;
+  Char_t* cpErr;
+
+  while ( i < argc ) {      
+    
+    // -- rcu format option-- default in constructor: kFALSE => use new data format
+    if ( !strcmp( argv[i], "rcuformat" ) ) {
+      if ( argc <= i+1 ) {
+       HLTError( "Missing RCU format - RCU format not specified" );
+       return ENOTSUP;
+      }
+      
+      // Decodes the rcu format --  options: "old" or "new"
+      if ( !strcmp( argv[i+1], "old" ) ) {
+       fRCUFormat = kTRUE;
+      }
+      else if ( !strcmp( argv[i+1], "new" ) ) {
+       fRCUFormat = kFALSE;
+      }
+      else {
+       HLTError( "Missing RCU format - Cannot convert rcu format  specifier '%s'.", argv[i+1] );
+       return EINVAL;
+      }
+      
+      i += 2;
+      continue;
+    }
+
+    HLTError( "Unknown Option - Unknown option '%s'", argv[i] );
+    return EINVAL;
+    
+  }
+  
+  // ** Create Signal calibration
+  if ( fCalibSignal )
+    return EINPROGRESS;
+  
+  fCalibSignal = new AliTPCCalibSignal();
+
+  // **  Create AliRoot Memory Reader
+  if (fRawReader)
+    return EINPROGRESS;
+
+#if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H) 
+  fRawReader = new AliRawReaderMemory();
+#else
+  HLTFatal("AliRawReader  not available - check your build");
+  return -ENODEV;
+#endif
+
+  return 0;
+}
+
+Int_t AliHLTTPCCalibSignalComponent::DoDeinit()
+{
+  // see header file for class documentation
+
+  if ( fRawReader )
+    delete fRawReader;
+  fRawReader = NULL;
+
+  if ( fCalibSignal )
+    delete fCalibSignal;
+  fCalibSignal = NULL;
+
+  return 0;
+}
+
+/*
+ * --- will be changing with the Calibration Processor, -> Split DoEvent into 2 functions:
+ *    --- > Process event
+ *    --- > Ship Data to FXS
+ * --- setter for rcuformat need in AliTPCCalibSignal class
+ */
+Int_t AliHLTTPCCalibSignalComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
+  // see header file for class documentation
+
+  const AliHLTComponentBlockData* iter = NULL;
+  AliHLTUInt32_t spec = 0;
+
+  Int_t slice, patch;
+  Int_t minPatch = 5;
+  Int_t maxPatch = 0;
+  Int_t DDLid = 0;
+  //--------same as for pedestal
+
+  // ** Loop over all input blocks and specify which data format should be read
+  iter = GetFirstInputBlock( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+  
+  while ( iter != NULL ) {
+    
+    // ** Print Debug output which data format was received
+    char tmp1[14], tmp2[14];
+    DataType2Text( iter->fDataType, tmp1 );
+    DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
+
+    HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+
+    // ** Get DDL ID in order to tell the memory reader which slice/patch to use
+    slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
+    patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+
+    if (patch < 2) DDLid = 768 + (2 * slice) + patch;
+    else DDLid = 838 + (4*slice) + patch;
+
+    // ---------
+    
+    HLTDebug ( "Input Raw Data - Slice/Patch: %d/%d - EquipmentID : %d.", slice, patch, DDLid );
+    
+    // ** Get the  min and max patch, used in the output specfication
+    if ( patch < minPatch ) minPatch =  patch;
+    if ( patch > maxPatch ) maxPatch =  patch;
+
+    // ** Init TPCRawStream
+    fRawReader->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize );
+    fRawReader->SetEquipmentID(DDLid);
+
+    fRawStream = new AliTPCRawStream( fRawReader );
+    fRawStream->SetOldRCUFormat( fRCUFormat );
+
+    fCalibSignal->ProcessEvent( fRawStream );
+  
+    if ( fRawStream )
+      delete fRawStream;
+    fRawStream = NULL;    
+
+    //-----------
+    // ** Get next input block, with the same specification as defined in GetFirstInputBlock()
+    iter = GetNextInputBlock();
+
+  } //  while ( iter != NULL ) {
+  
+  // !!! HIGHLY DEBUG !!!
+  // fCalibSignal->DumpToFile("Signal.root");
+  // !!! HIGHLY DEBUG !!!
+
+  // ** Call only at END of RUN event
+  //  fCalibSignal->Analyse();
+  
+  // ** PushBack data to shared memory ... 
+
+  spec = AliHLTTPCDefinitions::EncodeDataSpecification( slice, slice, minPatch, maxPatch );
+  PushBack( (TObject*) fCalibSignal, AliHLTTPCDefinitions::fgkCalibSignalDataType, spec);
+  
+  return 0;
+} // Int_t AliHLTTPCCalibSignalComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
+//-------------
diff --git a/HLT/TPCLib/AliHLTTPCCalibSignalComponent.h b/HLT/TPCLib/AliHLTTPCCalibSignalComponent.h
new file mode 100644 (file)
index 0000000..efa6e2b
--- /dev/null
@@ -0,0 +1,87 @@
+
+
+#ifndef ALIHLTTPCCALIBSIGNAlCOMPONENT_H
+#define ALIHLTTPCCALIBSIGNALCOMPONENT_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/** @file   AliHLTTPCCalibSignalComponent.h
+    @author Jochen Thaeder, Sorina Popescu
+    @date   
+    @brief HLT Pulser calibration component for the TPC.
+*/
+
+#include "AliHLTProcessor.h"
+#include "AliHLTTPCDefinitions.h"
+
+class AliTPCRawStream;
+class AliRawReaderMemory;
+class AliTPCCalibSignal;
+
+/**
+ * @class AliHLTTPCCalibSignalComponent
+ * 
+ * This class is the component for the AliTPCCalibSignal class used for 
+ * pedestal calibration of the TPC. It uses the high-level interface and
+ * the output is the TObject of AliTPCCalibSignal.
+ *
+ * The component has the following component arguments:
+ * -    The RCU format:  rcuformat  
+ *      which can be either 
+ *        - old ( used in the TPC Commissioning )
+ *        - new
+ *
+ * @ingroup alihlt_tpc
+ */
+class AliHLTTPCCalibSignalComponent : public AliHLTProcessor
+    {
+    public:
+      /**
+       * constructor 
+       */
+      AliHLTTPCCalibSignalComponent();
+      /** not a valid copy constructor, defined according to effective C++ style */
+      AliHLTTPCCalibSignalComponent(const AliHLTTPCCalibSignalComponent&);
+      /** not a valid assignment op, but defined according to effective C++ style */
+      AliHLTTPCCalibSignalComponent& operator=(const AliHLTTPCCalibSignalComponent&);
+      /** destructor */
+      virtual ~AliHLTTPCCalibSignalComponent();
+      
+      // Public functions to implement AliHLTComponent's interface.
+      // These functions are required for the registration process
+
+      const char* GetComponentID();
+      void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+      AliHLTComponentDataType GetOutputDataType();
+      virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+      AliHLTComponent* Spawn();
+
+    protected:
+      
+      // Protected functions to implement AliHLTComponent's interface.
+      // These functions provide initialization as well as the actual processing
+      // capabilities of the component. 
+      
+      Int_t DoInit( int argc, const char** argv );
+      Int_t DoDeinit();
+      Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
+      
+    private:
+
+      /** the reader object for reading from memory */
+      AliRawReaderMemory* fRawReader;                                              //!transient
+
+      /** the reader object for reading TPC raw data */  
+      AliTPCRawStream* fRawStream;                                                 //!transient
+
+      /** Signal Calibration class */
+      AliTPCCalibSignal * fCalibSignal;                                            //!transient
+      
+      /** if use old RCU format */
+      Bool_t fRCUFormat;                                                           // see description
+
+      ClassDef(AliHLTTPCCalibSignalComponent, 0)
+
+    };
+#endif
index 2cdbb1511198d9ed15eda35f63418761ce7ddce8..8ab892f8f9edc195a2ec01b2f988f70770d734b9 100644 (file)
@@ -36,6 +36,10 @@ const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = { sizeof
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTrackSegmentsDataType = { sizeof(AliHLTComponentDataType), {'T','R','A','K','S','E','G','S'},{'T','P','C',' '}};;
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTracksDataType = { sizeof(AliHLTComponentDataType), {'T','R','A','C','K','S',' ',' '},{'T','P','C',' '}};;
 
+const AliHLTComponentDataType AliHLTTPCDefinitions::fgkCalibPedestalDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','_','P','E','D',' '},{'T','P','C',' '}};;
+const AliHLTComponentDataType AliHLTTPCDefinitions::fgkCalibSignalDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','_','S','I','G',' '},{'T','P','C',' '}};;
+
+
 AliHLTTPCDefinitions::AliHLTTPCDefinitions()
 {
   // see header file for class documentation
index 3d4e9a47a4d5e8c7250af5708a6d06f95b0d0f52..857bb3967ed7d03a887d5a3acfb24dfde06b371c 100644 (file)
@@ -73,6 +73,10 @@ public:
   static const AliHLTComponentDataType fgkTracksDataType;          // see above
   /** vertex data structure */
   static const AliHLTComponentDataType fgkVertexDataType;          // see above
+  /** pedestal calibration data */
+  static const AliHLTComponentDataType fgkCalibPedestalDataType;   // see above
+  /** signal calibration data */
+  static const AliHLTComponentDataType fgkCalibSignalDataType;     // see above
 
   ClassDef(AliHLTTPCDefinitions, 0);
 
index 3614ff53e6865aaab90adfc48396dfa23d4063d8..12545d13bc3dff69a441dfbb01c340f97861c7b9 100644 (file)
@@ -52,6 +52,9 @@ MODULE_SRCS=  AliHLTTPCLog.cxx \
                AliHLTTPCCATrackerComponent.cxx \
                AliHLTTPCEsdWriterComponent.cxx
 
+#              AliHLTTPCCalibPedestalComponent.cxx \
+#              AliHLTTPCCalibSignalComponent.cxx
+
 CLASS_HDRS:=   AliHLTTPCTransform.h \
                AliHLTTPCMemHandler.h \
                AliHLTTPCDataCompressorHelper.h \
@@ -101,6 +104,9 @@ CLASS_HDRS:=        AliHLTTPCTransform.h \
                AliHLTTPCCATrackerComponent.h \
                AliHLTTPCEsdWriterComponent.h
 
+#              AliHLTTPCCalibPedestalComponent.h \
+#              AliHLTTPCCalibSignalComponent.h
+
 MODULE_HDRS:=  $(CLASS_HDRS) \
                AliHLTTPCLog.h \
                AliHLTTPCLogging.h \