+/**************************************************************************
+ * 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$
+*/
+
#include <iostream.h>
+#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(){
+ // 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
-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;
+ 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(const AliITSclusterSSD &OneSCluster)
-{
- // copy constructor
+//______________________________________________________________________
+AliITSclusterSSD::~AliITSclusterSSD(){
+ // destructor
- 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;
-}
+ delete fDigitsIndex;
+ delete fCrossedClusterIndexes;
+}
+//______________________________________________________________________
+AliITSclusterSSD::AliITSclusterSSD(const AliITSclusterSSD &OneSCluster){
+ // copy constructor
-/*************************************************************************/
-AliITSclusterSSD& AliITSclusterSSD::operator=(const AliITSclusterSSD & OneSCluster)
-{
- // assignment operator
+ 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;
-}
+ 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;
-/*************************************************************************/
-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;
+ //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 :
- //PH ((AliITSdigitSSD*)((*fDigits)[(*fDigitsIndex)[digit]]))->GetStripNumber();
- ((AliITSdigitSSD*)(fDigits->At((*fDigitsIndex)[digit])))->GetStripNumber();
+//______________________________________________________________________
+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];
- //PH signal = ((AliITSdigitSSD*)((*fDigits)[index]))->GetSignal();
- signal = ((AliITSdigitSSD*)(fDigits->At(index)))->GetSignal();
- /*
- if(signal>1.e5) printf("GetDigitSignal: digit %d index %d signal %d\n",
- digit,index, signal);
- */
- return signal;
+//______________________________________________________________________
+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
+//______________________________________________________________________
+void AliITSclusterSSD::AddCross(Int_t clIndex){
+ // add cluster cross to list of cluster crosses
- (*fCrossedClusterIndexes)[fNCrosses++] = clIndex;
+ (*fCrossedClusterIndexes)[fNCrosses++] = clIndex;
}
-/***********************************************************/
+//______________________________________________________________________
+Int_t AliITSclusterSSD::GetCross(Int_t crIndex){
+ // return crossing cluster
-Int_t AliITSclusterSSD::GetCross(Int_t crIndex)
-{
- // return crossing cluster
-
- return ((crIndex>-1)&&(crIndex<fNCrosses))?(*fCrossedClusterIndexes)[crIndex]:-1;
+ return ((crIndex>-1)&&(crIndex<fNCrosses))?(*fCrossedClusterIndexes)[crIndex]:-1;
}
-/***********************************************************/
-Double_t AliITSclusterSSD::CentrOfGravity()
-{
- // return center of gravity of the cluster
- Float_t ret=0;
+//______________________________________________________________________
+Double_t AliITSclusterSSD::CentrOfGravity(){
+ // return center of gravity of the cluster
+ Float_t ret=0;
- if (fLeftNeighbour) ret+=(GetDigitStripNo(0)*0.5*GetDigitSignal(0));
- else ret+=(GetDigitStripNo(0)*GetDigitSignal(0));
-
- if (fRightNeighbour) ret+=(GetDigitStripNo(fNDigits -1)*0.5*GetDigitSignal(fNDigits -1));
- else ret+=(GetDigitStripNo(fNDigits -1)*GetDigitSignal(fNDigits-1));
-
- for (Int_t i=1;i<fNDigits-1;i++)
- {
- ret +=GetDigitStripNo(i)*GetDigitSignal(i);
- }
+ if (fLeftNeighbour) ret+=(GetDigitStripNo(0)*0.5*GetDigitSignal(0));
+ else ret+=(GetDigitStripNo(0)*GetDigitSignal(0));
+ if (fRightNeighbour) ret+=(GetDigitStripNo(fNDigits -1)*0.5*GetDigitSignal(fNDigits -1));
+ else ret+=(GetDigitStripNo(fNDigits -1)*GetDigitSignal(fNDigits-1));
+ for (Int_t i=1;i<fNDigits-1;i++){
+ ret +=GetDigitStripNo(i)*GetDigitSignal(i);
+ }// end for i
- if (fTotalSignal<0) GetTotalSignal();
+ if (fTotalSignal<0) GetTotalSignal();
return (ret/fTotalSignal);
}
-
-/***********************************************************/
-Float_t AliITSclusterSSD::GetTotalSignal()
-{
- // return total signal
+//______________________________________________________________________
+Float_t AliITSclusterSSD::GetTotalSignal(){
+ // return total signal
- if(fTotalSignal <0)
- {
- fTotalSignal=0;
- if (fNDigits ==1) {
- fTotalSignal = (Float_t)GetDigitSignal(0);
- //printf("1 digit: signal %d \n",GetDigitSignal(0));
- return fTotalSignal;
- }
-
- if (fLeftNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(0));
- else fTotalSignal += (Float_t) GetDigitSignal(0);
- //printf("GetTotalSignal :i DigitSignal %d %d \n",0,GetDigitSignal(0));
-
- if (fRightNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(fNDigits -1));
+ if(fTotalSignal <0){
+ fTotalSignal=0;
+ if (fNDigits ==1) {
+ fTotalSignal = (Float_t)GetDigitSignal(0);
+ //printf("1 digit: signal %d \n",GetDigitSignal(0));
+ return fTotalSignal;
+ }
+ if (fLeftNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(0));
+ else fTotalSignal += (Float_t) GetDigitSignal(0);
+ //printf("GetTotalSignal :i DigitSignal %d %d \n",0,GetDigitSignal(0));
+ if (fRightNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(
+ fNDigits -1));
else fTotalSignal += (Float_t)GetDigitSignal(fNDigits-1);
- //printf("GetTotalSignal :i DigitSignal %d %d \n",fNDigits -1,GetDigitSignal(fNDigits -1));
-
- for (Int_t i = 1;i<fNDigits -1;i++)
- {
- fTotalSignal += (Float_t)GetDigitSignal(i);
- //printf("GetTotalSignal :i DigitSignal %d %d \n",i,GetDigitSignal(i));
+ //printf("GetTotalSignal :i DigitSignal %d %d \n",fNDigits -1,GetDigitSignal(fNDigits -1));
+ for (Int_t i = 1;i<fNDigits -1;i++){
+ fTotalSignal += (Float_t)GetDigitSignal(i);
+ //printf("GetTotalSignal :i DigitSignal %d %d \n",i,GetDigitSignal(i));
}
- //printf("GetTotalSignal: fNDigits %d fTotalSignal %.0f \n",fNDigits,fTotalSignal);
+ //printf("GetTotalSignal: fNDigits %d fTotalSignal %.0f \n",fNDigits,fTotalSignal);
}
- return fTotalSignal;
+ return fTotalSignal;
}
-/***********************************************************/
-
-Float_t AliITSclusterSSD::GetTotalSignalError()
-{
- // return the error on the signal
- Float_t err =0;
- for (Int_t i =1; i<fNDigits -1; i++)
- {
- err+=0.1*GetDigitSignal(i);
+//______________________________________________________________________
+Float_t AliITSclusterSSD::GetTotalSignalError(){
+ // return the error on the signal
+ Float_t err =0;
+ for (Int_t i =1; i<fNDigits -1; i++){
+ err+=0.1*GetDigitSignal(i);
}
- if (GetLeftNeighbour())
- {
- err+=GetDigitSignal(0);
- }
- else
- {
- err+=0.1*GetDigitSignal(0);
- }
- if (GetRightNeighbour())
- {
- err+=GetDigitSignal(fNDigits -1);
- }
- else
- {
- err+=0.1*GetDigitSignal(fNDigits -1);
- }
- return err;
-
+ if (GetLeftNeighbour()){
+ err+=GetDigitSignal(0);
+ }else{
+ err+=0.1*GetDigitSignal(0);
+ }
+ if (GetRightNeighbour()){
+ err+=GetDigitSignal(fNDigits -1);
+ }else{
+ err+=0.1*GetDigitSignal(fNDigits -1);
+ }
+ return err;
}
+//______________________________________________________________________
+void AliITSclusterSSD::DelCross(Int_t index){
+ // remove cross clusters from the list of cross clusters
+ Int_t i,j; //iterators
-/***********************************************************/
-
-void AliITSclusterSSD::DelCross(Int_t index)
-{
- // remove cross clusters from the list of cross clusters
-Int_t i,j; //iterators
-
-for (i =0;i<fNCrosses;i++)
- {
- if ((*fCrossedClusterIndexes)[i] == index)
- {
- for (j=i;j<fNCrosses-1;j++)
- {
- (*fCrossedClusterIndexes)[j]=(*fCrossedClusterIndexes)[j+1];
- }
- fNCrosses--;
- return;
- }
- }
-
+ for (i =0;i<fNCrosses;i++){
+ if ((*fCrossedClusterIndexes)[i] == index){
+ for (j=i;j<fNCrosses-1;j++){
+ (*fCrossedClusterIndexes)[j]=(*fCrossedClusterIndexes)[j+1];
+ }
+ fNCrosses--;
+ return;
+ }
+ }
}
-/***********************************************************/
+//______________________________________________________________________
+Int_t *AliITSclusterSSD::GetTracks(Int_t &nt){
+ // return the track number of the cluster
+ Int_t *tidx=0;
+ Int_t i, j,n;
+ Int_t bit =0;
+ Int_t ntracks=0;
+ nt=0;
-Int_t *AliITSclusterSSD::GetTracks(Int_t &nt)
-{
- // return the track number of the cluster
- Int_t *tidx=0;
- Int_t i, j;
- Int_t bit =0;
- Int_t ntracks=0;
- nt=0;
-
- for (i=0;i<10;i++) {
- fTrack[i] = -2;
- }
+ for (i=0;i<10;i++) fTrack[i] = -3;
- //cout<<"GetTrack start -------: fNDigits ="<<fNDigits<<endl;
+ //cout<<"GetTrack start -------: fNDigits ="<<fNDigits<<endl;
- for (i = 0; i<fNDigits; i++) {
- tidx=GetDigit(i)->GetTracks();
- for (j = 0; j<3;j++) {
- if (tidx[j] >= 0) {
- if(ntracks == 0){
- ntracks++;
- fTrack[ntracks-1] = tidx[j];
- }else if(tidx[j] != fTrack[ntracks-1]){
- ntracks++;
- if(ntracks > 9) {
- bit = 1;
- break;
- }
- fTrack[ntracks-1] = tidx[j];
- }
- }
- //cout<<"digit,dtrack,tidx,bit ="<<i<<","<<j<<","<<tidx[j]<<","<<bit<<endl;
- //if(ntracks>0) cout<<"digit,dtrack,fTrack,ntracks ="<<i<<","<<j<<","<<fTrack[ntracks-1]<<","<<ntracks<<endl;
- } // 3-tracks loop for the digit
- if(bit == 1) break;
- } // digit loop
+ for (i = 0; i<fNDigits; i++) {
+ tidx = GetDigit(i)->GetTracks();
+ n = GetDigit(i)->GetNTracks();
+ for (j = 0; j<n && j<10;j++) {
+ if (tidx[j] >= 0) {
+ if(ntracks == 0){
+ fTrack[ntracks] = tidx[j];
+ ntracks++;
+ }else if(tidx[j] != fTrack[ntracks-1]){
+ ntracks++;
+ if(ntracks > 9) {
+ bit = 1;
+ break;
+ } // end if ntracks > 9
+ fTrack[ntracks-1] = tidx[j];
+ } // end if ntracke == 0
+ } // end if tidx[j] >=0
+ } // 3-tracks loop for the digit
+ if(bit == 1) break;
+ } // digit loop
- SetNTracks(ntracks);
- nt = ntracks;
- //if(nt == 0) cout<<"!!! No tracks"<<endl;
- //cout<<"GetTracks: nt,fTrack0,fTrack1,fTrack2 ="<< nt<<","<<fTrack[0]<<","<<fTrack[1]<<","<<fTrack[2]<<endl;
- return &(fTrack[0]);
+ SetNTracks(ntracks);
+ nt = ntracks;
+ return &(fTrack[0]);
}
-/***********************************************************/
+//______________________________________________________________________
+Double_t AliITSclusterSSD::GetPosition(){
+ // return position of the cluster
+ Float_t ret;
-Double_t AliITSclusterSSD::GetPosition()
-{
- // return position of the cluster
- Float_t ret;
- switch(fNDigits)
- {
- case 1:
- ret = GetDigitStripNo(0);
- break;
- case 2:
- ret = EtaAlgorithm();
- break;
- default:
- ret = CentrOfGravity();
- }
- return ret;
+ switch(fNDigits){
+ case 1:
+ ret = GetDigitStripNo(0);
+ break;
+ case 2:
+ ret = EtaAlgorithm();
+ break;
+ default:
+ ret = CentrOfGravity();
+ }
+ return ret;
}
+//______________________________________________________________________
+Double_t AliITSclusterSSD::EtaAlgorithm(){
+ // algorithm for determing cluster position
+ if (fNDigits != 2) return -1;
-/***********************************************************/
-
-Double_t AliITSclusterSSD::EtaAlgorithm()
-{
- // algorithm for determing cluster position
- if (fNDigits != 2) return -1;
+ Int_t strip1 = GetDigit(0)->GetStripNumber();
+ Int_t strip2 = GetDigit(1)->GetStripNumber();
+ Int_t signal1 = GetDigit(0)->GetSignal();
+ Int_t signal2 = GetDigit(1)->GetSignal();
- Int_t strip1 = GetDigit(0)->GetStripNumber();
- Int_t strip2 = GetDigit(1)->GetStripNumber();
- Int_t signal1 = GetDigit(0)->GetSignal();
- Int_t signal2 = GetDigit(1)->GetSignal();
-
- Double_t eta;
+ Double_t eta;
- if (strip1<strip2)
- {
- eta = ((Double_t)signal2)/((Double_t)(signal1+signal2));
- if (eta<0.04) return strip1;
- if (eta>0.96) return strip2;
- return (strip1 + 0.43478261*eta + 0.2826087);
- }
- else
- {
- eta = ((Double_t)signal1)/((Double_t)(signal1+signal2));
- if (eta<0.04) return strip2;
- if (eta>0.96) return strip1;
- return (strip2 + 0.43478261*eta + 0.2826087);
- }
-
-
+ if (strip1<strip2){
+ eta = ((Double_t)signal2)/((Double_t)(signal1+signal2));
+ if (eta<0.04) return strip1;
+ if (eta>0.96) return strip2;
+ return (strip1 + 0.43478261*eta + 0.2826087);
+ } else{
+ eta = ((Double_t)signal1)/((Double_t)(signal1+signal2));
+ if (eta<0.04) return strip2;
+ if (eta>0.96) return strip1;
+ return (strip2 + 0.43478261*eta + 0.2826087);
+ }
}
-
-Double_t AliITSclusterSSD::GetPositionError()
-{
- // return the position error
- return (GetNumOfDigits()+1)/2;
+//______________________________________________________________________
+Double_t AliITSclusterSSD::GetPositionError(){
+ // return the position error
+ return (GetNumOfDigits()+1)/2;
}
+//______________________________________________________________________
+Bool_t AliITSclusterSSD::IsCrossingWith(Int_t idx){
+ // return the cluster to which he crosses
-Bool_t AliITSclusterSSD::IsCrossingWith(Int_t idx)
-{
- // return the cluster to which he crosses
- for (Int_t i =0; i< fNCrosses;i++)
- {
- if (GetCross(i) == idx) return kTRUE;
- }
- return kFALSE;
+ for (Int_t i =0; i< fNCrosses;i++){
+ if (GetCross(i) == idx) return kTRUE;
+ }
+ return kFALSE;
}
#ifndef ALIITSCLUSTERSSD_H
#define ALIITSCLUSTERSSD_H
-
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/*
+ $Id$
+ */
+
+ //Piotr Krzysztof Skowronski
+ //Warsaw University of Technology
+ //skowron@if.pw.edu.pl
+ //
+ // Describes set of neighbouring digits on one side of detector,
+ // that are supposed to be generated by one particle.
+ // includes information about clusters on other side that it crosses with
#include "TObject.h"
-#include "TArrayI.h"
-#include "TClonesArray.h"
+class TArrayI;
+class TConesArray;
class AliITSdigitSSD;
-class AliITSclusterSSD : public TObject
-{
-
-
-//Piotr Krzysztof Skowronski
-//Warsaw University of Technology
-//skowron@if.pw.edu.pl
-//
-// Describes set of neighbouring digits on one side of detector,
-// that are supposed to be generated by one particle.
-// includes information about clusters on other side that it crosses with
-
-public:
-
- AliITSclusterSSD(); //Default Constructor
- virtual ~AliITSclusterSSD();
- AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes, TObjArray *Digits, Bool_t side);
- AliITSclusterSSD(const AliITSclusterSSD &source);
- AliITSclusterSSD& operator=( const AliITSclusterSSD & source);
-
- void AddDigit(Int_t index){
- // //adds on digit
- (*fDigitsIndex)[fNDigits++]=index;
- }
- TObjArray* GetPointer2Digits(){
- // comment to be written
- return fDigits;
- }
-
-// TArrayI* GetDigitsIndexes(Int_t &ndigits);
-// void SetDigitIndex(Int_t index);
-
- void SetPointer2Digits(TObjArray *digits){
- // comment to be written
- fDigits = digits;
- }
- Int_t GetNumOfDigits(){
- //Returns number of digits that creates this cluster
- return fNDigits;
- }
- Int_t GetDigitSignal(Int_t digit);
-
-
- AliITSdigitSSD *GetDigit(Int_t idx) {
- // comment to be written
- return (AliITSdigitSSD *)((*fDigits)[GetDigitIndex(idx)]);
- }
- Int_t GetDigitIndex (Int_t digit) {
- // comment to be written
- return (*fDigitsIndex)[digit];
- }
- Int_t GetDigitStripNo(Int_t digit);
- Int_t GetFirstDigitStripNo(){
- // comment to be written
- return GetDigitStripNo(0);
- }
- Int_t GetLastDigitStripNo(){
- // comment to be written
- return GetDigitStripNo(fNDigits-1);
- }
- Int_t SplitCluster(Int_t where,Int_t *outdigits); //splits this one side cluster for two
- void AddCross(Int_t clIndex); //Add index of cluster that it crosses with
- Int_t GetCross(Int_t crIndex); //return index of cluster that it crosses with
- Int_t GetCrossNo() {
- // Returns number of crosses
- return fNCrosses;
- }
- void DelCross(Int_t index);
-
- Double_t GetPosition();
- Double_t GetPositionError();
- Float_t GetTotalSignal();
- Float_t GetTotalSignalError();
- void CutTotalSignal(Float_t sx) {
- // comment to be written
- if (fTotalSignal>sx) fTotalSignal-=sx;
- }
-
- Bool_t GetRightNeighbour() const {
- // comment to be written
- return fRightNeighbour;
- }
- Bool_t GetLeftNeighbour() const {
- // comment to be written
- return fLeftNeighbour;
- }
- void SetRightNeighbour(Bool_t nei) {
- // comment to be written
- fRightNeighbour=nei;
- }
- void SetLeftNeighbour(Bool_t nei) {
- // comment to be written
- fLeftNeighbour=nei;
- }
-
- void SetNTracks(Int_t ntracks) {
- // set ntracks
- fNTracks=ntracks;
- }
-
-
- Int_t GetNTracks(){
- // comment to be written
- return fNTracks;
- }
-
- Bool_t GetSide(){
- // comment to be written
- return fSide;
- }
- Int_t CheckSatus(Int_t *tracks){
- //check if digits comes from the same track
- return 0;
- }
- Int_t *GetTracks(Int_t &nt);
- void Consume(){
- // comment
- fConsumed = kTRUE;
- }
- Bool_t IsConsumed() const{
- // comment
- return fConsumed;
- }
- Bool_t IsCrossingWith(Int_t idx);
-
-protected:
-
- Bool_t fSide; //True if P
- TObjArray *fDigits; //Pointer to List of Digitsbelonging to AliITS
-
- Int_t fNDigits; //Number of digits that make up that cluster
- TArrayI *fDigitsIndex; // Digit indexes in fDigits array
-
- Int_t fNCrosses; //Number of crossed one side clusters on the other siede
- // (max 8 : it is not aribtrary)
- TArrayI *fCrossedClusterIndexes; //Array of inedexes of crossed clusters (in TClonesArray)
- // not in TArrayI in package
-
- Bool_t fLeftNeighbour; // comment to be written
- Bool_t fRightNeighbour; // comment to be written
- Bool_t fConsumed; // comment to be written
-
- Float_t fTotalSignal; // comment to be written
- Int_t fTrack[10]; // comment to be written
- Int_t fNTracks; // comment to be written
-
- Double_t CentrOfGravity();
- Double_t EtaAlgorithm();
-
-private:
-
-/*************************************/
-/*************************************/
- ClassDef(AliITSclusterSSD,1) // Cluster class for reconstructing SSD
+class AliITSclusterSSD : public TObject{
+ public:
+ AliITSclusterSSD(); //Default Constructor
+ virtual ~AliITSclusterSSD();
+ AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes,
+ TObjArray *Digits, Bool_t side);
+ AliITSclusterSSD(const AliITSclusterSSD &source);
+ AliITSclusterSSD& operator=( const AliITSclusterSSD & source);
+ void AddDigit(Int_t index){//adds on digit
+ (*fDigitsIndex)[fNDigits++]=index;}
+ TObjArray* GetPointer2Digits(){// comment to be written
+ return fDigits;}
+ void SetPointer2Digits(TObjArray *digits){// comment to be written
+ fDigits = digits;}
+ Int_t GetNumOfDigits(){//Returns number of digits that creates this cluster
+ return fNDigits;}
+ Int_t GetDigitSignal(Int_t digit);
+ AliITSdigitSSD *GetDigit(Int_t idx) { // comment to be written
+ return (AliITSdigitSSD *)((*fDigits)[GetDigitIndex(idx)]);}
+ Int_t GetDigitIndex (Int_t digit) {// comment to be written
+ return (*fDigitsIndex)[digit];}
+ Int_t GetDigitStripNo(Int_t digit);
+ Int_t GetFirstDigitStripNo(){// comment to be written
+ return GetDigitStripNo(0);}
+ Int_t GetLastDigitStripNo(){// comment to be written
+ return GetDigitStripNo(fNDigits-1);}
+ //splits this one side cluster for two
+ Int_t SplitCluster(Int_t where,Int_t *outdigits);
+ void AddCross(Int_t clIndex); //Add index of cluster that it crosses with
+ //return index of cluster that it crosses with
+ Int_t GetCross(Int_t crIndex);
+ Int_t GetCrossNo() {// Returns number of crosses
+ return fNCrosses;}
+ void DelCross(Int_t index);
+ Double_t GetPosition();
+ Double_t GetPositionError();
+ Float_t GetTotalSignal();
+ Float_t GetTotalSignalError();
+ void CutTotalSignal(Float_t sx) {// comment to be written
+ if (fTotalSignal>sx) fTotalSignal-=sx;}
+ Bool_t GetRightNeighbour() const {// comment to be written
+ return fRightNeighbour;}
+ Bool_t GetLeftNeighbour() const {// comment to be written
+ return fLeftNeighbour;}
+ void SetRightNeighbour(Bool_t nei) {// comment to be written
+ fRightNeighbour=nei;}
+ void SetLeftNeighbour(Bool_t nei) {// comment to be written
+ fLeftNeighbour=nei;}
+ void SetNTracks(Int_t ntracks) {// set ntracks
+ fNTracks=ntracks;}
+ Int_t GetNTracks(){// comment to be written
+ return fNTracks;}
+ Bool_t GetSide(){// comment to be written
+ return fSide;}
+ Int_t CheckSatus(Int_t *tracks){//check if digits comes from the same track
+ return 0;}
+ Int_t *GetTracks(Int_t &nt);
+ void Consume(){// comment
+ fConsumed = kTRUE;}
+ Bool_t IsConsumed() const{// comment
+ return fConsumed;}
+ Bool_t IsCrossingWith(Int_t idx);
+ protected:
+ Bool_t fSide; //True if P
+ TObjArray *fDigits; //Pointer to List of Digitsbelonging to AliITS
+ Int_t fNDigits; //Number of digits that make up that cluster
+ TArrayI *fDigitsIndex; // Digit indexes in fDigits array
+ Int_t fNCrosses; //Number of crossed one side clusters on the
+ // other side (max 8 : it is not aribtrary)
+ TArrayI *fCrossedClusterIndexes; //Array of inedexes of crossed clusters
+ // (in TClonesArray)
+ // not in TArrayI in package
+ Bool_t fLeftNeighbour; // comment to be written
+ Bool_t fRightNeighbour; // comment to be written
+ Bool_t fConsumed; // comment to be written
+ Float_t fTotalSignal; // comment to be written
+ Int_t fTrack[10]; // comment to be written
+ Int_t fNTracks; // comment to be written
+
+ Double_t CentrOfGravity();
+ Double_t EtaAlgorithm();
+ ClassDef(AliITSclusterSSD,1) // Cluster class for reconstructing SSD
};
#endif