/************************************************************************** * 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$ */ #include "AliMUONDigit.h" #include "Riostream.h" #include "TString.h" /// /// A class representing a digit in the MUON spectrometer /// either in tracking or trigger chambers. /// /// A digit holds the signal (proportional to a charge) on a pad /// (or strip). /// /// This class is used to represent either sdigits (purely simulated digit, /// with no electronic noise whatsoever) or digits (either real digits or /// simulated ones but including electronic noise and de-calibration, to /// closely ressemble real ones). /// ClassImp(AliMUONDigit) //_____________________________________________________________________________ AliMUONDigit::AliMUONDigit() : TObject(), fDetElemId(-1), fManuId(-1), fManuChannel(-1), fSignal(0), fPadX(-1), fPadY(-1), fCathode(-1), fADC(0), fFlags(0), fNtracks(0), fTcharges(0x0), fTracks(0x0), fPhysics(0), fHit(0) { // // Default constructor // } //_____________________________________________________________________________ AliMUONDigit::AliMUONDigit(const AliMUONDigit& digit) : TObject(digit), fDetElemId(-1), fManuId(-1), fManuChannel(-1), fSignal(0), fPadX(-1), fPadY(-1), fCathode(-1), fADC(0), fFlags(0), fNtracks(0), fTcharges(0x0), fTracks(0x0), fPhysics(0), fHit(0) { // // copy constructor // (static_cast(digit)).Copy(*this); } //_____________________________________________________________________________ AliMUONDigit::AliMUONDigit(Int_t *digits) : TObject(), fDetElemId(-1), fManuId(-1), fManuChannel(-1), fSignal(0), fPadX(-1), fPadY(-1), fCathode(-1), fADC(0), fFlags(0), fNtracks(0), fTcharges(0x0), fTracks(0x0), fPhysics(0), fHit(0) { // // Creates a MUON digit object to be updated // \deprecated // fPadX = digits[0]; fPadY = digits[1]; fCathode = digits[2]; fSignal = digits[3]; fPhysics = digits[4]; fHit = digits[5]; fDetElemId = digits[6]; fManuId = -1; fManuChannel = -1; fADC=0; fFlags = 0; } //_____________________________________________________________________________ AliMUONDigit::AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits) : TObject(), fDetElemId(-1), fManuId(-1), fManuChannel(-1), fSignal(0), fPadX(-1), fPadY(-1), fCathode(-1), fADC(0), fFlags(0), fNtracks(0), fTcharges(0x0), fTracks(0x0), fPhysics(0), fHit(0) { // // Creates a MUON digit object // // \deprecated fPadX = digits[0]; fPadY = digits[1]; fCathode = digits[2]; fSignal = digits[3]; fPhysics = digits[4]; fHit = digits[5]; fDetElemId = digits[6]; fManuId = -1; fManuChannel = -1; fADC=0; // For backward compatibility, which assumed 10 tracks. fNtracks = 10; fTcharges = new Int_t[fNtracks]; fTracks = new Int_t[fNtracks]; for ( Int_t i=0; i(obj); if ( DetElemId() > d->DetElemId() ) { return 1; } else if ( DetElemId() < d->DetElemId() ) { return -1; } else { if ( Signal() > d->Signal() ) { return 1; } else if ( Signal() < d->Signal() ) { return -1; } else { if ( ManuId() < d->ManuId() ) { return 1; } else if ( ManuId() > d->ManuId() ) { return -1; } else { return ( ManuChannel() < d->ManuChannel() ) ? 1 : -1; } } } } //______________________________________________________________________________ void AliMUONDigit::Copy(TObject& obj) const { // // Copy this line to line. // TObject::Copy(obj); AliMUONDigit& digit = static_cast(obj); digit.fDetElemId = fDetElemId; digit.fManuId = fManuId; digit.fManuChannel = fManuChannel; digit.fSignal = fSignal; digit.fPadX = fPadX; digit.fPadY = fPadY; digit.fCathode = fCathode; digit.fADC = fADC; digit.fFlags = fFlags; digit.fNtracks = fNtracks; delete[] digit.fTcharges; delete[] digit.fTracks; if ( fNtracks ) { digit.fTcharges = new Int_t[fNtracks]; digit.fTracks = new Int_t[fNtracks]; } for ( Int_t i=0; i=0 and < Ntracks()) or -1. // if ( i >= 0 && i < fNtracks ) { return fTracks[i]; } return -1; } //_____________________________________________________________________________ Int_t AliMUONDigit::TrackCharge(Int_t i) const { // // Return the i-th track charge (if i is >=0 and < Ntracjs()) or -1. // if ( i >= 0 && i < fNtracks ) { return fTcharges[i]; } return -1; }