3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTSampleOfflineSinkComponent.cxx
20 @author Matthias Richter
22 @brief A sample offline sink component.
25 #include "AliHLTSampleOfflineSinkComponent.h"
26 #include "AliRunLoader.h"
27 #include "AliLoader.h"
31 /** global instance for agent registration */
32 AliHLTSampleOfflineSinkComponent gAliHLTSampleOfflineSinkComponent;
34 /** ROOT macro for the implementation of ROOT specific class methods */
35 ClassImp(AliHLTSampleOfflineSinkComponent)
37 AliHLTSampleOfflineSinkComponent::AliHLTSampleOfflineSinkComponent()
39 // see header file for class documentation
41 // refer to README to build package
43 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46 AliHLTSampleOfflineSinkComponent::~AliHLTSampleOfflineSinkComponent()
48 // see header file for class documentation
51 const char* AliHLTSampleOfflineSinkComponent::GetComponentID()
53 // see header file for class documentation
54 return "SampleOfflineDataSink";
57 void AliHLTSampleOfflineSinkComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
59 // see header file for class documentation
61 list.push_back(kAliHLTAnyDataType);
64 AliHLTComponent* AliHLTSampleOfflineSinkComponent::Spawn()
66 // see header file for class documentation
67 return new AliHLTSampleOfflineSinkComponent;
70 int AliHLTSampleOfflineSinkComponent::DoInit( int argc, const char** argv )
72 // see header file for class documentation
77 int AliHLTSampleOfflineSinkComponent::DoDeinit()
79 // see header file for class documentation
84 int AliHLTSampleOfflineSinkComponent::DumpEvent(const AliHLTComponentEventData& evtData,
85 AliHLTComponentTriggerData& trigData)
87 // see header file for class documentation
89 AliInfoStream() << "dump event " << GetEventCount() << endl;
90 TTree* pTree=(TTree*)GetFirstInputObject(kAliHLTAnyDataType, "TTree");
92 AliInfoStream() << " got TTree object with " << pTree->GetEntries() << " entries" << endl;
93 pTree=(TTree*)GetNextInputObject();
98 int AliHLTSampleOfflineSinkComponent::FillESD(int eventNo, AliRunLoader* runLoader, AliESD* esd)
100 // see header file for class documentation
102 AliInfoStream() << "event " << eventNo << endl;