]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFilePublisherComponent.cxx
moved from BASE to BASE/util
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRootFilePublisherComponent.cxx
1 // $Id$
2
3 /**************************************************************************
4  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  *                                                                        *
6  * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
7  *          for The ALICE Off-line Project.                               *
8  *                                                                        *
9  * Permission to use, copy, modify and distribute this software and its   *
10  * documentation strictly for non-commercial purposes is hereby granted   *
11  * without fee, provided that the above copyright notice appears in all   *
12  * copies and that both the copyright notice and this permission notice   *
13  * appear in the supporting documentation. The authors make no claims     *
14  * about the suitability of this software for any purpose. It is          *
15  * provided "as is" without express or implied warranty.                  *
16  **************************************************************************/
17
18 /** @file   AliHLTRootFilePublisherComponent.cxx
19     @author Matthias Richter
20     @date   
21     @brief  HLT file publisher component implementation. */
22
23 #include "AliHLTRootFilePublisherComponent.h"
24 //#include <TObjString.h>
25 //#include <TMath.h>
26 //#include <TFile.h>
27
28 // temporary
29 #include "TH1F.h"
30
31 /** the global object for component registration */
32 AliHLTRootFilePublisherComponent gAliHLTRootFilePublisherComponent;
33
34 /** ROOT macro for the implementation of ROOT specific class methods */
35 ClassImp(AliHLTRootFilePublisherComponent)
36
37 AliHLTRootFilePublisherComponent::AliHLTRootFilePublisherComponent()
38   :
39   AliHLTFilePublisher()
40 {
41   // see header file for class documentation
42   // or
43   // refer to README to build package
44   // or
45   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46
47 }
48
49 AliHLTRootFilePublisherComponent::AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&)
50   :
51   AliHLTFilePublisher()
52 {
53   // see header file for class documentation
54   HLTFatal("copy constructor untested");
55 }
56
57 AliHLTRootFilePublisherComponent& AliHLTRootFilePublisherComponent::operator=(const AliHLTRootFilePublisherComponent&)
58
59   // see header file for class documentation
60   HLTFatal("assignment operator untested");
61   return *this;
62 }
63
64 AliHLTRootFilePublisherComponent::~AliHLTRootFilePublisherComponent()
65 {
66   // see header file for class documentation
67
68   // file list and file name list are owner of their objects and
69   // delete all the objects
70 }
71
72 const char* AliHLTRootFilePublisherComponent::GetComponentID()
73 {
74   // see header file for class documentation
75   return "ROOTFilePublisher";
76 }
77
78 AliHLTComponentDataType AliHLTRootFilePublisherComponent::GetOutputDataType()
79 {
80   // see header file for class documentation
81   AliHLTComponentDataType dt =
82     {sizeof(AliHLTComponentDataType),
83      kAliHLTVoidDataTypeID,
84      kAliHLTVoidDataOrigin};
85   return dt;
86 }
87
88 void AliHLTRootFilePublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
89 {
90   // see header file for class documentation
91   constBase=10000;
92   inputMultiplier=1.0;
93 }
94
95 AliHLTComponent* AliHLTRootFilePublisherComponent::Spawn()
96 {
97   // see header file for class documentation
98   return new AliHLTRootFilePublisherComponent;
99 }
100
101 int AliHLTRootFilePublisherComponent::ScanArgument(int argc, const char** argv)
102 {
103   // see header file for class documentation
104
105   // there are no other arguments than the standard ones
106   if (argc==0 && argv==NULL) {
107     // this is just to get rid of the warning "unused parameter"
108   }
109   int iResult=-EPROTO;
110   return iResult;
111 }
112
113 int AliHLTRootFilePublisherComponent::OpenFiles()
114 {
115   // see header file for class documentation
116   int iResult=0;
117   return iResult;
118 }
119
120 int AliHLTRootFilePublisherComponent::GetEvent( const AliHLTComponentEventData& evtData,
121               AliHLTComponentTriggerData& trigData,
122               AliHLTUInt8_t* outputPtr, 
123               AliHLTUInt32_t& size,
124               vector<AliHLTComponentBlockData>& outputBlocks )
125 {
126   int iResult=0;
127   if (GetCurrentSpecification()==0) {
128     TH1F *hpx = new TH1F("hpx","px distribution",100,-4,4);
129     hpx->FillRandom("gaus",1000);
130     PushBack(hpx, "TH1F", "ROOT");
131   } else {
132     TH1F *hpy = new TH1F("hpy","py distribution",100,-10,10);
133     hpy->FillRandom("gaus",10000);
134     PushBack(hpy, "TH1F", "ROOT");
135   }
136
137   return iResult;
138 }