From: kowal2 Date: Thu, 5 Oct 2000 16:17:27 +0000 (+0000) Subject: New class replacing AliCluster X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=c9787763364b2d82b681c3ebeda9401603b9489f;hp=d4c354b9aaeefb7b36d1a3b5ca0831b85ae542d3 New class replacing AliCluster --- diff --git a/TPC/AliClusters.cxx b/TPC/AliClusters.cxx index 60f6ed146fb..563da8770c6 100644 --- a/TPC/AliClusters.cxx +++ b/TPC/AliClusters.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.3 2000/06/30 12:07:49 kowal2 +Updated from the TPC-PreRelease branch + Revision 1.2.4.2 2000/06/14 16:45:13 kowal2 Improved algorithms. Compiler warnings removed. @@ -43,9 +46,8 @@ Clusters handling in a new data structure #include "TError.h" #include "TClass.h" #include -#include "AliCluster.h" +#include "AliComplexCluster.h" #include "AliClusters.h" -#include "TClonesArray.h" #include "TMarker.h" @@ -147,7 +149,7 @@ TObject * AliClusters::InsertCluster( const TObject * c) } if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000); TClonesArray &lclusters = *fClusters; - return new(lclusters[fNclusters++]) AliCluster(*((AliCluster*)c)); + return new(lclusters[fNclusters++]) AliComplexCluster(*((AliComplexCluster*)c)); } //_____________________________________________________________________________ @@ -156,14 +158,14 @@ Int_t AliClusters::Find(Double_t y) const // // return index of cluster nearest to given y position // - AliCluster* cl; - cl=(AliCluster*)fClusters->UncheckedAt(0); + AliComplexCluster* cl; + cl=(AliComplexCluster*)fClusters->UncheckedAt(0); if (y <= cl->fY) return 0; - cl=(AliCluster*)fClusters->UncheckedAt(fNclusters-1); + cl=(AliComplexCluster*)fClusters->UncheckedAt(fNclusters-1); if (y > cl->fY) return fNclusters; Int_t b=0, e=fNclusters-1, m=(b+e)/2; for (; bUncheckedAt(m); + cl = (AliComplexCluster*)fClusters->UncheckedAt(m); if (y > cl->fY) b=m+1; else e=m; } @@ -181,7 +183,7 @@ void AliClusters::DrawClusters(Float_t shiftx, Float_t shifty, //draw marker for each of cluster Int_t ncl=fClusters->GetEntriesFast(); for (Int_t i=0;iUncheckedAt(i); + AliComplexCluster *cl = (AliComplexCluster*)fClusters->UncheckedAt(i); TMarker * marker = new TMarker; marker->SetX(cl->fX+shiftx); marker->SetY(cl->fY+shifty); diff --git a/TPC/AliClusters.h b/TPC/AliClusters.h index c24c42bdab8..c3013f1f370 100644 --- a/TPC/AliClusters.h +++ b/TPC/AliClusters.h @@ -11,7 +11,8 @@ #include "AliSegmentID.h" -class TClonesArray; +#include + class TObjArray; @@ -31,7 +32,7 @@ protected: TClonesArray * fClusters; Int_t fNclusters; TClass * fClass; //!type of cluster class - ClassDef(AliClusters,1) + ClassDef(AliClusters,1) // Cluster manager }; diff --git a/TPC/AliComplexCluster.cxx b/TPC/AliComplexCluster.cxx new file mode 100644 index 00000000000..b4c2d8f7bad --- /dev/null +++ b/TPC/AliComplexCluster.cxx @@ -0,0 +1,58 @@ +/************************************************************************** + * 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$ + +*/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Time Projection Chamber clusters objects // +// +// Origin: Marian Ivanov , GSI Darmstadt +// // +//Begin_Html +/* + +*/ +//End_Html +// // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "AliComplexCluster.h" + +ClassImp(AliComplexCluster) +//_____________________________________________________________________________ +Int_t AliComplexCluster::Compare(TObject * o) +{ + // + // compare two clusters according y coordinata + AliComplexCluster *cl= (AliComplexCluster *)o; + if (fYfY) return -1; + if (fY==cl->fY) return 0; + return 1; +} + +Bool_t AliComplexCluster::IsSortable() const +{ + // + //make AliComplexCluster sortabale + return kTRUE; +} + +ClassImp(AliDigitCluster) +ClassImp(AliDifCluster) diff --git a/TPC/AliComplexCluster.h b/TPC/AliComplexCluster.h new file mode 100644 index 00000000000..6c7e19d3dee --- /dev/null +++ b/TPC/AliComplexCluster.h @@ -0,0 +1,53 @@ +#ifndef ALICOMPLEXCLUSTER_H +#define ALICOMPLEXCLUSTER_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#include "TObject.h" + +class AliComplexCluster : public TObject { +public: + Int_t fTracks[3];//labels of overlapped tracks + Float_t fX ; //Y of cluster + Float_t fY ; //Z of cluster + Float_t fQ ; //Q of cluster (in ADC counts) + Float_t fSigmaX2; //Sigma Y square of cluster + Float_t fSigmaY2; //Sigma Z square of cluster + Float_t fSigmaXY; // XY moment + Float_t fArea; //area of cluster + Float_t fMax; //amplitude at maximum +public: + AliComplexCluster() { + fTracks[0]=fTracks[1]=fTracks[2]=0; + fX=fY=fQ=fSigmaX2=fSigmaY2=0.; + } + virtual ~AliComplexCluster() {;} + Bool_t IsSortable() const; + Int_t Compare(TObject *o) ; + ClassDef(AliComplexCluster,1) // Cluster manager +}; + +class AliDigitCluster : public AliComplexCluster { +public: + Int_t fNx; //number of accepted x bins + Int_t fNy; //number of accepted y bins + Float_t fMaxX; //maximum x bin + Float_t fMaxY; //maximum y bin +public: + ClassDef(AliDigitCluster,1) // Tclusters +}; + +class AliDifCluster : public AliDigitCluster { +public: + Float_t fDx; //delta x + Float_t fDy; //delta y + Float_t fAngleX;//x angle + Float_t fAngleY;//y angle + Float_t fOrigQ; //original charge + Int_t fGenerTrack; //track number of nearest track + ClassDef(AliDifCluster,1) // // Cluster manager +}; + +#endif //ALICOMPLEXCLUSTER_H