From bdb68f8c4b20823866e958d1e4fb570b050e3fe6 Mon Sep 17 00:00:00 2001 From: hristov Date: Thu, 24 Nov 2005 09:25:21 +0000 Subject: [PATCH] Add information about digits in neighborhood of the cluster (M.Ivanov) --- TRD/AliTRDcluster.cxx | 47 ++++++++++++++++++++++++++++++++++++++++++- TRD/AliTRDcluster.h | 19 +++++++++-------- 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/TRD/AliTRDcluster.cxx b/TRD/AliTRDcluster.cxx index ebeb3e768fc..271b7a254c8 100644 --- a/TRD/AliTRDcluster.cxx +++ b/TRD/AliTRDcluster.cxx @@ -26,7 +26,20 @@ #include "AliTRDrecPoint.h" ClassImp(AliTRDcluster) - + + + //___________________________________________________________________________ + + AliTRDcluster::AliTRDcluster() : AliCluster() { + // + // default constructor + // + fQ=0; + fTimeBin=0; + fDetector=0; + fNPads=0; + for (Int_t i = 0;i<7; i++) fSignals[i]=0; +} //_____________________________________________________________________________ AliTRDcluster::AliTRDcluster(const AliTRDrecPoint &p):AliCluster() { @@ -75,6 +88,7 @@ AliTRDcluster::AliTRDcluster(const AliTRDcluster &c):AliCluster() fQ = c.GetQ(); fNPads = c.fNPads; fCenter = c.fCenter; + for (Int_t i=0;i<7;i++) fSignals[i] = c.fSignals[i]; } //_____________________________________________________________________________ @@ -144,3 +158,34 @@ void AliTRDcluster::AddTrackIndex(Int_t *track) } +void AliTRDcluster::SetSignals(Short_t*signals){ + // + // write signals in the cluster + // + for (Int_t i = 0;i<7;i++) fSignals[i]=signals[i]; +} + +Float_t AliTRDcluster::GetSumS() const +{ + // + // return total charge in non unfolded cluster + // + Float_t sum=0; + for (Int_t i = 0;i<7;i++) sum+=fSignals[i]; + return sum; +} +Float_t AliTRDcluster::GetCenterS() const +{ + // + // + // + Float_t sum=0; + Float_t sum2=0; + for (Int_t i = 0;i<7;i++) { + sum+=fSignals[i]; + sum2+=i*fSignals[i]; + } + if (sum>0) return sum2/sum-2; + return 0; + +} diff --git a/TRD/AliTRDcluster.h b/TRD/AliTRDcluster.h index 71863167980..b278f752c7b 100644 --- a/TRD/AliTRDcluster.h +++ b/TRD/AliTRDcluster.h @@ -14,7 +14,7 @@ class AliTRDcluster : public AliCluster { public: - AliTRDcluster() : AliCluster() { fQ=0; fTimeBin=0; fDetector=0; fNPads=0; } + AliTRDcluster(); AliTRDcluster(const AliTRDcluster &c); AliTRDcluster(const AliTRDrecPoint &p); @@ -34,7 +34,7 @@ class AliTRDcluster : public AliCluster { void SetDetector(Int_t d) { fDetector = d; } void SetLocalTimeBin(Int_t t) { fTimeBin = t; } void SetQ(Float_t q) { fQ = q; } - + void SetSignals(Short_t *signals); Int_t GetDetector() const { return fDetector; } Int_t GetLocalTimeBin() const { return fTimeBin; } Float_t GetQ() const { return fQ; } @@ -47,6 +47,8 @@ class AliTRDcluster : public AliCluster { Int_t GetNPads() const {return fNPads;} void SetCenter(Float_t center){fCenter =center;} Float_t GetCenter() const {return fCenter;} + Float_t GetSumS() const; + Float_t GetCenterS() const; protected: enum { @@ -57,14 +59,15 @@ class AliTRDcluster : public AliCluster { kLarge = 0x00000016 // Large cluster }; - Int_t fDetector; // TRD detector number - Int_t fTimeBin; // Time bin number within the detector - Float_t fQ; // amplitude - Int_t fNPads; // number of pads in cluster - Float_t fCenter; // center of the cluster relative to the pad - + Int_t fDetector; // TRD detector number + Char_t fTimeBin; // Time bin number within the detector + Float_t fQ; // amplitude + Char_t fNPads; // number of pads in cluster + Float_t fCenter; // center of the cluster relative to the pad + Short_t fSignals[7]; // signals in the cluster ClassDef(AliTRDcluster,2) // Cluster for the TRD }; + #endif -- 2.39.3