/************************************************************************* * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id: AliTRDarrayDictionary.cxx 25392 2008-04-23 19:40:29Z cblume $ */ ///////////////////////////////////////////////////////// // // // Container Class for Dictionary Info // // // // Author: // // Hermes Leon Vargas (hleon@ikf.uni-frankfurt.de) // // // ///////////////////////////////////////////////////////// #include #include "AliTRDarrayDictionary.h" #include "AliTRDfeeParam.h" #include "AliLog.h" ClassImp(AliTRDarrayDictionary) Short_t *AliTRDarrayDictionary::fgLutPadNumbering = 0x0; //________________________________________________________________________________ AliTRDarrayDictionary::AliTRDarrayDictionary() :TObject() ,fNdet(0) ,fNrow(0) ,fNcol(0) ,fNumberOfChannels(0) ,fNtime(0) ,fNDdim(0) ,fDictionary(0) ,fFlag(kFALSE) { // // AliTRDarrayDictionary default contructor // CreateLut(); } //________________________________________________________________________________ AliTRDarrayDictionary::AliTRDarrayDictionary(Int_t nrow, Int_t ncol, Int_t ntime) :TObject() ,fNdet(0) ,fNrow(0) ,fNcol(0) ,fNumberOfChannels(0) ,fNtime(0) ,fNDdim(0) ,fDictionary(0) ,fFlag(kFALSE) { // // AliTRDarrayDictionary contructor // CreateLut(); Allocate(nrow,ncol,ntime); } //________________________________________________________________________________ AliTRDarrayDictionary::AliTRDarrayDictionary(const AliTRDarrayDictionary &a) :TObject() ,fNdet(a.fNdet) ,fNrow(a.fNrow) ,fNcol(a.fNcol) ,fNumberOfChannels(a.fNumberOfChannels) ,fNtime(a.fNtime) ,fNDdim(a.fNDdim) ,fDictionary(0) ,fFlag(a.fFlag) { // // AliTRDarrayDictionary copy constructor // fDictionary = new Int_t[fNDdim]; for(Int_t i=0; i=-1) { bufferE[i]=fDictionary[contaexp]; } if(fDictionary[contaexp]<-1) { i=i+longArr[h]-1; h++; } contaexp++; } //Copy the buffer delete [] fDictionary; fDictionary=bufferE; fNDdim = dimexp; } } if (longArr) { delete [] longArr; } fFlag=kTRUE; // Not expand again } //________________________________________________________________________________ void AliTRDarrayDictionary::Reset() { // // Reset the array, the old contents are deleted // and the data array elements are set to zero. // memset(fDictionary,0,sizeof(Int_t)*fNDdim); } //________________________________________________________________________________ Int_t AliTRDarrayDictionary::GetData(Int_t nrow, Int_t ncol, Int_t ntime) const { // // Get the data using the pad numbering. // To access data using the mcm scheme use instead // the method GetDataByAdcCol // Int_t corrcolumn = fgLutPadNumbering[ncol]; return fDictionary[(nrow*fNumberOfChannels+corrcolumn)*fNtime+ntime]; } //________________________________________________________________________________ void AliTRDarrayDictionary::SetData(Int_t nrow, Int_t ncol, Int_t ntime, Int_t value) { // // Set the data using the pad numbering. // To write data using the mcm scheme use instead // the method SetDataByAdcCol // Int_t colnumb = fgLutPadNumbering[ncol]; fDictionary[(nrow*fNumberOfChannels+colnumb)*fNtime+ntime]=value; } //________________________________________________________________________________ void AliTRDarrayDictionary::CreateLut() { // // Initializes the Look Up Table to relate // pad numbering and mcm channel numbering // if(fgLutPadNumbering) return; fgLutPadNumbering = new Short_t[AliTRDfeeParam::GetNcol()]; memset(fgLutPadNumbering,0,sizeof(Short_t)*AliTRDfeeParam::GetNcol()); for(Int_t mcm=0; mcm<8; mcm++) { Int_t lowerlimit=0+mcm*18; Int_t upperlimit=18+mcm*18; Int_t shiftposition = 1+3*mcm; for(Int_t index=lowerlimit;index