// @(#) $Id$ // Original: AliHLTFileHandler.cxx,v 1.49 2005/06/23 17:46:55 hristov // Author: Uli Frankenfeld , Anders Vestbo , C. Loizides //*-- Copyright © ALICE HLT Group #include #include #include #include #include #include #include #include #include #include #include #include #include #include "AliHLTTPCLogging.h" #include "AliHLTTPCTransform.h" #include "AliHLTTPCDigitData.h" //#include "AliHLTTPCTrackSegmentData.h" #include "AliHLTTPCSpacePointData.h" //#include "AliHLTTPCTrackArray.h" #include "AliHLTTPCFileHandler.h" #if __GNUC__ >= 3 using namespace std; #endif /** \class AliHLTTPCFileHandler
//_____________________________________________________________
// AliHLTTPCFileHandler
//
// 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:
//
// AliHLTTPCFileHandler file;
// file.Init(slice,patch);
// file.SetAliInput("galice.root");
// AliHLTTPCDigitRowData *dataPt = (AliHLTTPCDigitRowData*)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 AliHLTTPCMemHandler class.
//
// For converting the data back, and writing it to a new AliROOT file do:
//
// AliHLTTPCFileHandler file;
// file.Init(slice,patch);
// file.SetAliInput("galice.root");
// file.Init(slice,patch,NumberOfRowsInPatch);
// file.AliDigits2RootFile(dataPt,"new_galice.root");
// file.CloseAliInput();
*/ ClassImp(AliHLTTPCFileHandler) AliHLTTPCFileHandler::AliHLTTPCFileHandler(Bool_t b) : fInAli(NULL), fUseRunLoader(kFALSE), fParam(NULL), fMC(NULL), fDigits(NULL), fDigitsTree(NULL), fIndexCreated(kFALSE), fUseStaticIndex(b) { //Default constructor for(Int_t i=0;i> fgStaticIndex[i][j]; } file.close(); fgStaticIndexCreated=kTRUE; return 0; } void AliHLTTPCFileHandler::FreeDigitsTree() { //free digits tree if(!fDigitsTree) { LOG(AliHLTTPCLog::kInformational,"AliHLTTPCFileHandler::FreeDigitsTree()","Pointer") <<"Cannot free digitstree, it is not present"<CdGAFile(); fParam = (AliTPCParam*)gFile->Get("75x40_100x60_150x60"); if(!fParam){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::SetAliInput","File") <<"No TPC parameters found in \""<GetName() <<"\", creating standard parameters " <<"which might not be what you want!"<GetName()<GetLoader("TPCLoader"); if(!tpcLoader){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandlerNewIO::IsDigit","File") <<"Pointer to AliLoader for TPC = 0x0 "<GetEvent(event); tpcLoader->LoadDigits(); TTree *t=tpcLoader->TreeD(); if(t){ LOG(AliHLTTPCLog::kInformational,"AliHLTTPCFileHandlerNewIO::IsDigit","File Type") <<"Found Digit Tree -> Use Fast Cluster Finder"< Use Cluster Tree"<GetEntries(); n++) { Int_t sector, row; Int_t lslice,lrow; fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); if(!AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row)){ LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::CreateIndex","Slice/Row") <GetEntries(); if(entries==0) { LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2Memory","ndigits") <<"No TPC digits (entries==0)!"<fRow = r; tempPt->fNDigit = 0; tempPt++; } return data; } Int_t * ndigits = new Int_t[fRowMax+1]; Float_t xyz[3]; for(Int_t r=fRowMin;r<=fRowMax;r++){ Int_t n=fIndex[fSlice][r]; if(n!=-1){ //data on that row fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); if(lrow!=r){ LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliDigits2Memory","Row") <First(); do { time=fDigits->CurrentRow(); pad=fDigits->CurrentColumn(); dig = fDigits->GetDigit(time,pad); if(dig <= fParam->GetZeroSup()) continue; if(dig >= AliHLTTPCTransform::GetADCSat()) dig = AliHLTTPCTransform::GetADCSat(); AliHLTTPCTransform::Raw2Local(xyz,sector,row,pad,time); // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) // continue; // why 230??? 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(AliHLTTPCDigitData)*ndigitcount + nrows*sizeof(AliHLTTPCDigitRowData); LOG(AliHLTTPCLog::kDebug,"AliHLTTPCFileHandler::AliDigits2Memory","Digits") <fRow = r; tempPt->fNDigit = 0; if(n!=-1){//data on that row fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); if(lrow!=r){ LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliDigits2Memory","Row") <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 >= AliHLTTPCTransform::GetADCSat()) dig = AliHLTTPCTransform::GetADCSat(); //Exclude data outside cone: AliHLTTPCTransform::Raw2Local(xyz,sector,row,pad,time); // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) // continue; // why 230??? if(localcount >= ndigits[lrow]) LOG(AliHLTTPCLog::kFatal,"AliHLTTPCFileHandler::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(AliHLTTPCDigitRowData) + ndigits[lrow]*sizeof(AliHLTTPCDigitData); tmp += size; tempPt = (AliHLTTPCDigitRowData*)tmp; } delete [] ndigits; return data; } AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliAltroDigits2Memory(UInt_t & nrow,Int_t event,Bool_t eventmerge) { //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). AliHLTTPCDigitRowData *data = 0; nrow=0; if(!fInAli){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliAltroDigits2Memory","File") <<"No Input avalible: Pointer to TFile == NULL"<= 1024) { LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliAltroDigits2Memory","TrackIDs") <<"Too many events if you want to merge!"<GetEntries(); if(entries==0) { LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliAltroDigits2Memory","ndigits") <<"No TPC digits (entries==0)!"<fRow = r; tempPt->fNDigit = 0; tempPt++; } return data; } Int_t * ndigits = new Int_t[fRowMax+1]; Int_t lslice,lrow; Int_t zerosupval=AliHLTTPCTransform::GetZeroSup(); Float_t xyz[3]; for(Int_t r=fRowMin;r<=fRowMax;r++){ Int_t n=fIndex[fSlice][r]; ndigits[r] = 0; if(n!=-1){//data on that row fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); //cout << lslice << " " << fSlice << " " << lrow << " " << r << " " << sector << " " << row << endl; if((lslice!=fSlice)||(lrow!=r)){ LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliAltroDigits2Memory","Row") <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 <= zerosupval) continue; if(dig >= AliHLTTPCTransform::GetADCSat()) dig = AliHLTTPCTransform::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)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; //Boundaries: if(i==0) //pad==0 { if(j < fDigits->GetNRows()-1 && j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; } else if(j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; } } if(j==0) { if(i < fDigits->GetNCols()-1 && i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval) continue; } else if(i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval) continue; } } if(i==fDigits->GetNCols()-1) { if(j>0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } else if(j==0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } else { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } } if(j==fDigits->GetNRows()-1) { if(i>0 && iGetNCols()-1) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } else if(i==0 && fDigits->GetNCols()-1) { if(fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } else { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } } AliHLTTPCTransform::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(AliHLTTPCDigitData)*ndigitcount + nrows*sizeof(AliHLTTPCDigitRowData); LOG(AliHLTTPCLog::kDebug,"AliHLTTPCFileHandler::AliAltroDigits2Memory","Digits") <fRow = r; tempPt->fNDigit = 0; if(n!=-1){ //no data on that row fDigitsTree->GetEvent(n); fParam->AdjustSectorRow(fDigits->GetID(),sector,row); AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); if(lrow!=r){ LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliAltroDigits2Memory","Row") <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 <= zerosupval) continue; if(dig >= AliHLTTPCTransform::GetADCSat()) dig = AliHLTTPCTransform::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)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; //Boundaries: if(i==0) //pad ==0 { if(j < fDigits->GetNRows()-1 && j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; } else if(j > 0) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval) continue; } } if(j==0) { if(i < fDigits->GetNCols()-1 && i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval) continue; } else if(i > 0) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval) continue; } } if(i == fDigits->GetNCols()-1) { if(j>0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } else if(j==0 && jGetNRows()-1) { if(fDigits->GetDigitFast(time+1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } else { if(fDigits->GetDigitFast(time-1,pad)<=zerosupval && fDigits->GetDigitFast(time,pad-1)<=zerosupval) continue; } } if(j==fDigits->GetNRows()-1) { if(i>0 && iGetNCols()-1) { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } else if(i==0 && fDigits->GetNCols()-1) { if(fDigits->GetDigitFast(time,pad+1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } else { if(fDigits->GetDigitFast(time,pad-1)<=zerosupval && fDigits->GetDigitFast(time-1,pad)<=zerosupval) continue; } } AliHLTTPCTransform::Raw2Local(xyz,sector,row,pad,time); // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2])) // continue; if(localcount >= ndigits[lrow]) LOG(AliHLTTPCLog::kFatal,"AliHLTTPCFileHandler::AliAltroDigits2Binary","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); if(eventmerge == kTRUE) //careful track mc info will be touched {//Event are going to be merged, so event number is stored in the upper 10 bits. tempPt->fDigitData[localcount].fTrackID[0] += 128; //leave some room tempPt->fDigitData[localcount].fTrackID[1] += 128; //for neg. numbers tempPt->fDigitData[localcount].fTrackID[2] += 128; tempPt->fDigitData[localcount].fTrackID[0] += ((event&0x3ff)<<22); tempPt->fDigitData[localcount].fTrackID[1] += ((event&0x3ff)<<22); tempPt->fDigitData[localcount].fTrackID[2] += ((event&0x3ff)<<22); } #endif localcount++; } } } Byte_t *tmp = (Byte_t*)tempPt; Int_t size = sizeof(AliHLTTPCDigitRowData) + ndigits[r]*sizeof(AliHLTTPCDigitData); tmp += size; tempPt = (AliHLTTPCDigitRowData*)tmp; } delete [] ndigits; return data; } Bool_t AliHLTTPCFileHandler::GetDigitsTree(Int_t event) { //Connects to the TPC digit tree in the AliROOT file. AliLoader* tpcLoader = fInAli->GetLoader("TPCLoader"); if(!tpcLoader){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::GetDigitsTree","File") <<"Pointer to AliLoader for TPC = 0x0 "<GetEvent(event); tpcLoader->LoadDigits(); fDigitsTree = tpcLoader->TreeD(); if(!fDigitsTree) { LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::GetDigitsTree","Digits Tree") <GetBranch("Segment")->SetAddress(&fDigits); if(!fIndexCreated) return CreateIndex(); else return kTRUE; } void AliHLTTPCFileHandler::AliDigits2RootFile(AliHLTTPCDigitRowData *rowPt,Char_t *newDigitsfile) { //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) { LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliDigits2RootFile","File") <<"No rootfile "<GetLoader("TPCLoader"); if(!tpcLoader){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2RootFile","File") <<"Pointer to AliLoader for TPC = 0x0 "<LoadDigits(); TTree *t=tpcLoader->TreeD(); AliTPCDigitsArray *oldArray = new AliTPCDigitsArray(); oldArray->Setup(fParam); oldArray->SetClass("AliSimDigits"); Bool_t ok = oldArray->ConnectTree(t); if(!ok) { LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliDigits2RootFile","File") << "No digits tree object" << ENDLOG; return; } tpcLoader->SetDigitsFileName(newDigitsfile); tpcLoader->MakeDigitsContainer(); //setup a new one, or connect it to the existing one: AliTPCDigitsArray *arr = new AliTPCDigitsArray(); arr->SetClass("AliSimDigits"); arr->Setup(fParam); arr->MakeTree(tpcLoader->TreeD()); Int_t digcounter=0,trackID[3]; for(Int_t i=fRowMin; i<=fRowMax; i++) { if((Int_t)rowPt->fRow != i) LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2RootFile","Data") <<"Mismatching row numbering "<<(Int_t)rowPt->fRow<<" "<LoadRow(sector,row); AliSimDigits * dig = (AliSimDigits*)arr->CreateRow(sector,row); oldDig->ExpandBuffer(); oldDig->ExpandTrackBuffer(); dig->ExpandBuffer(); dig->ExpandTrackBuffer(); if(!oldDig) LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2RootFile","Data") <<"No padrow " << sector << " " << row <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 { LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2RootFile","Data") <<"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); oldArray->ClearRow(sector,row); } char treeName[100]; sprintf(treeName,"TreeD_%s_0",fParam->GetTitle()); arr->GetTree()->SetName(treeName); arr->GetTree()->AutoSave(); tpcLoader->WriteDigits("OVERWRITE"); delete arr; delete oldArray; } ///////////////////////////////////////// Point IO Bool_t AliHLTTPCFileHandler::AliPoints2Binary(Int_t eventn) { //points to binary Bool_t out = kTRUE; UInt_t npoint; AliHLTTPCSpacePointData *data = AliPoints2Memory(npoint,eventn); out = Memory2Binary(npoint,data); Free(); return out; } AliHLTTPCSpacePointData * AliHLTTPCFileHandler::AliPoints2Memory(UInt_t & npoint,Int_t eventn) { //points to memory AliHLTTPCSpacePointData *data = 0; npoint=0; if(!fInAli){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliPoints2Memory","File") <<"No Input avalible: no object fInAli"<GetLoader("TPCLoader"); if(!tpcLoader){ LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliPoints2Memory","File") <<"Pointer to AliLoader for TPC = 0x0 "<GetEvent(eventn); tpcLoader->LoadRecPoints(); AliTPCClustersArray carray; carray.Setup(fParam); carray.SetClusterType("AliTPCcluster"); Bool_t clusterok = carray.ConnectTree(tpcLoader->TreeR()); 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; AliHLTTPCTransform::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(AliHLTTPCSpacePointData); LOG(AliHLTTPCLog::kDebug,"AliHLTTPCFileHandler::AliPoints2Memory","File") <GetEntries(); i++){ if(!clusterrow[i]) continue; Int_t row = rows[i]; Int_t sector = sects[i]; AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); Int_t entriesInRow = 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)+((pat&0x7)<<22);//uli data[n].fPadRow = lrow; data[n].fSigmaY2 = c->GetSigmaY2(); data[n].fSigmaZ2 = c->GetSigmaZ2(); #ifdef do_mc data[n].fTrackID[0] = c->GetLabel(0); data[n].fTrackID[1] = c->GetLabel(1); data[n].fTrackID[2] = c->GetLabel(2); #endif 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; }