/************************************************************************** * 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. * **************************************************************************/ /* $Id$ */ //_________________________________________________________________________// // // // TOF sdigit: member variables // // fSector : TOF sector // // fPlate : TOF plate // // fStrip : strips number // // fPadx : pad number along x // // fPadz : pad number along z // // fTdc : TArrayI of TDC values // // fAdc : TArrayI of ADC values // // // // Getters, setters and member functions defined here // // // // -- Authors: F. Pierella, A. Seganti, D. Vicinanza // //_________________________________________________________________________// #include "AliLog.h" #include "AliTOFGeometry.h" #include "AliTOFSDigit.h" ClassImp(AliTOFSDigit) //////////////////////////////////////////////////////////////////////// AliTOFSDigit::AliTOFSDigit(): fSector(-1), fPlate(-1), fStrip(-1), fPadx(-1), fPadz(-1), fNDigits(0), fTdc(0x0), fAdc(0x0), fTracks(0x0) { // // default ctor // } //////////////////////////////////////////////////////////////////////// AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t * const vol,Int_t * const digit): TObject(), fSector(-1), fPlate(-1), fStrip(-1), fPadx(-1), fPadz(-1), fNDigits(0), fTdc(0x0), fAdc(0x0), fTracks(0x0) { // // Constructor of digit object // fSector = vol[0]; fPlate = vol[1]; fStrip = vol[2]; fPadx = vol[3]; fPadz = vol[4]; fNDigits = 1; fTdc = new TArrayI(fNDigits); (*fTdc)[0] = digit[0]; fAdc = new TArrayI(fNDigits); (*fAdc)[0] = digit[1]; fTracks = new TArrayI(kMAXDIGITS*fNDigits); (*fTracks)[0] = tracknum; for (Int_t i = 1; i At(i)) < tdcwindow) { sameTime = i; break; } } if (sameTime >= 0) { // another time measurement happens during the // dead time of the hit pad => it corresponds // to the same time measurement (*fAdc)[sameTime] += adc; // update track index array in case the current digit track index // is different from -1 if (track!=-1) { //Find the first -1 value of the track index array and replace //it by the current digit track index for (Int_t iTrack=0; iTrackSet(fNDigits); (*fTdc)[fNDigits-1] = tdc; fAdc->Set(fNDigits); (*fAdc)[fNDigits-1] = adc; fTracks->Set(fNDigits*kMAXDIGITS); (*fTracks)[(fNDigits-1)*kMAXDIGITS] = track; for (Int_t i = 1; i GetNDigits(); for (Int_t j = 0; j < nlocations; j++) { tdc = (Int_t)sdig->GetTdc(j); adc = (Int_t)sdig->GetAdc(j); // getting here only the first track number //Int_t track = GetTrack(j,0); // getting here all the track numbers for (Int_t iTrack = 0; iTrackGetTrack(j,iTrack); Update(tdcbin, tdc, adc, track); } // end loop on tracks } // end loop on sdig locations } //////////////////////////////////////////////////////////////////////// AliTOFSDigit::~AliTOFSDigit() { // // dtor // delete fTdc; delete fAdc; delete fTracks; } //////////////////////////////////////////////////////////////////////// Int_t AliTOFSDigit::GetTotPad() const { // // Get the "total" index of the pad inside a Sector // starting from the digits data. // Int_t pad = AliTOFGeometry::NpadZ()*fPadx + fPadz; Int_t before=0; switch(fPlate){ case 0: //before = 0; break; case 1: before = AliTOFGeometry::NStripC(); break; case 2: before = AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; case 3: before = AliTOFGeometry::NStripA() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; case 4: before = AliTOFGeometry::NStripA() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripC(); break; } Int_t strip = fStrip + before; Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad; return padTot; }