]>
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 | ||
50 | AliHLTRootFilePublisherComponent::AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&) | |
51 | : | |
52 | AliHLTFilePublisher() | |
53 | { | |
54 | // see header file for class documentation | |
55 | HLTFatal("copy constructor untested"); | |
56 | } | |
57 | ||
58 | AliHLTRootFilePublisherComponent& AliHLTRootFilePublisherComponent::operator=(const AliHLTRootFilePublisherComponent&) | |
59 | { | |
60 | // see header file for class documentation | |
61 | HLTFatal("assignment operator untested"); | |
62 | return *this; | |
63 | } | |
64 | ||
65 | AliHLTRootFilePublisherComponent::~AliHLTRootFilePublisherComponent() | |
66 | { | |
67 | // see header file for class documentation | |
68 | ||
69 | // file list and file name list are owner of their objects and | |
70 | // delete all the objects | |
71 | } | |
72 | ||
73 | const char* AliHLTRootFilePublisherComponent::GetComponentID() | |
74 | { | |
75 | // see header file for class documentation | |
76 | return "ROOTFilePublisher"; | |
77 | } | |
78 | ||
79 | AliHLTComponentDataType AliHLTRootFilePublisherComponent::GetOutputDataType() | |
80 | { | |
81 | // see header file for class documentation | |
82 | AliHLTComponentDataType dt = | |
83 | {sizeof(AliHLTComponentDataType), | |
84 | kAliHLTVoidDataTypeID, | |
85 | kAliHLTVoidDataOrigin}; | |
86 | return dt; | |
87 | } | |
88 | ||
89 | void AliHLTRootFilePublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) | |
90 | { | |
91 | // see header file for class documentation | |
92 | constBase=10000; | |
93 | inputMultiplier=1.0; | |
94 | } | |
95 | ||
96 | AliHLTComponent* AliHLTRootFilePublisherComponent::Spawn() | |
97 | { | |
98 | // see header file for class documentation | |
99 | return new AliHLTRootFilePublisherComponent; | |
100 | } | |
101 | ||
102 | int AliHLTRootFilePublisherComponent::ScanArgument(int argc, const char** argv) | |
103 | { | |
104 | // see header file for class documentation | |
105 | ||
106 | // there are no other arguments than the standard ones | |
107 | if (argc==0 && argv==NULL) { | |
108 | // this is just to get rid of the warning "unused parameter" | |
109 | } | |
110 | int iResult=-EPROTO; | |
111 | return iResult; | |
112 | } | |
113 | ||
114 | int AliHLTRootFilePublisherComponent::OpenFiles() | |
115 | { | |
116 | // see header file for class documentation | |
117 | int iResult=0; | |
118 | return iResult; | |
119 | } | |
120 | ||
121 | int AliHLTRootFilePublisherComponent::GetEvent( const AliHLTComponentEventData& evtData, | |
122 | AliHLTComponentTriggerData& trigData, | |
123 | AliHLTUInt8_t* outputPtr, | |
124 | AliHLTUInt32_t& size, | |
125 | vector<AliHLTComponentBlockData>& outputBlocks ) | |
126 | { | |
127 | int iResult=0; | |
128 | if (GetCurrentSpecification()==0) { | |
129 | TH1F *hpx = new TH1F("hpx","px distribution",100,-4,4); | |
130 | hpx->FillRandom("gaus",1000); | |
131 | PushBack(hpx, "TH1F", "ROOT"); | |
e4d3b725 | 132 | delete hpx; |
4ddfc222 | 133 | } else { |
134 | TH1F *hpy = new TH1F("hpy","py distribution",100,-10,10); | |
135 | hpy->FillRandom("gaus",10000); | |
136 | PushBack(hpy, "TH1F", "ROOT"); | |
e4d3b725 | 137 | delete hpy; |
4ddfc222 | 138 | } |
139 | ||
140 | return iResult; | |
141 | } |