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