/************************************************************************** * Copyright(c) 1998-1999, 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. * **************************************************************************/ /* $Log$ */ //////////////////////////////////////////////////////////////////////// // // AliTOFDigitMap class // // digitmap enables fast check if the pad was already digit. // The index of a AliTOFdigit is saved in the each digitmap "cell" // (there is an offset +1, because the index can be zero and zero // means empty cell). // In TOF, number of strips varies according plate type, the highest // number is in plate C. For all plates is used this number, so the // size of the digitmap is a little bit greater than necessary, but it // simplifies the access algorithm. // // // Author: F. Pierella based on AliTOFHitMap // // Modified by A. De Caro // /////////////////////////////////////////////////////////////////////// #include "AliLog.h" #include "AliTOFDigitMap.h" #include "AliTOFGeometry.h" ClassImp(AliTOFDigitMap) AliTOFDigitMap::AliTOFDigitMap(): fNSector(-1), fNplate(-1), fNstrip(-1), fNpx(-1), fNpz(-1), fMaxIndex(-1), fDigitMap(0x0), fTOFGeometry(new AliTOFGeometry()) { // // Default ctor // fNSector = AliTOFGeometry::NSectors(); fNplate = AliTOFGeometry::NPlates(); fNstrip = fTOFGeometry->NStripC();//fTOFGeometry->NMaxNstrip(); fNpx = AliTOFGeometry::NpadX(); fNpz = AliTOFGeometry::NpadZ(); fMaxIndex=fNSector*fNplate*fNstrip*fNpx*fNpz; fDigitMap = new Int_t*[fMaxIndex]; for (Int_t i=0; i= fMaxIndex || index < 0) { AliError("CheckedIndex - input outside bounds"); return -1; } else { return index; } } //////////////////////////////////////////////////////////////////////// void AliTOFDigitMap::AddDigit(Int_t *vol, Int_t idigit) { // // Assign digit to pad vol // // 0 means empty pad, we need to shift indeces by 1 for (Int_t slot=0; slot=0) digitLabels[j] = dummy; else break; } } //////////////////////////////////////////////////////////////////////// Int_t AliTOFDigitMap::GetDigitIndex(Int_t *vol, Int_t label) const { // // Get one of the contents (label) of pad volume (vol) // // 0 means empty pad, we need to shift indeces by 1 if (!(label= kMaxDigitsPerPad (=%i)", label, kMaxDigitsPerPad)); return -1; } if (CheckedIndex(vol)==-1) return -1; Int_t dummy = fDigitMap[CheckedIndex(vol)][label]; if (dummy>0) return dummy-1; else return -1; } //////////////////////////////////////////////////////////////////////// FlagType AliTOFDigitMap::TestDigit(Int_t *vol) const { // // Check if hit cell is empty, used or unused // Int_t inf=fDigitMap[CheckedIndex(vol)][0]; // to be modified if (inf > 0) { return kUsed; } else if (inf == 0) { return kEmpty; } else { return kUnused; } } //////////////////////////////////////////////////////////////////////// AliTOFDigitMap & AliTOFDigitMap::operator = (const AliTOFDigitMap & /*rhs*/) { // Dummy assignment operator return *this; } //////////////////////////////////////////////////////////////////////// Int_t AliTOFDigitMap::GetFilledCellNumber() const { // // Returns the number of filled cells of the TOF digit map // Int_t volume[5] = {-1, -1, -1, -1, -1}; Int_t counter = 0; for (Int_t iSector=0; iSector0) counter++; } return counter; }