]>
Commit | Line | Data |
---|---|---|
4ddfc222 | 1 | // $Id$ |
2 | ||
3 | /************************************************************************** | |
9be2600f | 4 | * This file is property of and copyright by the ALICE HLT Project * |
5 | * ALICE Experiment at CERN, All rights reserved. * | |
4ddfc222 | 6 | * * |
9be2600f | 7 | * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> * |
8 | * for The ALICE HLT Project. * | |
4ddfc222 | 9 | * * |
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 | **************************************************************************/ | |
18 | ||
19 | /** @file AliHLTRootFilePublisherComponent.cxx | |
20 | @author Matthias Richter | |
21 | @date | |
22 | @brief HLT file publisher component implementation. */ | |
23 | ||
24 | #include "AliHLTRootFilePublisherComponent.h" | |
25 | //#include <TObjString.h> | |
26 | //#include <TMath.h> | |
27 | //#include <TFile.h> | |
28 | ||
29 | // temporary | |
30 | #include "TH1F.h" | |
31 | ||
32 | /** the global object for component registration */ | |
33 | AliHLTRootFilePublisherComponent gAliHLTRootFilePublisherComponent; | |
34 | ||
35 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
36 | ClassImp(AliHLTRootFilePublisherComponent) | |
37 | ||
38 | AliHLTRootFilePublisherComponent::AliHLTRootFilePublisherComponent() | |
39 | : | |
40 | AliHLTFilePublisher() | |
41 | { | |
42 | // see header file for class documentation | |
43 | // or | |
44 | // refer to README to build package | |
45 | // or | |
46 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
47 | ||
48 | } | |
49 | ||
4ddfc222 | 50 | AliHLTRootFilePublisherComponent::~AliHLTRootFilePublisherComponent() |
51 | { | |
52 | // see header file for class documentation | |
53 | ||
54 | // file list and file name list are owner of their objects and | |
55 | // delete all the objects | |
56 | } | |
57 | ||
58 | const char* AliHLTRootFilePublisherComponent::GetComponentID() | |
59 | { | |
60 | // see header file for class documentation | |
61 | return "ROOTFilePublisher"; | |
62 | } | |
63 | ||
64 | AliHLTComponentDataType AliHLTRootFilePublisherComponent::GetOutputDataType() | |
65 | { | |
66 | // see header file for class documentation | |
67 | AliHLTComponentDataType dt = | |
68 | {sizeof(AliHLTComponentDataType), | |
69 | kAliHLTVoidDataTypeID, | |
70 | kAliHLTVoidDataOrigin}; | |
71 | return dt; | |
72 | } | |
73 | ||
74 | void AliHLTRootFilePublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) | |
75 | { | |
76 | // see header file for class documentation | |
77 | constBase=10000; | |
78 | inputMultiplier=1.0; | |
79 | } | |
80 | ||
81 | AliHLTComponent* AliHLTRootFilePublisherComponent::Spawn() | |
82 | { | |
83 | // see header file for class documentation | |
84 | return new AliHLTRootFilePublisherComponent; | |
85 | } | |
86 | ||
87 | int AliHLTRootFilePublisherComponent::ScanArgument(int argc, const char** argv) | |
88 | { | |
89 | // see header file for class documentation | |
90 | ||
91 | // there are no other arguments than the standard ones | |
92 | if (argc==0 && argv==NULL) { | |
93 | // this is just to get rid of the warning "unused parameter" | |
94 | } | |
95 | int iResult=-EPROTO; | |
96 | return iResult; | |
97 | } | |
98 | ||
99 | int AliHLTRootFilePublisherComponent::OpenFiles() | |
100 | { | |
101 | // see header file for class documentation | |
102 | int iResult=0; | |
103 | return iResult; | |
104 | } | |
105 | ||
29312178 | 106 | int AliHLTRootFilePublisherComponent::GetEvent( const AliHLTComponentEventData& /*evtData*/, |
107 | AliHLTComponentTriggerData& /*trigData*/) | |
4ddfc222 | 108 | { |
109 | int iResult=0; | |
90cb4f5d | 110 | if (GetEventCount()%2==0) { |
4ddfc222 | 111 | TH1F *hpx = new TH1F("hpx","px distribution",100,-4,4); |
112 | hpx->FillRandom("gaus",1000); | |
113 | PushBack(hpx, "TH1F", "ROOT"); | |
e4d3b725 | 114 | delete hpx; |
4ddfc222 | 115 | } else { |
116 | TH1F *hpy = new TH1F("hpy","py distribution",100,-10,10); | |
117 | hpy->FillRandom("gaus",10000); | |
118 | PushBack(hpy, "TH1F", "ROOT"); | |
e4d3b725 | 119 | delete hpy; |
4ddfc222 | 120 | } |
121 | ||
122 | return iResult; | |
123 | } |