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