]>
Commit | Line | Data |
---|---|---|
a2e57ab1 | 1 | //-*- Mode: C++ -*- |
2 | // $Id: AliHLTGlobalCompareFlatComponent.cxx $ | |
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: Steffen Weber * | |
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 AliHLTGlobalCompareFlatComponent.cxx | |
19 | @author Steffen Weber | |
20 | @brief Compare flat events from different inputs | |
21 | */ | |
22 | ||
23 | #include "TMap.h" | |
24 | #include "TSystem.h" | |
25 | #include "TTimeStamp.h" | |
26 | #include "TObjString.h" | |
27 | #include "TList.h" | |
28 | #include "THnSparse.h" | |
29 | #include "AliESDEvent.h" | |
30 | #include "AliFlatESDEvent.h" | |
a88a189e | 31 | #include "AliFlatESDFriend.h" |
a2e57ab1 | 32 | #include "AliFlatESDTrigger.h" |
33 | #include "AliFlatESDV0.h" | |
ec748c4a | 34 | #include "AliFlatESDVertex.h" |
a2e57ab1 | 35 | #include "AliHLTErrorGuard.h" |
36 | #include "AliHLTDataTypes.h" | |
37 | #include "AliHLTGlobalCompareFlatComponent.h" | |
38 | #include "AliHLTITSClusterDataFormat.h" | |
39 | #include "AliHLTTPCDefinitions.h" | |
a88a189e | 40 | #include "AliTPCseed.h" |
41 | #include "AliExternalTrackParam.h" | |
a2e57ab1 | 42 | #include "TTree.h" |
43 | #include "AliCDBEntry.h" | |
44 | #include "AliCDBManager.h" | |
45 | ||
46 | using namespace std; | |
47 | ||
48 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
49 | ClassImp(AliHLTGlobalCompareFlatComponent) | |
50 | ||
51 | void AliHLTGlobalCompareFlatComponent::printDiff( string name, double val1, double val2){ | |
52 | double relDiff = ( val1 != 0 || val2!=0 ) ? (val1-val2)/(fabs(val1) + fabs(val2)): 0; | |
53 | int diff = 0; | |
54 | if (relDiff > 1e-6) diff = 1; | |
55 | else if(relDiff < -1e-6) diff = -1; | |
56 | outFile<<name<<"\t" << val1 << "\t" << val2 <<"\t" << diff << "\n"; | |
57 | } | |
a88a189e | 58 | |
59 | ||
60 | ||
61 | void AliHLTGlobalCompareFlatComponent::printDiff( string name, int n , double* vals1, double* vals2 ){ | |
62 | double relDiff = 0; | |
63 | int diff = 0; | |
64 | ||
65 | for(int i=0; i<n && diff == 0; i++){ | |
66 | relDiff = ( vals1[i] != 0 || vals2[i] !=0 ) ? (vals1[i]-vals2[i])/(fabs(vals1[i]) + fabs(vals2[i])): 0; | |
67 | if (relDiff > 1e-6) diff = 1; | |
68 | else if(relDiff < -1e-6) diff = -1; | |
69 | } | |
70 | ||
71 | outFile<<name<<"\t"; | |
72 | for(int i=0; i<n;i++){ | |
73 | outFile<<vals1[i]<<" "; | |
74 | } | |
75 | outFile<<"\t"; | |
76 | for(int i=0; i<n;i++){ | |
77 | outFile<<vals2[i]<<" "; | |
78 | } | |
79 | outFile<<"\t" << diff << "\n"; | |
80 | } | |
81 | ||
82 | ||
83 | ||
84 | ||
a2e57ab1 | 85 | void AliHLTGlobalCompareFlatComponent::printDiff( string name, TString val1, TString val2){ |
86 | outFile << name << "\t" << "\t\"" << val1 <<"\"\t\"" << val2 <<"\"\t" << (val1.EqualTo(val2) ?0:1)<<"\n"; | |
87 | } | |
88 | ||
89 | /* | |
90 | * --------------------------------------------------------------------------------- | |
91 | * Constructor / Destructor | |
92 | * --------------------------------------------------------------------------------- | |
93 | */ | |
94 | ||
95 | // ################################################################################# | |
96 | AliHLTGlobalCompareFlatComponent::AliHLTGlobalCompareFlatComponent() : | |
97 | AliHLTProcessor() | |
98 | { | |
99 | // an example component which implements the ALICE HLT processor | |
100 | // interface and does some analysis on the input raw data | |
101 | // | |
102 | // see header file for class documentation | |
103 | // or | |
104 | // refer to README to build package | |
105 | // or | |
106 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
107 | // | |
108 | // NOTE: all helper classes should be instantiated in DoInit() | |
109 | } | |
110 | ||
111 | // ################################################################################# | |
112 | AliHLTGlobalCompareFlatComponent::~AliHLTGlobalCompareFlatComponent() { | |
113 | // see header file for class documentation | |
114 | ||
115 | ||
116 | ||
117 | } | |
118 | ||
119 | /* | |
120 | * --------------------------------------------------------------------------------- | |
121 | * Public functions to implement AliHLTComponent's interface. | |
122 | * These functions are required for the registration process | |
123 | * --------------------------------------------------------------------------------- | |
124 | */ | |
125 | ||
126 | // ################################################################################# | |
127 | const Char_t* AliHLTGlobalCompareFlatComponent::GetComponentID() { | |
128 | // see header file for class documentation | |
129 | return "GlobalCompareFlat"; | |
130 | } | |
131 | ||
132 | // ################################################################################# | |
133 | void AliHLTGlobalCompareFlatComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) { | |
134 | // see header file for class documentation | |
135 | list.push_back(kAliHLTDataTypeFlatESD|kAliHLTDataOriginOut ); | |
136 | } | |
137 | ||
138 | // ################################################################################# | |
139 | AliHLTComponentDataType AliHLTGlobalCompareFlatComponent::GetOutputDataType() { | |
140 | // see header file for class documentation | |
141 | return kAliHLTDataTypeTObject|kAliHLTDataOriginOut; | |
142 | } | |
143 | ||
144 | // ################################################################################# | |
145 | void AliHLTGlobalCompareFlatComponent::GetOutputDataSize( ULong_t& constBase, Double_t& inputMultiplier ) { | |
146 | // see header file for class documentation | |
147 | constBase = 100000; | |
148 | inputMultiplier = 10.0; | |
149 | } | |
150 | ||
151 | ||
152 | // ################################################################################# | |
153 | AliHLTComponent* AliHLTGlobalCompareFlatComponent::Spawn() { | |
154 | // see header file for class documentation | |
155 | return new AliHLTGlobalCompareFlatComponent; | |
156 | } | |
157 | ||
158 | /* | |
159 | * --------------------------------------------------------------------------------- | |
160 | * Protected functions to implement AliHLTComponent's interface. | |
161 | * These functions provide initialization as well as the actual processing | |
162 | * capabilities of the component. | |
163 | * --------------------------------------------------------------------------------- | |
164 | */ | |
165 | ||
166 | // ################################################################################# | |
167 | Int_t AliHLTGlobalCompareFlatComponent::DoInit( Int_t argc, const Char_t** argv ) { | |
168 | // see header file for class documentation | |
169 | printf("AliHLTGlobalCompareFlatComponent::DoInit\n"); | |
170 | // see header file for class documentation | |
171 | int iResult=0; | |
172 | ||
173 | /* | |
174 | ||
175 | Int_t bins[fDim] = {3}; | |
176 | Double_t mins[fDim] = {0}; | |
177 | Double_t maxs[fDim] = {2}; | |
178 | fhDiff = new THnSparseD("Differences","Differences",fDim,bins,mins,maxs); | |
179 | ||
180 | ||
181 | Int_t tmp = 0; | |
182 | ||
183 | fhDiff->GetAxis(tmp)->SetName("Overall"); | |
184 | fhDiff->GetAxis(tmp)->SetBinLabel(1,"no differences"); | |
185 | fhDiff->GetAxis(tmp)->SetBinLabel(2,"sizes differ"); | |
186 | fhDiff->GetAxis(tmp)->SetBinLabel(3,"other differences"); | |
187 | ||
188 | fhDiff->GetAxis(++tmp)->SetName("GetSize"); | |
189 | fhDiff->GetAxis(++tmp)->SetName("GetMagneticField"); | |
190 | fhDiff->GetAxis(++tmp)->SetName("GetPeriodNumber"); | |
191 | fhDiff->GetAxis(++tmp)->SetName("GetRunNumber"); | |
192 | fhDiff->GetAxis(++tmp)->SetName("GetOrbitNumber"); | |
193 | fhDiff->GetAxis(++tmp)->SetName("GetBunchCrossNumber"); | |
194 | fhDiff->GetAxis(++tmp)->SetName("GetTriggerMask"); | |
195 | fhDiff->GetAxis(++tmp)->SetName("GetTriggerMaskNext50"); | |
196 | fhDiff->GetAxis(++tmp)->SetName("GetFiredTriggerClasses"); | |
197 | fhDiff->GetAxis(++tmp)->SetName("GetNumberOfTracks"); | |
198 | fhDiff->GetAxis(++tmp)->SetName("GetNumberOfV0s"); | |
199 | fhDiff->GetAxis(++tmp)->SetName("GetTimeStamp"); | |
200 | fhDiff->GetAxis(++tmp)->SetName("GetEventSpecie"); | |
201 | */ | |
202 | ||
203 | ||
204 | ||
205 | ||
206 | ||
207 | return iResult; | |
208 | } | |
209 | ||
210 | ||
211 | ||
212 | // ################################################################################# | |
213 | Int_t AliHLTGlobalCompareFlatComponent::DoDeinit() { | |
214 | // see header file for class documentation | |
215 | printf("AliHLTGlobalCompareFlatComponent::DoDeInit\n"); | |
216 | ||
217 | Int_t iResult = 0; | |
218 | /* | |
219 | TFile * f = TFile::Open("histograms.root","RECREATE"); | |
220 | f->Add(fhDiff); | |
221 | f->Write(); | |
222 | f->Close(); | |
223 | */ | |
224 | //delete fhDiff; | |
225 | ||
226 | return iResult; | |
227 | } | |
228 | ||
229 | // ################################################################################# | |
230 | Int_t AliHLTGlobalCompareFlatComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, | |
231 | const AliHLTComponentBlockData* /*blocks*/, | |
232 | AliHLTComponentTriggerData& /*trigData*/, | |
233 | AliHLTUInt8_t* /*outputPtr*/, | |
234 | AliHLTUInt32_t& /*size*/, | |
235 | AliHLTComponentBlockDataList& /*outputBlocks*/) { | |
236 | // see header file for class documentation | |
237 | ||
238 | printf("AliHLTGlobalCompareFlatComponent::DoEvent\n"); | |
239 | Int_t iResult=0; | |
240 | ||
241 | ||
242 | // -- Only use data event | |
243 | if (!IsDataEvent()) | |
244 | return 0; | |
245 | ||
0e757649 | 246 | AliFlatESDEvent *flatEsd[2] ={0,0}; |
247 | AliFlatESDFriend *flatFriend[2] ={0,0}; | |
a2e57ab1 | 248 | |
249 | printf("search for input onbjects\n"); | |
250 | { | |
251 | int i=0; | |
252 | for ( const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeFlatESD|kAliHLTDataOriginOut); | |
253 | pBlock!=NULL && i<2; pBlock = GetNextInputBlock(),i++ ) { | |
254 | flatEsd[i] = reinterpret_cast<AliFlatESDEvent*>( pBlock->fPtr ); | |
255 | } | |
a88a189e | 256 | i=0; |
257 | for ( const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeFlatESDFriend|kAliHLTDataOriginOut); | |
258 | pBlock!=NULL && i<2; pBlock = GetNextInputBlock(),i++ ) { | |
259 | flatFriend[i] = reinterpret_cast<AliFlatESDFriend*>( pBlock->fPtr ); | |
260 | } | |
261 | ||
a2e57ab1 | 262 | } |
0e757649 | 263 | |
264 | if( flatEsd[0] == NULL ){ | |
265 | cout<<"flatEsd[0] not set!"<<endl; | |
266 | return 0; | |
267 | } | |
268 | if( flatEsd[1] == NULL ){ | |
269 | cout<<"flatEsd[1] not set!"<<endl; | |
270 | return 0; | |
271 | } | |
272 | ||
273 | if( flatFriend[0] == NULL ){ | |
274 | cout<<"flatFriend[0] not set!"<<endl; | |
275 | return 0; | |
276 | } | |
277 | ||
278 | if( flatFriend[1] == NULL ){ | |
279 | cout<<"flatFriend[1] not set!"<<endl; | |
280 | return 0; | |
281 | } | |
282 | ||
a88a189e | 283 | cout<<"size event : "<<flatEsd[0]->GetSize() << " "<<flatEsd[1]->GetSize()<<endl; |
284 | cout<<"nTracks : "<<flatEsd[0]->GetNumberOfTracks()<<" "<<flatEsd[1]->GetNumberOfTracks()<<endl; | |
285 | ||
286 | cout<<"size friend : "<<flatFriend[0]->GetSize() << " "<<flatFriend[1]->GetSize()<<endl; | |
287 | cout<<"nFriendTracks : "<<flatFriend[0]->GetNumberOfTracks()<<" "<<flatFriend[1]->GetNumberOfTracks()<<endl; | |
a2e57ab1 | 288 | |
289 | outFile.open("comparison.txt",ios::app); | |
ec748c4a | 290 | |
291 | // Compare Event variables | |
292 | ||
293 | outFile<<"\n\n------------------\nnew AliFlatESDEvent\n------------------\n"; | |
a2e57ab1 | 294 | printDiff( "AliFlatESDEvent::GetSize" ,flatEsd[0]->GetSize(), flatEsd[1]->GetSize() ) ; |
295 | printDiff( "AliFlatESDEvent::GetMagneticField",flatEsd[0]->GetMagneticField(),flatEsd[1]->GetMagneticField() ); | |
296 | printDiff( "AliFlatESDEvent::GetPeriodNumber",flatEsd[0]->GetPeriodNumber(),flatEsd[1]->GetPeriodNumber() ); | |
297 | printDiff( "AliFlatESDEvent::GetRunNumber",flatEsd[0]->GetRunNumber(), flatEsd[1]->GetRunNumber() ); | |
298 | printDiff( "AliFlatESDEvent::GetOrbitNumber",flatEsd[0]->GetOrbitNumber(),flatEsd[1]->GetOrbitNumber() ); | |
299 | printDiff( "AliFlatESDEvent::GetBunchCrossNumber",flatEsd[0]->GetBunchCrossNumber(),flatEsd[1]->GetBunchCrossNumber() ); | |
300 | printDiff( "AliFlatESDEvent::GetTriggerMask",flatEsd[0]->GetTriggerMask(),flatEsd[1]->GetTriggerMask() ); | |
301 | printDiff( "AliFlatESDEvent::GetTriggerMaskNext50",flatEsd[0]->GetTriggerMaskNext50(),flatEsd[1]->GetTriggerMaskNext50() ); | |
302 | printDiff( "AliFlatESDEvent::GetFiredTriggerClasses",flatEsd[0]->GetFiredTriggerClasses() ,flatEsd[1]->GetFiredTriggerClasses() ); | |
303 | printDiff( "AliFlatESDEvent::GetNumberOfTracks",flatEsd[0]->GetNumberOfTracks(), flatEsd[1]->GetNumberOfTracks() ); | |
304 | printDiff( "AliFlatESDEvent::GetNumberOfV0s",flatEsd[0]->GetNumberOfV0s(),flatEsd[1]->GetNumberOfV0s() ); | |
305 | printDiff( "AliFlatESDEvent::GetTimeStamp",flatEsd[0]->GetTimeStamp(),flatEsd[1]->GetTimeStamp() ); | |
306 | printDiff( "AliFlatESDEvent::GetEventSpecie",flatEsd[0]->GetEventSpecie(),flatEsd[1]->GetEventSpecie() ); | |
307 | printDiff( "AliFlatESDEvent::GetNumberOfTriggerClasses",flatEsd[0]->GetNumberOfTriggerClasses(),flatEsd[1]->GetNumberOfTriggerClasses() ); | |
308 | ||
ec748c4a | 309 | const AliFlatESDVertex * vertexTracks[2] = {flatEsd[0]->GetFlatPrimaryVertexTracks(), flatEsd[1]->GetFlatPrimaryVertexTracks()}; |
310 | printDiff("AliFlatESDEvent::GetFlatPrimaryVertexTracks", (vertexTracks[0] ? 1:0), (vertexTracks[1] ? 1:0) ); | |
311 | ||
312 | const AliFlatESDVertex * vertexSPD[2] = {flatEsd[0]->GetFlatPrimaryVertexSPD(), flatEsd[1]->GetFlatPrimaryVertexSPD()}; | |
313 | printDiff("AliFlatESDEvent::GetFlatPrimaryVertexSPD", (vertexSPD[0] ? 1:0), (vertexSPD[1] ? 1:0) ); | |
314 | ||
315 | // Compare primary vertices | |
316 | ||
317 | if(vertexTracks[0] && vertexTracks[1]){ | |
318 | outFile<<"\nnew AliFlatESDVertexTracks\n"; | |
319 | printDiff( "AliFlatESDVertexTracks::GetSize",vertexTracks[0]->GetSize(),vertexTracks[1]->GetSize() ); | |
320 | printDiff( "AliFlatESDVertexTracks::GetX",vertexTracks[0]->GetX(),vertexTracks[1]->GetX() ); | |
321 | printDiff( "AliFlatESDVertexTracks::GetY",vertexTracks[0]->GetY(),vertexTracks[1]->GetY() ); | |
322 | printDiff( "AliFlatESDVertexTracks::GetZ",vertexTracks[0]->GetZ(),vertexTracks[1]->GetZ() ); | |
323 | } | |
324 | ||
325 | if(vertexSPD[0] && vertexSPD[1]){ | |
326 | outFile<<"\nnew AliFlatESDVertexSPD\n"; | |
a88a189e | 327 | outFile<<"AliFlatESDVertexSPD::memcmp "<<memcmp(vertexSPD[0], vertexSPD[1], max(vertexSPD[0]->GetSize(), vertexSPD[1]->GetSize()))<<"\n"; |
ec748c4a | 328 | printDiff( "AliFlatESDVertexSPD::GetSize",vertexSPD[0]->GetSize(),vertexSPD[1]->GetSize() ); |
329 | printDiff( "AliFlatESDVertexSPD::GetX",vertexSPD[0]->GetX(),vertexSPD[1]->GetX() ); | |
330 | printDiff( "AliFlatESDVertexSPD::GetY",vertexSPD[0]->GetY(),vertexSPD[1]->GetY() ); | |
331 | printDiff( "AliFlatESDVertexSPD::GetZ",vertexSPD[0]->GetZ(),vertexSPD[1]->GetZ() ); | |
332 | } | |
333 | ||
334 | ||
335 | // Compare triggers | |
336 | ||
a2e57ab1 | 337 | if(flatEsd[0]->GetNumberOfTriggerClasses() && flatEsd[1]->GetNumberOfTriggerClasses() ){ |
338 | outFile<<"------------------\ntriggers\n------------------\n"; | |
339 | AliFlatESDTrigger * trigger[2] = { const_cast<AliFlatESDTrigger*>(flatEsd[0]->GetTriggerClasses() ) , const_cast<AliFlatESDTrigger*>(flatEsd[1]->GetTriggerClasses() ) }; | |
340 | for( Int_t i = 0; i < flatEsd[0]->GetNumberOfTriggerClasses() && i < flatEsd[1]->GetNumberOfTriggerClasses() ; i++ ){ | |
ec748c4a | 341 | outFile<<"\nnew AliFlatESDTrigger\n"; |
a2e57ab1 | 342 | printDiff( "AliFlatESDTrigger::GetSize",trigger[0]->GetSize(),trigger[1]->GetSize() ); |
343 | printDiff( "AliFlatESDTrigger::GetTriggerIndex",trigger[0]->GetTriggerIndex(),trigger[1]->GetTriggerIndex() ); | |
344 | printDiff( "AliFlatESDTrigger::GetTriggerClassName",trigger[0]->GetTriggerClassName(),trigger[1]->GetTriggerClassName() ); | |
345 | ||
346 | trigger[0] = trigger[0]->GetNextTriggerNonConst(); | |
347 | trigger[1] = trigger[1]->GetNextTriggerNonConst(); | |
348 | } | |
349 | } | |
ec748c4a | 350 | |
351 | // Compare v0s | |
352 | ||
a2e57ab1 | 353 | if(flatEsd[0]->GetNumberOfV0s() && flatEsd[1]->GetNumberOfV0s() ){ |
354 | outFile<<"------------------\nv0s\n------------------\n"; | |
355 | ||
356 | AliFlatESDV0 * v0[2] = { const_cast<AliFlatESDV0*>(flatEsd[0]->GetV0s() ) , const_cast<AliFlatESDV0*>(flatEsd[1]->GetV0s() ) }; | |
357 | for( Int_t i = 0; i < flatEsd[0]->GetNumberOfV0s() && i < flatEsd[1]->GetNumberOfV0s() ; i++ ){ | |
ec748c4a | 358 | outFile<<"\nnew AliFlatESDV0\n"; |
a2e57ab1 | 359 | printDiff( "AliFlatESDV0::GetSize",v0[0]->GetSize(),v0[1]->GetSize() ); |
360 | printDiff( "AliFlatESDV0::GetNegTrackID",v0[0]->GetNegTrackID(),v0[1]->GetNegTrackID() ); | |
361 | printDiff( "AliFlatESDV0::GetPosTrackID",v0[0]->GetPosTrackID(),v0[1]->GetPosTrackID() ); | |
362 | ||
363 | v0[0] = v0[0]->GetNextV0NonConst(); | |
364 | v0[1] = v0[1]->GetNextV0NonConst(); | |
cee25adb | 365 | } |
366 | } | |
367 | ||
368 | // Compare tracks | |
369 | ||
370 | if(flatEsd[0]->GetNumberOfTracks() && flatEsd[1]->GetNumberOfTracks() ){ | |
371 | outFile<<"------------------\ntracks\n------------------\n"; | |
372 | ||
373 | AliFlatESDTrack * track[2] = { const_cast<AliFlatESDTrack*>(flatEsd[0]->GetTracks() ) , const_cast<AliFlatESDTrack*>(flatEsd[1]->GetTracks() ) }; | |
374 | for( Int_t t = 0; t < flatEsd[0]->GetNumberOfTracks() && t < flatEsd[1]->GetNumberOfTracks() ; t++ ){ | |
375 | outFile<<"\nnew AliFlatESDTrack\n"; | |
376 | printDiff( "AliFlatESDTrack::GetSize",track[0]->GetSize(),track[1]->GetSize() ); | |
377 | printDiff( "AliFlatESDTrack::GetNumberOfTPCClusters",track[0]->GetNumberOfTPCClusters(),track[1]->GetNumberOfTPCClusters() ); | |
378 | printDiff( "AliFlatESDTrack::GetNumberOfITSClusters",track[0]->GetNumberOfITSClusters(),track[1]->GetNumberOfITSClusters() ); | |
379 | ||
380 | const char* pNames[7] = {"", "Refitted", "Ip", "TPCInner", "Op", "Cp", "ITSOUT"}; | |
381 | ||
382 | const AliFlatExternalTrackParam * p[7][2] = { | |
383 | {track[0]->GetFlatTrackParam(), track[1]->GetFlatTrackParam()}, | |
384 | {track[0]->GetFlatTrackParamRefitted(), track[1]->GetFlatTrackParamRefitted()}, | |
385 | {track[0]->GetFlatTrackParamIp(), track[1]->GetFlatTrackParamIp()}, | |
386 | {track[0]->GetFlatTrackParamTPCInner(), track[1]->GetFlatTrackParamTPCInner()}, | |
387 | {track[0]->GetFlatTrackParamOp(), track[1]->GetFlatTrackParamOp()}, | |
388 | {track[0]->GetFlatTrackParamCp(), track[1]->GetFlatTrackParamCp()}, | |
389 | {track[0]->GetFlatTrackParamITSOut(), track[1]->GetFlatTrackParamITSOut()} | |
390 | }; | |
391 | ||
392 | for(int i = 0 ; i<7; i++){ | |
393 | printDiff( Form("AliFlatESDTrack::GetFlatTrackParam%s",pNames[i]), (p[i][0] ? 1:0), (p[i][1] ? 1:0) ); | |
394 | } | |
395 | ||
396 | for(int i = 0 ; i<7; i++){ | |
397 | if(p[i][0] && p[i][1] ){ | |
398 | outFile<<"\nnew AliFlatExternalTrackParam" << pNames[i] << "\n"; | |
399 | printDiff( Form("AliFlatExternalTrackParam%s::GetAlpha",pNames[i]),p[i][0]->GetAlpha(),p[i][1]->GetAlpha() ); | |
400 | printDiff( Form("AliFlatExternalTrackParam%s::GetX",pNames[i]),p[i][0]->GetX(),p[i][1]->GetX() ); | |
401 | printDiff( Form("AliFlatExternalTrackParam%s::GetY",pNames[i]),p[i][0]->GetY(),p[i][1]->GetY() ); | |
402 | printDiff( Form("AliFlatExternalTrackParam%s::GetZ",pNames[i]),p[i][0]->GetZ(),p[i][1]->GetZ() ); | |
403 | printDiff( Form("AliFlatExternalTrackParam%s::GetSnp",pNames[i]),p[i][0]->GetSnp(),p[i][1]->GetSnp() ); | |
404 | printDiff( Form("AliFlatExternalTrackParam%s::GetTgl",pNames[i]),p[i][0]->GetTgl(),p[i][1]->GetTgl() ); | |
405 | printDiff( Form("AliFlatExternalTrackParam%s::GetSigned1Pt",pNames[i]),p[i][0]->GetSigned1Pt(),p[i][1]->GetSigned1Pt() ); | |
406 | ||
a88a189e | 407 | |
408 | Double_t* cov[2] = {(Double_t* ) p[i][0]->GetCov() , (Double_t*) p[i][1]->GetCov() }; | |
409 | printDiff( Form("AliFlatExternalTrackParam%s::GetCov",pNames[i]) , 15, cov[0], cov[1]); | |
cee25adb | 410 | } |
411 | } | |
412 | ||
413 | ||
414 | ||
415 | ||
416 | track[0] = track[0]->GetNextTrackNonConst(); | |
a88a189e | 417 | track[1] = track[1]->GetNextTrackNonConst(); |
cee25adb | 418 | |
a88a189e | 419 | } |
420 | } | |
421 | ||
422 | ||
423 | // Compare Friend variables | |
424 | ||
425 | outFile<<"\n\n------------------\nnew AliFlatESDFriend\n------------------\n"; | |
426 | printDiff( "AliFlatESDFriend::GetSize" ,flatFriend[0]->GetSize(), flatFriend[1]->GetSize() ) ; | |
427 | printDiff( "AliFlatESDFriend::GetNumberOfTracks" ,flatFriend[0]->GetNumberOfTracks(), flatFriend[1]->GetNumberOfTracks()); | |
428 | printDiff( "AliFlatESDFriend::GetEntriesInTracks" ,flatFriend[0]->GetEntriesInTracks(), flatFriend[1]->GetEntriesInTracks()); | |
429 | printDiff( "AliFlatESDFriend::TestSkipBit" ,flatFriend[0]->TestSkipBit(), flatFriend[1]->TestSkipBit() ) ; | |
430 | ||
431 | Double_t clTpc[2][72]; | |
432 | Double_t clTpcU[2][72]; | |
433 | for(int i = 0 ; i<72; i++){ | |
434 | clTpc[0][i] = flatFriend[0]->GetNclustersTPC(i); | |
435 | clTpc[1][i] = flatFriend[1]->GetNclustersTPC(i); | |
436 | ||
437 | clTpcU[0][i] = flatFriend[0]->GetNclustersTPCused(i); | |
438 | clTpcU[1][i] = flatFriend[1]->GetNclustersTPCused(i); | |
439 | } | |
440 | ||
441 | ||
442 | printDiff( "AliFlatESDFriend::GetNclustersTPC" ,72, clTpc[0], clTpc[1] ) ; | |
443 | printDiff( "AliFlatESDFriend::GetNclustersTPCused" ,72, clTpcU[0], clTpcU[1] ) ; | |
444 | ||
445 | ||
446 | // compare friend tracks | |
0e757649 | 447 | /* |
a88a189e | 448 | if(flatFriend[0]->GetEntriesInTracks() && flatFriend[1]->GetEntriesInTracks() ){ |
449 | outFile<<"------------------\nfriend tracks\n------------------\n"; | |
450 | ||
451 | AliFlatESDFriendTrack * track[2] = { const_cast<AliFlatESDFriendTrack*>(flatFriend[0]->GetFlatTrackEntry(0) ) , const_cast<AliFlatESDFriendTrack*>(flatFriend[1]->GetFlatTrackEntry(0) ) }; | |
452 | for( Int_t t = 0; t < flatFriend[0]->GetEntriesInTracks() && t < flatFriend[1]->GetEntriesInTracks() ; t++ ){ | |
453 | if(!track[0] || !track[1]) continue; | |
454 | outFile<<"\nnew AliFlatESDFriendTrack\n"; | |
455 | printDiff( "AliFlatESDFriendTrack::GetSize",track[0]->GetSize(),track[1]->GetSize() ); | |
cee25adb | 456 | |
a88a189e | 457 | AliExternalTrackParam p[3][2]; |
458 | AliExternalTrackParam q =AliExternalTrackParam() ; | |
cee25adb | 459 | |
a88a189e | 460 | const char* pNames[3] = {"TPCOut", "ITSOut", "TRDIn"}; |
cee25adb | 461 | |
a88a189e | 462 | // track[0]->GetTrackParamTPCOut(q ); |
463 | // track[1]->GetTrackParamTPCOut(p[0][1] ); | |
cee25adb | 464 | |
a88a189e | 465 | // track[0]->GetTrackParamITSOut(p[1][0] ); |
466 | //track[1]->GetTrackParamITSOut(p[1][1] ); | |
cee25adb | 467 | |
468 | ||
0e757649 | 469 | //track[0]->GetTrackParamTRDIn(p[2][0] ); |
470 | //track[1]->GetTrackParamTRDIn(p[2][1] ); | |
cee25adb | 471 | |
a88a189e | 472 | for(int i = 0 ; i<7; i++){ |
473 | outFile<<"\nnew AliExternalTrackParam" << pNames[i] << "\n"; | |
474 | printDiff( Form("AliExternalTrackParam%s::GetAlpha",pNames[i]),p[i][0].GetAlpha(),p[i][1].GetAlpha() ); | |
475 | printDiff( Form("AliExternalTrackParam%s::GetX",pNames[i]),p[i][0].GetX(),p[i][1].GetX() ); | |
476 | printDiff( Form("AliExternalTrackParam%s::GetY",pNames[i]),p[i][0].GetY(),p[i][1].GetY() ); | |
477 | printDiff( Form("AliExternalTrackParam%s::GetZ",pNames[i]),p[i][0].GetZ(),p[i][1].GetZ() ); | |
478 | printDiff( Form("AliExternalTrackParam%s::GetSnp",pNames[i]),p[i][0].GetSnp(),p[i][1].GetSnp() ); | |
479 | printDiff( Form("AliExternalTrackParam%s::GetTgl",pNames[i]),p[i][0].GetTgl(),p[i][1].GetTgl() ); | |
480 | printDiff( Form("AliExternalTrackParam%s::GetSigned1Pt",pNames[i]),p[i][0].GetSigned1Pt(),p[i][1].GetSigned1Pt() ); | |
481 | ||
482 | ||
483 | Double_t* cov[2] = { const_cast<Double_t*>( p[i][0].GetCovariance()) , const_cast<Double_t*>( p[i][1].GetCovariance() ) }; | |
484 | printDiff( Form("AliExternalTrackParam%s::GetCovariance",pNames[i]) , 15, cov[0], cov[1]); | |
485 | ||
486 | } | |
487 | ||
488 | ||
489 | ||
490 | ||
491 | ||
492 | AliTPCseed s[2]; | |
493 | ||
494 | ||
495 | track[0]->GetTPCseed(s[0] ); | |
496 | track[1]->GetTPCseed(s[1] ); | |
497 | ||
a88a189e | 498 | track[0] = track[0]->GetNextTrackNonConst(); |
499 | track[1] = track[1]->GetNextTrackNonConst(); | |
500 | ||
501 | ||
502 | } | |
a2e57ab1 | 503 | |
a88a189e | 504 | } |
0e757649 | 505 | */ |
a88a189e | 506 | outFile.close(); |
a2e57ab1 | 507 | |
508 | ||
a88a189e | 509 | return iResult; |
a2e57ab1 | 510 | } |
511 | ||
512 | ||
513 | // ################################################################################# | |
514 | Int_t AliHLTGlobalCompareFlatComponent::ReadPreprocessorValues(const Char_t* /*modules*/) { | |
515 | // see header file for class documentation | |
516 | ALIHLTERRORGUARD(5, "ReadPreProcessorValues not implemented for this component"); | |
517 | return 0; | |
518 | } | |
519 | ||
520 | ||
521 | int AliHLTGlobalCompareFlatComponent::Configure(const char*/* arguments*/) | |
522 | { | |
523 | // see header file for class documentation | |
524 | int iResult=0; | |
525 | ||
526 | return iResult; | |
527 | } | |
528 | ||
529 | int AliHLTGlobalCompareFlatComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) | |
530 | { | |
531 | // see header file for class documentation | |
532 | int iResult=0; | |
533 | ||
534 | return iResult; | |
535 | } | |
536 | ||
537 |