]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/EMCAL/AliHLTEMCALDigitMakerComponent.cxx
Updated macros for PHOS alignment calculation
[u/mrichter/AliRoot.git] / HLT / EMCAL / AliHLTEMCALDigitMakerComponent.cxx
index b6acfe9d10c2db277f859137bf69611cea8ff2b4..ddcb2619e6aeddb4e587963e87264f5fc9d70962 100644 (file)
@@ -14,7 +14,6 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
 #include "AliHLTEMCALDigitMakerComponent.h"
 #include "AliHLTCaloDigitMaker.h"
 #include "AliHLTCaloDigitDataStruct.h"
@@ -125,25 +124,29 @@ AliHLTEMCALDigitMakerComponent::GetOutputDataSize(unsigned long& constBase, doub
 
 int 
 AliHLTEMCALDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
-                                       AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
+                                       AliHLTComponentTriggerData& /* trigData */, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
                                        std::vector<AliHLTComponentBlockData>& outputBlocks)
 {
+
+  //patch in order to skip calib events
+  if(! IsDataEvent()) return 0;
+
   //see header file for documentation
   UInt_t offset           = 0; 
   UInt_t mysize           = 0;
   Int_t digitCount        = 0;
   Int_t ret               = 0;
-
+  
   const AliHLTComponentBlockData* iter = 0; 
   unsigned long ndx; 
-
+  
   UInt_t specification = 0;
   AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0;
   
   //  fDigitMakerPtr->SetDigitHeaderPtr(reinterpret_cast<AliHLTCaloDigitHeaderStruct*>(outputPtr));
-
+  
   fDigitMakerPtr->SetDigitDataPtr(reinterpret_cast<AliHLTCaloDigitDataStruct*>(outputPtr));
-
+  
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
       iter = blocks+ndx;
@@ -158,31 +161,39 @@ AliHLTEMCALDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
       if(!fBCMInitialised)
        {
          AliHLTEMCALMapper mapper(iter->fSpecification);
+         module = mapper.GetModuleFromSpec(iter->fSpecification);
+         
+         if (module>=0) {
          
-         if (module = mapper.GetModuleFromSpec(iter->fSpecification))
-           
            for(Int_t x = 0; x < NXCOLUMNSMOD ; x++) // PTH  
-             
              for(Int_t z = 0; z <  NZROWSMOD ; z++) // PTH
-               
-               fDigitMakerPtr->SetBadChannel(x, z, fPedestalData->IsBadChannel(module, z+1, x+1));
+        // FR 
+               fDigitMakerPtr->SetBadChannel(x, z, fPedestalData->IsBadChannel(module, z, x));
+           //delete fBadChannelMap;  
+           fBCMInitialised = true;
+         }
+         else 
+           HLTError("Error setting pedestal with module value of %d", module);
          
-         //delete fBadChannelMap;
-         fBCMInitialised = true;
        }
       
       if(!fGainsInitialised)
        {
+         
          AliHLTEMCALMapper mapper(iter->fSpecification);
-         if (module = mapper.GetModuleFromSpec(iter->fSpecification))
+         module = mapper.GetModuleFromSpec(iter->fSpecification);
            
-           for(Int_t x = 0; x < NXCOLUMNSMOD; x++)   //PTH
-             for(Int_t z = 0; z < NZROWSMOD; z++)   //PTH
-               // FR setting gains 
-               fDigitMakerPtr->SetGain(x, z, HGLGFACTOR, fCalibData->GetADCchannel(module, z, x));
-         
-         
-         fGainsInitialised = true;
+           if (module>=0) {
+             
+             for(Int_t x = 0; x < NXCOLUMNSMOD; x++)   //PTH
+               for(Int_t z = 0; z < NZROWSMOD; z++)   //PTH
+                 // FR setting gains 
+                 fDigitMakerPtr->SetGain(x, z, HGLGFACTOR, fCalibData->GetADCchannel(module, z, x));
+             
+             fGainsInitialised = true;
+           }
+           else
+             HLTError("Error setting gains with module value of %d", module);
        }
       
       specification |= iter->fSpecification;