LCOV - code coverage report
Current view: top level - HLT/MUON/OfflineInterface - AliHLTMUONAgent.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 28 257 10.9 %
Date: 2016-06-14 17:26:59 Functions: 8 19 42.1 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : // $Id$
      17             : 
      18             : ///
      19             : /// @file   AliHLTMUONAgent.cxx
      20             : /// @author Artur Szostak <artursz@iafrica.com>
      21             : /// @date   28 May 2007
      22             : /// @brief  Implementation of the AliHLTMUONAgent class.
      23             : ///
      24             : 
      25             : #include "AliHLTMUONAgent.h"
      26             : #include "AliHLTMUONConstants.h"
      27             : #include "AliHLTMUONRecHitsSource.h"
      28             : #include "AliHLTMUONTriggerRecordsSource.h"
      29             : #include "AliHLTMUONDigitPublisherComponent.h"
      30             : #include "AliHLTMUONRootifierComponent.h"
      31             : #include "AliHLTMUONHitReconstructorComponent.h"
      32             : #include "AliHLTMUONTriggerReconstructorComponent.h"
      33             : #include "AliHLTMUONMansoTrackerFSMComponent.h"
      34             : #include "AliHLTMUONFullTrackerComponent.h"
      35             : #include "AliHLTMUONDecisionComponent.h"
      36             : #include "AliHLTMUONESDMaker.h"
      37             : #include "AliHLTMUONEmptyEventFilterComponent.h"
      38             : #include "AliHLTMUONDataCheckerComponent.h"
      39             : #include "AliHLTMUONClusterFinderComponent.h"
      40             : #include "AliHLTMUONRawDataHistoComponent.h"
      41             : #include "AliHLTMUONClusterHistoComponent.h"
      42             : #include "AliHLTOUTHandlerChain.h"
      43             : #include "AliHLTOUTHandlerIgnore.h"
      44             : #include "AliRawReader.h"
      45             : #include "AliRunLoader.h"
      46             : #include "AliRun.h"
      47             : #include "AliMUON.h"
      48             : #include "AliDAQ.h"
      49             : #include "TSystem.h"
      50             : #include "TObjArray.h"
      51             : #include "TString.h"
      52             : 
      53             : // The single global instance of the dimuon HLT agent.
      54           6 : AliHLTMUONAgent AliHLTMUONAgent::fgkInstance;
      55             : 
      56           6 : AliHLTOUTHandlerIgnore AliHLTMUONAgent::fgkDataIgnoreHandler;
      57             : Int_t AliHLTMUONAgent::fgMuonModuleLoaded = 0;
      58             : bool AliHLTMUONAgent::fgRunRootifyChain = false;
      59             : 
      60             : 
      61           6 : ClassImp(AliHLTMUONAgent);
      62             : 
      63             : 
      64             : bool AliHLTMUONAgent::IsMuonModuleLoaded()
      65             : {
      66             :         /// Checks to see if the MUON module is loaded or not.
      67             : 
      68             :         // If the check was already done then use the cached value.
      69           0 :         if (fgMuonModuleLoaded > 0) return true;
      70           0 :         if (fgMuonModuleLoaded < 0) return false;
      71             :         
      72           0 :         if (gAlice != NULL)
      73             :         {
      74             :                 // Search for a module in gAlice deriving from AliMUON.
      75           0 :                 TIter next(gAlice->Modules());
      76             :                 TObject* mod = NULL;
      77           0 :                 while ((mod = next()) != NULL)
      78             :                 {
      79           0 :                         if (mod->InheritsFrom(AliMUON::Class()))
      80             :                         {
      81           0 :                                 fgMuonModuleLoaded = 1;
      82           0 :                                 return true;
      83             :                         }
      84             :                 }
      85           0 :         }
      86             :         
      87           0 :         fgMuonModuleLoaded = -1;
      88           0 :         return false;
      89           0 : }
      90             : 
      91             : 
      92           3 : AliHLTMUONAgent::AliHLTMUONAgent() : AliHLTModuleAgent("MUON"),
      93           3 :                                      fgkESDMakerChain(NULL),
      94           3 :                                      fgkRootifyDumpChain(NULL)
      95          15 : {
      96             :         ///
      97             :         /// Default constructor.
      98             :         ///
      99           6 : }
     100             : 
     101           0 : AliHLTMUONAgent::~AliHLTMUONAgent()
     102           6 : {
     103             :         ///
     104             :         /// Default destructor.
     105             :         ///
     106           9 : }
     107             : 
     108             : UInt_t AliHLTMUONAgent::GetDetectorMask() const
     109             : {
     110           0 :   return AliDAQ::kMUON;
     111             : }
     112             : 
     113             : const char* AliHLTMUONAgent::GetReconstructionChains(AliRawReader* rawReader,
     114             :                                                      AliRunLoader* runloader
     115             :         ) const
     116             : {
     117             :         ///
     118             :         /// Inherited from AliHLTModuleAgent.
     119             :         /// Returns the top processing chain configurations for local event
     120             :         /// reconstruction.
     121             :         /// @param [in] rawReader  AliRoot rawreader instance.
     122             :         /// @param [in] runloader  AliRoot runloader
     123             :         /// @return string containing the top configurations separated by blanks.
     124             :         ///
     125             :         /// If rawReader is not NULL then the standard dHLT chain is run taking
     126             :         /// data from raw DDL data. Otherwise runloader is checked and if it is
     127             :         /// not NULL then a dHLT chain is run with input data from digits.
     128             :         
     129           0 :         if (rawReader != NULL)
     130             :         {
     131             :                 // Check if there is any data from the tracker and trigger.
     132             :                 bool dataFromTracker = false;
     133             :                 bool dataFromTrigger = false;
     134           0 :                 rawReader->Select("MUONTRK", 0, 19);
     135           0 :                 for (Int_t i = 0; i < 20; i++)
     136             :                 {
     137           0 :                         if (rawReader->ReadHeader()) dataFromTracker = true;
     138             :                 }
     139           0 :                 rawReader->Select("MUONTRG", 0, 1);
     140           0 :                 for (Int_t i = 0; i < 2; i++)
     141             :                 {
     142           0 :                         if (rawReader->ReadHeader()) dataFromTrigger = true;
     143             :                 }
     144           0 :                 rawReader->Reset();
     145             :                 
     146             :                 // If raw data was found for our detector then select the
     147             :                 // appropriate chain.
     148           0 :                 if (dataFromTracker and dataFromTrigger)
     149           0 :                         return "dHLT-sim-fromRaw";
     150           0 :         }
     151             :         
     152           0 :         if (runloader != NULL)
     153             :         {
     154             :                 // IsMuonModuleLoaded() is used to check if the muon module was loaded
     155             :                 // If there is no AliMUON module in the simulation then do not run the
     156             :                 // MUON HLT chain.
     157           0 :                 if (IsMuonModuleLoaded() and runloader->GetLoader("MUONLoader") != NULL)
     158           0 :                         return "dHLT-sim";
     159             :         }
     160             :         
     161           0 :         return "";
     162           0 : }
     163             : 
     164             : const char* AliHLTMUONAgent::GetRequiredComponentLibraries() const
     165             : {
     166             :         ///
     167             :         /// Inherited from AliHLTModuleAgent.
     168             :         /// Returns a list of libraries which the configurations registered by
     169             :         /// this module agent depend on.
     170             :         /// @return list of component libraries as a blank-separated string.
     171             :         ///
     172             :         
     173             :         // List of libraries that we depend on.
     174             :         static const char* libs[] =
     175             :         {
     176             :                 "libCore.so",
     177             :                 // "libCint.so",
     178             :                 "libGraf.so",
     179             :                 "libRIO.so",
     180             :                 "libNet.so",
     181             :                 "libHist.so",
     182             :                 "libMatrix.so",
     183             :                 "libMathCore.so",
     184             :                 "libMinuit.so",
     185             :                 "libTree.so",
     186             :                 "libGraf3d.so",
     187             :                 "libGpad.so",
     188             :                 "libPhysics.so",
     189             :                 "libGui.so",
     190             :                 "libProofPlayer.so",
     191             :                 "libProof.so",
     192             :                 "libThread.so",
     193             :                 "libGeom.so",
     194             :                 "libEG.so",
     195             :                 "libTreePlayer.so",
     196             :                 "libXMLIO.so",
     197             :                 "libVMC.so",
     198             :                 "libESD.so",
     199             :                 "libCDB.so",
     200             :                 "libSTEERBase.so",
     201             :                 "libSTEER.so",
     202             :                 "libGui.so",
     203             :                 "libRAWDatasim.so",
     204             :                 "libRAWDatarec.so",
     205             :                 "libRAWDatabase.so",
     206             :                 "libMUONcore.so",
     207             :                 "libMUONraw.so",
     208             :                 "libMUONbase.so",
     209             :                 "libMUONgeometry.so",
     210             :                 "libMUONmapping.so",
     211             :                 "libMUONcalib.so",
     212             :                 "libMUONsim.so",
     213             :                 "libMUONtrigger.so",
     214             :                 "libMUONevaluation.so",
     215             :                 "libMUONrec.so",
     216             :                 "libANALYSIS.so",
     217             :                 "libANALYSISalice.so",
     218             :                 "libHLTbase.so",
     219             :                 "libAliHLTUtil.so",
     220             :                 NULL
     221             :         };
     222             :         
     223             :         // First check if the library is not already loaded. If it is then we have
     224             :         // no reason to declare it as needed, so that we do not load it again.
     225           0 :         static TString result;
     226           0 :         for (const char** lib = libs; *lib != NULL; lib++)
     227             :         {
     228           0 :                 const char* list = gSystem->GetLibraries(*lib, "", kFALSE);
     229           0 :                 if (list == NULL) continue;
     230             :                 // Check if not found, i.e. result was an empty string.
     231             :                 // If so then add the library to the required list.
     232           0 :                 if (list[0] == '\0')
     233             :                 {
     234           0 :                         result += *lib;
     235           0 :                         result += " ";
     236           0 :                 }
     237           0 :         }
     238           0 :         return result.Data();
     239           0 : }
     240             : 
     241             : 
     242             : int AliHLTMUONAgent::CreateConfigurations(
     243             :                 AliHLTConfigurationHandler* handler,
     244             :                 AliRawReader* rawReader,
     245             :                 AliRunLoader* runloader
     246             :         ) const
     247             : {
     248             :         /// Register all processing configurations belonging to the dimuon HLT
     249             :         /// library with the AliHLTConfigurationHandler.
     250             :         /// @param [in] handler     the configuration handler
     251             :         /// @param [in] rawReader   AliRoot rawreader instance.
     252             :         /// @param [in] runloader   AliRoot runloader
     253             :         /// @return Zero on success and error code if failed.
     254             :         ///
     255             :         /// Chains available:
     256             :         /// dHLT-sim          - standard dHLT simulation chain.
     257             :         /// dHLT-sim-fromRaw  - standard dHLT chain taking raw DDL data as input.
     258             :         /// dHLT-sim-fromMC   - dHLT chain taking Monte Carlo hit data as input.
     259             :         ///                     So hit reconstruction is not checked, just the tracker.
     260             :         
     261           0 :         if (handler == NULL) return 0;
     262             :         
     263           0 :         const char* trackerId = AliHLTMUONConstants::MansoTrackerFSMId();
     264           0 :         const char* fullTrackerId = AliHLTMUONConstants::FullTrackerId();
     265           0 :         const char* decCompId = AliHLTMUONConstants::DecisionComponentId();
     266             :         
     267           0 :         if (rawReader != NULL)
     268             :         {
     269             :                 // Implement the dHLT-sim-fromRaw dHLT simulation chain reading
     270             :                 // from raw data.
     271             :                 const char* rawPubComp = "AliRawReaderPublisher";
     272             :                 const char* cmd1 = "-minid 2560 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000001";
     273             :                 const char* cmd2 = "-minid 2561 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000002";
     274             :                 const char* cmd3 = "-minid 2562 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000004";
     275             :                 const char* cmd4 = "-minid 2563 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000008";
     276             :                 const char* cmd5 = "-minid 2564 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000010";
     277             :                 const char* cmd6 = "-minid 2565 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000020";
     278             :                 const char* cmd7 = "-minid 2566 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000040";
     279             :                 const char* cmd8 = "-minid 2567 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000080";
     280             :                 const char* cmd9 = "-minid 2568 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000100";
     281             :                 const char* cmd10 = "-minid 2569 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000200";
     282             :                 const char* cmd11 = "-minid 2570 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000400";
     283             :                 const char* cmd12 = "-minid 2571 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x000800";
     284             :                 const char* cmd13 = "-minid 2572 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x001000";
     285             :                 const char* cmd14 = "-minid 2573 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x002000";
     286             :                 const char* cmd15 = "-minid 2574 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x004000";
     287             :                 const char* cmd16 = "-minid 2575 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x008000";
     288             :                 const char* cmd17 = "-minid 2576 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x010000";
     289             :                 const char* cmd18 = "-minid 2577 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x020000";
     290             :                 const char* cmd19 = "-minid 2578 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x040000";
     291             :                 const char* cmd20 = "-minid 2579 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x080000";
     292             :                 const char* cmd21 = "-minid 2816 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x100000";
     293             :                 const char* cmd22 = "-minid 2817 -datatype 'DDL_RAW ' 'MUON' -dataspec 0x200000";
     294           0 :                 handler->CreateConfiguration("RawDDL1", rawPubComp, NULL, cmd1);
     295           0 :                 handler->CreateConfiguration("RawDDL2", rawPubComp, NULL, cmd2);
     296           0 :                 handler->CreateConfiguration("RawDDL3", rawPubComp, NULL, cmd3);
     297           0 :                 handler->CreateConfiguration("RawDDL4", rawPubComp, NULL, cmd4);
     298           0 :                 handler->CreateConfiguration("RawDDL5", rawPubComp, NULL, cmd5);
     299           0 :                 handler->CreateConfiguration("RawDDL6", rawPubComp, NULL, cmd6);
     300           0 :                 handler->CreateConfiguration("RawDDL7", rawPubComp, NULL, cmd7);
     301           0 :                 handler->CreateConfiguration("RawDDL8", rawPubComp, NULL, cmd8);
     302           0 :                 handler->CreateConfiguration("RawDDL9", rawPubComp, NULL, cmd9);
     303           0 :                 handler->CreateConfiguration("RawDDL10", rawPubComp, NULL, cmd10);
     304           0 :                 handler->CreateConfiguration("RawDDL11", rawPubComp, NULL, cmd11);
     305           0 :                 handler->CreateConfiguration("RawDDL12", rawPubComp, NULL, cmd12);
     306           0 :                 handler->CreateConfiguration("RawDDL13", rawPubComp, NULL, cmd13);
     307           0 :                 handler->CreateConfiguration("RawDDL14", rawPubComp, NULL, cmd14);
     308           0 :                 handler->CreateConfiguration("RawDDL15", rawPubComp, NULL, cmd15);
     309           0 :                 handler->CreateConfiguration("RawDDL16", rawPubComp, NULL, cmd16);
     310           0 :                 handler->CreateConfiguration("RawDDL17", rawPubComp, NULL, cmd17);
     311           0 :                 handler->CreateConfiguration("RawDDL18", rawPubComp, NULL, cmd18);
     312           0 :                 handler->CreateConfiguration("RawDDL19", rawPubComp, NULL, cmd19);
     313           0 :                 handler->CreateConfiguration("RawDDL20", rawPubComp, NULL, cmd20);
     314           0 :                 handler->CreateConfiguration("RawDDL21", rawPubComp, NULL, cmd21);
     315           0 :                 handler->CreateConfiguration("RawDDL22", rawPubComp, NULL, cmd22);
     316           0 :                 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
     317           0 :                 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
     318           0 :                 handler->CreateConfiguration("RecoRawDDL1", hrId, "RawDDL1", "-ddl 1 -cdb");
     319           0 :                 handler->CreateConfiguration("RecoRawDDL2", hrId, "RawDDL2", "-ddl 2 -cdb");
     320           0 :                 handler->CreateConfiguration("RecoRawDDL3", hrId, "RawDDL3", "-ddl 3 -cdb");
     321           0 :                 handler->CreateConfiguration("RecoRawDDL4", hrId, "RawDDL4", "-ddl 4 -cdb");
     322           0 :                 handler->CreateConfiguration("RecoRawDDL5", hrId, "RawDDL5", "-ddl 5 -cdb");
     323           0 :                 handler->CreateConfiguration("RecoRawDDL6", hrId, "RawDDL6", "-ddl 6 -cdb");
     324           0 :                 handler->CreateConfiguration("RecoRawDDL7", hrId, "RawDDL7", "-ddl 7 -cdb");
     325           0 :                 handler->CreateConfiguration("RecoRawDDL8", hrId, "RawDDL8", "-ddl 8 -cdb");
     326           0 :                 handler->CreateConfiguration("RecoRawDDL9", hrId, "RawDDL9", "-ddl 9 -cdb");
     327           0 :                 handler->CreateConfiguration("RecoRawDDL10", hrId, "RawDDL10", "-ddl 10 -cdb");
     328           0 :                 handler->CreateConfiguration("RecoRawDDL11", hrId, "RawDDL11", "-ddl 11 -cdb");
     329           0 :                 handler->CreateConfiguration("RecoRawDDL12", hrId, "RawDDL12", "-ddl 12 -cdb");
     330           0 :                 handler->CreateConfiguration("RecoRawDDL13", hrId, "RawDDL13", "-ddl 13 -cdb");
     331           0 :                 handler->CreateConfiguration("RecoRawDDL14", hrId, "RawDDL14", "-ddl 14 -cdb");
     332           0 :                 handler->CreateConfiguration("RecoRawDDL15", hrId, "RawDDL15", "-ddl 15 -cdb");
     333           0 :                 handler->CreateConfiguration("RecoRawDDL16", hrId, "RawDDL16", "-ddl 16 -cdb");
     334           0 :                 handler->CreateConfiguration("RecoRawDDL17", hrId, "RawDDL17", "-ddl 17 -cdb");
     335           0 :                 handler->CreateConfiguration("RecoRawDDL18", hrId, "RawDDL18", "-ddl 18 -cdb");
     336           0 :                 handler->CreateConfiguration("RecoRawDDL19", hrId, "RawDDL19", "-ddl 19 -cdb");
     337           0 :                 handler->CreateConfiguration("RecoRawDDL20", hrId, "RawDDL20", "-ddl 20 -cdb");
     338           0 :                 handler->CreateConfiguration("RecoRawDDL21", trId, "RawDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
     339           0 :                 handler->CreateConfiguration("RecoRawDDL22", trId, "RawDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
     340             :                 
     341             :                 const char* recoSrcs = "RecoRawDDL13 RecoRawDDL14 RecoRawDDL15 RecoRawDDL16 RecoRawDDL17"
     342             :                         " RecoRawDDL18 RecoRawDDL19 RecoRawDDL20 RecoRawDDL21 RecoRawDDL22";
     343           0 :                 handler->CreateConfiguration("MansoTrackerForRaw", trackerId, recoSrcs, "");
     344             :                 
     345           0 :                 handler->CreateConfiguration("DecisionForRaw", decCompId, "MansoTrackerForRaw", "");
     346             :                 
     347           0 :                 TString outputSrcs = "DecisionForRaw MansoTrackerForRaw ";
     348           0 :                 outputSrcs += recoSrcs;
     349           0 :                 handler->CreateConfiguration("dHLT-sim-fromRaw", "BlockFilter", outputSrcs, "");
     350             :                 
     351             :                 // For reconstruction using full tracker.
     352             :                 const char* recoSrcsFull = " RecoRawDDL1 RecoRawDDL2 RecoRawDDL3 RecoRawDDL4 RecoRawDDL5 RecoRawDDL6 "
     353             :                         " RecoRawDDL7 RecoRawDDL8 RecoRawDDL9 RecoRawDDL10 RecoRawDDL11 RecoRawDDL12 "
     354             :                         " RecoRawDDL13 RecoRawDDL14 RecoRawDDL15 RecoRawDDL16 RecoRawDDL17 "
     355             :                         " RecoRawDDL18 RecoRawDDL19 RecoRawDDL20 RecoRawDDL21 RecoRawDDL22 ";
     356           0 :                 handler->CreateConfiguration("FullTrackerForRaw", fullTrackerId, recoSrcsFull, "-cdb");
     357             :                 
     358           0 :                 handler->CreateConfiguration("DecisionForRawFullTrk", decCompId, "FullTrackerForRaw", "");
     359             :                 
     360           0 :                 TString outputSrcsFull = "DecisionForRawFullTrk FullTrackerForRaw ";
     361           0 :                 outputSrcsFull += recoSrcsFull;
     362           0 :                 handler->CreateConfiguration("dHLT-sim-fromRaw-fullTracker", "BlockFilter", outputSrcsFull, "");
     363           0 :         }
     364             :         
     365           0 :         if (IsMuonModuleLoaded() and runloader != NULL)
     366             :         {
     367             :                 // Implement the dHLT-sim dHLT simulation chain reading from
     368             :                 // simulated digits.
     369           0 :                 const char* digitPub = AliHLTMUONConstants::DigitPublisherId();
     370           0 :                 handler->CreateConfiguration("DigitDDL13", digitPub, NULL, "-simdata -ddl 13");
     371           0 :                 handler->CreateConfiguration("DigitDDL14", digitPub, NULL, "-simdata -ddl 14");
     372           0 :                 handler->CreateConfiguration("DigitDDL15", digitPub, NULL, "-simdata -ddl 15");
     373           0 :                 handler->CreateConfiguration("DigitDDL16", digitPub, NULL, "-simdata -ddl 16");
     374           0 :                 handler->CreateConfiguration("DigitDDL17", digitPub, NULL, "-simdata -ddl 17");
     375           0 :                 handler->CreateConfiguration("DigitDDL18", digitPub, NULL, "-simdata -ddl 18");
     376           0 :                 handler->CreateConfiguration("DigitDDL19", digitPub, NULL, "-simdata -ddl 19");
     377           0 :                 handler->CreateConfiguration("DigitDDL20", digitPub, NULL, "-simdata -ddl 20");
     378           0 :                 handler->CreateConfiguration("DigitDDL21", digitPub, NULL, "-simdata -ddl 21");
     379           0 :                 handler->CreateConfiguration("DigitDDL22", digitPub, NULL, "-simdata -ddl 22");
     380           0 :                 const char* hrId = AliHLTMUONConstants::HitReconstructorId();
     381           0 :                 const char* trId = AliHLTMUONConstants::TriggerReconstructorId();
     382           0 :                 handler->CreateConfiguration("RecoDDL13", hrId, "DigitDDL13", "-ddl 13 -cdb");
     383           0 :                 handler->CreateConfiguration("RecoDDL14", hrId, "DigitDDL14", "-ddl 14 -cdb");
     384           0 :                 handler->CreateConfiguration("RecoDDL15", hrId, "DigitDDL15", "-ddl 15 -cdb");
     385           0 :                 handler->CreateConfiguration("RecoDDL16", hrId, "DigitDDL16", "-ddl 16 -cdb");
     386           0 :                 handler->CreateConfiguration("RecoDDL17", hrId, "DigitDDL17", "-ddl 17 -cdb");
     387           0 :                 handler->CreateConfiguration("RecoDDL18", hrId, "DigitDDL18", "-ddl 18 -cdb");
     388           0 :                 handler->CreateConfiguration("RecoDDL19", hrId, "DigitDDL19", "-ddl 19 -cdb");
     389           0 :                 handler->CreateConfiguration("RecoDDL20", hrId, "DigitDDL20", "-ddl 20 -cdb");
     390           0 :                 handler->CreateConfiguration("RecoDDL21", trId, "DigitDDL21", "-ddl 21 -cdb -suppress_partial_triggers");
     391           0 :                 handler->CreateConfiguration("RecoDDL22", trId, "DigitDDL22", "-ddl 22 -cdb -suppress_partial_triggers");
     392             :                 
     393             :                 const char* recoSrcs = "RecoDDL13 RecoDDL14 RecoDDL15 RecoDDL16 RecoDDL17"
     394             :                         " RecoDDL18 RecoDDL19 RecoDDL20 RecoDDL21 RecoDDL22";
     395           0 :                 handler->CreateConfiguration("MansoTracker", trackerId, recoSrcs, "");
     396             :                 
     397           0 :                 handler->CreateConfiguration("Decision", decCompId, "MansoTracker", "");
     398             :                 
     399           0 :                 TString outputSrcs = "Decision MansoTracker ";
     400           0 :                 outputSrcs += recoSrcs;
     401           0 :                 handler->CreateConfiguration("dHLT-sim", "BlockFilter", outputSrcs.Data(), "");
     402             :         
     403             :                 // Implement the dHLT-sim-fromMC dHLT simulation chain reading
     404             :                 // Monte Carlo geant hits and putting those into a tracker component.
     405           0 :                 const char* rhsId = AliHLTMUONConstants::RecHitsSourceId();
     406           0 :                 const char* trsId = AliHLTMUONConstants::TriggerRecordsSourceId();
     407           0 :                 handler->CreateConfiguration("HitsDDL13", rhsId, NULL, "-simdata -plane left  -chamber 7");
     408           0 :                 handler->CreateConfiguration("HitsDDL14", rhsId, NULL, "-simdata -plane right -chamber 7");
     409           0 :                 handler->CreateConfiguration("HitsDDL15", rhsId, NULL, "-simdata -plane left  -chamber 8");
     410           0 :                 handler->CreateConfiguration("HitsDDL16", rhsId, NULL, "-simdata -plane right -chamber 8");
     411           0 :                 handler->CreateConfiguration("HitsDDL17", rhsId, NULL, "-simdata -plane left  -chamber 9");
     412           0 :                 handler->CreateConfiguration("HitsDDL18", rhsId, NULL, "-simdata -plane right -chamber 9");
     413           0 :                 handler->CreateConfiguration("HitsDDL19", rhsId, NULL, "-simdata -plane left  -chamber 10");
     414           0 :                 handler->CreateConfiguration("HitsDDL20", rhsId, NULL, "-simdata -plane right -chamber 10");
     415           0 :                 handler->CreateConfiguration("TrigRecsDDL21", trsId, NULL, "-hitdata -plane left");
     416           0 :                 handler->CreateConfiguration("TrigRecsDDL22", trsId, NULL, "-hitdata -plane right");
     417             :                 
     418             :                 const char* dataSrcs = "HitsDDL13 HitsDDL14 HitsDDL15 HitsDDL16 HitsDDL17"
     419             :                         " HitsDDL18 HitsDDL19 HitsDDL20 TrigRecsDDL21 TrigRecsDDL22";
     420           0 :                 handler->CreateConfiguration("MansoTrackerForMC", trackerId, dataSrcs, "");
     421             :                 
     422           0 :                 handler->CreateConfiguration("DecisionForMC", decCompId, "MansoTrackerForMC", "");
     423             :                 
     424           0 :                 outputSrcs = "DecisionForMC MansoTrackerForMC ";
     425           0 :                 outputSrcs += dataSrcs;
     426           0 :                 handler->CreateConfiguration("dHLT-sim-fromMC", "BlockFilter", outputSrcs.Data(), "");
     427           0 :         }
     428             :         
     429             :         // Create a chain for generating AliESDEvent objects from dHLT raw reconstructed data.
     430           0 :         handler->CreateConfiguration("HLTOUTPubTrigRecs", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRECS' 'MUON'");
     431           0 :         handler->CreateConfiguration("HLTOUTPubMansoTracks", "AliHLTOUTPublisher", NULL, "-datatype 'MANTRACK' 'MUON'");
     432           0 :         handler->CreateConfiguration("HLTOUTPubTracks", "AliHLTOUTPublisher", NULL, "-datatype 'TRACKS  ' 'MUON'");
     433           0 :         handler->CreateConfiguration(
     434             :                         "dHLT-make-esd",
     435           0 :                         AliHLTMUONConstants::ESDMakerId(),
     436             :                         "HLTOUTPubTrigRecs HLTOUTPubMansoTracks HLTOUTPubTracks",
     437             :                         "-make_minimal_esd"
     438             :                 );
     439             :         
     440             :         // Create a chain for rootifying the raw dHLT data and dumping to file.
     441             :         // This is used during AliRoot reconstruction.
     442           0 :         handler->CreateConfiguration("HLTOUTPubTrigDbg", "AliHLTOUTPublisher", NULL, "-datatype 'TRIGRDBG' 'MUON'");
     443           0 :         handler->CreateConfiguration("HLTOUTPubHits", "AliHLTOUTPublisher", NULL, "-datatype 'RECHITS ' 'MUON'");
     444           0 :         handler->CreateConfiguration("HLTOUTPubClusters", "AliHLTOUTPublisher", NULL, "-datatype 'CLUSTERS' 'MUON'");
     445           0 :         handler->CreateConfiguration("HLTOUTPubChannels", "AliHLTOUTPublisher", NULL, "-datatype 'CHANNELS' 'MUON'");
     446           0 :         handler->CreateConfiguration("HLTOUTPubCandidates", "AliHLTOUTPublisher", NULL, "-datatype 'MNCANDID' 'MUON'");
     447           0 :         handler->CreateConfiguration("HLTOUTPubSingles", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDSIN' 'MUON'");
     448           0 :         handler->CreateConfiguration("HLTOUTPubPairs", "AliHLTOUTPublisher", NULL, "-datatype 'DECIDPAR' 'MUON'");
     449           0 :         handler->CreateConfiguration(
     450             :                         "HLTOUTConverter",
     451           0 :                         AliHLTMUONConstants::RootifierComponentId(),
     452             :                         "HLTOUTPubTrigRecs HLTOUTPubTrigDbg HLTOUTPubHits HLTOUTPubClusters"
     453             :                          " HLTOUTPubChannels HLTOUTPubMansoTracks HLTOUTPubCandidates"
     454             :                          " HLTOUTPubTracks HLTOUTPubSingles HLTOUTPubPairs",
     455             :                         ""
     456             :                 );
     457           0 :         handler->CreateConfiguration(
     458             :                         "dHLT-rootify-and-dump",
     459             :                         "ROOTFileWriter",
     460             :                         "HLTOUTConverter",
     461             :                         "-concatenate-events -datafile dHLTRawData.root -specfmt"
     462             :                 );
     463             :         
     464             :         return 0;
     465           0 : }
     466             : 
     467             : 
     468             : int AliHLTMUONAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
     469             : {
     470             :         ///
     471             :         /// Registers all available components of this module.
     472             :         /// @param [in] pHandler  instance of the component handler.
     473             :         ///
     474             :         
     475           6 :         if (pHandler == NULL) return -EINVAL;
     476           6 :         pHandler->AddComponent(new AliHLTMUONRecHitsSource);
     477           6 :         pHandler->AddComponent(new AliHLTMUONTriggerRecordsSource);
     478           6 :         pHandler->AddComponent(new AliHLTMUONDigitPublisherComponent);
     479           6 :         pHandler->AddComponent(new AliHLTMUONRootifierComponent);
     480           6 :         pHandler->AddComponent(new AliHLTMUONHitReconstructorComponent);
     481           6 :         pHandler->AddComponent(new AliHLTMUONTriggerReconstructorComponent);
     482           6 :         pHandler->AddComponent(new AliHLTMUONMansoTrackerFSMComponent);
     483           6 :         pHandler->AddComponent(new AliHLTMUONFullTrackerComponent);
     484           6 :         pHandler->AddComponent(new AliHLTMUONDecisionComponent);
     485           6 :         pHandler->AddComponent(new AliHLTMUONESDMaker);
     486           6 :         pHandler->AddComponent(new AliHLTMUONEmptyEventFilterComponent);
     487           6 :         pHandler->AddComponent(new AliHLTMUONDataCheckerComponent);
     488           6 :         pHandler->AddComponent(new AliHLTMUONClusterFinderComponent);
     489           6 :         pHandler->AddComponent(new AliHLTMUONRawDataHistoComponent);
     490           6 :         pHandler->AddComponent(new AliHLTMUONClusterHistoComponent);
     491           3 :         return 0;
     492           3 : }
     493             : 
     494             : 
     495             : int AliHLTMUONAgent::GetHandlerDescription(
     496             :                 AliHLTComponentDataType dt,
     497             : #ifdef __DEBUG
     498             :                 AliHLTUInt32_t spec,
     499             : #else
     500             :                 AliHLTUInt32_t /*spec*/,
     501             : #endif
     502             :                 AliHLTOUTHandlerDesc& desc
     503             :         ) const
     504             : {
     505             :         /// Get handler decription for MUON data in the HLTOUT data stream.
     506             :         
     507           0 :         if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
     508           0 :             dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
     509           0 :             dt == AliHLTMUONConstants::TracksBlockDataType()
     510             :            )
     511             :         {
     512             :                 HLTDebug("Indicating we can handle data type = %s and specification"
     513             :                         " = 0x%8.8X with dHLT-make-esd chain",
     514             :                         AliHLTComponent::DataType2Text(dt).c_str(),
     515             :                         spec
     516             :                 );
     517           0 :                 desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-make-esd");
     518           0 :                 return 1;
     519             :         }
     520             :         
     521           0 :         if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
     522           0 :             dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
     523           0 :             dt == AliHLTMUONConstants::RecHitsBlockDataType() or
     524           0 :             dt == AliHLTMUONConstants::ClusterBlockDataType() or
     525           0 :             dt == AliHLTMUONConstants::ChannelBlockDataType() or
     526           0 :             dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
     527           0 :             dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
     528           0 :             dt == AliHLTMUONConstants::TracksBlockDataType() or
     529           0 :             dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
     530           0 :             dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
     531             :            )
     532             :         {
     533           0 :                 if (fgRunRootifyChain)
     534             :                 {
     535             :                         HLTDebug("Indicating we can handle data type = %s and specification"
     536             :                                 " = 0x%8.8X with dHLT-rootify-and-dump chain",
     537             :                                 AliHLTComponent::DataType2Text(dt).c_str(),
     538             :                                 spec
     539             :                         );
     540           0 :                         desc = AliHLTOUTHandlerDesc(kChain, dt, "dHLT-rootify-and-dump");
     541           0 :                         return 1;
     542             :                 }
     543             :                 else
     544             :                 {
     545             :                         HLTDebug("Indicating we will ignore data type = %s and specification = 0x%8.8X",
     546             :                                 AliHLTComponent::DataType2Text(dt).c_str(),
     547             :                                 spec
     548             :                         );
     549           0 :                         desc = AliHLTOUTHandlerDesc(kProprietary, dt, "AliHLTOUTHandlerIgnore");
     550           0 :                         return 1;
     551             :                 }
     552             :         }
     553             : 
     554           0 :         if (dt == kAliHLTDataTypeEvent)
     555             :         {
     556             :                 HLTDebug("Indicating we will ignore data type = %s and specification = 0x%8.8X",
     557             :                         AliHLTComponent::DataType2Text(dt).c_str(),
     558             :                         spec
     559             :                 );
     560           0 :                 desc = AliHLTOUTHandlerDesc(kProprietary, dt, "AliHLTOUTHandlerIgnore");
     561           0 :                 return 1;
     562             :         }
     563             :         
     564           0 :         return 0;
     565           0 : }
     566             : 
     567             : 
     568             : AliHLTOUTHandler* AliHLTMUONAgent::GetOutputHandler(
     569             :                 AliHLTComponentDataType dt,
     570             : #ifdef __DEBUG
     571             :                 AliHLTUInt32_t spec
     572             : #else
     573             :                 AliHLTUInt32_t /*spec*/
     574             : #endif
     575             :         )
     576             : {
     577             :         /// Get specific handler for MUON data in the HLTOUT data stream.
     578             :         
     579             :         HLTDebug("Trying to create HLTOUT handler for data type = %s and"
     580             :                 " specification = 0x%8.8X",
     581             :                 AliHLTComponent::DataType2Text(dt).c_str(),
     582             :                 spec
     583             :         );
     584             :         
     585           0 :         if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
     586           0 :             dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
     587           0 :             dt == AliHLTMUONConstants::TracksBlockDataType()
     588             :            )
     589             :         {
     590           0 :           if(fgkESDMakerChain==NULL){
     591           0 :             fgkESDMakerChain=new AliHLTOUTHandlerChain("libAliHLTMUON.so chains=dHLT-make-esd");
     592           0 :           }
     593           0 :           return fgkESDMakerChain;
     594             :         }
     595             : 
     596           0 :         if (dt == AliHLTMUONConstants::TriggerRecordsBlockDataType() or
     597           0 :             dt == AliHLTMUONConstants::TrigRecsDebugBlockDataType() or
     598           0 :             dt == AliHLTMUONConstants::RecHitsBlockDataType() or
     599           0 :             dt == AliHLTMUONConstants::ClusterBlockDataType() or
     600           0 :             dt == AliHLTMUONConstants::ChannelBlockDataType() or
     601           0 :             dt == AliHLTMUONConstants::MansoTracksBlockDataType() or
     602           0 :             dt == AliHLTMUONConstants::MansoCandidatesBlockDataType() or
     603           0 :             dt == AliHLTMUONConstants::TracksBlockDataType() or
     604           0 :             dt == AliHLTMUONConstants::SinglesDecisionBlockDataType() or
     605           0 :             dt == AliHLTMUONConstants::PairsDecisionBlockDataType()
     606             :            )
     607             :         {
     608           0 :                 if (fgRunRootifyChain)
     609             :                 {
     610           0 :                   if(fgkRootifyDumpChain==NULL){
     611           0 :                     fgkRootifyDumpChain=new AliHLTOUTHandlerChain("libAliHLTMUON.so chains=dHLT-rootify-and-dump");
     612           0 :                   }
     613           0 :                   return fgkRootifyDumpChain;
     614             :                 }
     615             :                 else
     616             :                 {
     617           0 :                         return &fgkDataIgnoreHandler;
     618             :                 }
     619             :         }
     620             : 
     621           0 :         if (dt == kAliHLTDataTypeEvent)
     622             :         {
     623           0 :                 return &fgkDataIgnoreHandler;
     624             :         }
     625             :         
     626           0 :         return NULL;
     627           0 : }
     628             : 
     629             : 
     630             : int AliHLTMUONAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
     631             : {
     632             :         HLTDebug("Trying to delete HLTOUT handler: %p", pInstance);
     633             :         
     634           0 :         if (pInstance==NULL) return -EINVAL;
     635             : 
     636           0 :         if (pInstance==fgkESDMakerChain) {
     637           0 :           delete fgkESDMakerChain;
     638           0 :           fgkESDMakerChain=NULL;
     639           0 :         }
     640             : 
     641           0 :         if (pInstance==fgkRootifyDumpChain) {
     642           0 :           delete fgkRootifyDumpChain;
     643           0 :           fgkRootifyDumpChain=NULL;
     644           0 :         }
     645             : 
     646           0 :         return 0;
     647           0 : }

Generated by: LCOV version 1.11