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 **************************************************************************/
20 #include "AliMUONTransientDigit.h"
21 #include <TObjArray.h>
24 ClassImp(AliMUONTransientDigit)
27 //____________________________________________________________________________
29 AliMUONTransientDigit::AliMUONTransientDigit(const AliMUONTransientDigit& digit)
31 // dummy copy constructor
35 AliMUONTransientDigit::AliMUONTransientDigit(Int_t ich, Int_t *digits):
39 // Creates a MUON digit list object
42 fTrackList = new TObjArray(5);
43 // 5 is arbitrary number, just to decrease default 16
46 ////////////////////////////////////////////////////////////////////////
47 AliMUONTransientDigit::~AliMUONTransientDigit()
53 ////////////////////////////////////////////////////////////////////////
54 AliMUONTransientDigit& AliMUONTransientDigit::operator =(const AliMUONTransientDigit& rhs)
56 // Dummy assignment operator
60 ////////////////////////////////////////////////////////////////////////
61 void AliMUONTransientDigit::AddToTrackList(Int_t track, Int_t charge)
63 TVector *pTrInfo = new TVector(2);
64 TVector &trInfo = *pTrInfo;
67 fTrackList->Add(pTrInfo);
70 ////////////////////////////////////////////////////////////////////////
71 void AliMUONTransientDigit::UpdateTrackList(Int_t track, Int_t charge)
73 Int_t lastEntry = fTrackList->GetLast();
74 TVector *pVect = static_cast<TVector*>(fTrackList->At(lastEntry));
75 if ( static_cast<Int_t>((*pVect)(0)) == track) {
76 (*pVect)(1) += charge; // update charge
78 AddToTrackList(track,charge);
82 ////////////////////////////////////////////////////////////////////////
83 Int_t AliMUONTransientDigit::GetTrack(Int_t i) const
85 if (i > fTrackList->GetEntriesFast()) return 0;
86 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
87 return static_cast<Int_t>((*pVect)(0));
91 ////////////////////////////////////////////////////////////////////////
92 Int_t AliMUONTransientDigit::GetCharge(Int_t i) const
94 if (i > fTrackList->GetEntriesFast()) return 0;
95 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
96 return static_cast<Int_t>((*pVect)(1));