//_________________________________________________________________________ // TOF digit: member variables // fSector : TOF sector // fPlate : TOF plate // fStrip : strips number // fPadx : pad number along x // fPadz : pad number along z // fTdc : TArrayF of TDC values // fAdc : TArrayF of ADC values // // Getters, setters and member functions defined here // //*-- Authors: F. Pierella, A. Seganti, D. Vicinanza /************************************************************************** * 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. * **************************************************************************/ #include #include "TArrayF.h" #include "TArrayI.h" #include "AliTOF.h" #include "AliTOFSDigit.h" #include "AliTOFConstants.h" #include "AliRun.h" #include "AliMC.h" ClassImp(AliTOFSDigit) //////////////////////////////////////////////////////////////////////// AliTOFSDigit::AliTOFSDigit() { // // default ctor // fNDigits = 0; fTdc = 0; fAdc = 0; fTracks = 0; } //////////////////////////////////////////////////////////////////////// AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t *vol,Float_t *digit) { // // Constructor of digit object // fSector = vol[0]; fPlate = vol[1]; fStrip = vol[2]; fPadx = vol[3]; fPadz = vol[4]; fNDigits = 1; fTdc = new TArrayF(fNDigits); (*fTdc)[0] = digit[0]; fAdc = new TArrayF(fNDigits); (*fAdc)[0] = digit[1]; fTracks = new TArrayI(kMAXDIGITS*fNDigits); (*fTracks)[0] = tracknum; for (Int_t i = 1; i At(i)) < AliTOFConstants::fgkTimeDiff) { sameTime = i; break; } } if (sameTime >= 0) { (*fAdc)[sameTime] += static_cast(adc); // update track - find the first -1 value and replace it by the // track number 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 GetDetector("TOF"); }else{ printf("AliTOFSDigit::GetTotPad - No AliRun object present, exiting"); return 0; } Int_t pad = fPadx+tof->GetNpadX()*(fPadz-1); Int_t before=0; switch(fPlate){ case 1: before = 0; break; case 2: before = tof->GetNStripC(); break; case 3: before = tof->GetNStripB() + tof->GetNStripC(); break; case 4: before = tof->GetNStripA() + tof->GetNStripB() + tof->GetNStripC(); break; case 5: before = tof->GetNStripA() + 2*tof->GetNStripB() + tof->GetNStripC(); break; } Int_t strip = fStrip+before; Int_t padTot = tof->GetPadXStr()*(strip-1)+pad; return padTot; } //////////////////////////////////////////////////////////////////////// //void AliTOFSDigit::AddTrack(Int_t track) //{ // // Add a new and different track to the digit -- but to which digit?? // do not implemet this function // //////////////////////////////////////////////////////////////////////// // Overloading of Streaming, Sum and Comparison operators //////////////////////////////////////////////////////////////////////// /* Bool_t AliTOFSDigit::operator==(AliTOFSDigit const &digit) const { // // Overloading of Comparison operator // if (fSector==digit.fSector && fPlate==digit.fPlate && fStrip==digit.fStrip && fPadx==digit.fPadx && fPadz==digit.fPadz && fTdc==digit.fTdc && fAdc==digit.fAdc) return kTRUE; else return kFALSE; } */ //////////////////////////////////////////////////////////////////////// /* ostream& operator << (ostream& out, const AliTOFSDigit &digit) { // // Output streamer: output of the digit data // out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl; out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl; out << "TDC " << digit.fTdc->At(0) << ", ADC "<< digit.fAdc->At(0) << endl; return out; } */