]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Finetuing of software (Oystein), improved shared memory interface
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jun 2008 21:27:38 +0000 (21:27 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jun 2008 21:27:38 +0000 (21:27 +0000)
gives the possibillity to decide online to ship raw data
with the reconstructed event

HLT/PHOS/AliHLTPHOSRawAnalyzerComponent.h
HLT/PHOS/AliHLTPHOSRcuCellEnergyDataStruct.h
HLT/PHOS/AliHLTPHOSSharedMemoryInterface.cxx
HLT/PHOS/AliHLTPHOSSharedMemoryInterface.h
HLT/PHOS/AliHLTPHOSValidCellDataStruct.h

index 93dea5c8cc077a1b37e4b8b9c0df5804d1557a26..288befcc912d41b67df14a9be55f546ba929d97d 100644 (file)
@@ -60,8 +60,8 @@ class AliHLTPHOSRawAnalyzerComponent: public AliHLTPHOSRcuProcessor
   AliAltroData    *fAltroDataPtr;         // container for altro payload
   AliAltroBunch   *fAltroBunchPtr;        // container for altro bunches
 
-  /** Are we pushing the cell energies (raw data) */
-  Bool_t fDoPushCellEnergies; //Added by OD
+  /** Are we pushing the raw data */
+  Bool_t fDoPushRawData; //Added by OD
 
   /** Are we making digits? */
   Bool_t fDoMakeDigits;  //Added by OD
index 2a59e1cfee8623a06658541743d400b49de3cb3c..b181d03fa61807fbb6b8ac69ea7b5816d05d4744 100644 (file)
@@ -32,8 +32,8 @@ struct AliHLTPHOSRcuCellEnergyDataStruct
   Int_t fCnt;
   Int_t fAlgorithm;
   Int_t fInfo;
-  AliHLTPHOSValidCellDataStruct fValidData[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
-
+  Bool_t fHasRawData;
+  AliHLTPHOSValidCellDataStruct fValidData[N_XCOLUMNS_RCU*N_ZROWS_RCU*N_GAINS];
 };
 
 #endif
index 214c295adb635df0de7a061759892d47837e0d00..71e02b051321a61db7903fbcf1b0ede4d57e27ae 100644 (file)
@@ -27,6 +27,7 @@
 AliHLTPHOSSharedMemoryInterface::AliHLTPHOSSharedMemoryInterface(): fCurrentChannel(0),
                                                                    fCellEnergiesPtr(0),
                                                                    fIsSetMemory(false),
+                                                                   fHasRawData(false),
                                                                    fMaxCnt(0),
                                                                    fCurrentCnt(0),
                                                                    fCurrentX(0),
@@ -34,7 +35,8 @@ AliHLTPHOSSharedMemoryInterface::AliHLTPHOSSharedMemoryInterface(): fCurrentChan
                                                                    fCurrentGain(0),
                                                                    fCharDataOffset(0),
                                                                    fCharPtr(0),
-                                                                   fIntPtr(0)
+                                                                   fIntPtr(0),
+                                                                   fRawDataPtr(0)
 {
   fCharDataOffset = sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
 }
@@ -65,34 +67,14 @@ AliHLTPHOSSharedMemoryInterface::NextChannel()
   // Changed by OD
   if(fCurrentCnt < fMaxCnt)
     {
-      for(Int_t x = 0; x < N_XCOLUMNS_MOD; x++)
+      fCurrentChannel = &(fCellEnergiesPtr->fValidData[fCurrentCnt]);
+      fCurrentCnt++;
+      if(fCellEnergiesPtr->fHasRawData == true)
        {
-         for(Int_t z = 0; z < N_ZROWS_MOD; z++)
-           {
-             for(Int_t gain = 0; gain < N_GAINS; gain++)
-               {
-                 fCurrentChannel =  &(fCellEnergiesPtr->fValidData[x][z][gain]);
-                 
-                 if(fCurrentChannel->fID == fCurrentCnt)
-                   {
-                     
-
-                     /*
-                       commented out by PT, temorary patc
-                       the usage of a pointer AliHLTPHOSValidCellDataStruct
-                       gives incompability between 64 and 32 bit machines.
-                       data written on a 64 bit machine cannot be read on a 32 bit machine
-                       since a pointer is 64 bit on a 64 bit machine and 32 bit on a 32 bit machine
-                       fCurrentChannel->fData = fIntPtr; 
-                       fIntPtr +=  fCurrentChannel->fNSamples;
-                     */
-                     
-                     fCurrentCnt ++;
-                     return fCurrentChannel;
-                   }
-               }
-           }
+         fRawDataPtr = fIntPtr + 1;
+         fIntPtr = fIntPtr + *fIntPtr + 1;
        }
+      return fCurrentChannel;
     }
   else
     {
@@ -103,6 +85,21 @@ AliHLTPHOSSharedMemoryInterface::NextChannel()
   return 0;
 }
 
+Int_t*
+AliHLTPHOSSharedMemoryInterface::GetRawData(Int_t& nSamples)
+{
+  //Added by OD
+
+  if(fHasRawData == true)
+    {
+      nSamples = *(fRawDataPtr-1);
+      return fRawDataPtr;
+    }
+  else
+    {
+      return 0;
+    }
+}
 
 void
 AliHLTPHOSSharedMemoryInterface::SetMemory(AliHLTPHOSRcuCellEnergyDataStruct *rcuCellEnergyPtr)
@@ -110,7 +107,11 @@ AliHLTPHOSSharedMemoryInterface::SetMemory(AliHLTPHOSRcuCellEnergyDataStruct *rc
   //Shutting up rule checker
   fCellEnergiesPtr =  rcuCellEnergyPtr;
   fMaxCnt =  fCellEnergiesPtr->fCnt;
-  PingPongPointer();
+  if(fCellEnergiesPtr->fHasRawData == true)
+    {
+      PingPongPointer();
+      fHasRawData = true;
+    }
   fIsSetMemory = true;
 }
 
@@ -125,14 +126,16 @@ AliHLTPHOSSharedMemoryInterface::Reset()
   fCurrentZ = 0;
   fCurrentGain = 0;
   fIsSetMemory = false;
+  fHasRawData = false;
 }
 
-
 void 
 AliHLTPHOSSharedMemoryInterface::PingPongPointer()
 {
   // ping pong ping ping pong ping pong
+  
   fCharPtr = (char *)fCellEnergiesPtr ;
   fCharPtr += fCharDataOffset; 
-  fIntPtr = (Int_t *)fCharPtr; 
+  fIntPtr = (Int_t *)fCharPtr;
+
 }
index 70fb12cebb7dda003e87ef414c3763cb819014b2..b94737a272a527f13a4441b7116b63a789bca83d 100644 (file)
@@ -31,6 +31,7 @@ class  AliHLTPHOSSharedMemoryInterface
   virtual ~AliHLTPHOSSharedMemoryInterface();
   AliHLTPHOSValidCellDataStruct*   NextChannel();
   void SetMemory(AliHLTPHOSRcuCellEnergyDataStruct *rcuCeelEnergyPtr);
+  Int_t* GetRawData(Int_t& nSamples); //added by OD
   void Reset();
 
  private:
@@ -41,6 +42,7 @@ class  AliHLTPHOSSharedMemoryInterface
   AliHLTPHOSValidCellDataStruct *fCurrentChannel;
   AliHLTPHOSRcuCellEnergyDataStruct *fCellEnergiesPtr ;
   bool fIsSetMemory;
+  bool fHasRawData;
   int fMaxCnt;
   int fCurrentCnt; 
   int fCurrentX;   //added by OD
@@ -49,6 +51,7 @@ class  AliHLTPHOSSharedMemoryInterface
   Int_t fCharDataOffset;
   char  *fCharPtr;
   Int_t *fIntPtr;
+  Int_t *fRawDataPtr;
   //  Int_t *rawDataBufferPos = (Int_t *)outputPtr; 
 };
 
index e98f4de591d1048660be160019074de1c58c6a13..e64b6935907f8588ec47a8c74d97b0ef76fdf222 100644 (file)
@@ -29,19 +29,19 @@ struct AliHLTPHOSValidCellDataStruct
 {
   Int_t fX;
   Int_t fZ;
-  Int_t fID;
-
   Int_t fGain;
   Float_t fEnergy;
   Float_t fTime;
   Int_t fCrazyness;
-  Int_t fNSamples;
 
-  //  Int_t *fData;
+  //  Int_t fNSamples;
+
+  // Int_t *fData;
+
   //  unsigned int  fDataOffset;
   //  Int_t *fData2;
   
-  Int_t fData[N_DATA_SAMPLES];
+  //  Int_t fData[N_DATA_SAMPLES];
 
 };