Line data Source code
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 6 : ClassImp(AliHLTITSDigitPublisherComponent);
42 :
43 3 : AliHLTITSDigitPublisherComponent::AliHLTITSDigitPublisherComponent()
44 : :
45 3 : fRunLoader(NULL),
46 3 : fITSLoader(NULL),
47 3 : fNumberOfEvents(0),
48 3 : fEventNumber(0),
49 3 : tD(NULL)
50 15 : {
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 6 : }
57 :
58 12 : AliHLTITSDigitPublisherComponent::~AliHLTITSDigitPublisherComponent() {
59 : // see header file for class documentation
60 12 : }
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 18 : return "ITSDigitPublisher";
69 : }
70 :
71 : void AliHLTITSDigitPublisherComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
72 : // see header file for class documentation
73 0 : list.clear();
74 : //list.push_back( ???? | ???? );
75 0 : }
76 :
77 : AliHLTComponentDataType AliHLTITSDigitPublisherComponent::GetOutputDataType() {
78 : // see header file for class documentation
79 :
80 0 : return kAliHLTDataTypeAliTreeD|kAliHLTDataOriginITS;
81 : }
82 :
83 : void AliHLTITSDigitPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
84 : // see header file for class documentation
85 0 : constBase = 20000;
86 0 : inputMultiplier = 1000;
87 0 : }
88 :
89 : AliHLTComponent* AliHLTITSDigitPublisherComponent::Spawn() {
90 : // see header file for class documentation
91 0 : return new AliHLTITSDigitPublisherComponent();
92 0 : }
93 :
94 : Int_t AliHLTITSDigitPublisherComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
95 : // see header file for class documentation
96 :
97 0 : if(AliGeomManager::GetGeometry()==NULL){
98 0 : AliGeomManager::LoadGeometry();
99 0 : }
100 :
101 0 : fRunLoader = GetRunLoader();//AliRunLoader::Open("galice.root");
102 0 : if(!fRunLoader){
103 0 : HLTFatal("No RunLoader found");
104 0 : return -1;
105 : }
106 0 : fITSLoader = (AliITSLoader *)(fRunLoader->GetLoader("ITSLoader"));
107 0 : if(!fITSLoader){
108 0 : HLTFatal("No ITS RunLoader found");
109 0 : return -1;
110 : }
111 0 : fNumberOfEvents = fRunLoader->GetNumberOfEvents();
112 :
113 0 : return 0;
114 0 : }
115 :
116 : Int_t AliHLTITSDigitPublisherComponent::DoDeinit() {
117 : // see header file for class documentation
118 :
119 0 : return 0;
120 : }
121 :
122 : Int_t AliHLTITSDigitPublisherComponent::GetEvent(const AliHLTComponentEventData& /*evtData*/,AliHLTComponentTriggerData& /*trigData*/)
123 : {
124 : // see header file for class documentation
125 0 : if (!IsDataEvent()) return 0;
126 :
127 0 : fRunLoader->GetEvent(fEventNumber);
128 0 : fITSLoader->LoadDigits("read");
129 0 : tD = fITSLoader->TreeD();
130 0 : if(!tD){
131 0 : HLTFatal("No Digit Tree found");
132 0 : return -1;
133 : }
134 : //tD->GetEntry(fEventNumber);
135 :
136 0 : PushBack((TObject*)tD,kAliHLTDataTypeAliTreeD|kAliHLTDataOriginITS,0x00000000);
137 0 : fEventNumber++;
138 0 : return 0;
139 0 : }
140 :
|