From: richterm Date: Thu, 14 May 2009 07:21:26 +0000 (+0000) Subject: Renaming AliHLTReconstructorBase to AliHLTPluginBase to reflect the X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=7bf6c76dd1958da745faaf3bacd91d6a8d079b2c Renaming AliHLTReconstructorBase to AliHLTPluginBase to reflect the more common role. The change is backward campatible in order to run macros of older AliRoot versions. Adding the AliHLTPluginBase to AliHLTSimulation in order to support definition of HLT chains within the same macro. Incorporating chain definition into sim-hlt-tpc.C macro and deleting separate conf-tpc-esd.C macro. Removing command line initialization for magnetic field -> rely on OCDB object. --- diff --git a/HLT/BASE/AliHLTPluginBase.cxx b/HLT/BASE/AliHLTPluginBase.cxx new file mode 100644 index 00000000000..7fb83f970a3 --- /dev/null +++ b/HLT/BASE/AliHLTPluginBase.cxx @@ -0,0 +1,64 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTPluginBase.cxx + @author Matthias Richter + @date + @brief Base class for AliRoot HLT plugins. +*/ + +#include "AliHLTPluginBase.h" +#include "AliHLTSystem.h" + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTPluginBase) + +AliHLTPluginBase::AliHLTPluginBase() +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + fNofInstances++; +} + +AliHLTPluginBase::~AliHLTPluginBase() +{ + // see header file for class documentation + if (--fNofInstances<=0) delete fpSystem; + fpSystem=NULL; +} + +void AliHLTPluginBase::InitInstance() +{ + // see header file for class documentation + if (!fpSystem) fpSystem=new AliHLTSystem; +} + +AliHLTSystem* AliHLTPluginBase::GetInstance() +{ + // see header file for class documentation + if (!fpSystem) InitInstance(); + return fpSystem; +} + + +AliHLTSystem* AliHLTPluginBase::fpSystem=NULL; + +int AliHLTPluginBase::fNofInstances=0; diff --git a/HLT/BASE/AliHLTPluginBase.h b/HLT/BASE/AliHLTPluginBase.h new file mode 100644 index 00000000000..f4017278e46 --- /dev/null +++ b/HLT/BASE/AliHLTPluginBase.h @@ -0,0 +1,67 @@ +// $Id$ + +#ifndef ALIHLTPLUGINBASE_H +#define ALIHLTPLUGINBASE_H +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTPluginBase.h + @author Matthias Richter + @date + @brief Base class for AliRoot HLT plugins. +*/ + +// see below for class documentation +// or +// refer to README to build package +// or +// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + +#include "TObject.h" + +class AliHLTSystem; + +/** + * @class AliHLTPluginBase + * Base class for AliRoot HLT plugins. + * + * In order to allow definitions of HLT chains in the same macro as + * the simulation/reconstruction, a global instance of AliHLTSystem + * is required to make the registration of configurations work. + * + * AliHLTPlugin, AliRawReaderHLT and AliHLTSimulation all use + * the global AliHLTSystem instance hosted by this base class. + */ +class AliHLTPluginBase { + public: + AliHLTPluginBase(); + /** destructor */ + virtual ~AliHLTPluginBase(); + + /** + * Init the global AliHLTSystem instance. + */ + static void InitInstance(); + + /** + * Get the global AliHLTSystem instance. + */ + static AliHLTSystem* GetInstance(); + + protected: + + private: + /** copy constructor prohibited */ + AliHLTPluginBase(const AliHLTPluginBase& src); + /** assignment operator prohibited */ + AliHLTPluginBase& operator=(const AliHLTPluginBase& src); + + static AliHLTSystem* fpSystem; //! HLT steering object + + static int fNofInstances; + + ClassDef(AliHLTPluginBase, 0) // base class for the HLT reconstruction +}; + +#endif diff --git a/HLT/BASE/AliHLTReconstructorBase.cxx b/HLT/BASE/AliHLTReconstructorBase.cxx index e3518287a08..e78cc3c5bfd 100644 --- a/HLT/BASE/AliHLTReconstructorBase.cxx +++ b/HLT/BASE/AliHLTReconstructorBase.cxx @@ -19,11 +19,10 @@ /** @file AliHLTReconstructorBase.cxx @author Matthias Richter @date - @brief Base class for HLT reconstruction classes. + @brief AliHLTPluginBase child for backward compatibility. */ #include "AliHLTReconstructorBase.h" -#include "AliHLTSystem.h" /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTReconstructorBase) @@ -35,30 +34,9 @@ AliHLTReconstructorBase::AliHLTReconstructorBase() // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - fNofInstances++; } AliHLTReconstructorBase::~AliHLTReconstructorBase() { // see header file for class documentation - if (--fNofInstances<=0) delete fpSystem; - fpSystem=NULL; } - -void AliHLTReconstructorBase::InitInstance() -{ - // see header file for class documentation - if (!fpSystem) fpSystem=new AliHLTSystem; -} - -AliHLTSystem* AliHLTReconstructorBase::GetInstance() -{ - // see header file for class documentation - if (!fpSystem) InitInstance(); - return fpSystem; -} - - -AliHLTSystem* AliHLTReconstructorBase::fpSystem=NULL; - -int AliHLTReconstructorBase::fNofInstances=0; diff --git a/HLT/BASE/AliHLTReconstructorBase.h b/HLT/BASE/AliHLTReconstructorBase.h index 69eb99da171..bb546b9c45a 100644 --- a/HLT/BASE/AliHLTReconstructorBase.h +++ b/HLT/BASE/AliHLTReconstructorBase.h @@ -9,7 +9,7 @@ /** @file AliHLTReconstructorBase.h @author Matthias Richter @date - @brief Base class for HLT reconstruction classes. + @brief AliHLTPluginBase child for backward compatibility. */ // see below for class documentation @@ -18,44 +18,23 @@ // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt -#include "TObject.h" - -class AliHLTSystem; +#include "AliHLTPluginBase.h" /** * @class AliHLTReconstructorBase - * Base class for HLT reconstruction classes. AliHLTReconstructor and - * AliRawReaderHLT both use the global AliHLTSystem instance. This - * base class hosts the global instance. + * This class was the former name of the base class for HLT + * reconstruction instances. It has evolved to a more general + * 'plugin' base class and the name has been changed to + * AliHLTPluginBase */ -class AliHLTReconstructorBase { +class AliHLTReconstructorBase : public AliHLTPluginBase { public: AliHLTReconstructorBase(); - /** destructor */ - virtual ~AliHLTReconstructorBase(); - - /** - * Init the global AliHLTSystem instance. - */ - static void InitInstance(); - - /** - * Get the global AliHLTSystem instance. - */ - static AliHLTSystem* GetInstance(); + ~AliHLTReconstructorBase(); protected: private: - /** copy constructor prohibited */ - AliHLTReconstructorBase(const AliHLTReconstructorBase& src); - /** assignment operator prohibited */ - AliHLTReconstructorBase& operator=(const AliHLTReconstructorBase& src); - - static AliHLTSystem* fpSystem; //! HLT steering object - - static int fNofInstances; - - ClassDef(AliHLTReconstructorBase, 0) // base class for the HLT reconstruction + ClassDef(AliHLTReconstructorBase, 0) // AliHLTPluginBase child for backward compatibility }; #endif diff --git a/HLT/CMake_libHLTbase.txt b/HLT/CMake_libHLTbase.txt index 6daa5bc5eff..07d5bff8a7b 100644 --- a/HLT/CMake_libHLTbase.txt +++ b/HLT/CMake_libHLTbase.txt @@ -5,6 +5,7 @@ BASE/AliHLTComponent.cxx BASE/AliHLTComponentHandler.cxx BASE/AliHLTSystem.cxx BASE/AliHLTReconstructorBase.cxx +BASE/AliHLTPluginBase.cxx BASE/AliHLTProcessor.cxx BASE/AliHLTCalibrationProcessor.cxx BASE/AliHLTConfiguration.cxx diff --git a/HLT/ITS/macros/rec-sdd-from-hltout.C b/HLT/ITS/macros/rec-sdd-from-hltout.C index 19c7f0b1eca..32fa5823f32 100644 --- a/HLT/ITS/macros/rec-sdd-from-hltout.C +++ b/HLT/ITS/macros/rec-sdd-from-hltout.C @@ -25,8 +25,7 @@ void rec_sdd_from_hltout() ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/ITS/macros/rec-spd-cluster.C b/HLT/ITS/macros/rec-spd-cluster.C index aa2f0d9fff9..2feca880ef3 100644 --- a/HLT/ITS/macros/rec-spd-cluster.C +++ b/HLT/ITS/macros/rec-spd-cluster.C @@ -18,8 +18,7 @@ void rec_spd_cluster(const char* input="./", char* opt="") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/ITS/macros/rec-ssd-cluster.C b/HLT/ITS/macros/rec-ssd-cluster.C index 883618f6805..75df6a19ad6 100644 --- a/HLT/ITS/macros/rec-ssd-cluster.C +++ b/HLT/ITS/macros/rec-ssd-cluster.C @@ -18,8 +18,7 @@ void rec_ssd_cluster(const char* input="./", char* opt="") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/MUON/macros/HLToutputTodHLTRootObjects.C b/HLT/MUON/macros/HLToutputTodHLTRootObjects.C index 58a6e349c87..e672b88e241 100644 --- a/HLT/MUON/macros/HLToutputTodHLTRootObjects.C +++ b/HLT/MUON/macros/HLToutputTodHLTRootObjects.C @@ -17,7 +17,7 @@ // $Id: $ #if !defined(__CINT__) || defined(__MAKECINT__) -#include "AliHLTReconstructorBase.h" +#include "AliHLTPluginBase.h" #include "AliHLTConfiguration.h" #include "AliReconstruction.h" #include @@ -54,7 +54,7 @@ void HLToutputTodHLTRootObjects(const char* dataSource = "./", bool dumpBinary = { // setup of the HLT system gSystem->Load("libHLTrec.so"); - AliHLTSystem* sys = AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* sys = AliHLTPluginBase::GetInstance(); if (sys == NULL) { cerr << "FATAL ERROR: Cannot get HLT system instance." << endl; diff --git a/HLT/TPCLib/macros/activePadsTest.C b/HLT/TPCLib/macros/activePadsTest.C index 7db0ea24996..2250d44e811 100644 --- a/HLT/TPCLib/macros/activePadsTest.C +++ b/HLT/TPCLib/macros/activePadsTest.C @@ -62,8 +62,7 @@ void activePadsTest(const char* input="./"){ // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); // AliCDBManager* pManager=AliCDBManager::Instance(NULL, 0); // pManager->SetRun(0); diff --git a/HLT/TPCLib/macros/cal-hlt-tpc-offline.C b/HLT/TPCLib/macros/cal-hlt-tpc-offline.C index 461e4ed5a40..0b52610cf26 100644 --- a/HLT/TPCLib/macros/cal-hlt-tpc-offline.C +++ b/HLT/TPCLib/macros/cal-hlt-tpc-offline.C @@ -41,8 +41,7 @@ void cal_hlt_tpc_offline(const char* input="./") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); //gHLT.SwitchAliLog(0); diff --git a/HLT/TPCLib/macros/conf-tpc-esd.C b/HLT/TPCLib/macros/conf-tpc-esd.C deleted file mode 100644 index b5d0726c2cb..00000000000 --- a/HLT/TPCLib/macros/conf-tpc-esd.C +++ /dev/null @@ -1,111 +0,0 @@ -// $Id$ -/* - * Configuration macro defining a chain running the HLT Conformal mapping - * tracker embedded into AliRoot simulation. - * The reconstruction is done from the TPC digits. - * - * Several output options are possible: - * - sink-writeall FileWriter writing all blocks - * - sink-esd-file write ESD using the TPCEsdWriter - * - sink-esd write ESD using the TPCEsdConverter and EsdCollector - * - sink-clusters relay cluster blocks to HLTOUT - * - * @author Matthias.Richter@ift.uib.no - * @ingroup alihlt_tpc - */ -{ - // load TPCParam from OCDB - const char* cdbEntry="TPC/Calib/Parameters"; - AliCDBManager* pMan=AliCDBManager::Instance(); - AliTPCParam* pTPCParam=NULL; - if (pMan) { - AliCDBEntry *pEntry = pMan->Get(cdbEntry); - if (pEntry && - pEntry->GetObject() && - (pTPCParam=dynamic_cast(pEntry->GetObject()))) { - } else { - HLTWarning("can not load AliTPCParam from CDB entry %s", cdbEntry); - } - } - - int iMinSlice=0; - int iMaxSlice=35; - int iMinPart=0; - int iMaxPart=5; - TString mergerInput; - TString writerInput; - TString sinkClusterInput; - for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { - TString trackerInput; - for (int part=iMinPart; part<=iMaxPart; part++) { - TString arg, publisher, cf; - - // digit publisher components - arg.Form("-slice %d -partition %d", slice, part); - publisher.Form("DP_%02d_%d", slice, part); - AliHLTConfiguration pubconf(publisher.Data(), "TPCDigitPublisher", NULL , arg.Data()); - - // cluster finder components - arg="-timebins "; - if (pTPCParam) arg+=pTPCParam->GetMaxTBin()+1; - else arg+=446; // old simulated data - arg+=" -sorted "; - cf.Form("CF_%02d_%d", slice, part); - AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data()); - if (trackerInput.Length()>0) trackerInput+=" "; - trackerInput+=cf; - if (sinkClusterInput.Length()>0) sinkClusterInput+=" "; - sinkClusterInput+=cf; - } - TString tracker; - // tracker finder components - tracker.Form("TR_%02d", slice); - AliHLTConfiguration trackerconf(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "-pp-run -solenoidBz 0.5"); - //AliHLTConfiguration trackerconf(tracker.Data(), "TPCCATracker", trackerInput.Data(), "-solenoidBz 0.5"); - - //add all trackers to writer input. Include if you would like all slice tracks written. - //if (writerInput.Length()>0) writerInput+=" "; - //writerInput+=tracker; - - // add all clusterfinders to the writer input - if (writerInput.Length()>0) writerInput+=" "; - writerInput+=trackerInput; - - if (mergerInput.Length()>0) mergerInput+=" "; - mergerInput+=tracker; - - } - - // GlobalMerger component - AliHLTConfiguration mergerconf("globalmerger","TPCGlobalMerger",mergerInput.Data(),""); - - if (writerInput.Length()>0) writerInput+=" "; - writerInput+="globalmerger"; - - ////////////////////////////////////////////////////////////////////////////////////////// - // - // output section - // - - ////////////////////////////////////////////////////////////////////////////////////////// - // sink1: id=sink-writeall write all blocks - AliHLTConfiguration sink1("sink-writeall", "FileWriter" , writerInput.Data(), "-specfmt -subdir=event_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); - - - ////////////////////////////////////////////////////////////////////////////////////////// - // sink2: id=sink-esd-file write ESD using the TPCEsdWriter - AliHLTConfiguration sink2("sink-esd-file", "TPCEsdWriter" , "globalmerger", "-datafile AliHLTESDs.root"); - - - ////////////////////////////////////////////////////////////////////////////////////////// - // sink3: id=sink-esd add ESD to HLTOUT using the TPCEsdConverter - - // the esd converter configuration - //AliHLTConfiguration sink3("sink-esd", "TPCEsdConverter" , "globalmerger", ""); - AliHLTConfiguration sink3("sink-esd", "TPCEsdConverter" , mergerInput.Data(), ""); - - - ////////////////////////////////////////////////////////////////////////////////////////// - // sink4: id=sink-clusters add cluster data blocks to HLTOUT - AliHLTConfiguration sink4("sink-clusters", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC '"); -} diff --git a/HLT/TPCLib/macros/histogramHandlerTest.C b/HLT/TPCLib/macros/histogramHandlerTest.C index 076ccc7116f..7366fe29005 100644 --- a/HLT/TPCLib/macros/histogramHandlerTest.C +++ b/HLT/TPCLib/macros/histogramHandlerTest.C @@ -43,8 +43,7 @@ void histogramHandlerTest(const char* input="./"){ // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/TPCLib/macros/noiseMapHistoHandler.C b/HLT/TPCLib/macros/noiseMapHistoHandler.C index 8ae26294ad3..f7d6973d1e0 100644 --- a/HLT/TPCLib/macros/noiseMapHistoHandler.C +++ b/HLT/TPCLib/macros/noiseMapHistoHandler.C @@ -54,8 +54,7 @@ void noiseMapHistoHandler(const char* input="./"){ // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/TPCLib/macros/rec-hlt-tpc-ca.C b/HLT/TPCLib/macros/rec-hlt-tpc-ca.C index 111817bf0fc..6ad97886376 100644 --- a/HLT/TPCLib/macros/rec-hlt-tpc-ca.C +++ b/HLT/TPCLib/macros/rec-hlt-tpc-ca.C @@ -44,8 +44,7 @@ void rec_hlt_tpc_ca(const char* input="./", bool bUseClusterFinderDecoder=true) // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/TPCLib/macros/rec-hlt-tpc-offline.C b/HLT/TPCLib/macros/rec-hlt-tpc-offline.C index 53a2de9fdb1..989a51f0169 100644 --- a/HLT/TPCLib/macros/rec-hlt-tpc-offline.C +++ b/HLT/TPCLib/macros/rec-hlt-tpc-offline.C @@ -39,8 +39,7 @@ void rec_hlt_tpc_offline(const char* input="./") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); //gHLT.SwitchAliLog(0); diff --git a/HLT/TPCLib/macros/rec-hlt-tpc-tracks.C b/HLT/TPCLib/macros/rec-hlt-tpc-tracks.C index c0ea263e6ad..71acb8750ca 100644 --- a/HLT/TPCLib/macros/rec-hlt-tpc-tracks.C +++ b/HLT/TPCLib/macros/rec-hlt-tpc-tracks.C @@ -43,8 +43,7 @@ void rec_hlt_tpc_tracks(const char* input="./") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/TPCLib/macros/rec-hlt-tpc.C b/HLT/TPCLib/macros/rec-hlt-tpc.C index 25c451a9a37..bede1c32271 100644 --- a/HLT/TPCLib/macros/rec-hlt-tpc.C +++ b/HLT/TPCLib/macros/rec-hlt-tpc.C @@ -55,8 +55,7 @@ void rec_hlt_tpc(const char* input="./", char* opt="decoder ESD") // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); /////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/HLT/TPCLib/macros/sim-hlt-tpc.C b/HLT/TPCLib/macros/sim-hlt-tpc.C index 0a1bc917708..197d31db621 100644 --- a/HLT/TPCLib/macros/sim-hlt-tpc.C +++ b/HLT/TPCLib/macros/sim-hlt-tpc.C @@ -23,8 +23,128 @@ AliHLTLogging log; //log.SwitchAliLog(0); - AliSimulation sim; + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // init the HLT system in order to define the analysis chain below + // + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // define the analysis chain + // + + // load TPCParam from OCDB + const char* cdbEntry="TPC/Calib/Parameters"; + AliCDBManager* pMan=AliCDBManager::Instance(); + AliTPCParam* pTPCParam=NULL; + if (pMan) { + if (!pMan->IsDefaultStorageSet()) { + pMan->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + pMan->SetRun(0); + } + AliCDBEntry *pEntry = pMan->Get(cdbEntry); + if (pEntry && + pEntry->GetObject() && + (pTPCParam=dynamic_cast(pEntry->GetObject()))) { + } else { + HLTWarning("can not load AliTPCParam from CDB entry %s", cdbEntry); + } + } + + int iMinSlice=0; + int iMaxSlice=35; + int iMinPart=0; + int iMaxPart=5; + TString mergerInput; + TString writerInput; + TString sinkClusterInput; + for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { + TString trackerInput; + for (int part=iMinPart; part<=iMaxPart; part++) { + TString arg, publisher, cf; + + // digit publisher components + arg.Form("-slice %d -partition %d", slice, part); + publisher.Form("DP_%02d_%d", slice, part); + AliHLTConfiguration pubconf(publisher.Data(), "TPCDigitPublisher", NULL , arg.Data()); + + // cluster finder components + arg="-timebins "; + if (pTPCParam) arg+=pTPCParam->GetMaxTBin()+1; + else arg+=446; // old simulated data + arg+=" -sorted "; + cf.Form("CF_%02d_%d", slice, part); + AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data()); + if (trackerInput.Length()>0) trackerInput+=" "; + trackerInput+=cf; + if (sinkClusterInput.Length()>0) sinkClusterInput+=" "; + sinkClusterInput+=cf; + } + TString tracker; + // tracker finder components + tracker.Form("TR_%02d", slice); + AliHLTConfiguration trackerconf(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "-pp-run"); + + //add all trackers to writer input. Include if you would like all slice tracks written. + //if (writerInput.Length()>0) writerInput+=" "; + //writerInput+=tracker; + + // add all clusterfinders to the writer input + if (writerInput.Length()>0) writerInput+=" "; + writerInput+=trackerInput; + + if (mergerInput.Length()>0) mergerInput+=" "; + mergerInput+=tracker; + + } + + // GlobalMerger component + AliHLTConfiguration mergerconf("globalmerger","TPCGlobalMerger",mergerInput.Data(),""); + if (writerInput.Length()>0) writerInput+=" "; + writerInput+="globalmerger"; + + ////////////////////////////////////////////////////////////////////////////////////////// + // + // output section + // + + ////////////////////////////////////////////////////////////////////////////////////////// + // sink1: id=sink-writeall write all blocks + AliHLTConfiguration sink1("sink-writeall", "FileWriter" , writerInput.Data(), "-specfmt -subdir=event_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); + + + ////////////////////////////////////////////////////////////////////////////////////////// + // sink2: id=sink-esd-file write ESD using the TPCEsdWriter + AliHLTConfiguration sink2("sink-esd-file", "TPCEsdWriter" , "globalmerger", "-datafile AliHLTESDs.root"); + + + ////////////////////////////////////////////////////////////////////////////////////////// + // sink3: id=sink-esd add ESD to HLTOUT using the TPCEsdConverter + + // the esd converter configuration + //AliHLTConfiguration sink3("sink-esd", "TPCEsdConverter" , "globalmerger", ""); + AliHLTConfiguration sink3("sink-esd", "TPCEsdConverter" , mergerInput.Data(), ""); + + + ////////////////////////////////////////////////////////////////////////////////////////// + // sink4: id=sink-clusters add cluster data blocks to HLTOUT + AliHLTConfiguration sink4("sink-clusters", "BlockFilter" , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC '"); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Init and run the HLT simulation + // All but HLT simulation is switched off + // + AliSimulation sim; + // switch of simulation and data generation // comment all that stuff to also simulate the events and data sim.SetRunGeneration(kFALSE); @@ -32,9 +152,11 @@ sim.SetMakeSDigits(""); sim.SetMakeDigitsFromHits(""); sim.SetMakeTrigger(""); + sim.SetRunQA(":"); + //sim.SetWriteRawData("HLT TPC", "raw.root", kTRUE); // set the options for the HLT simulation sim.SetRunHLT("libAliHLTUtil.so libAliHLTTPC.so loglevel=0x7c " - "config=$ALICE_ROOT/HLT/TPCLib/macros/conf-tpc-esd.C chains=sink-esd,sink-clusters"); + "chains=sink-esd,sink-clusters"); sim.Run(); } diff --git a/HLT/TPCLib/test/compareDigitReaders.C b/HLT/TPCLib/test/compareDigitReaders.C index 8acf852391f..98ad6dbee7b 100644 --- a/HLT/TPCLib/test/compareDigitReaders.C +++ b/HLT/TPCLib/test/compareDigitReaders.C @@ -62,8 +62,7 @@ int compareDigitReaders(const char* input, int iMinEvent=-1, int iMaxEvent=-1) ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/benchmark/macros/bench-externaltrackparam-sequence.C b/HLT/benchmark/macros/bench-externaltrackparam-sequence.C index 12a1d21f11f..31aad9ecd9a 100644 --- a/HLT/benchmark/macros/bench-externaltrackparam-sequence.C +++ b/HLT/benchmark/macros/bench-externaltrackparam-sequence.C @@ -17,8 +17,7 @@ void bench_externaltrackparam_sequence(int events=100) // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); gHLT->SetGlobalLoggingLevel(0x7c); /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/HLT/exa/extract-ddlraw.C b/HLT/exa/extract-ddlraw.C index d55b81e7368..66f9d5ed403 100644 --- a/HLT/exa/extract-ddlraw.C +++ b/HLT/exa/extract-ddlraw.C @@ -58,8 +58,7 @@ void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/exa/extract-hltout-payload.C b/HLT/exa/extract-hltout-payload.C index 65d2a9d75af..fe425a9e5ea 100644 --- a/HLT/exa/extract-hltout-payload.C +++ b/HLT/exa/extract-hltout-payload.C @@ -32,8 +32,7 @@ void extract_hltout_payload(const char* input, const char* selection="", int max ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/exa/hltout-collect-esd.C b/HLT/exa/hltout-collect-esd.C index 902dc4c0de5..d68a3e782c1 100644 --- a/HLT/exa/hltout-collect-esd.C +++ b/HLT/exa/hltout-collect-esd.C @@ -27,8 +27,7 @@ void hltout_collect_esd() ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase!::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/exa/publish-rawreader-data.C b/HLT/exa/publish-rawreader-data.C index 1562086a211..c562b64e348 100644 --- a/HLT/exa/publish-rawreader-data.C +++ b/HLT/exa/publish-rawreader-data.C @@ -47,8 +47,7 @@ void publish_rawreader_data(const char* input, int iMinDDLno, int iMaxDDLno) ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/exa/rec-from-hltout.C b/HLT/exa/rec-from-hltout.C index 5ed44149db1..5c8e29c7b40 100644 --- a/HLT/exa/rec-from-hltout.C +++ b/HLT/exa/rec-from-hltout.C @@ -27,8 +27,7 @@ void rec_from_hltout() ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/exa/split-hltout.C b/HLT/exa/split-hltout.C index 7c5dbedd232..4e569f7c53d 100644 --- a/HLT/exa/split-hltout.C +++ b/HLT/exa/split-hltout.C @@ -26,8 +26,7 @@ void split_hltout() ///////////////////////////////////////////////////////////////////////// // // setup of the HLT system - gSystem->Load("libHLTrec"); - AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); if (!pHLT) { cerr << "fatal error: can not get HLT instance" << endl; } diff --git a/HLT/global/macros/rec-hlt-global-merger.C b/HLT/global/macros/rec-hlt-global-merger.C index 18a3a5637e8..698f4b23722 100644 --- a/HLT/global/macros/rec-hlt-global-merger.C +++ b/HLT/global/macros/rec-hlt-global-merger.C @@ -43,8 +43,7 @@ void rec_hlt_global_merger(const char* input="./", bool bUseClusterFinderDecoder // // init the HLT system in order to define the analysis chain below // - gSystem->Load("libHLTrec.so"); - AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); gHLT->SetGlobalLoggingLevel(0x4); /* enum AliHLTComponentLogSeverity { kHLTLogNone = 0, diff --git a/HLT/libHLTbase.pkg b/HLT/libHLTbase.pkg index a6405fd5a26..6b304164d4b 100644 --- a/HLT/libHLTbase.pkg +++ b/HLT/libHLTbase.pkg @@ -7,6 +7,7 @@ CLASS_HDRS:= AliHLTComponent.h \ AliHLTComponentHandler.h \ AliHLTSystem.h \ AliHLTReconstructorBase.h \ + AliHLTPluginBase.h \ AliHLTProcessor.h \ AliHLTCalibrationProcessor.h \ AliHLTConfiguration.h \ diff --git a/HLT/rec/AliHLTReconstructor.cxx b/HLT/rec/AliHLTReconstructor.cxx index 5a35dc4b539..40e19e071a6 100644 --- a/HLT/rec/AliHLTReconstructor.cxx +++ b/HLT/rec/AliHLTReconstructor.cxx @@ -39,7 +39,7 @@ ClassImp(AliHLTReconstructor) AliHLTReconstructor::AliHLTReconstructor() : AliReconstructor(), - AliHLTReconstructorBase(), + AliHLTPluginBase(), fFctProcessHLTOUT(NULL), fpEsdManager(NULL) { @@ -49,7 +49,7 @@ AliHLTReconstructor::AliHLTReconstructor() AliHLTReconstructor::AliHLTReconstructor(const char* options) : AliReconstructor(), - AliHLTReconstructorBase(), + AliHLTPluginBase(), fFctProcessHLTOUT(NULL), fpEsdManager(NULL) { diff --git a/HLT/rec/AliHLTReconstructor.h b/HLT/rec/AliHLTReconstructor.h index 5b9f2d66523..57176fcf3e7 100644 --- a/HLT/rec/AliHLTReconstructor.h +++ b/HLT/rec/AliHLTReconstructor.h @@ -13,7 +13,7 @@ */ #include "AliReconstructor.h" -#include "AliHLTReconstructorBase.h" +#include "AliHLTPluginBase.h" class AliHLTSystem; class AliRawReader; @@ -190,7 +190,7 @@ class AliHLTEsdManager; * @ingroup alihlt_aliroot_reconstruction * @section sec_alihltreconstructor_members Class members */ -class AliHLTReconstructor: public AliReconstructor, public AliHLTReconstructorBase { +class AliHLTReconstructor: public AliReconstructor, public AliHLTPluginBase { public: /** standard constructor */ AliHLTReconstructor(); diff --git a/HLT/rec/AliRawReaderHLT.cxx b/HLT/rec/AliRawReaderHLT.cxx index 4a6caa1cac5..84644c141a4 100644 --- a/HLT/rec/AliRawReaderHLT.cxx +++ b/HLT/rec/AliRawReaderHLT.cxx @@ -45,7 +45,7 @@ ClassImp(AliRawReaderHLT) AliRawReaderHLT::AliRawReaderHLT(AliRawReader* pRawreader, const char* options) : AliRawReader(), - AliHLTReconstructorBase(), + AliHLTPluginBase(), fpParentReader(pRawreader), fOptions(), fSystemOptions(), diff --git a/HLT/rec/AliRawReaderHLT.h b/HLT/rec/AliRawReaderHLT.h index 118461c2c32..6f034d0084d 100644 --- a/HLT/rec/AliRawReaderHLT.h +++ b/HLT/rec/AliRawReaderHLT.h @@ -21,7 +21,7 @@ #include "AliHLTDataTypes.h" #include "AliRawReader.h" // RAW, base class -#include "AliHLTReconstructorBase.h" +#include "AliHLTPluginBase.h" #include "TString.h" #include @@ -116,7 +116,7 @@ class AliHLTOUTHandler; * * @ingroup alihlt_aliroot_reconstruction */ -class AliRawReaderHLT : public AliRawReader, public AliHLTReconstructorBase { +class AliRawReaderHLT : public AliRawReader, public AliHLTPluginBase { public: /** constructor */ AliRawReaderHLT(AliRawReader* pParentReader, const char* options=NULL); diff --git a/HLT/sim/AliHLTSimulation.cxx b/HLT/sim/AliHLTSimulation.cxx index 653d93c400e..b0c56f2c139 100644 --- a/HLT/sim/AliHLTSimulation.cxx +++ b/HLT/sim/AliHLTSimulation.cxx @@ -37,6 +37,7 @@ #include "AliCDBId.h" #include "AliCDBMetaData.h" #include "AliHLTSystem.h" +#include "AliHLTPluginBase.h" #include "AliRawReaderFile.h" #include "AliRawReaderDate.h" #include "AliRawReaderRoot.h" @@ -53,7 +54,7 @@ ClassImp(AliHLTSimulation); AliHLTSimulation::AliHLTSimulation() : fOptions(), - fpSystem(NULL), + fpPluginBase(new AliHLTPluginBase), fpRawReader(NULL) { // see header file for class documentation @@ -66,10 +67,9 @@ AliHLTSimulation::AliHLTSimulation() AliHLTSimulation::~AliHLTSimulation() { // see header file for function documentation - if (fpSystem) { - delete fpSystem; - } - fpSystem=NULL; + if (fpPluginBase) delete fpPluginBase; + fpPluginBase=NULL; + if (fpRawReader) { delete fpRawReader; } @@ -96,12 +96,17 @@ int AliHLTSimulation::Init(AliRunLoader* pRunLoader, const char* options) fOptions=options; TString sysOp; - if (!fpSystem) fpSystem=new AliHLTSystem; - if (!fpSystem) { - AliError("can not create AliHLTSystem object"); + if(!fpPluginBase) { + AliError("internal initialization failed"); + return -EINVAL; + } + + AliHLTSystem* pSystem=fpPluginBase->GetInstance(); + if (!pSystem) { + AliError("can not get AliHLTSystem instance"); return -ENOMEM; } - if (fpSystem->CheckStatus(AliHLTSystem::kError)) { + if (pSystem->CheckStatus(AliHLTSystem::kError)) { AliError("HLT system in error state"); return -EFAULT; } @@ -178,13 +183,13 @@ int AliHLTSimulation::Init(AliRunLoader* pRunLoader, const char* options) } // scan options - if (fpSystem->ScanOptions(sysOp.Data())<0) { + if (pSystem->ScanOptions(sysOp.Data())<0) { AliError("error setting options for HLT system"); return -EINVAL; } - if (!fpSystem->CheckStatus(AliHLTSystem::kReady)) { - if ((fpSystem->Configure(fpRawReader, pRunLoader))<0) { + if (!pSystem->CheckStatus(AliHLTSystem::kReady)) { + if ((pSystem->Configure(fpRawReader, pRunLoader))<0) { AliError("error during HLT system configuration"); return -EFAULT; } @@ -197,6 +202,11 @@ int AliHLTSimulation::Init(AliRunLoader* pRunLoader, const char* options) int AliHLTSimulation::Run(AliRunLoader* pRunLoader) { // HLT reconstruction for simulated data + if(!fpPluginBase) { + AliError("internal initialization failed"); + return -EINVAL; + } + if(!pRunLoader) { AliError("Missing RunLoader! 0x0"); return -EINVAL; @@ -205,24 +215,30 @@ int AliHLTSimulation::Run(AliRunLoader* pRunLoader) int nEvents = pRunLoader->GetNumberOfEvents(); int iResult=0; - if (fpSystem->CheckStatus(AliHLTSystem::kError)) { + AliHLTSystem* pSystem=fpPluginBase->GetInstance(); + if (!pSystem) { + AliError("can not get AliHLTSystem instance"); + return -ENOMEM; + } + + if (pSystem->CheckStatus(AliHLTSystem::kError)) { AliError("HLT system in error state"); return -EFAULT; } // Note: the rawreader is already placed at the first event - if ((iResult=fpSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) { - fpSystem->FillESD(0, pRunLoader, NULL); + if ((iResult=pSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) { + pSystem->FillESD(0, pRunLoader, NULL); for (int i=1; iNextEvent()) { AliError("mismatch in event count, rawreader corrupted"); break; } - fpSystem->Reconstruct(1, pRunLoader, fpRawReader); - fpSystem->FillESD(i, pRunLoader, NULL); + pSystem->Reconstruct(1, pRunLoader, fpRawReader); + pSystem->FillESD(i, pRunLoader, NULL); } // send specific 'event' to execute the stop sequence - fpSystem->Reconstruct(0, NULL, NULL); + pSystem->Reconstruct(0, NULL, NULL); } return iResult; } diff --git a/HLT/sim/AliHLTSimulation.h b/HLT/sim/AliHLTSimulation.h index 1bcbe19093d..9a955f932e6 100644 --- a/HLT/sim/AliHLTSimulation.h +++ b/HLT/sim/AliHLTSimulation.h @@ -60,7 +60,7 @@ #include "TObject.h" #include "TString.h" class AliRunLoader; -class AliHLTSystem; +class AliHLTPluginBase; class AliRawReader; /** @@ -116,13 +116,13 @@ class AliHLTSimulation : public TObject { /* current options */ TString fOptions; //!transient - /* HLT steering object */ - AliHLTSystem* fpSystem; //!transient + /** base class for AliRoot HLT plugins */ + AliHLTPluginBase* fpPluginBase; //!transient - /* RAW reader instance for chains which need RAW data as input */ - AliRawReader* fpRawReader; //!transient + /** RAW reader instance for chains which need RAW data as input */ + AliRawReader* fpRawReader; //!transient - ClassDef(AliHLTSimulation, 1) + ClassDef(AliHLTSimulation, 2) }; #define ALIHLTSIMULATION_LIBRARY "libHLTsim.so"