]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- fixing bug in digit maker causing it to crash with new firmware
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Oct 2009 14:53:33 +0000 (14:53 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Oct 2009 14:53:33 +0000 (14:53 +0000)
HLT/PHOS/AliHLTPHOSDigitMaker.cxx
HLT/PHOS/AliHLTPHOSDigitMaker.h
HLT/PHOS/AliHLTPHOSDigitMakerComponent.cxx

index 9ad7c4bf7eeda368bf70356a06487d064a23ae0d..0f12e2768de5ef1f629ff398a8821b1055cdfc98 100644 (file)
@@ -15,7 +15,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  /** 
- * @file   AliHLTPHOSClusterizer.cxx
+ * @file   AliHLTPHOSDigitMaker.cxx
  * @author Oystein Djuvsland
  * @date 
  * @brief  Digit maker for PHOS HLT  
@@ -31,6 +31,7 @@
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
 #include "AliHLTPHOSDigitMaker.h"
+#include "AliHLTLogging.h"
 
 #include "AliHLTPHOSConstants.h"
 #include "AliHLTPHOSMapper.h"
 #include "AliPHOSEMCAGeometry.h"
 #include "TH2F.h"
 
+
 ClassImp(AliHLTPHOSDigitMaker);
 
 using namespace PhosHLTConst;
 
 AliHLTPHOSDigitMaker::AliHLTPHOSDigitMaker() :
-  //  AliHLTPHOSBase(),
+  AliHLTLogging(),
   fShmPtr(0),
   fDigitStructPtr(0),
   fDigitCount(0),
@@ -95,13 +97,13 @@ AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataH
   AliHLTPHOSChannelDataStruct* currentchannel = 0;
   AliHLTPHOSChannelDataStruct* currentchannelLG = 0;  
   AliHLTPHOSChannelDataStruct* tmpchannel = 0;
-  
+
   fShmPtr->SetMemory(channelDataHeader);
   currentchannel = fShmPtr->NextChannel();
-
+  
   while(currentchannel != 0)
     {
-      if(availableSize < totSize) return -1;
+        if(availableSize < totSize) return -1;
 
       AliHLTPHOSMapper::GetChannelCoord(currentchannel->fChannelID, coord1);
       
@@ -111,7 +113,6 @@ AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataH
          
          if(coord1[2] == HIGHGAIN) // We got a completely new crystal
            {
-
              if(currentchannel->fEnergy < MAXBINVALUE) // Make sure we don't have signal overflow
                {
                  AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
@@ -133,7 +134,6 @@ AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataH
 
              else // Ooops, overflow, we try the next channel... 
                {
-       
                  currentchannel = fShmPtr->NextChannel();
                  if(currentchannel != 0) // There was a next channel
                    {
@@ -210,7 +210,7 @@ AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSChannelDataHeaderStruct* channelDataH
                }
              else //Fine, no more channels, better add this one...
                {
-                 AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+                 AliHLTPHOSMapper::GetLocalCoord(currentchannelLG->fChannelID, locCoord);
                  AddDigit(currentchannelLG, coord1, locCoord);
                  j++;
                  totSize += sizeof(AliHLTPHOSDigitDataStruct);
index 81497869704c735394b6b165beb9bcc659cd1cf1..530c0b6d1cf27059269b3e44e8031eba1c60233c 100644 (file)
@@ -39,6 +39,7 @@
 #include "AliHLTPHOSDigitDataStruct.h"
 #include "AliHLTPHOSChannelDataStruct.h"
 #include "AliHLTDataTypes.h"
+#include "AliHLTLogging.h"
 
 /**
  * @class AliHLTPHOSDigitMaker
@@ -55,7 +56,7 @@ class AliHLTPHOSMapper;
 using namespace PhosHLTConst;
 
 //class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
-class AliHLTPHOSDigitMaker
+class AliHLTPHOSDigitMaker : public AliHLTLogging
 {
 public:
 
@@ -67,7 +68,7 @@ public:
 
   /** Copy constructor */  
   AliHLTPHOSDigitMaker(const AliHLTPHOSDigitMaker &) : 
-    //    AliHLTPHOSBase(),
+    AliHLTLogging(),
     fShmPtr(0),
     fDigitStructPtr(0),
     fDigitCount(0),
@@ -145,12 +146,12 @@ private:
     if(channelCoordinates[2] == HIGHGAIN)
       {
        fDigitStructPtr->fEnergy = channelData->fEnergy*fHighGainFactors[channelCoordinates[0]][channelCoordinates[1]];
-       //      printf("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy);
+       //      HLTDebug("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy);
       }
     else
       {
        fDigitStructPtr->fEnergy = channelData->fEnergy*fLowGainFactors[channelCoordinates[0]][channelCoordinates[1]];
-       //      printf("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy); 
+       //      HLTDebug("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", channelCoordinates[0], channelCoordinates[1], channelData->fEnergy, fDigitStructPtr->fEnergy); 
       }
     fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO
     fDigitStructPtr->fCrazyness = channelData->fCrazyness;
index a98c2d765a0593fae02793d581c1fa3def765b18..641e5264de1866095ecd80f006a51bbc0de565e4 100644 (file)
@@ -131,6 +131,7 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
   
   fDigitMakerPtr->SetDigitDataPtr(reinterpret_cast<AliHLTPHOSDigitDataStruct*>(outputPtr));
 
+
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
       iter = blocks+ndx;