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 // ------------------------------
19 // Class AliMUONTransientDigit
20 // ------------------------------
21 // MUON transient digit
22 // Extends AliMUONDigit with a list of contributing tracks
24 #include <TObjArray.h>
27 #include "AliMUONTransientDigit.h"
30 ClassImp(AliMUONTransientDigit)
32 //____________________________________________________________________________
33 AliMUONTransientDigit::AliMUONTransientDigit() :
38 /// Default constructor
41 //____________________________________________________________________________
42 AliMUONTransientDigit::AliMUONTransientDigit(const AliMUONTransientDigit& digit) :
45 /// Protected copy constructor
47 AliFatal( "Not implemented.");
51 AliMUONTransientDigit::AliMUONTransientDigit(Int_t ich, Int_t *digits) :
54 fTrackList(new TObjArray(5))
55 // 5 is arbitrary number, just to decrease default 16
57 /// Creates a MUON digit list object
60 ////////////////////////////////////////////////////////////////////////
61 AliMUONTransientDigit::~AliMUONTransientDigit()
69 ////////////////////////////////////////////////////////////////////////
70 AliMUONTransientDigit&
71 AliMUONTransientDigit::operator =(const AliMUONTransientDigit& rhs)
73 /// Protected assignement operator
75 if (this == &rhs) return *this;
77 AliFatal("Not implemented.");
82 ////////////////////////////////////////////////////////////////////////
83 void AliMUONTransientDigit::AddToTrackList(Int_t track, Int_t charge)
85 TVector *pTrInfo = new TVector(3);
86 TVector &trInfo = *pTrInfo;
89 fTrackList->Add(pTrInfo);
92 ////////////////////////////////////////////////////////////////////////
93 void AliMUONTransientDigit::UpdateTrackList(Int_t track, Int_t charge)
95 Int_t lastEntry = fTrackList->GetLast();
96 TVector *pVect = static_cast<TVector*>(fTrackList->At(lastEntry));
97 if ( static_cast<Int_t>((*pVect)(0)) == track) {
98 (*pVect)(1) += charge; // update charge
100 AddToTrackList(track,charge);
104 ////////////////////////////////////////////////////////////////////////
105 Int_t AliMUONTransientDigit::GetTrack(Int_t i) const
107 if (i > fTrackList->GetEntriesFast()) return 0;
108 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
109 return static_cast<Int_t>((*pVect)(0));
113 ////////////////////////////////////////////////////////////////////////
114 Int_t AliMUONTransientDigit::GetCharge(Int_t i) const
116 if (i > fTrackList->GetEntriesFast()) return 0;
117 TVector *pVect = static_cast<TVector*>(fTrackList->At(i));
118 return static_cast<Int_t>((*pVect)(1));