]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/AliHMPIDRawStream.cxx
Adding an example of CDB location on alien.
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDRawStream.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 ///////////////////////////////////////////////////////////////////////////////
17 ///
18 /// This is a class for reading the HMPID raw data
19 /// The format of the raw data corresponds to the one
20 /// which was documented by Paolo Martinengo.
21 ///
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliHMPIDRawStream.h"
25 #include "AliRawReader.h"
26 #include "AliLog.h"
27
28 static Bool_t stDeb = kFALSE;      
29 //static Bool_t stDeb = kTRUE;      
30
31 ClassImp(AliHMPIDRawStream)
32
33 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34 AliHMPIDRawStream::AliHMPIDRawStream(AliRawReader* rawReader) :
35   fNPads(0),
36   fCharge(0x0),
37   fPad(0x0),
38   fDDLNumber(-1),
39   fLDCNumber( 0),
40   fTimeStamp( 0),
41   fRawReader(rawReader),
42   fData(0x0),
43   fNumOfErr(0x0),
44   fPosition(-1),
45   fWord(0),
46   fZeroSup(kTRUE),
47   fPos(0x0),
48   fiPos(0)
49 {
50   //
51   // Constructor
52   //
53   fNumOfErr = new Int_t*[kNDDL];                                 // Store the numner of errors for a given error type and a given DD
54   for(Int_t i=0;i<kNDDL;i++) {
55     fNumOfErr[i] = new Int_t [kSumErr];
56   }
57   
58   for(Int_t iddl=0;iddl<kNDDL;iddl++) 
59     for(Int_t ierr=0; ierr < kSumErr; ierr++) fNumOfErr[iddl][ierr]=0;               //reset errors  
60   fRawReader->Reset();
61   fRawReader->Select("HMPID");
62 }
63 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64 AliHMPIDRawStream::AliHMPIDRawStream() :
65   fNPads(0),
66   fCharge(0x0),
67   fPad(0x0),
68   fDDLNumber(-1),
69   fLDCNumber( 0),
70   fTimeStamp( 0),
71   fRawReader(0x0),
72   fData(0x0),
73   fNumOfErr(0x0),  
74   fPosition(-1),
75   fWord(0),
76   fZeroSup(kTRUE),
77   fPos(0x0),
78   fiPos(0) 
79 {
80   //
81   // Constructor
82   //
83   fNumOfErr = new Int_t*[kNDDL];                                 // Store the numner of errors for a given error type and a given DD
84   for(Int_t i=0;i<kNDDL;i++) {
85     fNumOfErr[i] = new Int_t [kSumErr];
86   }
87   for(Int_t iddl=0;iddl<kNDDL;iddl++) 
88     for(Int_t ierr=0; ierr < kSumErr; ierr++) fNumOfErr[iddl][ierr]=0;               //reset errors  
89
90 }
91 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92 AliHMPIDRawStream::~AliHMPIDRawStream()
93 {
94   //
95   // destructor
96   //
97   DelVars();
98 }
99 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
100 void AliHMPIDRawStream::Reset()
101 {
102   // reset raw stream params
103   // Reinitalize the containers
104   fDDLNumber = -1;
105   fLDCNumber =  0;
106   fTimeStamp =  0;
107   fPosition = -1;
108   fData = NULL;
109   if (fRawReader) fRawReader->Reset();
110 }
111 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
112 Bool_t AliHMPIDRawStream::Next()
113 {
114   // read next DDL raw data from the HMPID raw data stream
115   // return kFALSE in case of error or no data left
116   AliDebug(1,"Start.");
117   do {
118     if (!fRawReader->ReadNextData(fData)) return kFALSE;
119   } while (fRawReader->GetDataSize() == 0);
120   
121      
122   /*
123   Event type is selected as in $ALICE_ROOT/RAW/event.h  
124   #define START_OF_RUN                    ((eventTypeType) 1)
125   #define END_OF_RUN                      ((eventTypeType) 2)
126   #define START_OF_RUN_FILES              ((eventTypeType) 3)
127   #define END_OF_RUN_FILES                ((eventTypeType) 4)
128   #define START_OF_BURST                  ((eventTypeType) 5)
129   #define END_OF_BURST                    ((eventTypeType) 6)
130   #define PHYSICS_EVENT                   ((eventTypeType) 7) <<---------------  
131   #define CALIBRATION_EVENT               ((eventTypeType) 8)
132   #define EVENT_FORMAT_ERROR              ((eventTypeType) 9)
133   #define START_OF_DATA                   ((eventTypeType)10)
134   #define END_OF_DATA                     ((eventTypeType)11)
135   #define SYSTEM_SOFTWARE_TRIGGER_EVENT   ((eventTypeType)12)
136   #define DETECTOR_SOFTWARE_TRIGGER_EVENT ((eventTypeType)13)
137   #define EVENT_TYPE_MIN                  1
138   #define EVENT_TYPE_MAX                  13 
139   */
140
141   fPosition = 0;
142   Bool_t status;
143   Int_t  rawDataSize=0;        
144   if(fRawReader->GetType() == 7)  {                             //New: Select Physics events, Old: Raw data size is not 0 and not 47148 (pedestal)
145     fDDLNumber = fRawReader->GetDDLID();
146     fLDCNumber = fRawReader->GetLDCId();
147     fTimeStamp = fRawReader->GetTimestamp();
148
149     if(stDeb) Printf("DDL %i started to be decoded!",fDDLNumber); 
150     rawDataSize=fRawReader->GetDataSize()/4;
151     InitVars(rawDataSize);
152     
153     status = ReadHMPIDRawData();
154    
155     if(stDeb) {
156       if(status) Printf("Event DDL %i successfully decoded!.",fDDLNumber);
157       else Printf("Event DDL %i ERROR in decoding!.",fDDLNumber);
158 //      DumpData(fRawReader->GetDataSize());
159     }
160 //    stDeb=kFALSE;
161   }
162 //  return status;
163     return kTRUE;
164 }
165 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
166 void AliHMPIDRawStream::InitVars(Int_t n)
167 {
168   //
169   //
170   //
171   fNPads = 0;
172   fCharge = new Int_t[n];
173   fPad = new Int_t[n];
174   //for debug purpose
175   fPos = new Int_t[4*n+4];                     //reset debug
176   fiPos = 0;
177 }    
178 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
179 void AliHMPIDRawStream::DelVars()
180 {
181   //
182   //
183   // 
184   fNPads = 0;
185   fDDLNumber=0;
186   fLDCNumber=0;
187   fTimeStamp=0;
188   fPosition=0;
189   fWord=0;
190   fZeroSup=0;
191   fiPos=0;
192   
193   if (fCharge)     { delete [] fCharge;    fCharge = 0x0;    }
194   if (fPad)        { delete [] fPad;       fPad = 0x0;       }   
195   if (fPos)        { delete [] fPos;       fPos = 0x0;       }     
196   for(Int_t i=0;i<kSumErr;i++) delete [] fNumOfErr[i]; 
197   delete [] fNumOfErr; 
198
199   
200       
201 }    
202 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
203 Bool_t AliHMPIDRawStream::ReadHMPIDRawData()
204 {
205   Int_t cntGlob = fRawReader->GetDataSize()/4;
206   if(cntGlob==0) {fNumOfErr[fDDLNumber][kRawDataSizeErr]++; return kFALSE; }
207   
208   Int_t cnt = cntGlob;
209   Int_t nwSeg;
210   Int_t cntSegment;
211
212   if(!GetWord(cnt)) return kFALSE;
213   cnt--;
214
215   
216   while (cnt>0) {
217     
218     nwSeg = (fWord >> kbit8) & 0xfff;
219     if(!CheckSegment()) return kFALSE;
220     if(!ReadSegment(cntSegment)) return kFALSE;
221
222     if(nwSeg != cntSegment) {if(stDeb){Printf("Error in Segment counters: %i different wrt %i",nwSeg,cntSegment);} return kFALSE;}
223     if(!GetWord(cntSegment+1,kBwd)) return kFALSE;
224     cnt-=cntSegment+1;
225   }
226   
227   return kTRUE;
228   
229 }
230 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
231 Bool_t AliHMPIDRawStream::ReadSegment(Int_t &cntSegment)
232 {
233   cntSegment = (fWord >> kbit8) & 0xfff;
234   Int_t cnt = cntSegment;
235   Int_t cntRow;
236   Int_t nwRow;
237
238   if(!GetWord(cnt,kBwd)) return kFALSE;
239   
240   while (cnt>0) {
241
242     cntRow  = (fWord >> kbit16) & 0xfff;
243     if(!CheckRowMarker()) return kFALSE;
244     if(!ReadRow(nwRow)) return kFALSE;
245
246     if(nwRow != cntRow) {if(stDeb){Printf("Error in Row counters: %i different wrt %i",nwRow,cntRow);} return kFALSE;}
247     if(!GetWord(cntRow+1)) return kFALSE;
248     cnt -= cntRow+1;
249     
250   }
251
252   cntSegment -= cnt;
253   
254   return kTRUE;
255     
256 }    
257 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
258 Bool_t AliHMPIDRawStream::ReadRow(Int_t &cntRow)
259 {
260   Int_t cnt;
261   Int_t cntDilogic;
262   Int_t nwDil;
263   
264   cntRow  = (fWord >> kbit16) & 0xfff;
265   cnt = cntRow;  
266   
267   if(!GetWord(cntRow)) return kFALSE;
268   
269   while (cnt>0) {
270     
271     if(!CheckEoE(nwDil)) return kFALSE;
272     if(!ReadDilogic(cntDilogic)) return kFALSE;
273     
274     if(nwDil != cntDilogic) {if(stDeb){Printf("Error in Dilogic counters: %i different wrt %i",nwDil,cntDilogic);}return kFALSE;}
275     cnt -= cntDilogic;
276     if(!GetWord(1,kBwd)) return kFALSE; // go to next Dilogic bank...
277     cnt--;
278 //    Printf(" cnt %i cntDilogic %i ",cnt,cntDilogic);
279   }
280   
281   cntRow -= cnt;  
282   
283   return kTRUE;
284   
285 }
286 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
287 Bool_t AliHMPIDRawStream::ReadDilogic(Int_t &cntDilogic)
288 {
289   cntDilogic = fWord & 0x7f;
290   
291   Int_t cnt = cntDilogic;
292   
293 //  Printf(" cnt DILOGIC %i at %i word %08X",cnt,fPosition,fWord);
294
295   for(Int_t iDil=0;iDil<cntDilogic;iDil++) {
296     UInt_t dilogic = 0, row = 0;
297     if(!GetWord(1,kBwd)) return kFALSE;
298 //check on row number      
299     cnt--;
300     row = (fWord >> kbit22) & 0x1f;
301     if(!CheckRow(row)) continue;
302 //check dilogic number     
303     dilogic = (fWord >> kbit18) & 0xf;                                              //dilogic info in raw word is between bits: 18...21
304     if(!CheckDilogic(dilogic)) continue;
305 //check pad number
306     UInt_t pad = (fWord >> kbit12) & 0x3f;                                          //pad info in raw word is between bits: 12...17
307     if(!CheckPad(pad)) continue;
308     Int_t charge = fWord & 0xfff;
309     fPad[fNPads] = GetPad(fDDLNumber,row,dilogic,pad);
310     fCharge[fNPads] = charge;
311     fNPads++;
312   }
313
314   cntDilogic -= cnt;  
315   return kTRUE;  
316 }
317 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
318 Bool_t AliHMPIDRawStream::CheckSegment()
319 {
320   UInt_t markSegment = 0xAB0;
321   /*
322   if (iRow%8 == 0) {
323     UInt_t segWord = GetWord();          
324     if ((segWord >> 20) != statusSegWord) {
325       fRawReader->AddMajorErrorLog(kBadSegWordErr);
326       AliWarning(Form("Wrong segment word signature: %x, expected 0xab0!",(segWord >> 20)));
327       fNumOfErr[kBadSegWordErr]++;
328       return kTRUE;
329     }
330 */
331   UInt_t segMarker = (fWord >> kbit20) & 0xfff;
332   if (segMarker != markSegment ) {
333     //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment marker %0X wrong (expected %0X) at %i in word %0X!",segMarker,markSegment,fPosition,fWord));
334     if(stDeb){ AliWarning(Form("Segment marker %X wrong (expected %0X)! at %i in word %0X!",segMarker,markSegment,fPosition,fWord));}
335     fNumOfErr[fDDLNumber][kWrongSegErr]++;
336     return kFALSE;
337   }
338   
339   UInt_t segAddress = fWord & 0xff;
340   if (segAddress<1 ||segAddress>3) {
341     //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment address %d not in the valid range [1-3] at %i in word %0X",segAddress,fPosition,fWord));
342     if(stDeb){AliWarning(Form("Segment address %d not in the valid range [1-3]",segAddress));}
343     fNumOfErr[fDDLNumber][kWrongSegErr]++;
344     return kFALSE;
345   }
346 //  Printf("Segment Marker found at %i! Number of segment is %i",fPosition,segAddress);
347   return kTRUE;
348 }
349 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
350 Bool_t AliHMPIDRawStream::CheckRow(UInt_t row)
351 {
352 //check on row number      
353 //  Printf("ROW %i word %0X",row,fWord);
354   if(row>=1 && row <=kNRows) return kTRUE;
355   
356   //fRawReader->AddMajorErrorLog(kWrongRowErr,Form("row %d",row));
357   if(stDeb){AliWarning(Form("Wrong row index: %d, expected (1 -> %d) word %0X at %i...",row,kNRows,fWord,fPosition));}
358   fNumOfErr[fDDLNumber][kWrongRowErr]++;
359   return kFALSE;
360 }
361 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
362 Bool_t AliHMPIDRawStream::CheckDilogic(UInt_t dilogic)
363 {
364 //check dilogic number     
365   if (dilogic>= 1 && dilogic <=kNDILOGICAdd) return kTRUE;
366
367   //fRawReader->AddMajorErrorLog(kWrongDilogicErr,Form("dil %d",dilogic));
368   if(stDeb){AliWarning(Form("Wrong DILOGIC index: %d, expected (1 -> %d)!",dilogic,kNDILOGICAdd));}
369   fNumOfErr[fDDLNumber][kWrongDilogicErr]++;
370   //dilogic = iDILOGIC;
371   return kFALSE;
372 }      
373 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
374 Bool_t AliHMPIDRawStream::CheckPad(UInt_t pad)
375 {
376 //check pad number     
377   if (pad < kNPadAdd) return kTRUE;
378   
379   //fRawReader->AddMajorErrorLog(kWrongPadErr,Form("pad %d",pad));
380   if(stDeb){AliWarning(Form("Wrong pad index: %d, expected (0 -> %d)!",pad,kNPadAdd));}
381   fNumOfErr[fDDLNumber][kWrongPadErr]++;
382   return kFALSE;
383 }    
384 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
385 Bool_t AliHMPIDRawStream::CheckEoE(Int_t &nDil)
386 {
387   if (!((fWord >> kbit27) & 0x1)) {                                                //check 27th bit in EoE. It must be 1!
388     //fRawReader->AddMajorErrorLog(kEoEFlagErr);
389     if(stDeb){AliWarning(Form("Missing end-of-event flag! (%08X) at %i",fWord,fPosition));}
390     fNumOfErr[fDDLNumber][kEoEFlagErr]++;
391     return kFALSE;
392   }
393   nDil = fWord & 0x7f;                                               //nDil=EoE word count
394   if(nDil < 0 || nDil > 48 ) { 
395
396     //fRawReader->AddMajorErrorLog(kEoESizeErr,Form("EoE size=%d",nDil));
397     if(stDeb){AliWarning(Form("Wrong end-of-event word-count: %08X",fWord));}
398     fNumOfErr[fDDLNumber][kEoESizeErr]++;
399     return kFALSE;
400   }
401 //  UInt_t da = (eOfEvent >> 18) & 0xf;
402 //  if (cntData!=0 && da != dilogic) {
403 //    fRawReader->AddMajorErrorLog(kEoEDILOGICErr,Form("eoe dil %d != %d",da,dilogic));
404 //    AliWarning(Form("Wrong DILOGIC address found in end-of-event: %d, expected %d!",da,dilogic));
405 //    fNumOfErr[kEoEDILOGICErr]++;
406 //    return kFALSE;  AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj) ;  
407
408 //  }
409 //  UInt_t ca = (eOfEvent >> 22) & 0x1f;
410 //  if (cntData!=0 &&  ca != row) {
411 //    fRawReader->AddMajorErrorLog(kEoERowErr,Form("eoe row %d != %d",ca,row));
412 //    AliWarning(Form("Wrong row index found in end-of-event: %d, expected %d!",ca,row));
413 //    fNumOfErr[kEoERowErr]++;
414 //    return kFALSE;
415 //  }
416   return kTRUE;
417 }
418 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
419 Bool_t AliHMPIDRawStream::CheckRowMarker()
420 {
421   UInt_t nMAXwordsInRow = 0x1EA;
422   UInt_t statusControlRow = 0x32a8; // 0x36a8 for zero suppression
423 //First check on row marker    
424   UInt_t rowControlWord = fWord >> kbit0 & 0xfbff;
425   
426   if(rowControlWord != statusControlRow) {
427     //fRawReader->AddMajorErrorLog(kRowMarkerErr);
428     if(stDeb){AliWarning(Form("Wrong row marker %x expected 0x32a8!",rowControlWord));
429               fNumOfErr[fDDLNumber][kRowMarkerErr]++;
430               return kFALSE; }
431    }
432 //Second check on row marker    
433    UInt_t wordsInRow = fWord >> kbit16 & 0x0fff;                // Number of words after the row marker, bit 10 is skipped in this check
434   
435   if (wordsInRow > nMAXwordsInRow) {
436     //fRawReader->AddMajorErrorLog(kRowMarkerSizeErr);
437     if(stDeb){AliWarning(Form(" FATAL: Number of words %x in a row exceeds the expected value: 0x1EA !",wordsInRow));}
438     fNumOfErr[fDDLNumber][kRowMarkerSizeErr]++;
439     return kFALSE;
440   }
441   
442   return kTRUE;
443 }
444 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
445 Bool_t AliHMPIDRawStream::GetWord(Int_t n,EDirection dir)
446 {
447   // This method returns the n-th 32 bit word
448   // inside the raw data payload.
449   // The method is supposed to be endian (platform)
450   // independent.
451   
452   fWord = 0;
453   if (!fData || fPosition < 0) AliFatal("Raw data payload buffer is not yet initialized !");
454
455   if(dir==kBwd) n = -n; 
456   fPosition+=4*n-4;
457
458   if(fPosition==-4) return kTRUE;
459   
460   if(fPosition<0 || fPosition > fRawReader->GetDataSize()) {
461     if(stDeb) Printf("fPosition out of boundaries %i",fPosition);
462     return kFALSE;
463   }
464     
465   StorePosition();
466   
467   fWord |= fData[fPosition++];
468   fWord |= fData[fPosition++] << 8;
469   fWord |= fData[fPosition++] << 16;
470   fWord |= fData[fPosition++] << 24;
471
472   return kTRUE;
473 }
474 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
475 void AliHMPIDRawStream::DumpData(Int_t nw)
476 {
477    for(Int_t i=0;i<nw;i+=4) {
478      if(!(i%16)) printf(" \n %8i) ",i);
479      printf("%02X%02X%02X%02X [ %06i ] ",fData[i+3],fData[i+2],fData[i+1],fData[i+0],fPos[i]);
480    }
481    Printf(" \n -----end of dump ----------- ");
482 }
483 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
484 void AliHMPIDRawStream::StorePosition()
485 {
486 //  Printf("@@@@@@@@@ fPos: %x fPosition: %d",fPos,fPosition);
487   if(fPos[fPosition]!=0) {
488 //    Printf("Position already stored!!! Value %i at address %i",fPos[fPosition],fPosition); 
489     return;
490   }
491   fiPos++;
492   fPos[fPosition] = fiPos;
493 //  if(stDeb)Printf("%i - Actual position %i",iPos,fPosition); 
494 }
495 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++