]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding functionality to generate AliESDEvent objects from dHLT raw data during offlin...
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 10:00:33 +0000 (10:00 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 10:00:33 +0000 (10:00 +0000)
Making declared buffer requirements bigger for AliHLTMUONESDMaker.
Adding includes to allow the HLToutputTodHLTRootObjects.C macro to compile.

HLT/MUON/OfflineInterface/AliHLTMUONAgent.cxx
HLT/MUON/OfflineInterface/AliHLTMUONAgent.h
HLT/MUON/OfflineInterface/AliHLTMUONESDMaker.cxx
HLT/MUON/macros/HLToutputTodHLTRootObjects.C

index 409602e3b3ce6d6541dab6a4c38250da7cd1f481..476f9b66578680aae02666ec328fddee5cb79aab 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliHLTMUONESDMaker.h"
 #include "AliHLTMUONEmptyEventFilterComponent.h"
 #include "AliHLTMUONDataCheckerComponent.h"
+#include "AliHLTOUTHandlerChain.h"
 #include "AliRawReader.h"
 #include "AliRunLoader.h"
 #include "TSystem.h"
 // The single global instance of the dimuon HLT agent.
 AliHLTMUONAgent AliHLTMUONAgent::fgkInstance;
 
+AliHLTOUTHandlerChain AliHLTMUONAgent::fgkESDMakerChain("libAliHLTMUON.so chains=dHLT-make-esd");
+AliHLTOUTHandlerChain AliHLTMUONAgent::fgkRootifyDumpChain("libAliHLTMUON.so chains=dHLT-rootify-and-dump");
+
+
 ClassImp(AliHLTMUONAgent);
 
 
@@ -321,6 +326,40 @@ int AliHLTMUONAgent::CreateConfigurations(
                handler->CreateConfiguration("dHLT-sim-fromMC", "BlockFilter", outputSrcs.Data(), "");
        }
        
+       // Create a chain for generating AliESDEvent objects from dHLT raw reconstructed data.
+       handler->CreateConfiguration("HLTOUTPubTrigRecs", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRECS' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubMansoTracks", "AliHLTOUTPublisher", NULL, "-datatype 'MANTRACK' 'MUON'");
+       handler->CreateConfiguration(
+                       "dHLT-make-esd",
+                       AliHLTMUONConstants::ESDMakerId(),
+                       "HLTOUTPubTrigRecs HLTOUTPubMansoTracks",
+                       "-make_minimal_esd"
+               );
+       
+       // Create a chain for rootifying the raw dHLT data and dumping to file.
+       // This is used during AliRoot reconstruction.
+       handler->CreateConfiguration("HLTOUTPubTrigDbg", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRDBG' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubHits", "AliHLTOUTPublisher", NULL, "-datatype 'RECHITS ' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubClusters", "AliHLTOUTPublisher", NULL, "-datatype 'CLUSTERS' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubChannels", "AliHLTOUTPublisher", NULL, "-datatype 'CHANNELS' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubCandidates", "AliHLTOUTPublisher", NULL, "-datatype 'MNCANDID' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubSingles", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDSIN' 'MUON'");
+       handler->CreateConfiguration("HLTOUTPubPairs", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDPAR' 'MUON'");
+       handler->CreateConfiguration(
+                       "HLTOUTConverter",
+                       AliHLTMUONConstants::RootifierComponentId(),
+                       "HLTOUTPubTrigRecs HLTOUTPubTrigDbg HLTOUTPubHits HLTOUTPubClusters"
+                        " HLTOUTPubChannels HLTOUTPubMansoTracks HLTOUTPubCandidates"
+                        " HLTOUTPubSingles HLTOUTPubPairs",
+                       ""
+               );
+       handler->CreateConfiguration(
+                       "dHLT-rootify-and-dump",
+                       "ROOTFileWriter",
+                       "HLTOUTConverter",
+                       "-concatenate-events -datafile dHLTRawData.root -specfmt"
+               );
+       
        return 0;
 }
 
@@ -347,3 +386,108 @@ int AliHLTMUONAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
        return 0;
 }
 
+
+int AliHLTMUONAgent::GetHandlerDescription(
+               AliHLTComponentDataType dt,
+#ifdef __DEBUG
+               AliHLTUInt32_t spec,
+#else
+               AliHLTUInt32_t /*spec*/,
+#endif
+               AliHLTOUTHandlerDesc& desc
+       ) const
+{
+       /// Get handler decription for MUON data in the HLTOUT data stream.
+       
+       if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
+           dt == AliHLTMUONConstants::MansoTracksBlockDataType()
+          )
+       {
+               HLTDebug("Indicating we can handle data type = %s and specification"
+                       " = 0x%8.8X with dHLT-make-esd chain",
+                       AliHLTComponent::DataType2Text(dt).c_str(),
+                       spec
+               );
+               desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-make-esd");
+               return 1;
+       }
+       
+       if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
+           dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
+           dt == AliHLTMUONConstants::RecHitsBlockDataType() or
+           dt == AliHLTMUONConstants::ClusterBlockDataType() or
+           dt == AliHLTMUONConstants::ChannelBlockDataType() or
+           dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
+           dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
+           dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
+           dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
+          )
+       {
+               HLTDebug("Indicating we can handle data type = %s and specification"
+                       " = 0x%8.8X with dHLT-rootify-and-dump chain",
+                       AliHLTComponent::DataType2Text(dt).c_str(),
+                       spec
+               );
+               desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-rootify-and-dump");
+               return 1;
+       }
+       
+       return 0;
+}
+
+
+AliHLTOUTHandler* AliHLTMUONAgent::GetOutputHandler(
+               AliHLTComponentDataType dt,
+#ifdef __DEBUG
+               AliHLTUInt32_t spec
+#else
+               AliHLTUInt32_t /*spec*/
+#endif
+       )
+{
+       /// Get specific handler for MUON data in the HLTOUT data stream.
+       
+       HLTDebug("Trying to create HLTOUT handler for data type = %s and"
+               " specification = 0x%8.8X",
+               AliHLTComponent::DataType2Text(dt).c_str(),
+               spec
+       );
+       
+       if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
+           dt == AliHLTMUONConstants::MansoTracksBlockDataType()
+          )
+       {
+               return &fgkESDMakerChain;
+       }
+       
+       if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
+           dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
+           dt == AliHLTMUONConstants::RecHitsBlockDataType() or
+           dt == AliHLTMUONConstants::ClusterBlockDataType() or
+           dt == AliHLTMUONConstants::ChannelBlockDataType() or
+           dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
+           dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
+           dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
+           dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
+          )
+       {
+               return &fgkRootifyDumpChain;
+       }
+       
+       return NULL;
+}
+
+
+int AliHLTMUONAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
+{
+       /// Deletes the HLTOUT handlers. In this case since the handlers are
+       /// allocated statically, we just check that the right pointer was
+       /// given and exit.
+       
+       HLTDebug("Trying to delete HLTOUT handler: %p", pInstance);
+       
+       if (pInstance != &fgkESDMakerChain or pInstance != &fgkRootifyDumpChain)
+               return -EINVAL;
+       
+       return 0;
+}
index 2b27e0c1fc81f50a4a84b11266463e043e3da65e..5b77b9fefd5ac9ac90c96208aa422de2b0b416af 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "AliHLTModuleAgent.h"
 class AliRunLoader;
+class AliHLTOUTHandlerChain;
 
 /**
  * This module agent handles dimuon HLT module registration and configurations
@@ -63,9 +64,41 @@ public:
         */
        virtual int RegisterComponents(AliHLTComponentHandler* pHandler) const;
        
+       /**
+        * Get handler decription for dHLT data in the HLTOUT data stream.
+        * @param dt        [in] data type of the block
+        * @param spec      [in] specification of the block
+        * @param desc      [out] handler description
+        * @return 1 if the agent can provide a handler, 0 if not.
+        */
+       virtual int GetHandlerDescription(
+                       AliHLTComponentDataType dt,
+                       AliHLTUInt32_t spec,
+                       AliHLTOUTHandlerDesc& desc
+               ) const;
+       
+       /**
+        * Get specific handler for dHLT data in the HLTOUT data stream.
+        * @param dt        [in] data type of the block
+        * @param spec      [in] specification of the block
+        * @return pointer to handler
+        */
+       virtual AliHLTOUTHandler* GetOutputHandler(
+                       AliHLTComponentDataType dt, AliHLTUInt32_t spec
+               );
+       
+       /**
+        * Delete an HLTOUT handler.
+        * @param pInstance      pointer to handler
+        */
+       virtual int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
+       
 private:
        // The following instance is used for automatic agent and component registration.
-       static AliHLTMUONAgent fgkInstance;  // The single global instance of the dimuon HLT agent.
+       static AliHLTMUONAgent fgkInstance;  ///< The single global instance of the dimuon HLT agent.
+       
+       static AliHLTOUTHandlerChain  fgkESDMakerChain;  ///< Chain handler for converting dHLT raw data to ESD format.
+       static AliHLTOUTHandlerChain  fgkRootifyDumpChain;  ///< Chain handler for converting dHLT raw data to ROOT objects and dumping to file.
 
        ClassDef(AliHLTMUONAgent, 0); // Dimuon HLT module agent which handles processing configurations.
 };
index efc193d0377bfd687c1096f6604ea589cd51e060..38d14947c70338d2a2e8dcbd117d99f5f5be81b0 100644 (file)
@@ -140,7 +140,7 @@ void AliHLTMUONESDMaker::GetOutputDataSize(
        /// Inherited from AliHLTComponent.
        /// Returns an estimate of the expected output data size.
        
-       constBase = sizeof(AliESDEvent);
+       constBase = sizeof(AliESDEvent) + 1024*1024;  // The extra 1 MByte is for auxilary objects created in AliESDEvent.
        inputMultiplier = 10;
 }
 
index f7059f94351411bd98d7789a5d2f978cddc6caac..081e68069c6b54ccfe8c20ca385687f8cc623c18 100644 (file)
 
 // $Id: $
 
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "AliHLTReconstructorBase.h"
+#include "AliHLTConfiguration.h"
+#include "AliReconstruction.h"
+#include <iostream>
+using std::cerr;
+using std::endl;
+#endif
+
 /**
  * @file HLToutputTodHLTRootObjects.C
  * @brief Macro for converting dHLT output in HLTOUT into ROOT objects or dumping to file.