]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- porting the PHOS raw analyzers to the CALO library
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Feb 2010 21:48:12 +0000 (21:48 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Feb 2010 21:48:12 +0000 (21:48 +0000)
- modifying the mapper to facilitate for 2 different geometries for PHOS;
  leading to changes in the CALO/EMCAL mappers as well

12 files changed:
HLT/CALO/AliHLTCaloMapper.h
HLT/CALO/AliHLTCaloRawAnalyzerComponentv3.h
HLT/EMCAL/AliHLTEMCALMapper.cxx
HLT/EMCAL/AliHLTEMCALMapper.h
HLT/PHOS/AliHLTPHOSChannelRawDataStruct.h
HLT/PHOS/AliHLTPHOSMapper.cxx
HLT/PHOS/AliHLTPHOSMapper.h
HLT/PHOS/AliHLTPHOSRawAnalyzerComponentv3.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerComponentv3.h
HLT/PHOS/AliHLTPHOSRawAnalyzerCrudeComponent.h
HLT/PHOS/AliHLTPHOSRawAnalyzerPeakFinderComponent.cxx
HLT/PHOS/AliHLTPHOSSharedMemoryInterfacev2.cxx

index 0032b0c9991a423b2300d0e2e9e84646d7223d1b..08f5163d272c98e3d32a6fab9553298c216dd378 100644 (file)
@@ -37,13 +37,13 @@ public:
 
   AliHLTCaloMapper(const unsigned long specification, TString det);
   virtual ~AliHLTCaloMapper();
-  virtual void InitAltroMapping( const unsigned long specification ) = 0; 
+  virtual Bool_t InitAltroMapping( const unsigned long specification ) = 0; 
   virtual void InitDDLSpecificationMapping() = 0;
   bool GetIsInitializedMapping();
-  char* GetFilePath();
+  virtual char* GetFilePath();
  
   int  GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
-  void GetChannelCoord(const UShort_t channelId, UShort_t* channelCoord);
+  static void GetChannelCoord(const UShort_t channelId, UShort_t* channelCoord);
   static void ChannelId2Coordinate(const int channelId,    AliHLTCaloCoordinate &channelCoord);
   virtual void GetLocalCoord(const int channelId, Float_t* localCoord) const; 
   int GetDDLFromSpec( const AliHLTUInt32_t spec );
index ea5b04a20d9566a4fa47172377efccb3c29a19f1..278e54f16b79c4f37cc734840fa9c3d44f4fba91 100644 (file)
@@ -171,6 +171,8 @@ class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, publ
   //** Pointer to a mapper opbject */
   AliHLTCaloMapper *fMapperPtr;          //COMMENT
 
+  virtual void InitMapping(const int specification ) = 0;
+
  private:
 
 /** Keep default constructor private since it should not be used */
@@ -182,7 +184,7 @@ class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, publ
   /** Keep the assignement operator private since it should not be used */
   AliHLTCaloRawAnalyzerComponentv3 & operator = (const AliHLTCaloRawAnalyzerComponentv3 &);
 
-  virtual void InitMapping(const int specification ) = 0;
+  //virtual void InitMapping(const int specification ) = 0;
   
   /** Mapping from harware address to geometrical address */
   //  AliHLTCaloMapper *fMapperPtr;                       //!transient 
index b4efa998e6d485940e51ab320a9e84cc44b2d735..b764e19880bb9c934c008d8e6b9bf92ba98ea112 100644 (file)
@@ -52,7 +52,7 @@ AliHLTEMCALMapper::GetLocalCoord(const int channelId, Float_t* localCoord) const
 }
 
 
-void 
+Bool_t 
 AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
 {
   char *base =  getenv("ALICE_ROOT");
index 85674e266313ca55dde520de54ac2df78131534a..4c955d840b327fac6a3165d77692e97c4c5588ff 100644 (file)
@@ -29,7 +29,7 @@ class  AliHLTEMCALMapper : public AliHLTCaloMapper
  public:
   AliHLTEMCALMapper(  const unsigned long  specifiaction );
   virtual ~AliHLTEMCALMapper();
-  virtual void InitAltroMapping( const unsigned long specification ); 
+  virtual Bool_t InitAltroMapping( const unsigned long specification ); 
   virtual void InitDDLSpecificationMapping();
   virtual void GetLocalCoord(const int channelId, Float_t* localCoord) const; 
   //  static  const int GlobalX2ModuleId(const int globalX);
index 03b6cadfeb18ecd61b3eb419d9bb37b449658edd..5df4a6756cce7e388f1357afb69200366db0ddff 100644 (file)
 #include "AliHLTPHOSChannelDataStruct.h"
 #include "AliHLTPHOSCoordinate.h"
 #include "Rtypes.h"
-#include "AliHLTPHOSConstant.h"
-
-using namespace PhosHLTConst;
 
 struct  AliHLTPHOSChannelRawDataStruct : public AliHLTPHOSChannelDataStruct
 {
   AliHLTPHOSCoordinate fCoordinate;
   int nSamplesUsed;
-  UShort_t fDataPtr[ALTROMAXSAMPLES];
+  UShort_t fDataPtr[1008];
 };
 
 #endif
index 7fef002484b9692959710c634514df90e6603d27..4b0b6fe33b8c8466c15598427b2d55e60082cfb4 100644 (file)
 //
 //
 
-#include "AliPHOSEMCAGeometry.h"
 #include "AliHLTPHOSMapper.h"
-#include "AliHLTPHOSConstant.h"
-#include "AliHLTLogging.h"
-#include "Rtypes.h"
 #include "unistd.h"
 #include <iostream>
 #include "AliHLTPHOSCoordinate.h"
 
-using namespace PhosHLTConst;
-AliHLTPHOSMapper::AliHLTPHOSMapper():  AliHLTLogging(), 
-                                      fHw2geomapPtr(0),
-                                      fIsInitializedMapping(false),
-                                      fSpecificationMapPtr(0)
-                                      //                              fPHOSGeometry(0)
+AliHLTPHOSMapper::AliHLTPHOSMapper():  
+   AliHLTCaloMapper(0,"PHOS") 
+   ,fDDLId(-1)
+   ,fModuleId(-1)
 {
-  InitAltroMapping(); 
   InitDDLSpecificationMapping();
-  //  fPHOSGeometry = new AliPHOSEMCAGeometry();
-
+  sprintf(fFilepath, "\0");
 }
 
 
@@ -53,70 +45,88 @@ AliHLTPHOSMapper::~AliHLTPHOSMapper()
   fHw2geomapPtr = 0;
 }
 
-void
-AliHLTPHOSMapper::InitAltroMapping()
+
+Bool_t
+AliHLTPHOSMapper::InitAltroMapping(const unsigned long specification)
 {
   // Loads mapping between Altro addresses and geometrical addresses from file
+   
+  fDDLId = GetDDLFromSpec(specification);
+  Int_t modId = GetModuleFromSpec(specification);
 
-  //  char filename[256];
   char *base =  getenv("ALICE_ROOT");
-  int nChannels = 0;
-  int maxaddr = 0;
-  int tmpHwaddr = 0;
-  int tmpZRow = 0;
-  int tmpXCol = 0;
-  int tmpGain = 0;
-  int res = 0; 
-  if(base !=0)
-    {
-      sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
-      
-      FILE *fp = fopen(fFilepath, "r");
-      if(fp != 0)
-       {
-         res = fscanf(fp, "%d", &nChannels);
-         res = fscanf(fp, "%d", &maxaddr);
-         fHw2geomapPtr = new fAltromap[maxaddr +1]; 
-
-         for(int i=0; i< maxaddr + 1 ; i ++)
-           {
-             fHw2geomapPtr[i].fXCol = 0;
-             fHw2geomapPtr[i].fZRow = 0;
-             fHw2geomapPtr[i].fGain = 0;
-           }
 
-         for(int i=0; i<nChannels; i ++)
-           {
-             res = fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow,  &tmpGain);
-             if(tmpGain < 2)
-               {
-                 fHw2geomapPtr[tmpHwaddr].fXCol   = tmpXCol;
-                 fHw2geomapPtr[tmpHwaddr].fZRow   = tmpZRow;
-                 fHw2geomapPtr[tmpHwaddr].fGain  = tmpGain;
-               } 
+  if ( base )
+    {
+      if ( modId != fModuleId )
+        {
+          fModuleId = modId;
+          if ( base )
+            {
+              sprintf ( fFilepath,"%s/PHOS/mapping/Mod%dRCU0.data", base, GetModuleFromSpec ( specification ) );
+              int nChannels = 0;
+              int maxaddr = 0;
+              int tmpHwaddr = 0;
+              int tmpZRow = 0;
+              int tmpXCol = 0;
+              int tmpGain = 0;
+              int res = 0;
+
+              FILE *fp = fopen ( fFilepath, "r" );
+              if ( fp != 0 )
+                {
+                  res = fscanf ( fp, "%d", &nChannels );
+                  res = fscanf ( fp, "%d", &maxaddr );
+                  if (fHw2geomapPtr)
+                    {
+                      delete fHw2geomapPtr;
+                    }
+                  fHw2geomapPtr = new fAltromap[maxaddr +1];
+
+                  for ( int i=0; i< maxaddr + 1 ; i ++ )
+                    {
+                      fHw2geomapPtr[i].fXCol = 0;
+                      fHw2geomapPtr[i].fZRow = 0;
+                      fHw2geomapPtr[i].fGain = 0;
+                    }
+
+                  for ( int i=0; i<nChannels; i ++ )
+                    {
+                      res = fscanf ( fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow,  &tmpGain );
+                      if ( tmpGain < 2 )
+                        {
+                          fHw2geomapPtr[tmpHwaddr].fXCol   = tmpXCol;
+                          fHw2geomapPtr[tmpHwaddr].fZRow   = tmpZRow;
+                          fHw2geomapPtr[tmpHwaddr].fGain  = tmpGain;
+                        }
+                    }
+                  fIsInitializedMapping = true;
+                  fclose ( fp );
+                }
+              else
+                {
+                  fIsInitializedMapping = false;
+                }
            }
-         fIsInitializedMapping = true;   
-         fclose(fp);
-       }
-      else
-       {
-         fIsInitializedMapping = false;          
        }
     }
-  else
-    {
+   else 
+   {
       fIsInitializedMapping = false;
-    }
-} 
+   }
+   
+   return fIsInitializedMapping;
+}
+   
 
 void
 AliHLTPHOSMapper::InitDDLSpecificationMapping()
 {
-  fSpecificationMapPtr = new fDDLSpecificationMap[PhosHLTConst::NMODULES*PhosHLTConst::NRCUSPERMODULE];
-  for(Int_t ddl = 0; ddl < PhosHLTConst::NMODULES*PhosHLTConst::NRCUSPERMODULE; ddl++)
+  fSpecificationMapPtr = new fDDLSpecificationMap[fCaloConstants->GetNMODULES()*fCaloConstants->GetNRCUSPERMODULE()];
+  for(Int_t ddl = 0; ddl < fCaloConstants->GetNMODULES()*fCaloConstants->GetNRCUSPERMODULE(); ddl++)
     {
       
-      fSpecificationMapPtr[ddl].fModId = ddl/PhosHLTConst::NRCUSPERMODULE;
+      fSpecificationMapPtr[ddl].fModId = ddl/fCaloConstants->GetNRCUSPERMODULE();
       
       if(ddl%4 == 0)
        {
@@ -141,8 +151,8 @@ AliHLTPHOSMapper::InitDDLSpecificationMapping()
          fSpecificationMapPtr[ddl].fRcuZ = 0;
        }
       
-      fSpecificationMapPtr[ddl].fRcuZOffset = NZROWSRCU*(fSpecificationMapPtr[ddl].fRcuZ);
-      fSpecificationMapPtr[ddl].fRcuXOffset = NXCOLUMNSRCU*(fSpecificationMapPtr[ddl].fRcuX);
+      fSpecificationMapPtr[ddl].fRcuZOffset = fCaloConstants->GetNZROWSRCU()*(fSpecificationMapPtr[ddl].fRcuZ);
+      fSpecificationMapPtr[ddl].fRcuXOffset = fCaloConstants->GetNXCOLUMNSMOD()*(fSpecificationMapPtr[ddl].fRcuX);
     }
 }
 
@@ -153,15 +163,18 @@ AliHLTPHOSMapper::GetIsInitializedMapping()
   return  fIsInitializedMapping;
 }
 
-
-char* 
-AliHLTPHOSMapper::GetFilePath()
+Int_t
+AliHLTPHOSMapper::GetChannelID(Int_t hwAddress)
 {
-  return  fFilepath;
+  
+  return ((fHw2geomapPtr[hwAddress].fXCol + fSpecificationMapPtr[fDDLId].fRcuXOffset) |
+         ((fHw2geomapPtr[hwAddress].fZRow + fSpecificationMapPtr[fDDLId].fRcuZOffset) << 6) |
+         (fHw2geomapPtr[hwAddress].fGain << 12) |
+         fSpecificationMapPtr[fDDLId].fModId << 13);
 }
 
-UShort_t
-AliHLTPHOSMapper::GetChannelID(Int_t specification, Int_t hwAddress)
+Int_t
+AliHLTPHOSMapper::GetChannelID(AliHLTUInt32_t specification, Int_t hwAddress)
 {
   
   Short_t index = 0;
@@ -204,41 +217,40 @@ AliHLTPHOSMapper::GetChannelID(Int_t specification, Int_t hwAddress)
 
 
 
-void
-AliHLTPHOSMapper::GetChannelCoord(const UShort_t channelId, UShort_t* channelCoord)
-{
-  channelCoord[0] = channelId&0x3f;
-  channelCoord[1] = (channelId >> 6)&0x3f;
-  channelCoord[2] = (channelId >> 12)&0x1;
-  channelCoord[3] = (channelId >> 13)&0x1f;
-  //  printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
-}
-
-
-
-void
-//AliHLTPHOSMapper::GetChannelCoord(const UShort_t channelId,    &AliHLTPHOSCoordinate channelCoord)
-AliHLTPHOSMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTPHOSCoordinate &channelCoord)
-{
-  channelCoord.fX = channelId&0x3f;
-  channelCoord.fZ = (channelId >> 6)&0x3f;
-  channelCoord.fGain = (channelId >> 12)&0x1;
-  channelCoord.fModuleId  = (channelId >> 13)&0x1f;
-  //  printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
-}
-
-
-
-void
-AliHLTPHOSMapper::GetLocalCoord(const UShort_t channelId, Float_t* channelCoord)
-{
-  channelCoord[0] = (static_cast<Float_t>(channelId&0x3f) - NXCOLUMNSMOD/2)* fCellStep;
-  channelCoord[1] = (static_cast<Float_t>((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellStep;
-  //  printf("Local coordinates: x = %f, z = %f\n", channelCoord[0], channelCoord[1]);
-}
+// void
+// AliHLTPHOSMapper::GetChannelCoord(const UShort_t channelId, UShort_t* channelCoord)
+// {
+//   channelCoord[0] = channelId&0x3f;
+//   channelCoord[1] = (channelId >> 6)&0x3f;
+//   channelCoord[2] = (channelId >> 12)&0x1;
+//   channelCoord[3] = (channelId >> 13)&0x1f;
+//   //  printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
+// }
+// 
+// 
+// 
+// void
+// AliHLTPHOSMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTPHOSCoordinate &channelCoord)
+// {
+//   channelCoord.fX = channelId&0x3f;
+//   channelCoord.fZ = (channelId >> 6)&0x3f;
+//   channelCoord.fGain = (channelId >> 12)&0x1;
+//   channelCoord.fModuleId  = (channelId >> 13)&0x1f;
+//   //  printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
+// }
+// 
+// 
+// 
+// void
+// AliHLTPHOSMapper::GetLocalCoord(const UShort_t channelId, Float_t* channelCoord)
+// {
+//   channelCoord[0] = (static_cast<Float_t>(channelId&0x3f) - NXCOLUMNSMOD/2)* fCellStep;
+//   channelCoord[1] = (static_cast<Float_t>((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellStep;
+//   //  printf("Local coordinates: x = %f, z = %f\n", channelCoord[0], channelCoord[1]);
+// }
 
 Int_t 
-AliHLTPHOSMapper::GetDDLFromSpec(Int_t specification)
+AliHLTPHOSMapper::GetDDLFromSpec(AliHLTUInt32_t specification)
 {
   Int_t index = -1;
   if(specification == 0x00001) index = 0;
@@ -272,7 +284,7 @@ AliHLTPHOSMapper::GetDDLFromSpec(Int_t specification)
 }
 
 Int_t 
-AliHLTPHOSMapper::GetModuleFromSpec(Int_t specification)
+AliHLTPHOSMapper::GetModuleFromSpec(AliHLTUInt32_t specification)
 {
   Int_t module = -1;
       
index a79937281eba4c82a77d7b12e79c3234ec684d86..93c5acbad02ff68a1126288778d8ba652a8f5fb2 100644 (file)
 
 //using namespace PhosHLTConst;
 #include "Rtypes.h"
-#include "AliHLTLogging.h"
-
+#include "AliHLTCaloMapper.h"
 #include "AliPHOSEMCAGeometry.h"
 
+class AliHLTCaloCoordinate;
 class AliHLTPHOSCoordinate;
 
-class AliHLTPHOSMapper : public AliHLTLogging
-//class AliHLTPHOSMapper 
+class AliHLTPHOSMapper : public AliHLTCaloMapper
 {
  public:
+
   AliHLTPHOSMapper();
   virtual ~AliHLTPHOSMapper();
-  void InitAltroMapping(); 
+  
+  Bool_t InitAltroMapping(const unsigned long specification); 
   void InitDDLSpecificationMapping();
   bool GetIsInitializedMapping();
-  char* GetFilePath();
+  char* GetFilePath(const int ddlId);
+  
+  Int_t GetChannelID(Int_t hwAddress);
+  Int_t GetChannelID(AliHLTUInt32_t specification, Int_t hwAddress);
 
-  UShort_t GetChannelID(Int_t specification, Int_t hwAddress);
-  static void GetChannelCoord(const UShort_t channelId, UShort_t* channelCoord);
-  static void ChannelId2Coordinate(const UShort_t channelId, AliHLTPHOSCoordinate &channelCoord );
-  static void GetLocalCoord(const UShort_t channelId, Float_t* localCoord);
-  int GetDDLFromSpec(Int_t specification);
-  int GetModuleFromSpec(Int_t specification);
+  //static void GetChannelCoord(const Int_t channelId, UShort_t* channelCoord);
+  //static void ChannelId2Coordinate(const Int_t channelId, AliHLTCaloCoordinate &channelCoord );
+  //static void GetLocalCoord(const Int_t channelId, Float_t* localCoord);
+  int GetDDLFromSpec(AliHLTUInt32_t specification);
+  int GetModuleFromSpec(AliHLTUInt32_t specification);
 
   struct fAltromap{ 
     int fZRow; // Coordinate in Z direction (beam direction) relatve too one RCU
@@ -72,12 +75,16 @@ class AliHLTPHOSMapper : public AliHLTLogging
 
  private:
   bool fIsInitializedMapping;
+
   AliHLTPHOSMapper(const AliHLTPHOSMapper & );
   AliHLTPHOSMapper & operator = (const AliHLTPHOSMapper &);
   
   fDDLSpecificationMap* fSpecificationMapPtr;
   //AliPHOSEMCAGeometry fPHOSGeometry;
   static const Float_t fCellStep = 2.2;//2.*fPHOSGeometry.GetAirCellHalfSize()[0];
+  
+  Int_t fModuleId;
+    int fDDLId;
 };
 
 #endif
index e9a4671953d1a46402d4d9523a0a8a3eee9cbd92..664d0ecca230a2f1f8c405394cd10b7376cd792e 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-#include "AliHLTPHOSRawAnalyzer.h"
 #include "AliHLTPHOSRawAnalyzerComponentv3.h"
-#include "AliHLTPHOSChannelDataHeaderStruct.h"
-#include "AliHLTPHOSChannelDataStruct.h"
-#include "AliHLTPHOSMapper.h"
-#include "AliHLTPHOSSanityInspector.h"
-
-#include "AliAltroRawStreamV3.h"
-#include "AliCaloRawStreamV3.h"
-#include "AliRawReaderMemory.h"
-
-#include "AliHLTPHOSConstant.h"
-
+#include "AliHLTPHOSRawAnalyzer.h"
+#include "AliHLTCaloChannelDataHeaderStruct.h"
+#include "AliHLTPHOSDefinitions.h"
 #include "AliHLTPHOSUtilities.h"
+#include "AliHLTPHOSMapper.h"
 
 
-using namespace PhosHLTConst;
-
-AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3():
-  AliHLTPHOSRcuProcessor(), 
-  fAnalyzerPtr(0), 
-  fMapperPtr(0), 
-  fSanityInspectorPtr(0),
-  fRawReaderMemoryPtr(0),
-  fAltroRawStreamPtr(0),
-  fAlgorithm(0),
-  fOffset(0),
-  fBunchSizeCut(0),
-  fMinPeakPosition(0),
-  fMaxPeakPosition(100),
-  fDoPushRawData(false),
-  fInspectSanity(false),
-  fRawDataWriter(0)
+AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3() :
+   AliHLTCaloRawAnalyzerComponentv3("PHOS")
+   ,fAnalyzerPtr(0)
 {
-  //comment
-  fMapperPtr = new AliHLTPHOSMapper();
-
-  fRawReaderMemoryPtr = new AliRawReaderMemory();
-
-  fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawReaderMemoryPtr);
-  //  fAltroRawStreamPtr = new AliCaloRawStreamV3(fRawReaderMemoryPtr, TString("PHOS"));
-  fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
-
-  if( fDoPushRawData == true  )
-    {
-      
-      fRawDataWriter  = new AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter();
-
-    }
-
+   // See header file for class documentation
 }
 
-
 AliHLTPHOSRawAnalyzerComponentv3::~AliHLTPHOSRawAnalyzerComponentv3()
 {
   //comment
-  Deinit();
-}
-
-int 
-AliHLTPHOSRawAnalyzerComponentv3::Deinit()
-{
-  //comment
-  if(fAnalyzerPtr)
-    {
-      delete fAnalyzerPtr;
-      fAnalyzerPtr = 0;
-    }
-  if(fMapperPtr)
-    {
-      delete  fMapperPtr;
-      fMapperPtr = 0;
-    }
-  if(fRawReaderMemoryPtr)
-    {
-      delete fRawReaderMemoryPtr;
-      fRawReaderMemoryPtr = 0;
-    }
-  if(fAltroRawStreamPtr)
-    {
-      delete fAltroRawStreamPtr;
-      fAltroRawStreamPtr = 0;
-    }
-  return 0;
-}
-
-const char* 
-AliHLTPHOSRawAnalyzerComponentv3::GetComponentID()
-{
-  //comment
-  return "PhosRawAnalyzerv3";
 }
 
 
@@ -113,7 +40,7 @@ AliHLTPHOSRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataT
 {
   //comment
   list.clear();
-  list.push_back( AliHLTPHOSDefinitions::fgkDDLPackedRawDataType | kAliHLTDataOriginPHOS );
+  list.push_back( AliHLTPHOSDefinitions::fgkDDLPackedRawDataType);
 }
 
 AliHLTComponentDataType 
@@ -127,8 +54,8 @@ void
 AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
 {
   //comment
-  constBase = sizeof(AliHLTPHOSChannelDataHeaderStruct);
-  inputMultiplier = 0.5;
+  constBase = sizeof(AliHLTCaloChannelDataHeaderStruct);
+  inputMultiplier = 1.5;
 }
 
 int 
@@ -150,7 +77,11 @@ AliHLTPHOSRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtDa
          HLTDebug("Data block is not of type fgkDDLPackedRawDataType");
          continue; 
        }
-
+      if(iter->fSpecification != fCurrentSpec)
+      {
+        fCurrentSpec = iter->fSpecification;
+        InitMapping(iter->fSpecification);
+      }
       blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
 
       if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
@@ -173,296 +104,16 @@ AliHLTPHOSRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtDa
       outputPtr += blockSize; //Updating position of the output buffer
     }
 
-  fPhosEventCount++; 
+  fCaloEventCount++; 
   size = totSize; //telling the framework how much buffer space we have used.
   
   return 0;
 }//end DoEvent
 
-Int_t
-AliHLTPHOSRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize)
-{
-  //comment
-  int tmpsize=  0;
-  Int_t crazyness          = 0;
-  Int_t nSamples           = 0;
-  Short_t channelCount     = 0;
-
-  // Firs we want to write a header to the output
-  AliHLTPHOSChannelDataHeaderStruct *channelDataHeaderPtr = reinterpret_cast<AliHLTPHOSChannelDataHeaderStruct*>(outputPtr); 
-
-  // Then comes the channel data
-  AliHLTPHOSChannelDataStruct *channelDataPtr = reinterpret_cast<AliHLTPHOSChannelDataStruct*>(outputPtr+sizeof(AliHLTPHOSChannelDataHeaderStruct)); 
-  
-  //Adding to the total size of data written
-  totSize += sizeof( AliHLTPHOSChannelDataHeaderStruct );
-
-
-  fRawReaderMemoryPtr->SetMemory(reinterpret_cast<UChar_t*>(iter->fPtr), static_cast<ULong_t>(iter->fSize));
-  fRawReaderMemoryPtr->SetEquipmentID(fMapperPtr->GetDDLFromSpec(iter->fSpecification) + 1792);
-  fRawReaderMemoryPtr->Reset();
-  fRawReaderMemoryPtr->NextEvent();
-  
- //  if( fDoPushRawData == true)
-//     {
-//       fRawDataWriter->NewEvent( );
-//     }
-
-  if(fAltroRawStreamPtr != NULL)
-    {
-      delete fAltroRawStreamPtr;
-      fAltroRawStreamPtr=NULL;
-    }
-
-  fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawReaderMemoryPtr);
-  
-  //  fAltroRawStreamPtr = new AliCaloRawStreamV3(fRawReaderMemoryPtr, TString("PHOS"));
-
-  if(fAltroRawStreamPtr->NextDDL())
-    {
-      fOffset = (fAltroRawStreamPtr->GetAltroCFG1() >> 10) & 0xf;
-      int cnt = 0;
-      while( fAltroRawStreamPtr->NextChannel()  )
-       { 
-         // Removing TRUs
-         if(  fAltroRawStreamPtr->GetHWAddress() < 128 || ( fAltroRawStreamPtr->GetHWAddress() ^ 0x800) < 128 ) 
-           {
-             continue; 
-           }
-         else
-           {
-             cnt ++;
-             UShort_t* firstBunchPtr = 0;
-             UShort_t chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress()); 
-           
-//           if( fDoPushRawData == true)
-//             {
-//               fRawDataWriter->SetChannelId( chId );
-//             }
-             while( fAltroRawStreamPtr->NextBunch() == true )
-               {
-
-//               if( fDoPushRawData == true)
-//                 {
-//                   fRawDataWriter->WriteBunchData( fAltroRawStreamPtr->GetSignals(), nSamples,  fAltroRawStreamPtr->GetEndTimeBin()  );
-//                 }
-
-                 firstBunchPtr = const_cast< UShort_t* >(  fAltroRawStreamPtr->GetSignals()  );
-                 
-                 nSamples = fAltroRawStreamPtr->GetBunchLength();
-
-               }
-             if(firstBunchPtr)
-               {             
-                 totSize += sizeof( AliHLTPHOSChannelDataStruct );
-                 if(totSize > size)
-                   {
-                     HLTError("Buffer overflow: Trying to write data of size: %d bytes. Output buffer available: %d bytes.", totSize, size);
-                     return -1;
-                   }
-//               if(fInspectSanity)
-//                 {
-//                   crazyness = fSanityInspectorPtr->CheckAndHealInsanity(firstBunchPtr, nSamples);
-//                 }
-
-                 fAnalyzerPtr->SetData( firstBunchPtr, nSamples);
-                 fAnalyzerPtr->Evaluate(0, nSamples);  
-          
-                 channelDataPtr->fChannelID =  chId;
-                 channelDataPtr->fEnergy = static_cast<Float_t>(fAnalyzerPtr->GetEnergy()) - fOffset;
-               
-                 channelDataPtr->fTime = static_cast<Float_t>(fAnalyzerPtr->GetTiming());
-                 channelDataPtr->fCrazyness = static_cast<Short_t>(crazyness);
-                 channelCount++;
-                 channelDataPtr++; // Updating position of the free output.
-               }
-           }
-//       if(fDoPushRawData)
-//         {
-//           fRawDataWriter->NewChannel();
-//         }
-       }
-    }
-  
-  //Writing the header
-  channelDataHeaderPtr->fNChannels   =  channelCount;
-  channelDataHeaderPtr->fAlgorithm   = fAlgorithm;
-  channelDataHeaderPtr->fInfo        = 0;
-
-//   if( fDoPushRawData == true)
-//     {
-//       tmpsize += fRawDataWriter->CopyBufferToSharedMemory( (UShort_t *)channelDataPtr, size, totSize);
-//     }
-
-  // channelDataHeaderPtr->fHasRawData  = false;
-  channelDataHeaderPtr->fHasRawData = fDoPushRawData;
-
-  HLTDebug("Number of channels: %d", channelCount);
-  //returning the size used
-  // delete fAltroRawStreamPtr;
-  tmpsize += sizeof(AliHLTPHOSChannelDataStruct)*channelCount + sizeof(AliHLTPHOSChannelDataHeaderStruct); 
-
-  //  return sizeof(AliHLTPHOSChannelDataStruct)*channelCount + sizeof(AliHLTPHOSChannelDataHeaderStruct);
-  return  tmpsize;
-
-}
-
-int 
-AliHLTPHOSRawAnalyzerComponentv3::WriteRawData(AliHLTPHOSChannelDataStruct*) //dtaPtr)
-{
-  return 0;
-}
-
-int
-AliHLTPHOSRawAnalyzerComponentv3::DoInit( int argc, const char** argv )
-{ 
-
-  //See base class for documentation
-  // fPrintInfo = kFALSE;
-  int iResult=0;
-  fMapperPtr = new AliHLTPHOSMapper();
-
-  for(int i = 0; i < argc; i++)
-    {
-      if(!strcmp("-bunchsizecut", argv[i]))
-       {
-         fBunchSizeCut = atoi(argv[i+1]);
-       }
-      if(!strcmp("-minpeakposition", argv[i]))
-       {
-         fMinPeakPosition = atoi(argv[i+1]);
-       }
-      if(!strcmp("-maxpeakposition", argv[i]))
-       {
-         fMaxPeakPosition = atoi(argv[i+1]);
-       }  
-      if(!strcmp("-pushrawdata", argv[i]))
-       {
-         fDoPushRawData = true;
-       }
-      if(!strcmp("-inspectsanity", argv[i]))
-       {
-         fInspectSanity = true;
-       }
-    }
-  if(fMapperPtr->GetIsInitializedMapping() == false)
-    {
-      Logging(kHLTLogFatal, __FILE__ , IntToChar(  __LINE__ ) , "AliHLTPHOSMapper::Could not initialise mapping from file %s, aborting", fMapperPtr->GetFilePath());
-      return -4;
-    }
-
-  return iResult;
-}
-
-
-
-
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::RawDataWriter() :  //fIsFirstChannel(true),
-                                                                   fRawDataBuffer(0),
-                                                                   fCurrentChannelSize(0),
-                                                                   //    fIsFirstChannel(true),
-                                                                   fBufferIndex(0),
-                                                                   fBufferSize( NZROWSRCU*NXCOLUMNSRCU*ALTROMAXSAMPLES*NGAINS +1000 ),
-                                                                   fCurrentChannelIdPtr(0),
-                                                                   fCurrentChannelSizePtr(0),
-                                                                   fCurrentChannelDataPtr(0),
-                                                                   fTotalSize(0)
-{
-  fRawDataBuffer = new UShort_t[fBufferSize];
-  Init();
-}
-
-
-   
-void  
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::Init()
-{
-  fCurrentChannelIdPtr = fRawDataBuffer;
-  fCurrentChannelSizePtr = fRawDataBuffer +1;
-  fCurrentChannelDataPtr = fRawDataBuffer +2;
-  ResetBuffer();
-}
-
-void
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::NewEvent()
-{
-  Init();
-  fTotalSize = 0;
-}
-
 
-void
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::NewChannel( )
+void AliHLTPHOSRawAnalyzerComponentv3::InitMapping ( const int specification )
 {
-  *fCurrentChannelSizePtr   = fCurrentChannelSize;
-  fCurrentChannelIdPtr     += fCurrentChannelSize;
-  fCurrentChannelSizePtr    += fCurrentChannelSize;
-  fCurrentChannelDataPtr   += fCurrentChannelSize;
-  fBufferIndex = 0;
-  fCurrentChannelSize = 2;
-  fTotalSize += 2;
+   // See header file for class documentation
+   fMapperPtr = new AliHLTPHOSMapper;
 }
 
-
-void 
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::WriteBunchData(const UShort_t *bunchdata,  const int length,   const UInt_t starttimebin )
-{
-  fCurrentChannelDataPtr[fBufferIndex] = starttimebin;
-  fCurrentChannelSize ++;
-  fBufferIndex++;
-  fCurrentChannelDataPtr[fBufferIndex] = length;
-  fCurrentChannelSize ++;
-  fBufferIndex++;
-
-  fTotalSize +=2;
-
-  for(int i=0; i < length; i++)
-    {
-      fCurrentChannelDataPtr[ fBufferIndex + i ] =  bunchdata[i];
-    }
-
-  fCurrentChannelSize += length;
-  fTotalSize += length;
-  fBufferIndex += length;
-}
-
-
-void
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::SetChannelId( const UShort_t channeldid  )
-{
-  *fCurrentChannelIdPtr =  channeldid;
-}
-
-
-void
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::ResetBuffer()
-{
-  for(int i=0; i < fBufferSize ; i++ )
-    {
-      fRawDataBuffer[i] = 0;
-    }
-}
-
-
-int
-AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused )
-{
-  int sizerequested =  (sizeof(int)*fTotalSize + sizeused);
-
-  if(  sizerequested   > sizetotal  )
-    {
-      return 0;
-  }
-  else
-    {
-      for(int i=0; i < fTotalSize; i++)
-       {
-         memPtr[i] = fRawDataBuffer[i]; 
-       }
-      return fTotalSize;
-   }
-}
-  
index 6188f107eb6451c0f367498806e13e84850c2283..38541d6a2dda49cb87e6e6486d08604a1fa22389 100644 (file)
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
-#include "AliHLTPHOSRcuProcessor.h"
-
-
+#include <AliHLTCaloRawAnalyzerComponentv3.h>
 
 class AliHLTPHOSRawAnalyzer;
-class AliHLTPHOSRcuCellEnergyDataStruct;
-class AliHLTPHOSMapper;
-class AliHLTPHOSSanityInspector;
-class AliHLTPHOSDigitMaker;
-class AliHLTPHOSDigitContainerDataStruct;
-class AliRawReaderMemory;
-class AliAltroRawStreamV3;
-class AliHLTPHOSChannelDataStruct;
-
-//class RawDataWriter;
-
 
 /**
  * @class AliHLTPHOSRawAnalyzerComponentv3
@@ -100,7 +87,7 @@ class AliHLTPHOSChannelDataStruct;
  */ 
 
 
-class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
+class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTCaloRawAnalyzerComponentv3
 {
  public:
 
@@ -110,12 +97,6 @@ class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
   /** Destructor */
   virtual ~AliHLTPHOSRawAnalyzerComponentv3();
 
-  /** 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 Deinit();
-
   /** interface function, see @ref AliHLTComponent for description */
   virtual const char* GetComponentID() = 0;
 
@@ -131,33 +112,21 @@ class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
   /** interface function, see @ref AliHLTComponent for description */
   virtual AliHLTComponent* Spawn() = 0; 
 
+  //virtual void InitMapping(const AliHLTUInt32_t specification);
+  
  protected:
 
-  /** interface function, see @ref AliHLTComponent for description */
-  using AliHLTPHOSRcuProcessor::DoEvent;
-
   /** interface function, see @ref AliHLTComponent for description */
   virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
                     AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
                       AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );  
-
-  /** 
-   * Do the real processing in the component 
-   * @param iter is the pointer to the data blocks
-   * @param outputPtr is the pointer to the output buffer
-   * @param size is the available size for output
-   * @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); 
-
-
+  
   /** Pointer to an analyzer object used for raw data anlysis */ 
   AliHLTPHOSRawAnalyzer *fAnalyzerPtr;   //COMMENT
 
- private:
+   virtual void InitMapping(const int specification);
 
-  int WriteRawData( AliHLTPHOSChannelDataStruct *dtaPtr );
+ private:
 
   /** Keep the copy constructor private since it should not be used */
   AliHLTPHOSRawAnalyzerComponentv3(const AliHLTPHOSRawAnalyzerComponentv3 & );
@@ -165,78 +134,8 @@ class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
   /** Keep the assignement operator private since it should not be used */
   AliHLTPHOSRawAnalyzerComponentv3 & operator = (const AliHLTPHOSRawAnalyzerComponentv3 &);
 
-  /** Mapping from harware address to geometrical address */
-  AliHLTPHOSMapper *fMapperPtr;                       //!transient 
-
-  /** Pointer to object which may check the integrity of the data */
-  AliHLTPHOSSanityInspector *fSanityInspectorPtr;     //!transient
-
-  /** Pointer to the raw data reader which reads from memory */
-  AliRawReaderMemory* fRawReaderMemoryPtr;            //!transient
-  
-  /** Pointer to the raw stream */
-  AliAltroRawStreamV3* fAltroRawStreamPtr;              //!transient
-
-  /** Describing which algorithm we are using */
-  Short_t fAlgorithm;                                 //COMMENT
-
-  /** The offset applied before ZS */
-  Int_t fOffset;                                      //COMMENT
-
-  /** The minimum length a bunch can have to be considered */
-  Int_t fBunchSizeCut;                                //COMMENT
-
-  /** The lowest position a peak can have to be considered */
-  Int_t fMinPeakPosition;                             //COMMENT
-  
-  /** The maximum position a peak can have to be considered */
-  Int_t fMaxPeakPosition;                             //COMMENT
-
-  /** Should we push raw data? */
-  bool fDoPushRawData;                                //COMMENT
-  
-  /** Should we check for and heal insanity? */
-  bool fInspectSanity;                                //COMMENT
-
-  // const UShort_t* fRawDataBuffer;
-  // RawDataWriter *fRawDataWriter; 
-
-  //  class RawDataWriter : public AliHLTLogging
-  class RawDataWriter 
-  {
-  public:
-    RawDataWriter();
-    ~RawDataWriter();
-    //   void WriteChannelId(const UShort_t channeldid );
-    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:
-    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;
- };
-
-  RawDataWriter *fRawDataWriter; 
+  /** The current specification for which the mapping is loaded */
+  AliHLTUInt32_t fCurrentSpec;
 
 };
 
index 685828641019b8779342dcf1a459895f18740cb6..13dd4b5213254c573f13363255c096ac444e8663 100644 (file)
@@ -4,16 +4,16 @@
 #ifndef ALIHLTPHOSRAWANALYZERCRUDECOMPONENT_H
 #define ALIHLTPHOSRAWANALYZERCRUDECOMPONENT_H
 
-//#include "AliHLTPHOSRawAnalyzerComponent.h"
 #include "AliHLTPHOSRawAnalyzerComponentv3.h"
+//#include "AliHLTCaloRawAnalyzerComponentv3.h"
 
 /* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice  */ 
 
 
 
-//class AliHLTPHOSRawAnalyzerCrudeComponent: public AliHLTPHOSRawAnalyzerComponent
 class AliHLTPHOSRawAnalyzerCrudeComponent: public AliHLTPHOSRawAnalyzerComponentv3
+//class AliHLTPHOSRawAnalyzerCrudeComponent: public AliHLTCaloRawAnalyzerComponentv3
 {
  public:
   AliHLTPHOSRawAnalyzerCrudeComponent();
index 86964490309cf625871adc46c4604a49c586b09a..299475eddc35eb570658c6322ec94d40a1cb5642 100644 (file)
 
 #include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
 #include "AliHLTPHOSRawAnalyzerPeakFinder.h"
-//#include <cstdlib>
-//#include "AliHLTPHOSCommonDefs.h"
-#include "AliHLTPHOSConstant.h"
-
-using namespace PhosHLTConst;
 
 AliHLTPHOSRawAnalyzerPeakFinderComponent gAliHLTPHOSRawAnalyzerPeakFinderComponent;
 
@@ -30,7 +25,7 @@ AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderCompone
 {
   fAnalyzerPtr = new AliHLTPHOSRawAnalyzerPeakFinder();
 
-  if(LoadPFVector() == kFALSE)
+  if(1)//LoadPFVector() == kFALSE)
     {
       //      cout << "Warning, could not load PF vectors" << endl;
     }
@@ -84,7 +79,8 @@ AliHLTPHOSRawAnalyzerPeakFinderComponent::GetComponentID()
 Bool_t 
 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector()
 {
-  return LoadPFVector(PFDEFAULTSTARTINDEX,  PFDEFAULTNSAMPLES, DEFAULTTAU, DEFAULTFS );
+  return LoadPFVector(fCaloConstants->GetPFDEFAULTSTARTINDEX(),  fCaloConstants->GetPFDEFAULTNSAMPLES(), 
+                                 fCaloConstants->GetDEFAULTTAU(), fCaloConstants->GetDEFAULTFS() );
 }
 
 
@@ -92,7 +88,8 @@ AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector()
 Bool_t 
 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector(int startIndex, int nSamples, int tau, int fs)
 {
-  char tmpPFPath[PFMAXPATHLENGTH];
+   
+  char tmpPFPath[fCaloConstants->GetPFMAXPATHLENGTH()];
   Double_t * tmpAVector = new Double_t[nSamples];
   Double_t * tmpTVector = new Double_t[nSamples]; 
   sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PFVECTORDIR, startIndex, nSamples, tau, fs);
index e8f04ba43ab3e2ad36a6943cd4377288e3e6a937..32d73102577164236079fb429af10202872a2ec0 100644 (file)
@@ -75,7 +75,7 @@ AliHLTPHOSSharedMemoryInterfacev2::NextChannel()
          fRawData.fCrazyness  = tmpChannelPtr->fCrazyness; 
          Reset(fRawData);
          //AliHLTPHOSMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTPHOSCoordinate &channelCoord) 
-         AliHLTPHOSMapper::ChannelId2Coordinate( fRawData.fChannelID, fRawData.fCoordinate);
+//       AliHLTPHOSMapper::ChannelId2Coordinate( fRawData.fChannelID, fRawData.fCoordinate);
          
          if( fRawData.fChannelID ==  fRawDataPtr[0]  )
            {
@@ -175,7 +175,7 @@ AliHLTPHOSSharedMemoryInterfacev2::Reset()
 void 
 AliHLTPHOSSharedMemoryInterfacev2::Reset(AliHLTPHOSChannelRawDataStruct &str)
 {
-  for(int i=0; i< ALTROMAXSAMPLES; i++ )
+  for(int i=0; i< 1008; i++ )
     {
       str.fDataPtr[i] = 0;
     }