/************************************************************************** * 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.7.6.1 2002/10/14 13:14:08 hristov Updating VirtualMC to v3-09-02 Revision 1.8 2002/09/09 17:23:28 nilsen Minor changes in support of changes to AliITSdigitS?D class'. */ #include #include "TArrayI.h" #include "TClonesArray.h" #include "AliITSdigit.h" #include "AliITSclusterSSD.h" ClassImp(AliITSclusterSSD) //______________________________________________________________________ AliITSclusterSSD::AliITSclusterSSD(){ // default constructor fSide = kTRUE; fDigits = 0; fNDigits = 0; fDigitsIndex = 0; fNCrosses = 0; fTotalSignal = -1; fNTracks = -1; fLeftNeighbour = kFALSE; fRightNeighbour = kFALSE; fCrossedClusterIndexes = 0; fConsumed=kFALSE; } //______________________________________________________________________ AliITSclusterSSD::AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes, TObjArray *Digits, Bool_t side){ // non-default constructor fNDigits = ndigits; fDigits = Digits; fSide = side; fDigitsIndex = new TArrayI(fNDigits,DigitIndexes ); fNCrosses = 0; fCrossedClusterIndexes = new TArrayI(300); fLeftNeighbour = kFALSE; fRightNeighbour = kFALSE; fTotalSignal =-1; fNTracks = -1; fConsumed=kFALSE; } //______________________________________________________________________ AliITSclusterSSD::~AliITSclusterSSD(){ // destructor delete fDigitsIndex; delete fCrossedClusterIndexes; } //______________________________________________________________________ AliITSclusterSSD::AliITSclusterSSD(const AliITSclusterSSD &OneSCluster){ // copy constructor if (this == &OneSCluster) return; fNDigits = OneSCluster.fNDigits; fSide=OneSCluster.fSide; fDigits=OneSCluster.fDigits; fDigitsIndex = new TArrayI(fNDigits); fLeftNeighbour = OneSCluster.fLeftNeighbour; fRightNeighbour = OneSCluster.fRightNeighbour; fTotalSignal =-1; fNTracks = -1; fNCrosses = OneSCluster.fNCrosses; fConsumed = OneSCluster.fConsumed; Int_t i; for (i = 0; i< fNCrosses ; i++){ fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i]; } for (i = 0; i< fNDigits ; i++){ fDigitsIndex[i]=OneSCluster.fDigitsIndex[i]; } return; } //______________________________________________________________________ AliITSclusterSSD& AliITSclusterSSD::operator=(const AliITSclusterSSD &OneSCluster){ // assignment operator if (this == &OneSCluster) return *this; fNDigits = OneSCluster.fNDigits; fSide=OneSCluster.fSide; fDigits=OneSCluster.fDigits; fDigitsIndex = new TArrayI(fNDigits); fLeftNeighbour = OneSCluster.fLeftNeighbour; fRightNeighbour = OneSCluster.fRightNeighbour; fTotalSignal =-1; fNTracks = -1; fNCrosses = OneSCluster.fNCrosses; fConsumed = OneSCluster.fConsumed; Int_t i; for (i = 0; i< fNCrosses ; i++){ fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i]; } for (i = 0; i< fNDigits ; i++){ fDigitsIndex[i]=OneSCluster.fDigitsIndex[i]; } return *this; } //______________________________________________________________________ Int_t AliITSclusterSSD::SplitCluster(Int_t where, Int_t *outdigits){ //This methods generate data necessery to make new object of this class //I choosen this way, because methods TClonesArray::Add* dont work //so I have to use constraction: new (a[i]) Creator(params...); //where 'a' is a TClonesArray //This method generate params - see AliITSmoduleSSD::SplitCluster; Int_t tmp = fNDigits; Int_t ind = 0; outdigits[ind++]=(*fDigitsIndex)[where]; //coping border strip (it is shared by this two clusters) for (Int_t i = (where+1); i < tmp; i++) { outdigits[ind++]=(*fDigitsIndex)[i]; //"moving" strips from this to the new one (*fDigitsIndex)[i]=-1; fNDigits--; //deleting strips from this cluster } return ind; } //______________________________________________________________________ Int_t AliITSclusterSSD::GetDigitStripNo(Int_t digit){ // return strip no of a digit if (digit<0) return -1; return (digit>(fNDigits-1)) ? -1 : ((AliITSdigitSSD*)(fDigits->At((*fDigitsIndex)[digit])))->GetStripNumber(); } //______________________________________________________________________ Int_t AliITSclusterSSD::GetDigitSignal(Int_t digit){ // returns digit signal Int_t index,signal; if (digit<0||digit>=fNDigits) return -1; index = (*fDigitsIndex)[digit]; signal = ((AliITSdigitSSD*)(fDigits->At(index)))->GetSignal(); /* if(signal>1.e5) printf("GetDigitSignal: digit %d index %d signal %d\n", digit,index, signal); */ return signal; } //______________________________________________________________________ void AliITSclusterSSD::AddCross(Int_t clIndex){ // add cluster cross to list of cluster crosses (*fCrossedClusterIndexes)[fNCrosses++] = clIndex; } //______________________________________________________________________ Int_t AliITSclusterSSD::GetCross(Int_t crIndex){ // return crossing cluster return ((crIndex>-1)&&(crIndex