ROOT logo
/**
 * @file rootfilepublisher.C
 * @brief Macro for testing ROOT-file publishing and writing
 *
 * This macro is a testing/example macro of how to use the RootFilePublisher 
 * (AliHLTRootFilePublisher) and RootFileWriter (AliHLTRootFileWriter). 
 * It defines only two component in the chain, the publisher, which 
 * publishes the content of the root files according to the selection. 
 * Be aware there can be several root objects in one root file.
 *
 * The file myRootFile.root has to be changed with the actual file.
 * In this example, an ESD file is used, which contains a "esdTree" and
 * a "HLTesdTree" object. Only the "HLTesdTree" object is selected. The 
 * data blocks, which will are published here, have the data type of 
 * {ROOTTOBJ,"***"} and specification of 0x00000000. They also have to 
 * been adopted to the actual content of the root file. 
 *
 * @author thaeder@kip.uni-heidelberg.de
 * @ingroup alihlt_tutorial
 */

/** RootFilePublisher test macro
 *  @param nEvents Number of events which should be processed
 */
void rootfilepublisher(Int_t nEvents=1) {

  TString writerInput;
  TString arg;

  AliHLTSystem gHLT;
  gHLT.LoadComponentLibraries("libAliHLTUtil.so");

  // -- Root publisher configuration
  // !!! myRootFile.root has to be exchanged with an existing one.
  arg.Form("-objectname HLTesdTree -datatype 'ESD_TREE' 'TPC '-dataspec 0x00000000 -datafile myRootFile.root");

  // -- The AliHLTRootFilePublisher (Id 'ROOTFilePublisher') is a data source. 
  //    It provides the given files to the subsequent components in the chain.
  //    see AliHLTRootFilePublisher for more options
  AliHLTConfiguration RootPublisher("RootPublisher", "ROOTFilePublisher", NULL, arg.Data() );
  if (!writerInput.IsNull()) writerInput+=" ";
  writerInput+="RootPublisher";

  // -
  // -- Processing Components can be put in here
  // - 

  // -- The AliHLTRootFileWriter (Id 'ROOTFileWriter') is a data sink. It writes
  // all incoming data blocks to files. Several options available.
  AliHLTConfiguration RootWriter("RootWriter", "ROOTFileWriter", writerInput.Data(),"-datafile event");

  // -- Here you specify the top most configuration of the chain. The
  // configuration depends on all the parents. The task lisy is build
  // according to that.
  gHLT.BuildTaskList("RootWriter");
  gHLT.Run(nEvents);
}
 rootfilepublisher.C:1
 rootfilepublisher.C:2
 rootfilepublisher.C:3
 rootfilepublisher.C:4
 rootfilepublisher.C:5
 rootfilepublisher.C:6
 rootfilepublisher.C:7
 rootfilepublisher.C:8
 rootfilepublisher.C:9
 rootfilepublisher.C:10
 rootfilepublisher.C:11
 rootfilepublisher.C:12
 rootfilepublisher.C:13
 rootfilepublisher.C:14
 rootfilepublisher.C:15
 rootfilepublisher.C:16
 rootfilepublisher.C:17
 rootfilepublisher.C:18
 rootfilepublisher.C:19
 rootfilepublisher.C:20
 rootfilepublisher.C:21
 rootfilepublisher.C:22
 rootfilepublisher.C:23
 rootfilepublisher.C:24
 rootfilepublisher.C:25
 rootfilepublisher.C:26
 rootfilepublisher.C:27
 rootfilepublisher.C:28
 rootfilepublisher.C:29
 rootfilepublisher.C:30
 rootfilepublisher.C:31
 rootfilepublisher.C:32
 rootfilepublisher.C:33
 rootfilepublisher.C:34
 rootfilepublisher.C:35
 rootfilepublisher.C:36
 rootfilepublisher.C:37
 rootfilepublisher.C:38
 rootfilepublisher.C:39
 rootfilepublisher.C:40
 rootfilepublisher.C:41
 rootfilepublisher.C:42
 rootfilepublisher.C:43
 rootfilepublisher.C:44
 rootfilepublisher.C:45
 rootfilepublisher.C:46
 rootfilepublisher.C:47
 rootfilepublisher.C:48
 rootfilepublisher.C:49
 rootfilepublisher.C:50
 rootfilepublisher.C:51
 rootfilepublisher.C:52
 rootfilepublisher.C:53
 rootfilepublisher.C:54
 rootfilepublisher.C:55
 rootfilepublisher.C:56
 rootfilepublisher.C:57
 rootfilepublisher.C:58