/************************************************************************** * 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. * **************************************************************************/ /* $Log$ Revision 1.5.6.2 2002/07/24 10:09:31 alibrary Updating VirtualMC Revision 1.6 2002/03/28 14:59:07 cblume Coding conventions Revision 1.5 2001/11/06 17:19:41 cblume Add detailed geometry and simple simulator Revision 1.4 2001/10/21 18:30:02 hristov Several pointers were set to zero in the default constructors to avoid memory management problems Revision 1.3 2000/10/15 23:40:01 cblume Remove AliTRDconst Revision 1.2 2000/10/06 16:49:46 cblume Made Getters const Revision 1.1.2.2 2000/10/04 16:34:58 cblume Replace include files by forward declarations Revision 1.1.2.1 2000/09/22 14:47:52 cblume Add the tracking code */ ////////////////////////////////////////////////////////////////////// // // // Hit compression class // // Adapted from AliTPCTimeBin by Marian // // // ////////////////////////////////////////////////////////////////////// #include "AliTRDcluster.h" #include "AliTRDtimeBin.h" ClassImp(AliTRDtimeBin) //______________________________________________________ AliTRDtimeBin::AliTRDtimeBin() { //default constructor fN=0; for (UInt_t i=0; iGetY()); memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTRDcluster*)); memmove(fIndex +i+1 ,fIndex +i,(fN-i)*sizeof(UInt_t)); fIndex[i]=index; fClusters[i]=c; fN++; } //______________________________________________________ Int_t AliTRDtimeBin::Find(Double_t y) const { // Returns index of the cluster nearest in Y if (y <= fClusters[0]->GetY()) return 0; if (y > fClusters[fN-1]->GetY()) return fN; Int_t b=0, e=fN-1, m=(b+e)/2; for (; b fClusters[m]->GetY()) b=m+1; else e=m; } return m; } //______________________________________________________ AliTRDcluster *AliTRDtimeBin::operator[](Int_t i) { // // Index operator // return fClusters[i]; }