]>
Commit | Line | Data |
---|---|---|
33a4976d | 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: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> * | |
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 AliHLTTPCCalibTimeComponent.cxx | |
19 | @author Kalliopi Kanaki | |
20 | @date 2009-07-08 | |
21 | @brief A calibration component for interfacing the offline calculation of TPC drift velocity correction | |
22 | */ | |
23 | ||
24 | // see header file for class documentation | |
25 | // or | |
26 | // refer to README to build package | |
27 | // or | |
28 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
29 | ||
30 | #if __GNUC__>= 3 | |
31 | using namespace std; | |
32 | #endif | |
33 | ||
34 | #include "AliHLTTPCCalibTimeComponent.h" | |
35 | ||
36 | #include "AliHLTTPCDefinitions.h" | |
37 | #include "AliTPCcalibTime.h" | |
38 | ||
39 | #include <cstdlib> | |
40 | #include <cerrno> | |
41 | #include "TString.h" | |
42 | ||
43 | ||
44 | ClassImp(AliHLTTPCCalibTimeComponent) // ROOT macro for the implementation of ROOT specific class methods | |
45 | ||
46 | AliHLTTPCCalibTimeComponent::AliHLTTPCCalibTimeComponent() | |
47 | : | |
48 | fCalibTime(NULL), | |
49 | fESDEvent(NULL), | |
50 | fMinPartition(5), | |
51 | fMaxPartition(0), | |
52 | fMinSlice(35), | |
53 | fMaxSlice(0), | |
54 | fSpecification(0) , | |
55 | fEnableAnalysis(kTRUE) | |
56 | { | |
57 | // see header file for class documentation | |
58 | // or | |
59 | // refer to README to build package | |
60 | // or | |
61 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
62 | } | |
63 | ||
64 | AliHLTTPCCalibTimeComponent::~AliHLTTPCCalibTimeComponent() { | |
65 | // see header file for class documentation | |
66 | } | |
67 | ||
68 | ||
69 | const char* AliHLTTPCCalibTimeComponent::GetComponentID() { | |
70 | // see header file for class documentation | |
71 | ||
72 | return "TPCCalibTime"; | |
73 | } | |
74 | ||
75 | void AliHLTTPCCalibTimeComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) { | |
76 | // see header file for class documentation | |
77 | ||
78 | list.clear(); | |
79 | list.push_back( kAliHLTDataTypeTObjArray ); // output of TPCCalibSeedMaker | |
80 | list.push_back( kAliHLTDataTypeESDTree ); // output of global merger | |
81 | } | |
82 | ||
83 | AliHLTComponentDataType AliHLTTPCCalibTimeComponent::GetOutputDataType() { | |
84 | // see header file for class documentation | |
85 | ||
86 | return AliHLTTPCDefinitions::fgkCalibCEDataType; | |
87 | } | |
88 | ||
89 | void AliHLTTPCCalibTimeComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) { | |
90 | // see header file for class documentation | |
91 | ||
92 | constBase = 0; | |
93 | inputMultiplier = (2.0); // to be estimated | |
94 | } | |
95 | ||
96 | AliHLTComponent* AliHLTTPCCalibTimeComponent::Spawn() { | |
97 | // see header file for class documentation | |
98 | ||
99 | return new AliHLTTPCCalibTimeComponent(); | |
100 | } | |
101 | ||
102 | ||
103 | Int_t AliHLTTPCCalibTimeComponent::ScanArgument( Int_t argc, const char** argv ) { | |
104 | // see header file for class documentation | |
105 | ||
106 | Int_t iResult = 0; | |
107 | TString argument = ""; | |
108 | TString parameter = ""; | |
109 | ||
110 | if(!argc) return -EINVAL; | |
111 | ||
112 | argument = argv[iResult]; | |
113 | ||
114 | if(argument.IsNull()) return -EINVAL; | |
115 | ||
116 | if( argument.CompareTo("-enable-analysis") == 0 ){ | |
117 | HLTInfo( "Analysis before shipping data to FXS enabled." ); | |
118 | fEnableAnalysis = kTRUE; | |
119 | } | |
120 | else { | |
121 | iResult = -EINVAL; | |
122 | } | |
123 | return iResult; | |
124 | } | |
125 | ||
126 | Int_t AliHLTTPCCalibTimeComponent::InitCalibration() { | |
127 | // see header file for class documentation | |
128 | ||
129 | if(fCalibTime) return EINPROGRESS; | |
130 | //fCalibTime = new AliTPCcalibTime(); | |
131 | ||
132 | fCalibTime = new AliTPCcalibTime("cosmicTime","cosmicTime",0, 1213.9e+06, 1213.96e+06); | |
133 | //AliTPCcalibTime::AliTPCcalibTime(const Text_t *name, const Text_t *title, UInt_t StartTime, UInt_t EndTime, Int_t deltaIntegrationTimeVdrift) | |
134 | ||
135 | return 0; | |
136 | } | |
137 | ||
138 | Int_t AliHLTTPCCalibTimeComponent::DeinitCalibration() { | |
139 | // see header file for class documentation | |
140 | ||
141 | if(fCalibTime) delete fCalibTime; | |
142 | fCalibTime = NULL; | |
143 | ||
144 | return 0; | |
145 | } | |
146 | ||
147 | Int_t AliHLTTPCCalibTimeComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ){ | |
148 | // see header file for class documentation | |
149 | ||
150 | if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0; | |
151 | ||
152 | const AliHLTComponentBlockData *iter = NULL; | |
153 | ||
154 | for(iter = GetFirstInputBlock(kAliHLTDataTypeESDTree); iter != NULL; iter = GetNextInputBlock()){ | |
155 | ||
156 | if(iter->fDataType != (kAliHLTDataTypeESDTree | kAliHLTDataOriginTPC)) continue; | |
157 | ||
158 | AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); | |
159 | AliHLTUInt8_t partition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); | |
160 | ||
161 | if( partition < fMinPartition ) fMinPartition = partition; | |
162 | if( partition > fMaxPartition ) fMaxPartition = partition; | |
163 | if( slice < fMinSlice ) fMinSlice = slice; | |
164 | if( slice > fMaxSlice ) fMaxSlice = slice; | |
165 | ||
166 | //fESDEvent = (AliESDEvent*)iter; | |
167 | } | |
168 | ||
169 | //fCalibTime->Process(fESDEvent); | |
170 | ||
171 | // loop over TObjArray of seeds missing | |
172 | ||
173 | fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( fMinSlice, fMaxSlice, fMinPartition, fMaxPartition ); | |
174 | PushBack( (TObject*)fCalibTime, AliHLTTPCDefinitions::fgkCalibCEDataType, fSpecification); | |
175 | ||
176 | return 0; | |
177 | } | |
178 | ||
179 | Int_t AliHLTTPCCalibTimeComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ){ | |
180 | // see header file for class documentation | |
181 | ||
182 | if(fEnableAnalysis) fCalibTime->Analyze(); | |
183 | ||
184 | PushToFXS( (TObject*)fCalibTime, "TPC", "Time" ) ; | |
185 | ||
186 | return 0; | |
187 | } | |
188 | ||
189 |