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