//$Id$ // Author: Uli Frankenfeld , Anders Vestbo //*-- Copyright © Uli #include "AliL3StandardIncludes.h" #include #include #include #include #include #include #include #include "AliL3Logging.h" #include "AliL3Transform.h" #include "AliL3MemHandler.h" #include "AliL3FileHandler.h" #include "AliL3DigitData.h" #include "AliL3TrackSegmentData.h" #include "AliL3SpacePointData.h" #include "AliL3TrackArray.h" //_____________________________________________________________ // AliL3FileHandler // // The HLT ROOT <-> binary files handling class // // This class provides the interface between AliROOT files, // and HLT binary files. It should be used for converting // TPC data stored in AliROOT format (outputfile from a simulation), // into the data format currently used by in the HLT framework. // This enables the possibility to always use the same data format, // whether you are using a binary file as an input, or a AliROOT file. // // For example on how to create binary files from a AliROOT simulation, // see example macro exa/Binary.C. // // For reading a AliROOT file into HLT format in memory, do the following: // // AliL3FileHandler file; // file.Init(slice,patch); // file.SetAliInput("galice.root"); // AliL3DigitRowData *dataPt = (AliL3DigitRowData*)file.AliDigits2Memory(nrows,eventnr); // // All the data are then stored in memory and accessible via the pointer dataPt. // Accesing the data is then identical to the example 1) showed in AliL3MemHandler class. // // For converting the data back, and writing it to a new AliROOT file do: // // AliL3FileHandler file; // file.Init(slice,patch); // file.SetAliInput("galice.root"); // file.Init(slice,patch,NumberOfRowsInPatch); // file.AliDigits2RootFile(dataPt,"new_galice.root"); // file.CloseAliInput(); ClassImp(AliL3FileHandler) AliL3FileHandler::AliL3FileHandler() { //Default constructor fInAli = 0; fParam = 0; fMC =0; fLastIndex=0; fDigits=0; fDigitsTree=0; } AliL3FileHandler::~AliL3FileHandler() { //Destructor if(fMC) CloseMCOutput(); FreeDigitsTree(); if(fInAli) CloseAliInput(); } void AliL3FileHandler::FreeDigitsTree() { if(!fDigitsTree) { LOG(AliL3Log::kWarning,"AliL3FileHandler::FreeDigitsTree()","Pointer") <<"Cannot free digitstree, it is not present"<Delete(); fDigitsTree=0; } Bool_t AliL3FileHandler::SetMCOutput(char *name) { fMC = fopen(name,"w"); if(!fMC){ LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open") <<"Pointer to File = 0x0 "<IsOpen()){ LOG(AliL3Log::kError,"AliL3FileHandler::SetAliInput","File Open") <<"Ali File "<GetName()<<" does not exist"<Get(AliL3Transform::GetParamName()); if(!fParam){ LOG(AliL3Log::kError,"AliL3FileHandler::SetAliInput","File Open") <<"No AliTPCParam "<GetName()<IsOpen()) fInAli->Close(); delete fInAli; fInAli = 0; } Bool_t AliL3FileHandler::IsDigit(Int_t event) { //Check if there is a TPC digit tree in the current file. //Return kTRUE if tree was found, and kFALSE if not found. if(!fInAli){ LOG(AliL3Log::kWarning,"AliL3FileHandler::IsDigit","File") <<"Pointer to TFile = 0x0 "<Get(name); if(t){ LOG(AliL3Log::kInformational,"AliL3FileHandler::IsDigit","File Type") <<"Found Digit Tree -> Use Fast Cluster Finder"< Use Cluster Tree"<IsOpen()){ LOG(AliL3Log::kWarning,"AliL3FileHandler::AliDigits2Memory","File") <<"No Input avalible: TFile not opened"<GetEntries(); Int_t ndigits[entries]; Int_t lslice,lrow; Float_t xyz[3]; for(Int_t n=fLastIndex; nGetEntries(); n++) { fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliL3Transform::Sector2Slice(lslice,lrow,sector,row); //if(fSlice != lslice || lrowfRowMax) continue; if(lslice < fSlice) continue; if(lslice != fSlice) break; if(lrow < fRowMin) continue; if(lrow > fRowMax) break; ndigits[lrow] = 0; fDigits->First(); do { time=fDigits->CurrentRow(); pad=fDigits->CurrentColumn(); dig = fDigits->GetDigit(time,pad); if(dig <= fParam->GetZeroSup()) continue; if(dig >= AliL3Transform::GetADCSat()) dig = AliL3Transform::GetADCSat(); AliL3Transform::Raw2Local(xyz,sector,row,pad,time); if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) continue; ndigits[lrow]++; //for this row only ndigitcount++; //total number of digits to be published } while (fDigits->Next()); //cout << lrow << " " << ndigits[lrow] << " - " << ndigitcount << endl; nrows++; } Int_t size = sizeof(AliL3DigitData)*ndigitcount + nrows*sizeof(AliL3DigitRowData); LOG(AliL3Log::kDebug,"AliL3FileHandler::AliDigits2Memory","Digits") <GetEntries(); n++) { fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliL3Transform::Sector2Slice(lslice,lrow,sector,row); //if(fSlice != lslice || lrowfRowMax) continue; if(lslice < fSlice) continue; if(lslice != fSlice) break; if(lrow < fRowMin) continue; if(lrow > fRowMax) break; tempPt->fRow = lrow; tempPt->fNDigit = ndigits[lrow]; Int_t localcount=0; fDigits->First(); do { time=fDigits->CurrentRow(); pad=fDigits->CurrentColumn(); dig = fDigits->GetDigit(time,pad); if (dig <= fParam->GetZeroSup()) continue; if(dig >= AliL3Transform::GetADCSat()) dig = AliL3Transform::GetADCSat(); //Exclude data outside cone: AliL3Transform::Raw2Local(xyz,sector,row,pad,time); if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) continue; if(localcount >= ndigits[lrow]) LOG(AliL3Log::kFatal,"AliL3FileHandler::AliDigits2Binary","Memory") <fDigitData[localcount].fCharge=dig; tempPt->fDigitData[localcount].fPad=pad; tempPt->fDigitData[localcount].fTime=time; #ifdef do_mc tempPt->fDigitData[localcount].fTrackID[0] = fDigits->GetTrackID(time,pad,0); tempPt->fDigitData[localcount].fTrackID[1] = fDigits->GetTrackID(time,pad,1); tempPt->fDigitData[localcount].fTrackID[2] = fDigits->GetTrackID(time,pad,2); #endif localcount++; } while (fDigits->Next()); Byte_t *tmp = (Byte_t*)tempPt; Int_t size = sizeof(AliL3DigitRowData) + ndigits[lrow]*sizeof(AliL3DigitData); tmp += size; tempPt = (AliL3DigitRowData*)tmp; #ifdef ASVVERSION fLastIndex=n; #endif } #ifdef ASVVERSION fLastIndex++; #endif return data; } AliL3DigitRowData * AliL3FileHandler::AliAltroDigits2Memory(UInt_t & nrow,Int_t event) { //Read data from AliROOT file into memory, and store it in the HLT data format. //Returns a pointer to the data. //This functions filter out single timebins, which is noise. The timebins which //are removed are timebins which have the 4 zero neighbours; //(pad-1,time),(pad+1,time),(pad,time-1),(pad,time+1). AliL3DigitRowData *data = 0; nrow=0; if(!fInAli){ LOG(AliL3Log::kWarning,"AliL3FileHandler::AliAltroDigits2Memory","File") <<"No Input avalible: no object TFile"<IsOpen()){ LOG(AliL3Log::kWarning,"AliL3FileHandler::AliAltroDigits2Memory","File") <<"No Input avalible: TFile not opened"<GetEntries(); Int_t ndigits[entries]; Int_t lslice,lrow; Float_t xyz[3]; for(Int_t n=fLastIndex; nGetEntries(); n++) { fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliL3Transform::Sector2Slice(lslice,lrow,sector,row); //if(fSlice != lslice || lrowfRowMax) continue; if(lslice < fSlice) continue; if(lslice != fSlice) break; if(lrow < fRowMin) continue; if(lrow > fRowMax) break; ndigits[lrow] = 0; fDigits->ExpandBuffer(); fDigits->ExpandTrackBuffer(); for(Int_t i=0; iGetNCols(); i++) { for(Int_t j=0; jGetNRows(); j++) { pad=i; time=j; dig = fDigits->GetDigitFast(time,pad); if(dig <= fParam->GetZeroSup()) continue; if(dig >= AliL3Transform::GetADCSat()) dig = AliL3Transform::GetADCSat(); //Check for single timebins, and remove them because they are noise for sure. if(i>0 && iGetNCols()-1 && j>0 && jGetNRows()-1) if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; //Boundaries: if(i==0) //pad ==0 { if(j < fDigits->GetNRows()-1 && j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; } else if(j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; } } if(j==0) { if(i < fDigits->GetNCols()-1 && i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup()) continue; } else if(i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup()) continue; } } if(i == fDigits->GetNCols()-1) { if(j>0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } else if(j==0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } else { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } } if(j==fDigits->GetNRows()-1) { if(i>0 && iGetNCols()-1) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } else if(i==0 && fDigits->GetNCols()-1) { if(fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } else { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } } AliL3Transform::Raw2Local(xyz,sector,row,pad,time); if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) continue; ndigits[lrow]++; //for this row only ndigitcount++; //total number of digits to be published } } nrows++; } Int_t size = sizeof(AliL3DigitData)*ndigitcount + nrows*sizeof(AliL3DigitRowData); LOG(AliL3Log::kDebug,"AliL3FileHandler::AliAltroDigits2Memory","Digits") <GetEntries(); n++) { fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliL3Transform::Sector2Slice(lslice,lrow,sector,row); //if(fSlice != lslice || lrowfRowMax) continue; if(lslice < fSlice) continue; if(lslice != fSlice) break; if(lrow < fRowMin) continue; if(lrow > fRowMax) break; tempPt->fRow = lrow; tempPt->fNDigit = ndigits[lrow]; Int_t localcount=0; fDigits->ExpandBuffer(); fDigits->ExpandTrackBuffer(); for(Int_t i=0; iGetNCols(); i++) { for(Int_t j=0; jGetNRows(); j++) { pad=i; time=j; dig = fDigits->GetDigitFast(time,pad); if(dig <= fParam->GetZeroSup()) continue; if(dig >= AliL3Transform::GetADCSat()) dig = AliL3Transform::GetADCSat(); //Check for single timebins, and remove them because they are noise for sure. if(i>0 && iGetNCols()-1 && j>0 && jGetNRows()-1) if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; //Boundaries: if(i==0) //pad ==0 { if(j < fDigits->GetNRows()-1 && j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; } else if(j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup()) continue; } } if(j==0) { if(i < fDigits->GetNCols()-1 && i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup()) continue; } else if(i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup()) continue; } } if(i == fDigits->GetNCols()-1) { if(j>0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } else if(j==0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time+1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } else { if(fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup()) continue; } } if(j==fDigits->GetNRows()-1) { if(i>0 && iGetNCols()-1) { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } else if(i==0 && fDigits->GetNCols()-1) { if(fDigits->GetDigitFast(time,pad+1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } else { if(fDigits->GetDigitFast(time,pad-1)<=fParam->GetZeroSup() && fDigits->GetDigitFast(time-1,pad)<=fParam->GetZeroSup()) continue; } } AliL3Transform::Raw2Local(xyz,sector,row,pad,time); if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) continue; if(localcount >= ndigits[lrow]) LOG(AliL3Log::kFatal,"AliL3FileHandler::AliDigits2Binary","Memory") <fDigitData[localcount].fCharge=dig; tempPt->fDigitData[localcount].fPad=pad; tempPt->fDigitData[localcount].fTime=time; #ifdef do_mc tempPt->fDigitData[localcount].fTrackID[0] = fDigits->GetTrackIDFast(time,pad,0)-2; tempPt->fDigitData[localcount].fTrackID[1] = fDigits->GetTrackIDFast(time,pad,1)-2; tempPt->fDigitData[localcount].fTrackID[2] = fDigits->GetTrackIDFast(time,pad,2)-2; #endif localcount++; } } Byte_t *tmp = (Byte_t*)tempPt; Int_t size = sizeof(AliL3DigitRowData) + ndigits[lrow]*sizeof(AliL3DigitData); tmp += size; tempPt = (AliL3DigitRowData*)tmp; #ifdef ASVVERSION fLastIndex=n; #endif } #ifdef ASVVERSION fLastIndex++; #endif return data; } Bool_t AliL3FileHandler::GetDigitsTree(Int_t event) { //Connects to the TPC digit tree in the AliROOT file. fInAli->cd(); Char_t dname[100]; sprintf(dname,"TreeD_%s_%d",AliL3Transform::GetParamName(),event); fDigitsTree = (TTree*)fInAli->Get(dname); if(!fDigitsTree) { LOG(AliL3Log::kError,"AliL3FileHandler::GetDigitsTree","Digits Tree") <GetBranch("Segment")->SetAddress(&fDigits); return kTRUE; } void AliL3FileHandler::AliDigits2RootFile(AliL3DigitRowData *rowPt,Char_t *new_digitsfile) { //Write the data stored in rowPt, into a new AliROOT file. //The data is stored in the AliROOT format //This is specially a nice thing if you have modified data, and wants to run it //through the offline reconstruction chain. //The arguments is a pointer to the data, and the name of the new AliROOT file. //Remember to pass the original AliROOT file (the one that contains the original //simulated data) to this object, in order to retrieve the MC id's of the digits. if(!fInAli) { printf("AliL3FileHandler::AliDigits2RootFile : No rootfile\n"); return; } if(!fParam) { printf("AliL3FileHandler::AliDigits2RootFile : No parameter object. Run on rootfile\n"); return; } //Get the original digitstree: Char_t dname[100]; sprintf(dname,"TreeD_%s_0",AliL3Transform::GetParamName()); fInAli->cd(); AliTPCDigitsArray *old_array = new AliTPCDigitsArray(); old_array->Setup(fParam); old_array->SetClass("AliSimDigits"); Bool_t ok = old_array->ConnectTree(dname); if(!ok) { printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object\n"); return; } Bool_t create=kFALSE; TFile *digFile; if(gSystem->AccessPathName(new_digitsfile)) { cout<<"AliL3FileHandler::AliDigits2RootFile : Creating new file :"<Write(fParam->GetTitle()); } else { create = kFALSE; digFile = TFile::Open(new_digitsfile,"UPDATE"); } if(!digFile->IsOpen()) { LOG(AliL3Log::kError,"AliL3FileHandler::AliDigits2RootFile","Rootfile") <<"Error opening rootfile "<cd(); //setup a new one, or connect it to the existing one: AliTPCDigitsArray *arr = new AliTPCDigitsArray(); arr->SetClass("AliSimDigits"); arr->Setup(fParam); if(create) arr->MakeTree(); else { Bool_t ok = arr->ConnectTree(dname); if(!ok) { printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object in existing file\n"); return; } } Int_t digcounter=0,trackID[3]; for(Int_t i=fRowMin; i<=fRowMax; i++) { if((Int_t)rowPt->fRow != i) cerr<<"AliL3FileHandler::AliDigits2RootFile : Mismatching row numbering!!!"<LoadRow(sector,row); AliSimDigits * dig = (AliSimDigits*)arr->CreateRow(sector,row); old_dig->ExpandBuffer(); old_dig->ExpandTrackBuffer(); dig->ExpandBuffer(); dig->ExpandTrackBuffer(); if(!old_dig) printf("AliL3FileHandler::AliDigits2RootFile : No padrow %d %d\n",sector,row); AliL3DigitData *digPt = rowPt->fDigitData; digcounter=0; for(UInt_t j=0; jfNDigit; j++) { Short_t charge = (Short_t)digPt[j].fCharge; Int_t pad = (Int_t)digPt[j].fPad; Int_t time = (Int_t)digPt[j].fTime; if(charge == 0) //Only write the digits that has not been removed { cerr<<"AliL3FileHandler::AliDigits2RootFile : Zero charge!!! "<GetTrackIDFast(time,pad,t); if(label > 1) trackID[t] = label - 2; else if(label==0) trackID[t] = -2; else trackID[t] = -1; } dig->SetDigitFast(charge,time,pad); for(Int_t t=0; t<3; t++) ((AliSimDigits*)dig)->SetTrackIDFast(trackID[t],time,pad,t); } //cout<<"Wrote "<StoreRow(sector,row); arr->ClearRow(sector,row); old_array->ClearRow(sector,row); } digFile->cd(); char treeName[100]; sprintf(treeName,"TreeD_%s_0",fParam->GetTitle()); arr->GetTree()->SetName(treeName); arr->GetTree()->AutoSave(); delete arr; delete old_array; digFile->Close(); } ///////////////////////////////////////// Point IO Bool_t AliL3FileHandler::AliPoints2Binary(){ Bool_t out = kTRUE; UInt_t npoint; AliL3SpacePointData *data = AliPoints2Memory(npoint); out = Memory2Binary(npoint,data); Free(); return out; } AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint){ AliL3SpacePointData *data = 0; npoint=0; if(!fInAli){ LOG(AliL3Log::kWarning,"AliL3FileHandler::AliPoints2Memory","File") <<"No Input avalible: no object TFile"<IsOpen()){ LOG(AliL3Log::kWarning,"AliL3FileHandler::AliPoints2Memory","File") <<"No Input avalible: TFile not opend"<cd(); Char_t cname[100]; Int_t eventn = 0; sprintf(cname,"TreeC_TPC_%d",eventn); AliTPCClustersArray carray; carray.Setup(fParam); carray.SetClusterType("AliTPCcluster"); Bool_t clusterok = carray.ConnectTree(cname); if(!clusterok) return 0; AliTPCClustersRow ** clusterrow = new AliTPCClustersRow*[ (int)carray.GetTree()->GetEntries()]; Int_t *rows = new int[ (int)carray.GetTree()->GetEntries()]; Int_t *sects = new int[ (int)carray.GetTree()->GetEntries()]; Int_t sum=0; Int_t lslice,lrow; for(Int_t i=0; iGetEntries(); i++){ AliSegmentID *s = carray.LoadEntry(i); Int_t sector,row; fParam->AdjustSectorRow(s->GetID(),sector,row); rows[i] = row; sects[i] = sector; clusterrow[i] = 0; AliL3Transform::Sector2Slice(lslice,lrow,sector,row); if(fSlice != lslice || lrowfRowMax) continue; clusterrow[i] = carray.GetRow(sector,row); if(clusterrow[i]) sum+=clusterrow[i]->GetArray()->GetEntriesFast(); } UInt_t size = sum*sizeof(AliL3SpacePointData); LOG(AliL3Log::kDebug,"AliL3FileHandler::AliPoints2Memory","File") <GetEntries(); i++){ if(!clusterrow[i]) continue; Int_t row = rows[i]; Int_t sector = sects[i]; AliL3Transform::Sector2Slice(lslice,lrow,sector,row); Int_t entries_in_row = clusterrow[i]->GetArray()->GetEntriesFast(); for(Int_t j = 0;jGetZ(); data[n].fY = c->GetY(); data[n].fX = fParam->GetPadRowRadii(sector,row); data[n].fCharge = (UInt_t)c->GetQ(); data[n].fID = n+((fSlice&0x7f)<<25)+((fPatch&0x7)<<22);//uli data[n].fPadRow = lrow; data[n].fXYErr = sqrt(c->GetSigmaY2()); data[n].fZErr = sqrt(c->GetSigmaZ2()); if(fMC) fprintf(fMC,"%d %d\n",data[n].fID,c->GetLabel(0)); n++; } } for(Int_t i=0;iGetEntries();i++){ Int_t row = rows[i]; Int_t sector = sects[i]; if(carray.GetRow(sector,row)) carray.ClearRow(sector,row); } delete [] clusterrow; delete [] rows; delete [] sects; savedir->cd(); return data; }