]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerDDLDecoder.h
Adding the cascade performance task (Antonin Maire)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerDDLDecoder.h
index c0985a294c88c655f22b2725a73d461ffc6094d7..2e055055347ef83e3f57db702bde5c57e9b3905e 100644 (file)
@@ -345,11 +345,18 @@ void AliMUONTriggerDDLDecoder<EventHandler>::DecodeBuffer(
        
        // Detect how many regional blocks we expect. If we have no idea then
        // just use what the maximum setting is.
-       switch (EventHandler::GetDarcType(*darcHeader))
+       UInt_t darkType = EventHandler::GetDarcType(*darcHeader);
+       if (darkType == fgkDarcVadorhType)
        {
-       case fgkDarcVadorhType:  fNoRegionals = 1; break;
-       case fgkDarcDefaultType: fNoRegionals = 8; break;
-       default: fNoRegionals = fMaxRegionals; break;
+               fNoRegionals = 1;
+       }
+       else if (darkType == fgkDarcDefaultType)
+       {
+               fNoRegionals = 8;
+       }
+       else
+       {
+               fNoRegionals = fMaxRegionals;
        }
        
        // Check if the DARC header indicates we expect more regionals than we
@@ -628,10 +635,14 @@ void AliMUONTriggerDDLDecoder<EventHandler>::DecodeRegionalStructs(
                
                // Tell the handler that we have a new regional block and decode it.
                // When done, tell the handler again.
+               // We call both versions of OnNewRegionalStruct so that user event
+               // handlers can implement the one they prefer to use.
                const UChar_t* startOfLocals = current;
                fHandler.OnNewRegionalStruct(regionalHeader, regionalScalars, startOfLocals);
+               fHandler.OnNewRegionalStructV2(iReg, regionalHeader, regionalScalars, startOfLocals);
                current = DecodeLocalStructs(current, end, scalarEvent);
                fHandler.OnEndOfRegionalStruct(regionalHeader, regionalScalars, startOfLocals);
+               fHandler.OnEndOfRegionalStructV2(iReg, regionalHeader, regionalScalars, startOfLocals);
        }
        
        // Now just check that there is no extra rubbish at the end of the DDL.
@@ -778,7 +789,10 @@ const UChar_t* AliMUONTriggerDDLDecoder<EventHandler>::DecodeLocalStructs(
                        }
                }
                
+               // Call both handlers for local structures so that the user decoder event
+               // handler class can implement the one it prefers to use.
                fHandler.OnLocalStruct(localStruct, localScalars);
+               fHandler.OnLocalStructV2(iLocal, localStruct, localScalars);
        }
        
        return current;