]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/ITS/AliHLTITSDigitPublisherComponent.cxx
status messages shouldn't have log level warning
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSDigitPublisherComponent.cxx
1 // $Id$
2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project        * 
4 //* ALICE Experiment at CERN, All rights reserved.                         *
5 //*                                                                        *
6 //* Primary Authors: Kenneth Aamodt, Sergey Gorbunov                       *
7 //*                  for The ALICE HLT 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   AliHLTITSDigitPublisherComponent.cxx
19     @author Kenneth Aamodt, Sergey Gorbunov
20     @date   
21     @brief  Component to run offline clusterfinders
22 */
23
24 #include <TSystem.h>
25 #include <TROOT.h>
26 #include "AliHLTITSDigitPublisherComponent.h" 
27 #include "AliRun.h"
28 #include "AliRunLoader.h"
29 #include "AliGeomManager.h"
30 #include "AliITSInitGeometry.h"
31 #include "AliITSLoader.h"
32 #include "AliCDBManager.h"
33 #include "AliLog.h"
34 #include "TTree.h"
35 #include "TObjArray.h"
36 #include "TClonesArray.h"
37
38 using namespace std;
39
40 /** ROOT macro for the implementation of ROOT specific class methods */
41 ClassImp(AliHLTITSDigitPublisherComponent);
42
43 AliHLTITSDigitPublisherComponent::AliHLTITSDigitPublisherComponent()
44   :
45   fRunLoader(NULL),
46   fITSLoader(NULL),
47   fNumberOfEvents(0),
48   fEventNumber(0),
49   tD(NULL)
50
51   // see header file for class documentation
52   // or
53   // refer to README to build package
54   // or
55   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 }
57
58 AliHLTITSDigitPublisherComponent::~AliHLTITSDigitPublisherComponent() {
59   // see header file for class documentation
60 }
61
62 // Public functions to implement AliHLTComponent's interface.
63 // These functions are required for the registration process
64
65 const char* AliHLTITSDigitPublisherComponent::GetComponentID()
66 {
67   // see header file for class documentation
68   return "ITSDigitPublisher";
69 }
70
71 void AliHLTITSDigitPublisherComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
72   // see header file for class documentation
73   list.clear(); 
74   //list.push_back( ???? | ???? );
75 }
76
77 AliHLTComponentDataType AliHLTITSDigitPublisherComponent::GetOutputDataType() {
78   // see header file for class documentation
79
80   return kAliHLTDataTypeAliTreeD|kAliHLTDataOriginITS;
81 }
82
83 void AliHLTITSDigitPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
84   // see header file for class documentation
85   constBase = 20000;
86   inputMultiplier = 1000;
87 }
88
89 AliHLTComponent* AliHLTITSDigitPublisherComponent::Spawn() {
90   // see header file for class documentation
91   return new AliHLTITSDigitPublisherComponent();
92 }
93         
94 Int_t AliHLTITSDigitPublisherComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
95   // see header file for class documentation
96   
97   if(AliGeomManager::GetGeometry()==NULL){
98     AliGeomManager::LoadGeometry();
99   }
100
101   fRunLoader = GetRunLoader();//AliRunLoader::Open("galice.root");
102   if(!fRunLoader){
103     HLTFatal("No RunLoader found");
104     return -1;
105   }
106   fITSLoader = (AliITSLoader *)(fRunLoader->GetLoader("ITSLoader"));
107   if(!fITSLoader){
108     HLTFatal("No ITS RunLoader found");
109     return -1;
110   }
111   fNumberOfEvents = fRunLoader->GetNumberOfEvents();
112  
113   return 0;
114 }
115
116 Int_t AliHLTITSDigitPublisherComponent::DoDeinit() {
117   // see header file for class documentation
118
119   return 0;
120 }
121
122 Int_t AliHLTITSDigitPublisherComponent::GetEvent(const AliHLTComponentEventData& /*evtData*/,AliHLTComponentTriggerData& /*trigData*/)
123 {
124   // see header file for class documentation
125   if (!IsDataEvent()) return 0;
126
127   fRunLoader->GetEvent(fEventNumber);
128   fITSLoader->LoadDigits("read");
129   tD = fITSLoader->TreeD();
130   if(!tD){
131     HLTFatal("No Digit Tree found");
132     return -1;
133   } 
134   //tD->GetEntry(fEventNumber);
135   
136   PushBack((TObject*)tD,kAliHLTDataTypeAliTreeD|kAliHLTDataOriginITS,0x00000000);
137   fEventNumber++;
138   return 0;
139 }
140