/** ESD data block
* an AliESD object of varying origin
*/
-# define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
+# define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
+/** ESD tree data block
+ * TTree with an AliESD object of varying origin
+ */
+# define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
/** HW Address selection data block
* - a selection list for 16 bit HW addresses
/** RAW DDL data specification, origin is 'any', data publisher origin correctly */
extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
+ /** ESD object data specification, origin is 'any' */
+ extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
+
/** ESD Tree data specification, origin is 'any' */
extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "TTree.h"
+#include "TFile.h"
#include "AliHLTTPCTrack.h"
#include "AliHLTTPCTrackArray.h"
#include "AliHLTTPCTrackletDataFormat.h"
fESD = new AliESDEvent;
if (fESD) {
fESD->CreateStdContent();
+ // we have to open a TFile in order to avoid warnings related to
+ // memory resident TTree's. Bad Root feature, yes ;-(
+ // Unfortunatly, opening a dummy file leads to the file to be
+ // created.
+ //TFile dummy("/tmp/dummy-to-avoid-ttree-warnigs", "CRAETE");
fTree = new TTree("esdTree", "Tree with HLT ESD objects");
if (fTree) {
fESD->WriteToTree(fTree);
{
// see header file for class documentation
int iResult=0;
- if (pTree && pESD && blocks) {
+ if (pESD && blocks) {
const AliHLTComponentBlockData* iter = NULL;
AliHLTTPCTrackletData* inPtr=NULL;
int bIsTrackSegs=0;
}
}
}
- if (iResult>=0) {
+ if (iResult>=0 && pTree) {
pTree->Fill();
}
pESD->Reset();
} else {
+ HLTError("invalid paremeter");
iResult=-EINVAL;
}
return iResult;
AliHLTTPCEsdWriterComponent::AliConverter::AliConverter()
:
- fBase(new AliHLTTPCEsdWriterComponent)
+ fBase(new AliHLTTPCEsdWriterComponent),
+ fWriteTree(1)
{
// see header file for class documentation
// or
int AliHLTTPCEsdWriterComponent::AliConverter::DoInit(int argc, const char** argv)
{
// see header file for class documentation
- return 0;
+ int iResult=0;
+ TString argument="";
+ int bMissingParam=0;
+ for (int i=0; i<argc && iResult>=0; i++) {
+ argument=argv[i];
+ if (argument.IsNull()) continue;
+
+ // -notree
+ if (argument.CompareTo("-notree")==0) {
+ fWriteTree=0;
+
+ // -tree
+ } else if (argument.CompareTo("-tree")==0) {
+ fWriteTree=1;
+
+ } else {
+ HLTError("unknown argument %s", argument.Data());
+ break;
+ }
+ }
+ if (bMissingParam) {
+ HLTError("missing parameter for argument %s", argument.Data());
+ iResult=-EINVAL;
+ }
+
+ return iResult;
}
int AliHLTTPCEsdWriterComponent::AliConverter::DoDeinit()
// see header file for class documentation
int iResult=0;
assert(fBase);
+ // we have to open a TFile in order to avoid warnings related to
+ // memory resident TTree's. Bad Root feature, yes ;-(
+ // Unfortunatly, opening a dummy file leads to the file to be
+ // created.
+ //TFile dummy("/tmp/dummy-to-avoid-ttree-warnigs", "RECREATE");
AliESDEvent* pESD = new AliESDEvent;
if (pESD && fBase) {
pESD->CreateStdContent();
- TTree* pTree = new TTree("esdTree", "Tree with HLT ESD objects");
+ TTree* pTree = NULL;
+ // TODO: Matthias 06.12.2007
+ // Tried to write the ESD directly instead to a tree, but this did not work
+ // out. Information in the ESD is different, needs investigation.
+ if (fWriteTree)
+ pTree = new TTree("esdTree", "Tree with HLT ESD objects");
if (pTree) {
pESD->WriteToTree(pTree);
+ }
- if ((iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt))>=0) {
+ if ((iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt))>=0) {
// TODO: set the specification correctly
+ if (pTree)
iResult=PushBack(pTree, kAliHLTDataTypeESDTree|kAliHLTDataOriginTPC, 0);
- }
- delete pTree;
+ else
+ iResult=PushBack(pESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC, 0);
}
+ if (pTree)
+ delete pTree;
+
delete pESD;
}
return iResult;