From 68f62aaad6ed2e76f92435da058eb172f0ecbfbe Mon Sep 17 00:00:00 2001 From: richterm Date: Thu, 6 Dec 2007 15:18:06 +0000 Subject: [PATCH] avoid memory resident TTree, TPCEsdConverter added to example macros --- HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx | 12 ++---------- HLT/TPCLib/macros/conf-tpc-esd.C | 14 ++++++++++++-- HLT/TPCLib/macros/sim-hlt-tpc.C | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx index 451b576b6fc..897da120eee 100644 --- a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx @@ -91,13 +91,9 @@ int AliHLTTPCEsdWriterComponent::AliWriter::InitWriter() 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) { + fTree->SetDirectory(0); fESD->WriteToTree(fTree); } } @@ -327,11 +323,6 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoEvent(const AliHLTComponentEven // 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(); @@ -342,6 +333,7 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoEvent(const AliHLTComponentEven if (fWriteTree) pTree = new TTree("esdTree", "Tree with HLT ESD objects"); if (pTree) { + pTree->SetDirectory(0); pESD->WriteToTree(pTree); } diff --git a/HLT/TPCLib/macros/conf-tpc-esd.C b/HLT/TPCLib/macros/conf-tpc-esd.C index 9cc431df444..e4f57fc677c 100644 --- a/HLT/TPCLib/macros/conf-tpc-esd.C +++ b/HLT/TPCLib/macros/conf-tpc-esd.C @@ -39,6 +39,16 @@ writerInput+=tracker; } - // the esd writer configuration - AliHLTConfiguration esdwconf("esd-writer", "TPCEsdWriter" , writerInput.Data(), "-datafile AliHLTESDs.root"); + bool esdFile=true; + + if (esdFile) { + // the esd writer configuration + AliHLTConfiguration sink("sink1", "TPCEsdWriter" , writerInput.Data(), "-datafile AliHLTESDs.root"); + } else { + // the esd writer configuration + AliHLTConfiguration esdcconf("esd-converter", "TPCEsdConverter" , writerInput.Data(), "-tree"); + + // the esd writer configuration + AliHLTConfiguration sink("sink1", "ROOTFileWriter" , "esd-converter", "-datafile AliHLTESDs.root"); + } } diff --git a/HLT/TPCLib/macros/sim-hlt-tpc.C b/HLT/TPCLib/macros/sim-hlt-tpc.C index d7c966a9292..ecfd711e673 100644 --- a/HLT/TPCLib/macros/sim-hlt-tpc.C +++ b/HLT/TPCLib/macros/sim-hlt-tpc.C @@ -27,6 +27,6 @@ // set the options for the HLT simulation //sim.SetRunHLT("libAliHLTTPC.so loglevel=0x3c config=conf-tpc-writer.C chains=sink1"); - sim.SetRunHLT("libAliHLTTPC.so loglevel=0x3c config=conf-tpc-esd.C chains=esd-writer"); + sim.SetRunHLT("libAliHLTTPC.so loglevel=0x3c config=conf-tpc-esd.C chains=sink1"); sim.Run(); } -- 2.39.3