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()
35 //____________________________________________________________________________
37 AliMUONTransientDigit::AliMUONTransientDigit(const AliMUONTransientDigit& digit)
40 // Protected copy constructor
42 AliFatal( "Not implemented.");
46 AliMUONTransientDigit::AliMUONTransientDigit(Int_t ich, Int_t *digits):
50 // Creates a MUON digit list object
53 fTrackList = new TObjArray(5);
54 // 5 is arbitrary number, just to decrease default 16
57 ////////////////////////////////////////////////////////////////////////
58 AliMUONTransientDigit::~AliMUONTransientDigit()
64 ////////////////////////////////////////////////////////////////////////
65 AliMUONTransientDigit&
66 AliMUONTransientDigit::operator =(const AliMUONTransientDigit& rhs)
68 // Protected assignement operator
70 if (this == &rhs) return *this;
72 AliFatal("Not implemented.");
77 ////////////////////////////////////////////////////////////////////////
78 void AliMUONTransientDigit::AddToTrackList(Int_t track, Int_t charge)
80 TVector *pTrInfo = new TVector(3);
81 TVector &trInfo = *pTrInfo;
84 fTrackList->Add(pTrInfo);
87 ////////////////////////////////////////////////////////////////////////
88 void AliMUONTransientDigit::UpdateTrackList(Int_t track, Int_t charge)
90 Int_t lastEntry = fTrackList->GetLast();
91 TVector *pVect = static_cast<TVector*>(fTrackList->At(lastEntry));
92 if ( static_cast<Int_t>((*pVect)(0)) == track) {
93 (*pVect)(1) += charge; // update charge
95 AddToTrackList(track,charge);
99 ////////////////////////////////////////////////////////////////////////
100 Int_t AliMUONTransientDigit::GetTrack(Int_t i) const
102 if (i > fTrackList->GetEntriesFast()) return 0;
103 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
104 return static_cast<Int_t>((*pVect)(0));
108 ////////////////////////////////////////////////////////////////////////
109 Int_t AliMUONTransientDigit::GetCharge(Int_t i) const
111 if (i > fTrackList->GetEntriesFast()) return 0;
112 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
113 return static_cast<Int_t>((*pVect)(1));