Moved from exa
[u/mrichter/AliRoot.git] / HLT / src / AliL3FileHandler.cxx
CommitLineData
31d9405a 1//$Id$
2
b661165c 3// Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
4//*-- Copyright &copy Uli
108615fc 5
6#include <math.h>
7#include <iostream.h>
108615fc 8
9#include "AliL3Transform.h"
10#include "AliL3Logging.h"
11#include "AliL3MemHandler.h"
12#include "AliL3FileHandler.h"
13
0d319e67 14#include "AliTPCDigitsArray.h"
108615fc 15#include "AliTPCClustersArray.h"
16#include "AliTPCcluster.h"
17#include "AliTPCClustersRow.h"
108615fc 18
19#include "AliL3DigitData.h"
20#include "AliL3TrackSegmentData.h"
21#include "AliL3SpacePointData.h"
22#include "AliL3TrackArray.h"
b661165c 23
108615fc 24//_____________________________________________________________
b661165c 25// AliL3FileHandler
108615fc 26//
27// The L3 Binary File handler
28//
29
30ClassImp(AliL3FileHandler)
31
32AliL3FileHandler::AliL3FileHandler(){
33 //Default constructor
34 fInAli = 0;
35 fParam = 0;
108615fc 36 fMC =0;
a6e4f9d6 37 fLastIndex=0;
38 fDigits=0;
39 fDigitsTree=0;
108615fc 40}
41
108615fc 42AliL3FileHandler::~AliL3FileHandler(){
43 //Destructor
108615fc 44 if(fMC) CloseMCOutput();
a6e4f9d6 45 if(fDigitsTree) delete fDigitsTree;
8f1a9904 46 if(fInAli) CloseAliInput();
a6e4f9d6 47
108615fc 48}
49
50Bool_t AliL3FileHandler::SetMCOutput(char *name){
51 fMC = fopen(name,"w");
52 if(!fMC){
53 LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
54 <<"Pointer to File = 0x0 "<<ENDLOG;
55 return kFALSE;
56 }
57 return kTRUE;
58}
59
60Bool_t AliL3FileHandler::SetMCOutput(FILE *file){
61 fMC = file;
62 if(!fMC){
63 LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
64 <<"Pointer to File = 0x0 "<<ENDLOG;
65 return kFALSE;
66 }
67 return kTRUE;
68}
69
70void AliL3FileHandler::CloseMCOutput(){
71 if(!fMC){
72 LOG(AliL3Log::kWarning,"AliL3FileHandler::CloseMCOutPut","File Close")
73 <<"Nothing to Close"<<ENDLOG;
74 return;
75 }
76 fclose(fMC);
77 fMC =0;
78}
79
80Bool_t AliL3FileHandler::SetAliInput(){
81 if(!fInAli->IsOpen()){
82 LOG(AliL3Log::kError,"AliL3FileHandler::SetAliInput","File Open")
83 <<"Ali File "<<fInAli->GetName()<<" does not exist"<<ENDLOG;
84 return kFALSE;
85 }
86 fParam = (AliTPCParam*)fInAli->Get("75x40_100x60");
87 if(!fParam){
88 LOG(AliL3Log::kError,"AliL3FileHandler::SetAliInput","File Open")
89 <<"No AliTPCParam 75x40_100x60 in File "<<fInAli->GetName()<<ENDLOG;
90 return kFALSE;
91 }
108615fc 92 return kTRUE;
93}
94
95Bool_t AliL3FileHandler::SetAliInput(char *name){
96 fInAli= new TFile(name,"READ");
97 if(!fInAli){
98 LOG(AliL3Log::kWarning,"AliL3FileHandler::SetAliInput","File Open")
99 <<"Pointer to TFile = 0x0 "<<ENDLOG;
100 return kFALSE;
101 }
102 return SetAliInput();
103}
104
105Bool_t AliL3FileHandler::SetAliInput(TFile *file){
106 fInAli=file;
107 if(!fInAli){
108 LOG(AliL3Log::kWarning,"AliL3FileHandler::SetAliInput","File Open")
109 <<"Pointer to TFile = 0x0 "<<ENDLOG;
110 return kFALSE;
111 }
112 return SetAliInput();
113}
114
115void AliL3FileHandler::CloseAliInput(){
116 if(!fInAli){
117 LOG(AliL3Log::kWarning,"AliL3FileHandler::CloseAliInput","File Close")
118 <<"Nothing to Close"<<ENDLOG;
119 return;
120 }
121 if(fInAli->IsOpen()) fInAli->Close();
122 delete fInAli;
123 fInAli = 0;
8f1a9904 124
108615fc 125}
126
127Bool_t AliL3FileHandler::IsDigit(){
128 if(!fInAli){
129 LOG(AliL3Log::kWarning,"AliL3FileHandler::IsDigit","File")
130 <<"Pointer to TFile = 0x0 "<<ENDLOG;
131 return kTRUE; //may you are use binary input which is Digits!!
132 }
03b6adf7 133 TTree *t=(TTree*)fInAli->Get("TreeD_75x40_100x60_0");
108615fc 134 if(t){
135 LOG(AliL3Log::kInformational,"AliL3FileHandler::IsDigit","File Type")
136 <<"Found Digit Tree -> Use Fast Cluster Finder"<<ENDLOG;
137 return kTRUE;
138 }
139 else{
140 LOG(AliL3Log::kInformational,"AliL3FileHandler::IsDigit","File Type")
141 <<"No Digit Tree -> Use Cluster Tree"<<ENDLOG;
142 return kFALSE;
143 }
144}
145
146///////////////////////////////////////// Digit IO
31d9405a 147Bool_t AliL3FileHandler::AliDigits2Binary(Int_t event){
108615fc 148 Bool_t out = kTRUE;
149 UInt_t nrow;
31d9405a 150 AliL3DigitRowData* data = AliDigits2Memory(nrow,event);
108615fc 151 out = Memory2Binary(nrow,data);
152 Free();
153 return out;
154}
155
156
31d9405a 157Bool_t AliL3FileHandler::AliDigits2CompBinary(Int_t event){
108615fc 158 Bool_t out = kTRUE;
159 UInt_t ndigits=0;
31d9405a 160 AliL3DigitRowData* digits = AliDigits2Memory(ndigits,event);
108615fc 161 out = Memory2CompBinary(ndigits,digits);
162 Free();
163 return out;
164}
165
166
31d9405a 167AliL3DigitRowData * AliL3FileHandler::AliDigits2Memory(UInt_t & nrow,Int_t event){
108615fc 168 AliL3DigitRowData *data = 0;
169 nrow=0;
170 if(!fInAli){
171 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliDigits2Memory","File")
172 <<"No Input avalible: no object TFile"<<ENDLOG;
173 return 0;
174 }
175 if(!fInAli->IsOpen()){
176 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliDigits2Memory","File")
177 <<"No Input avalible: TFile not opend"<<ENDLOG;
178 return 0;
179 }
b25c64e5 180 if(!fTransformer)
181 {
182 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliDigits2Memory","Transformer")
183 <<"No transformer object"<<ENDLOG;
184 return 0;
185 }
186
a6e4f9d6 187 if(!fDigitsTree)
188 GetDigitsTree(event);
189
108615fc 190 UShort_t dig;
191 Int_t time,pad,sector,row;
192 Int_t nrows=0;
193 Int_t ndigitcount=0;
a6e4f9d6 194 Int_t entries = (Int_t)fDigitsTree->GetEntries();
108615fc 195 Int_t ndigits[entries];
196 Int_t lslice,lrow;
a6e4f9d6 197
198 for(Int_t n=fLastIndex; n<fDigitsTree->GetEntries(); n++)
108615fc 199 {
a6e4f9d6 200 fDigitsTree->GetEvent(n);
201 fParam->AdjustSectorRow(fDigits->GetID(),sector,row);
108615fc 202 fTransformer->Sector2Slice(lslice,lrow,sector,row);
a6e4f9d6 203 //if(fSlice != lslice || lrow<fRowMin || lrow>fRowMax) continue;
204 if(lslice < fSlice) continue;
205 if(lslice != fSlice) break;
206 if(lrow < fRowMin) continue;
207 if(lrow > fRowMax) break;
108615fc 208
209 Float_t xyz[3];
210 ndigits[lrow] = 0;
a6e4f9d6 211 fDigits->First();
108615fc 212 do {
a6e4f9d6 213 time=fDigits->CurrentRow();
214 pad=fDigits->CurrentColumn();
215 dig = fDigits->GetDigit(time,pad);
108615fc 216 if(dig<=fParam->GetZeroSup()) continue;
217 if(time < fParam->GetMaxTBin()-1 && time > 0)
a6e4f9d6 218 if(fDigits->GetDigit(time+1,pad) <= fParam->GetZeroSup()
219 && fDigits->GetDigit(time-1,pad) <= fParam->GetZeroSup())
108615fc 220 continue;
221
222 fTransformer->Raw2Local(xyz,sector,row,pad,time);
223 if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
224 continue;
225
226 ndigits[lrow]++; //for this row only
227 ndigitcount++; //total number of digits to be published
228
a6e4f9d6 229 } while (fDigits->Next());
108615fc 230
231 nrows++;
232 }
233 Int_t size = sizeof(AliL3DigitData)*ndigitcount
8f1a9904 234 + nrows*sizeof(AliL3DigitRowData);
108615fc 235
236 LOG(AliL3Log::kDebug,"AliL3FileHandler::AliDigits2Memory","Digits")
a6e4f9d6 237 <<AliL3Log::kDec<<"Found "<<ndigitcount<<" Digits"<<ENDLOG;
238
108615fc 239 data=(AliL3DigitRowData*) Allocate(size);
240 nrow = (UInt_t)nrows;
241 AliL3DigitRowData *tempPt = data;
a6e4f9d6 242 for(Int_t n=fLastIndex; n<fDigitsTree->GetEntries(); n++)
108615fc 243 {
a6e4f9d6 244 fDigitsTree->GetEvent(n);
108615fc 245 Float_t xyz[3];
a6e4f9d6 246 fParam->AdjustSectorRow(fDigits->GetID(),sector,row);
108615fc 247 fTransformer->Sector2Slice(lslice,lrow,sector,row);
a6e4f9d6 248 //if(fSlice != lslice || lrow<fRowMin || lrow>fRowMax) continue;
249 if(lslice < fSlice) continue;
250 if(lslice != fSlice) break;
251 if(lrow < fRowMin) continue;
252 if(lrow > fRowMax) break;
253
108615fc 254 tempPt->fRow = lrow;
255 tempPt->fNDigit = ndigits[lrow];
256
257 Int_t localcount=0;
a6e4f9d6 258 fDigits->First();
108615fc 259 do {
a6e4f9d6 260 //dig=fDigits->CurrentDigit();
03b6adf7 261 //if (dig<=fParam->GetZeroSup()) continue;
a6e4f9d6 262 time=fDigits->CurrentRow();
263 pad=fDigits->CurrentColumn();
264 dig = fDigits->GetDigit(time,pad);
03b6adf7 265 if (dig <= fParam->GetZeroSup()) continue;
266 if(time < fParam->GetMaxTBin()-1 && time > 0)
a6e4f9d6 267 if(fDigits->GetDigit(time-1,pad) <= fParam->GetZeroSup() &&
268 fDigits->GetDigit(time+1,pad) <= fParam->GetZeroSup()) continue;
108615fc 269
270 //Exclude data outside cone:
271 fTransformer->Raw2Local(xyz,sector,row,pad,time);
272 if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
273 continue;
274
275 if(localcount >= ndigits[lrow])
276 LOG(AliL3Log::kFatal,"AliL3FileHandler::AliDigits2Binary","Memory")
03b6adf7 277 <<AliL3Log::kDec<<"Mismatch: localcount "<<localcount<<" ndigits "
278 <<ndigits[lrow]<<ENDLOG;
279
108615fc 280 tempPt->fDigitData[localcount].fCharge=dig;
281 tempPt->fDigitData[localcount].fPad=pad;
282 tempPt->fDigitData[localcount].fTime=time;
10f815d9 283#ifdef do_mc
284 tempPt->fDigitData[localcount].fTrackID[0] = fDigits->GetTrackID(time,pad,0);
285 tempPt->fDigitData[localcount].fTrackID[1] = fDigits->GetTrackID(time,pad,1);
286 tempPt->fDigitData[localcount].fTrackID[2] = fDigits->GetTrackID(time,pad,2);
287#endif
108615fc 288 localcount++;
a6e4f9d6 289 } while (fDigits->Next());
108615fc 290
291 Byte_t *tmp = (Byte_t*)tempPt;
292 Int_t size = sizeof(AliL3DigitRowData)
293 + ndigits[lrow]*sizeof(AliL3DigitData);
294 tmp += size;
295 tempPt = (AliL3DigitRowData*)tmp;
a6e4f9d6 296 //fLastIndex=n;
108615fc 297 }
a6e4f9d6 298 //fLastIndex++;
108615fc 299 return data;
300}
301
a6e4f9d6 302Bool_t AliL3FileHandler::GetDigitsTree(Int_t event)
303{
304
305 fInAli->cd();
306 Char_t dname[100];
307 sprintf(dname,"TreeD_75x40_100x60_%d",event);
308 fDigitsTree = (TTree*)fInAli->Get("TreeD_75x40_100x60_0");
309 if(!fDigitsTree)
310 {
311 LOG(AliL3Log::kError,"AliL3FileHandler::GetDigitsTree","Digits Tree")
312 <<AliL3Log::kHex<<"Error getting digitstree "<<(Int_t)fDigitsTree<<ENDLOG;
313 return kFALSE;
314 }
315 fDigitsTree->GetBranch("Segment")->SetAddress(&fDigits);
316 return kTRUE;
317}
318
0d319e67 319void AliL3FileHandler::AliDigits2RootFile(AliL3DigitRowData *rowPt,Char_t *new_digitsfile)
320{
321 //Write digits to a new alirootfile.
322
323 if(!fInAli)
324 {
8f1a9904 325 printf("AliL3FileHandler::AliDigits2RootFile : No rootfile\n");
0d319e67 326 return;
327 }
328 if(!fParam)
329 {
330 printf("AliL3FileHandler::AliDigits2RootFile : No parameter object. Run on rootfile\n");
331 return;
332 }
333 if(!fTransformer)
334 {
335 printf("AliL3FileHandler::AliDigits2RootFile : No transform object\n");
336 return;
337 }
338
339 //Get the original digitstree:
340 fInAli->cd();
341 AliTPCDigitsArray *old_array = new AliTPCDigitsArray();
342 old_array->Setup(fParam);
343 old_array->SetClass("AliSimDigits");
03b6adf7 344 Bool_t ok = old_array->ConnectTree("TreeD_75x40_100x60_0");
0d319e67 345 if(!ok)
346 {
347 printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object\n");
348 return;
349 }
0d319e67 350
03b6adf7 351 Bool_t create=kFALSE;
352 TFile *digFile;
353
8f1a9904 354 digFile = TFile::Open(new_digitsfile,"NEW");
355 if(digFile->IsOpen())
03b6adf7 356 {
03b6adf7 357 create = kTRUE;
358 fParam->Write(fParam->GetTitle());
359 }
360 else
361 {
8f1a9904 362 LOG(AliL3Log::kDebug,"AliL3FileHandler::AliDigits2RootFile","Rootfile")
363 <<"Rootfile did already exist, so I will just open it for updates"<<ENDLOG;
03b6adf7 364 digFile = TFile::Open(new_digitsfile,"UPDATE");
365 create=kFALSE;
366 }
367 if(!digFile->IsOpen())
368 {
8f1a9904 369 LOG(AliL3Log::kError,"AliL3FileHandler::AliDigits2RootFile","Rootfile")
370 <<"Error opening rootfile "<<new_digitsfile<<ENDLOG;
03b6adf7 371 return;
372 }
373
374 digFile->cd();
375
376 //setup a new one, or connect it to the existing one:
0d319e67 377 AliTPCDigitsArray *arr = new AliTPCDigitsArray;
378 arr->SetClass("AliSimDigits");
379 arr->Setup(fParam);
03b6adf7 380 if(create)
381 arr->MakeTree();
382 else
383 {
384 Bool_t ok = arr->ConnectTree("TreeD_75x40_100x60_0");
385 if(!ok)
386 {
387 printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object in existing file\n");
388 return;
389 }
390 }
54efe57a 391 Int_t digcounter=0;
49898c33 392
0d319e67 393 for(Int_t i=fRowMin; i<=fRowMax; i++)
394 {
03b6adf7 395
49898c33 396 if((Int_t)rowPt->fRow != i) printf("AliL3FileHandler::AliDigits2RootFile : Mismatching row numbering!!!\n");
03b6adf7 397
0d319e67 398 Int_t sector,row;
399 fTransformer->Slice2Sector(fSlice,i,sector,row);
49898c33 400 AliSimDigits * dig = (AliSimDigits*)arr->CreateRow(sector,row);
401 AliSimDigits *old_dig = (AliSimDigits*)old_array->LoadRow(sector,row);
0d319e67 402 if(!old_dig)
403 printf("AliL3FileHandler::AliDigits2RootFile : No padrow %d %d\n",sector,row);
404
405 AliL3DigitData *digPt = rowPt->fDigitData;
54efe57a 406 digcounter=0;
0d319e67 407 for(UInt_t j=0; j<rowPt->fNDigit; j++)
408 {
49898c33 409 Int_t charge = (Int_t)digPt[j].fCharge;
410 Int_t pad = (Int_t)digPt[j].fPad;
411 Int_t time = (Int_t)digPt[j].fTime;
03b6adf7 412
413 if(charge == 0) //Only write the digits that has not been removed
414 continue;
54efe57a 415 digcounter++;
416 dig->SetDigitFast(charge,time,pad);
49898c33 417
418 Int_t trackID[3] = {old_dig->GetTrackID(time,pad,0),old_dig->GetTrackID(time,pad,1),old_dig->GetTrackID(time,pad,2)};
419 Int_t s_pad = pad;
420 Int_t s_time = time - 1;
421 while(trackID[0] < 0)
422 {
423 if(s_time >= 0 && s_time < fTransformer->GetNTimeBins() && s_pad >= 0 && s_pad < fTransformer->GetNPads(i))
424 {
425 if(old_dig->GetTrackID(s_time,s_pad,0) > 0)
426 {
427 trackID[0]=old_dig->GetTrackID(s_time,s_pad,0);
428 trackID[1]=old_dig->GetTrackID(s_time,s_pad,1);
429 trackID[2]=old_dig->GetTrackID(s_time,s_pad,2);
430 }
431 }
432 if(s_pad == pad && s_time == time - 1)
433 s_time = time + 1;
434 else if(s_pad == pad && s_time == time + 1)
435 {s_pad = pad - 1; s_time = time;}
436 else if(s_pad == pad - 1 && s_time == time)
437 s_time = time - 1;
438 else if(s_pad == pad - 1 && s_time == time - 1)
439 s_time = time + 1;
440 else if(s_pad == pad - 1 && s_time == time + 1)
441 {s_pad = pad + 1; s_time = time;}
442 else if(s_pad == pad + 1 && s_time == time)
443 s_time = time - 1;
444 else if(s_pad == pad + 1 && s_time == time - 1)
445 s_time = time + 1;
446 else
447 break;
448 }
449
450 dig->SetTrackIDFast(trackID[0],time,pad,0);
451 dig->SetTrackIDFast(trackID[1],time,pad,1);
452 dig->SetTrackIDFast(trackID[2],time,pad,2);
0d319e67 453
454 }
54efe57a 455 //cout<<"Wrote "<<digcounter<<" on row "<<i<<endl;
0d319e67 456 UpdateRowPointer(rowPt);
457 arr->StoreRow(sector,row);
458 arr->ClearRow(sector,row);
459 old_array->ClearRow(sector,row);
460 }
461 digFile->cd();
462 char treeName[100];
03b6adf7 463 sprintf(treeName,"TreeD_%s_0",fParam->GetTitle());
8f1a9904 464 printf("Writing tree to file.....");
0d319e67 465 arr->GetTree()->Write(treeName,TObject::kOverwrite);
8f1a9904 466 printf("done\n");
0d319e67 467 digFile->Close();
03b6adf7 468 //arr->GetTree()->Delete();
469 //delete arr;
0d319e67 470}
471
108615fc 472///////////////////////////////////////// Point IO
473Bool_t AliL3FileHandler::AliPoints2Binary(){
474 Bool_t out = kTRUE;
475 UInt_t npoint;
476 AliL3SpacePointData *data = AliPoints2Memory(npoint);
477 out = Memory2Binary(npoint,data);
478 Free();
479 return out;
480}
481
482AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint){
483 AliL3SpacePointData *data = 0;
484 npoint=0;
485 if(!fInAli){
486 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliPoints2Memory","File")
487 <<"No Input avalible: no object TFile"<<ENDLOG;
488 return 0;
489 }
490 if(!fInAli->IsOpen()){
491 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliPoints2Memory","File")
492 <<"No Input avalible: TFile not opend"<<ENDLOG;
493 return 0;
494 }
b25c64e5 495 if(!fTransformer)
496 {
497 LOG(AliL3Log::kWarning,"AliL3FileHandler::AliPoints2Memory","Transformer")
498 <<"No transformer object"<<ENDLOG;
499 return 0;
500 }
108615fc 501 TDirectory *savedir = gDirectory;
502 fInAli->cd();
8f1a9904 503
504 Char_t cname[100];
505 Int_t eventn = 0;
506 sprintf(cname,"TreeC_TPC_%d",eventn);
108615fc 507 AliTPCClustersArray carray;
508 carray.Setup(fParam);
509 carray.SetClusterType("AliTPCcluster");
8f1a9904 510 Bool_t clusterok = carray.ConnectTree(cname);
108615fc 511 if(!clusterok) return 0;
512
513 AliTPCClustersRow ** clusterrow =
514 new AliTPCClustersRow*[ (int)carray.GetTree()->GetEntries()];
515 Int_t *rows = new int[ (int)carray.GetTree()->GetEntries()];
516 Int_t *sects = new int[ (int)carray.GetTree()->GetEntries()];
517 Int_t sum=0;
518
519 Int_t lslice,lrow;
520 for(Int_t i=0; i<carray.GetTree()->GetEntries(); i++){
521 AliSegmentID *s = carray.LoadEntry(i);
522 Int_t sector,row;
523 fParam->AdjustSectorRow(s->GetID(),sector,row);
524 rows[i] = row;
525 sects[i] = sector;
526 clusterrow[i] = 0;
527 fTransformer->Sector2Slice(lslice,lrow,sector,row);
528 if(fSlice != lslice || lrow<fRowMin || lrow>fRowMax) continue;
529 clusterrow[i] = carray.GetRow(sector,row);
530 if(clusterrow[i])
531 sum+=clusterrow[i]->GetArray()->GetEntriesFast();
532 }
533 UInt_t size = sum*sizeof(AliL3SpacePointData);
534
535 LOG(AliL3Log::kDebug,"AliL3FileHandler::AliPoints2Memory","File")
536 <<AliL3Log::kDec<<"Found "<<sum<<" SpacePoints"<<ENDLOG;
537
538 data = (AliL3SpacePointData *) Allocate(size);
539 npoint = sum;
540 UInt_t n=0;
541 for(Int_t i=0; i<carray.GetTree()->GetEntries(); i++){
542 if(!clusterrow[i]) continue;
543 Int_t row = rows[i];
544 Int_t sector = sects[i];
545 fTransformer->Sector2Slice(lslice,lrow,sector,row);
546 Int_t entries_in_row = clusterrow[i]->GetArray()->GetEntriesFast();
547 for(Int_t j = 0;j<entries_in_row;j++){
548 AliTPCcluster *c = (AliTPCcluster*)(*clusterrow[i])[j];
549 data[n].fZ = c->GetZ();
550 data[n].fY = c->GetY();
551 data[n].fX = fParam->GetPadRowRadii(sector,row);
552 data[n].fID = n+((fSlice&0x7f)<<25)+((fPatch&0x7)<<22);//uli
553 data[n].fPadRow = lrow;
554 data[n].fXYErr = c->GetSigmaY2();
555 data[n].fZErr = c->GetSigmaZ2();
556 if(fMC) fprintf(fMC,"%d %d\n",data[n].fID,c->GetLabel(0));
557 n++;
558 }
559 }
560 for(Int_t i=0;i<carray.GetTree()->GetEntries();i++){
561 Int_t row = rows[i];
562 Int_t sector = sects[i];
563 if(carray.GetRow(sector,row))
564 carray.ClearRow(sector,row);
565 }
566
567 delete [] clusterrow;
568 delete [] rows;
569 delete [] sects;
570 savedir->cd();
571
572 return data;
573}
574