1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include <TObjArray.h>
21 #include "AliMUONTransientDigit.h"
24 ClassImp(AliMUONTransientDigit)
26 //____________________________________________________________________________
27 AliMUONTransientDigit::AliMUONTransientDigit() :
31 // Default constructor
34 //____________________________________________________________________________
35 AliMUONTransientDigit::AliMUONTransientDigit(const AliMUONTransientDigit& digit) :
38 // Protected copy constructor
40 AliFatal( "Not implemented.");
44 AliMUONTransientDigit::AliMUONTransientDigit(Int_t ich, Int_t *digits) :
47 fTrackList(new TObjArray(5))
48 // 5 is arbitrary number, just to decrease default 16
51 // Creates a MUON digit list object
55 ////////////////////////////////////////////////////////////////////////
56 AliMUONTransientDigit::~AliMUONTransientDigit()
62 ////////////////////////////////////////////////////////////////////////
63 AliMUONTransientDigit&
64 AliMUONTransientDigit::operator =(const AliMUONTransientDigit& rhs)
66 // Protected assignement operator
68 if (this == &rhs) return *this;
70 AliFatal("Not implemented.");
75 ////////////////////////////////////////////////////////////////////////
76 void AliMUONTransientDigit::AddToTrackList(Int_t track, Int_t charge)
78 TVector *pTrInfo = new TVector(3);
79 TVector &trInfo = *pTrInfo;
82 fTrackList->Add(pTrInfo);
85 ////////////////////////////////////////////////////////////////////////
86 void AliMUONTransientDigit::UpdateTrackList(Int_t track, Int_t charge)
88 Int_t lastEntry = fTrackList->GetLast();
89 TVector *pVect = static_cast<TVector*>(fTrackList->At(lastEntry));
90 if ( static_cast<Int_t>((*pVect)(0)) == track) {
91 (*pVect)(1) += charge; // update charge
93 AddToTrackList(track,charge);
97 ////////////////////////////////////////////////////////////////////////
98 Int_t AliMUONTransientDigit::GetTrack(Int_t i) const
100 if (i > fTrackList->GetEntriesFast()) return 0;
101 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
102 return static_cast<Int_t>((*pVect)(0));
106 ////////////////////////////////////////////////////////////////////////
107 Int_t AliMUONTransientDigit::GetCharge(Int_t i) const
109 if (i > fTrackList->GetEntriesFast()) return 0;
110 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
111 return static_cast<Int_t>((*pVect)(1));