/************************************************************************** * Copyright(c) 2002-2003, 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. * **************************************************************************/ #include #include "AliITSTableSSD.h" ClassImp(AliITSTableSSD) //////////////////////////////////////////////////////////////////////// // Version: 0 // Origin: Massimo Masera // March 2002 // // AliITSTableSSD is used by AliITSsimulationSSD class to fill the AliITSpList // object starting from the map with energy depositions //---------------------------------------------------------------------- AliITSTableSSD::AliITSTableSSD() : TObject(){ // Default Constructor fDim=0; fArray=0; for(Int_t i=0;i<2;i++){ fCurrUse[i]=0; fCurrFil[i]=0; } } //---------------------------------------------------------------------- AliITSTableSSD::AliITSTableSSD(const AliITSTableSSD & source):TObject(source){ // Copy constructor if(this == &source) return; fDim=source.fDim; fArray = new Int_t [fDim]; fCurrUse[0]=(source.fCurrUse)[0]; fCurrUse[1]=(source.fCurrUse)[1]; fCurrFil[0]=(source.fCurrFil)[0]; fCurrFil[1]=(source.fCurrFil)[1]; for(Int_t i=0;i=fDim/2){ cerr<<" Error in AliITSTableSSD::Add. "<(fDim/2-1)){ cerr<<" Error in AliITSTableSSD::Add. Trying to fill an element out of range\n"; cerr<<" Element="<=0)return; fArray[index]=strip; fCurrFil[side]++; } //---------------------------------------------------------------------- void AliITSTableSSD::Clear(){ fCurrUse[0]= 0; fCurrUse[1] = 0; fCurrFil[0]= 0; fCurrFil[1] = 0; for(Int_t i=0;i0)printf("\n"); } printf("\n"); cout<<"\n Elements for N side: \n"; for(Int_t i=0; i0)printf("\n"); } printf("\n"); } //---------------------------------------------------------------------- Int_t AliITSTableSSD::Use(Int_t side){ // uses the current element. This means that the current element is returned // and its content is replaced by -1. Hence each element can be used only // once. Int_t elem=-1; if((side!=0) && (side!=1)){ cerr<<" Error in AliITSTableSSD::Use. side="<(fDim/2-1)){ cerr<<" Error in AliITSTableSSD::Use. Trying to use an element out of range\n"; cerr<<" Element="<