From b64e4d93f40fad4f54c0f4c94fcedc929f4c22ac Mon Sep 17 00:00:00 2001 From: richterm Date: Wed, 18 Aug 2010 23:46:39 +0000 Subject: [PATCH] Making RootSchemaEvolutionComponent a CalibrationProcessor - implementing PushToTXS, default on EOR, configurable with option '-fxs' bugfixes in the argument scan of arguments '-fxs' and '-hltout' --- .../AliHLTRootSchemaEvolutionComponent.cxx | 67 ++++++++++++------- .../util/AliHLTRootSchemaEvolutionComponent.h | 42 ++++++++---- 2 files changed, 71 insertions(+), 38 deletions(-) diff --git a/HLT/BASE/util/AliHLTRootSchemaEvolutionComponent.cxx b/HLT/BASE/util/AliHLTRootSchemaEvolutionComponent.cxx index 94afbd81d50..99b5da5f342 100644 --- a/HLT/BASE/util/AliHLTRootSchemaEvolutionComponent.cxx +++ b/HLT/BASE/util/AliHLTRootSchemaEvolutionComponent.cxx @@ -24,6 +24,7 @@ #include "AliHLTRootSchemaEvolutionComponent.h" #include "AliHLTMessage.h" +#include "AliHLTReadoutList.h" #include "TObjArray.h" #include "TStreamerInfo.h" #include "TList.h" @@ -46,9 +47,9 @@ using std::accumulate; ClassImp(AliHLTRootSchemaEvolutionComponent) AliHLTRootSchemaEvolutionComponent::AliHLTRootSchemaEvolutionComponent() - : AliHLTProcessor() + : AliHLTCalibrationProcessor() , fList() - , fFlags(0) + , fFlags(kFXS) , fpStreamerInfos(NULL) , fpEventTimer(NULL) , fpCycleTimer(NULL) @@ -63,6 +64,8 @@ AliHLTRootSchemaEvolutionComponent::AliHLTRootSchemaEvolutionComponent() // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt } + +// FIXME: read below when defining an OCDB object here const char* AliHLTRootSchemaEvolutionComponent::fgkConfigurationObject=NULL; const AliHLTUInt32_t AliHLTRootSchemaEvolutionComponent::fgkTimeScale=1000000; @@ -98,18 +101,18 @@ void AliHLTRootSchemaEvolutionComponent::GetOutputDataSize(unsigned long& constB inputMultiplier=3; } -int AliHLTRootSchemaEvolutionComponent::DoInit(int argc, const char** argv) +int AliHLTRootSchemaEvolutionComponent::InitCalibration() { // see header file for class documentation int iResult=0; // default configuration from CDB + // FIXME: has to be called from AliHLTCalibrationProcessor::DoInit in order to set + // the default parameters from OCDB before the custom argument scan + // not valid at the moment because fgkConfigurationObject==NULL if (iResult>=0 && fgkConfigurationObject!=NULL) iResult=ConfigureFromCDBTObjString(fgkConfigurationObject); - // custom configuration from command line arguments - if (iResult>=0 && argc>0) iResult=ConfigureFromArgumentString(argc, argv); - if (iResult>=0) { fpStreamerInfos=new TObjArray(); if (!fpStreamerInfos) iResult=-ENOMEM; @@ -127,7 +130,7 @@ int AliHLTRootSchemaEvolutionComponent::DoInit(int argc, const char** argv) return 0; } -int AliHLTRootSchemaEvolutionComponent::DoDeinit() +int AliHLTRootSchemaEvolutionComponent::DeinitCalibration() { // see header file for class documentation if (fFileName.IsNull()==0) { @@ -152,8 +155,8 @@ int AliHLTRootSchemaEvolutionComponent::DoDeinit() return 0; } -int AliHLTRootSchemaEvolutionComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, - AliHLTComponentTriggerData& /*trigData*/ ) +int AliHLTRootSchemaEvolutionComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/, + AliHLTComponentTriggerData& /*trigData*/ ) { // see header file for class documentation int iResult=0; @@ -230,22 +233,39 @@ int AliHLTRootSchemaEvolutionComponent::DoEvent( const AliHLTComponentEventData& if (iResult>=0) { if ((TestBits(kHLTOUTatFirstEvent) && GetEventCount()==0) || - (TestBits(kHLTOUTatAllEvents)) || - (TestBits(kHLTOUTatEOR) && eventType==gkAliEventTypeEndOfRun)) { + (TestBits(kHLTOUTatAllEvents))) { PushBack(fpStreamerInfos, kAliHLTDataTypeStreamerInfo); } } - if (TestBits(kFXS) && eventType==gkAliEventTypeEndOfRun) { - // push to FXS, needs to be implemented in the base class + if (TestBits(kFXS) && fFXSPrescaler>0 && (GetEventCount()%fFXSPrescaler)==0) { + // push to FXS + AliHLTReadoutList rdList(AliHLTReadoutList::kHLT); + PushToFXS((TObject*)fpStreamerInfos, "HLT", "StreamerInfo", &rdList ); + } + + return iResult; +} + +int AliHLTRootSchemaEvolutionComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, + AliHLTComponentTriggerData& /*trigData*/) +{ + // see header file for class documentation + if (TestBits(kFXS)) { + // push to FXS + AliHLTReadoutList rdList(AliHLTReadoutList::kHLT); + PushToFXS((TObject*)fpStreamerInfos, "HLT", "StreamerInfo", &rdList ); } - if (fFileName.IsNull()==0 && eventType==gkAliEventTypeEndOfRun) { + if (fFileName.IsNull()==0) { WriteToFile(fFileName, fpStreamerInfos); fFileName.Clear(); } - if (eventType==gkAliEventTypeEndOfRun) { + if (TestBits(kHLTOUTatEOR)) { + PushBack(fpStreamerInfos, kAliHLTDataTypeStreamerInfo); + } + for (unsigned i=0; i @@ -42,10 +42,12 @@ class AliHLTMessage; * *

Optional arguments:

* - * \li -fxs<=off>
+ * \li -fxs<=[n,off]>
* push streamer info to FXS, fetched by Shuttle and store in the entry - * HLT/Calib/StreamerInfo - * default off + * HLT/Calib/StreamerInfo
+ * if a scalar greather then 0 is specified the calibration object is + * pushed during the event processing with the specified scale down
+ * always pushed on EOR, default on * \li -hltout<=[all,first,eor,off]>
* push streamer info to output, the streamer info is stored in the * events in all, the first, and/or the EOR. @@ -72,7 +74,7 @@ class AliHLTMessage; * * @ingroup alihlt_util_components */ -class AliHLTRootSchemaEvolutionComponent : public AliHLTProcessor +class AliHLTRootSchemaEvolutionComponent : public AliHLTCalibrationProcessor { public: /// standard constructor @@ -176,16 +178,28 @@ class AliHLTRootSchemaEvolutionComponent : public AliHLTProcessor AliHLTUInt32_t spec); protected: - /// inherited from AliHLTComponent: custom initialization - int DoInit( int argc, const char** argv ); - /// inherited from AliHLTComponent: cleanup - int DoDeinit(); - - /// inherited from AliHLTProcessor processing - virtual int DoEvent( const AliHLTComponentEventData& evtData, - AliHLTComponentTriggerData& trigData ); + /// inherited from AliHLTCalibrationProcessor: custom initialization + int InitCalibration(); + /// inherited from AliHLTCalibrationProcessor: custom argument scan + /// the AliHLTCalibrationProcessor so far does not use the base class + /// methods for argument scan. + int ScanArgument( int argc, const char** argv ) { + int result=ScanConfigurationArgument(argc, argv); return result>0?result-1:result; + } + /// inherited from AliHLTCalibrationProcessor: cleanup + int DeinitCalibration(); + + /// inherited from AliHLTCalibrationProcessor processing + virtual int ProcessCalibration( const AliHLTComponentEventData& evtData, + AliHLTComponentTriggerData& trigData ); - using AliHLTProcessor::DoEvent; + using AliHLTCalibrationProcessor::ProcessCalibration; + + /// inherited from AliHLTCalibrationProcessor processing + int ShipDataToFXS( const AliHLTComponentEventData& evtData, + AliHLTComponentTriggerData& trigData); + + using AliHLTCalibrationProcessor::ShipDataToFXS; /** * Inherited from AliHLTComponent -- 2.43.0