]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing bug in suppression of warning message printing in the hit reconstruction compo...
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 22:20:17 +0000 (22:20 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 22:20:17 +0000 (22:20 +0000)
Adding the '-dontprintwrongeventerror' option to the trigger reconstruction component.

HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructor.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructor.h
HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.h
HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructor.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructor.h
HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.h

index b50335030519fd9ba2dcff7e70172b9a2733dc4b..9061cd73791f7f221e245e50876e745cc3fb4eaf 100644 (file)
@@ -313,21 +313,33 @@ bool AliHLTMUONHitReconstructor::DecodeDDL(const AliHLTUInt32_t* rawData,AliHLTU
   handler.SetMaxFiredPerDetElem(fMaxFiredPerDetElem);
   handler.SetMaxEntryPerBusPatch(fMaxEntryPerBusPatch);
  
-  if(!fHLTMUONDecoder.Decode(rawData,bufferSize))
+  if (not fHLTMUONDecoder.Decode(rawData,bufferSize))
   {
        switch (TryRecover())
        {
        case kRecoverFull:
-               HLTWarning("There was a problem with the raw data."
-                       " Recovered as much data as possible."
-                       " Will continue processing the next event."
-               );
+               // Do not print the following warning for option "-dontprintparityerrors" if there
+               // were only parity errors.
+               if (fHLTMUONDecoder.GetHandler().NonParityErrorFound() or
+                   (fHLTMUONDecoder.GetHandler().ParityErrorFound() and not fHLTMUONDecoder.GetHandler().DontPrintParityErrors())
+                  )
+               {
+                       HLTWarning("There was a problem with the raw data."
+                               " Recovered as much data as possible."
+                               " Will continue processing the next event."
+                       );
+               }
                break;
        case kRecoverJustSkip:
-               HLTWarning("There was a problem with the raw data."
-                       " Skipped corrupted data structures."
-                       " Will continue processing the next event."
-               );
+               if (fHLTMUONDecoder.GetHandler().NonParityErrorFound() or
+                   (fHLTMUONDecoder.GetHandler().ParityErrorFound() and not fHLTMUONDecoder.GetHandler().DontPrintParityErrors())
+                  )
+               {
+                       HLTWarning("There was a problem with the raw data."
+                               " Skipped corrupted data structures."
+                               " Will continue processing the next event."
+                       );
+               }
                break;
        case kRecoverFromParityErrorsOnly:
                if (fHLTMUONDecoder.GetHandler().NonParityErrorFound())
@@ -335,9 +347,13 @@ bool AliHLTMUONHitReconstructor::DecodeDDL(const AliHLTUInt32_t* rawData,AliHLTU
                        HLTError("Failed to decode the tracker DDL raw data.");
                        return false;
                }
-               HLTWarning("Found parity errors in the raw data,"
-                       " but will continue processing."
-               );
+               if (not fHLTMUONDecoder.GetHandler().DontPrintParityErrors())
+               {
+                       assert( fHLTMUONDecoder.GetHandler().ParityErrorFound() );
+                       HLTWarning("Found parity errors in the raw data,"
+                               " but will continue processing."
+                       );
+               }
                break;
        default:
                HLTError("Failed to decode the tracker DDL raw data.");
@@ -1221,6 +1237,7 @@ AliHLTMUONHitReconstructor::AliHLTMUONRawDecoder::AliHLTMUONRawDecoder() :
        fSkipParityErrors(false),
        fDontPrintParityErrors(false),
        fPrintParityErrorAsWarning(false),
+       fParityErrorFound(false),
        fNonParityErrorFound(false),
        fIsMuchNoisy(false)
 {
@@ -1245,7 +1262,8 @@ void AliHLTMUONHitReconstructor::AliHLTMUONRawDecoder::OnNewBuffer(const void* b
        // dataCount starts from 1 because the 0-th element of fPadData is used as null value.
        fDataCount = 1;
        *fNofFiredDetElem = 0;
-       fPrevDetElemId = 0 ;
+       fPrevDetElemId = 0;
+       fParityErrorFound = false;
        fNonParityErrorFound = false;
 };
 
@@ -1258,7 +1276,14 @@ void AliHLTMUONHitReconstructor::AliHLTMUONRawDecoder::OnError(ErrorCode code, c
        /// \param location  A pointer to the location in the raw data buffer
        ///      where the problem was found.
        
-       if (code != kParityError) fNonParityErrorFound = true;
+       if (code == kParityError)
+       {
+               fParityErrorFound = true;
+       }
+       else
+       {
+               fNonParityErrorFound = true;
+       }
        if (fDontPrintParityErrors and code == kParityError) return;
        
        long bytepos = long(location) - long(fBufferStart) + sizeof(AliRawDataHeader);
index 9d569a567c2da650793cb2fb822ef235d756f51f..f8a8d0eed95837924043f8b899314da6f0a86d41 100644 (file)
@@ -253,6 +253,11 @@ private:
                 */
                void PrintParityErrorAsWarning(bool value) { fPrintParityErrorAsWarning = value; }
                
+               /**
+                * Returns true if a parity error was found during the last call to Decode.
+                */
+               bool ParityErrorFound() const { return fParityErrorFound; }
+               
                /**
                 * Returns true if a non-parity error was found during the last call to Decode.
                 */
@@ -286,9 +291,9 @@ private:
                bool fSkipParityErrors;  ///< Flag indicating if ADC digits with parity errors should be skipped.
                bool fDontPrintParityErrors;  ///< Flag for controlling if messages about parity errors should be printed.
                bool fPrintParityErrorAsWarning;  ///< Flag for controlling if parity error messages are printed as warnings.
+               bool fParityErrorFound;  ///< Flag if a parity error was found after a decoding pass.
                bool fNonParityErrorFound;  ///< Flag which indicates if a non parity error code was found after a decoding pass.
-
-              bool fIsMuchNoisy;  ///< tag for noisy buspatch.
+               bool fIsMuchNoisy;  ///< tag for noisy buspatch.
        };
 
        AliMUONTrackerDDLDecoder<AliHLTMUONRawDecoder> fHLTMUONDecoder; // robust HLTMUON Decoder
index c35ab50bb09f53e234304c436856b09b29165f95..ae53f37fedad4b9755fb7f3edf633b16c7c38f8d 100644 (file)
@@ -97,6 +97,7 @@ extern "C" struct AliHLTMUONHitRecoLutRow;
  *             corrupt in the raw data, without trying to recover the data inside. <br>
  *         - parityerrors  Will only continue decoding if parity errors are found
  *             but the decoder will stop if any other corruption is found. <br>
+ *      if no <i>mode</i> option is specified then full recovery logic is enabled. <br>
  * \li -skipparityerrors <br>
  *      Skips any ADC digit data words that contain parity errors. <br>
  * \li -dontprintparityerrors <br>
index 64bae02d3f3b29d19756c85ad051e238e09e2d63..fd95f18604462f1d4bf3da904822fb24e0e8557a 100644 (file)
@@ -107,10 +107,16 @@ bool AliHLTMUONTriggerReconstructor::Run(
        {
                if (TryRecover())
                {
-                       HLTWarning("There was a problem with the raw data."
-                               " Recovered as much data as possible."
-                               " Will continue processing the next event."
-                       );
+                       /// Fix as long as the DARC header problem is not fixed in hardware by trigger colleagues
+                       if (fDecoder.GetHandler().HadNonWrongEventTypeError() or
+                           (fDecoder.GetHandler().HadWrongEventTypeError() and not fDecoder.GetHandler().DontPrintWrongEventError())
+                          )
+                       {
+                               HLTWarning("There was a problem with the raw data."
+                                       " Recovered as much data as possible."
+                                       " Will continue processing the next event."
+                               );
+                       }
                }
                else
                {
@@ -161,7 +167,10 @@ AliHLTMUONTriggerReconstructor::AliDecoderHandler::AliDecoderHandler() :
        fStoreInfo(false),
        fInfoBufferSize(0),
        fInfoBufferCount(0),
-       fInfoBuffer(NULL)
+       fInfoBuffer(NULL),
+       fDontPrintWrongEventError(false),
+       fHadWrongEventTypeError(false),
+       fHadNonWrongEventTypeError(false)
 {
        /// Default constructor just resets the lookup table to zero and local
        /// structure marker pointers to NULL.
@@ -1118,6 +1127,17 @@ void AliHLTMUONTriggerReconstructor::AliDecoderHandler::OnError(
        /// Logs an error message if there was a decoding problem with the DDL payload.
        
        long bytepos = long(location) - long(fBufferStart) + sizeof(AliRawDataHeader);
+       if (code == kWrongEventType)
+       {
+               fHadWrongEventTypeError = true;
+               
+               /// Do not generate an error message if the fDontPrintWrongEventError option is set.
+               if (fDontPrintWrongEventError) return;
+       }
+       else
+       {
+               fHadNonWrongEventTypeError = true;
+       }
        if (fWarnOnly)
        {
                HLTWarning("There is a problem with decoding the raw data."
index 0425a4d9144c2c05d795f00b05297c7f85df5b93..89cd4ea6e2272d8c6785630edd13704cf86c624a 100644 (file)
@@ -133,6 +133,18 @@ public:
        /// Empty the info buffer.
        void ZeroInfoBuffer() { fDecoder.GetHandler().ZeroInfoBuffer(); }
        
+       /**
+        * Returns the flag indicating if the error message for a wrong event type found
+        * in the DARC header should be suppressed.
+        */
+       bool DontPrintWrongEventError() const { return fDecoder.GetHandler().DontPrintWrongEventError(); }
+       
+       /**
+        * Sets the flag indicating if the error message for a wrong event type found
+        * in the DARC header should be suppressed.
+        */
+       void DontPrintWrongEventError(bool value) { fDecoder.GetHandler().DontPrintWrongEventError(value); }
+       
 private:
 
        class AliDecoderHandler : public AliMUONTriggerDDLDecoderEventHandler, public AliHLTLogging
@@ -252,6 +264,7 @@ private:
                {
                        assert( buffer != NULL );
                        fBufferStart = buffer;
+                       fHadWrongEventTypeError = fHadNonWrongEventTypeError = false;
                }
                
                /**
@@ -305,7 +318,28 @@ private:
                
                /// Empty the info buffer.
                void ZeroInfoBuffer() { fInfoBufferCount = 0; }
-       
+               
+               /**
+                * Returns the flag indicating if the error message for a wrong event type found
+                * in the DARC header should be suppressed.
+                */
+               bool DontPrintWrongEventError() const { return fDontPrintWrongEventError; }
+               
+               /**
+                * Sets the flag indicating if the error message for a wrong event type found
+                * in the DARC header should be suppressed.
+                */
+               void DontPrintWrongEventError(bool value) { fDontPrintWrongEventError = value; }
+               
+               /// Returns true if the last decoded DDL had a wrong event type error in the DARC header.
+               bool HadWrongEventTypeError() const { return fHadWrongEventTypeError; }
+               
+               /**
+                * Returns true if the last decoded DDL had a different error than just a
+                * wrong event type error in the DARC header.
+                */
+               bool HadNonWrongEventTypeError() const { return fHadNonWrongEventTypeError; }
+               
        private:
                // Do not allow copying of this class.
                /// Not implemented
@@ -389,7 +423,10 @@ private:
                AliHLTUInt32_t fInfoBufferSize;  ///< Number of elements storable in fInfoBuffer.
                AliHLTUInt32_t fInfoBufferCount;  ///< Number of elements stored in the fInfoBuffer.
                AliHLTMUONTrigRecInfoStruct* fInfoBuffer;  ///< Buffer for storing the debug information.
-               
+               bool fDontPrintWrongEventError;    ///< Flag indicating if the error message for kWrongEventType is suppressed or not.
+               bool fHadWrongEventTypeError;  ///< Flag indicating if a kWrongEventType error was found in the last decoded DDL.
+               bool fHadNonWrongEventTypeError;  ///< Flag indicating if a different error than kWrongEventType was found in the last decoded DDL.
+
                static const AliMUONLocalInfoStruct fgkNullStruct; ///< Empty structure marker.
        };
 
index 400bc472e36379f159063cb39a1b87f1361dedc9..8e963f19b6a9051ddd88f70f205dc96020daad2c 100644 (file)
@@ -181,6 +181,7 @@ int AliHLTMUONTriggerReconstructorComponent::DoInit(int argc, const char** argv)
        bool tryRecover = false;
        bool useLocalId = true;
        bool makeDebugInfo = false;
+       bool dontPrintWrongEventError = false;
        double zmiddle = 0;
        double bfieldintegral = 0;
        
@@ -396,6 +397,12 @@ int AliHLTMUONTriggerReconstructorComponent::DoInit(int argc, const char** argv)
                        continue;
                }
                
+               if (strcmp( argv[i], "-dontprintwrongeventerror" ) == 0)
+               {
+                       dontPrintWrongEventError = true;
+                       continue;
+               }
+               
                HLTError("Unknown option '%s'.", argv[i]);
                return -EINVAL;
                
@@ -510,6 +517,7 @@ int AliHLTMUONTriggerReconstructorComponent::DoInit(int argc, const char** argv)
        fTrigRec->UseCrateId(fUseCrateId);
        fTrigRec->UseLocalId(useLocalId);
        fTrigRec->StoreDebugInfo(makeDebugInfo);
+       fTrigRec->DontPrintWrongEventError(dontPrintWrongEventError);
        
        return 0;
 }
index 3d4fdb20b15ce988f6facbd39c77ddcc81f013a5..6731cbe79dee7079daf7e37b69f71f408018451b 100644 (file)
@@ -125,6 +125,9 @@ class AliHLTMUONTriggerReconstructor;
  *      if an error occurs. <br>
  * \li -makedebuginfo <br>
  *      If specified then the trigger record debug informaiton data blocks are generated. <br>
+ * \li -dontprintwrongeventerror <br>
+ *      If specified the error message about an incorrect event type found in the DDL DARC
+ *      header is not generated or logged. <br>
  *
  * <h2>Standard configuration:</h2>
  * The configuration is taken from the CDB by default. It can be overridden with