From 88d764f0b15a9fbbfe28660e08a94f3a34b9d6ca Mon Sep 17 00:00:00 2001 From: schutz Date: Wed, 16 Jan 2002 23:32:09 +0000 Subject: [PATCH] 1. fPrimary and fParent are created by ctor 2. added IsInPreShower method --- EMCAL/AliEMCALDigit.cxx | 23 ++++++++++++++++++++--- EMCAL/AliEMCALDigit.h | 20 ++++++++++---------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/EMCAL/AliEMCALDigit.cxx b/EMCAL/AliEMCALDigit.cxx index fbed5e9ab9e..f90e10f152a 100644 --- a/EMCAL/AliEMCALDigit.cxx +++ b/EMCAL/AliEMCALDigit.cxx @@ -36,6 +36,7 @@ #include "AliEMCALDigit.h" #include "AliEMCALGeometry.h" +#include "AliEMCALGetter.h" ClassImp(AliEMCALDigit) @@ -47,9 +48,11 @@ ClassImp(AliEMCALDigit) fIndexInList = -1 ; fNprimary = 0 ; - fNMaxPrimary = 21 ; + fNMaxPrimary = 5 ; fNiparent = 0 ; fNMaxiparent = fNMaxPrimary*10; + fPrimary = new Int_t[fNMaxPrimary] ; + fIparent = new Int_t[fNMaxiparent] ; } //____________________________________________________________________________ @@ -57,8 +60,10 @@ AliEMCALDigit::AliEMCALDigit(Int_t primary, Int_t iparent, Int_t id, Int_t DigEn { // ctor with all data - fNMaxPrimary = 21 ; + fNMaxPrimary = 5 ; fNMaxiparent = fNMaxPrimary*10; + fPrimary = new Int_t[fNMaxPrimary] ; + fIparent = new Int_t[fNMaxiparent] ; fAmp = DigEnergy ; fTime = time ; fId = id ; @@ -93,6 +98,8 @@ AliEMCALDigit::AliEMCALDigit(const AliEMCALDigit & digit) fNMaxPrimary = digit.fNMaxPrimary ; fNMaxiparent = digit.fNMaxiparent ; + fPrimary = new Int_t[fNMaxPrimary] ; + fIparent = new Int_t[fNMaxiparent] ; Int_t i ; for ( i = 0; i < fNMaxPrimary ; i++) fPrimary[i] = digit.fPrimary[i] ; @@ -111,7 +118,8 @@ AliEMCALDigit::AliEMCALDigit(const AliEMCALDigit & digit) AliEMCALDigit::~AliEMCALDigit() { // Delete array of primiries if any - + delete [] fPrimary ; + delete [] fIparent ; } //____________________________________________________________________________ @@ -179,6 +187,15 @@ Int_t AliEMCALDigit::GetIparent(Int_t index) const } +//______________________________________________________________________ +const Bool_t AliEMCALDigit::IsInPreShower() const +{ + Bool_t rv = kFALSE ; + const AliEMCALGeometry * geom = AliEMCALGetter::GetInstance()->EMCALGeometry() ; + if( GetId() > (geom->GetNZ() * geom->GetNPhi() )) + rv = kTRUE; + return rv; +} //____________________________________________________________________________ void AliEMCALDigit::ShiftPrimary(Int_t shift){ diff --git a/EMCAL/AliEMCALDigit.h b/EMCAL/AliEMCALDigit.h index f46d0ac80ff..bc210f5589a 100644 --- a/EMCAL/AliEMCALDigit.h +++ b/EMCAL/AliEMCALDigit.h @@ -48,25 +48,25 @@ class AliEMCALDigit : public AliDigitNew { Int_t GetIparent(Int_t index) const ; const Float_t GetPhi() const; Float_t GetTime(void) const {return fTime ;} - + const Bool_t IsInPreShower() const ; Bool_t IsSortable() const { // says that AliEMCALDigits are sortable (needed for Sort method return kTRUE ; } - void SetAmp(Int_t Amp) { + void SetAmp(Int_t amp) { // sets the amplitude data member - fAmp= Amp ; } - void SetTime(Float_t Time) {fTime = Time ;} + fAmp= amp ; } + void SetId(Int_t id) {fId = id ;} + void SetTime(Float_t time) {fTime = time ;} void ShiftPrimary(Int_t shift); // shift to semarate different TreeK in merging - private: - + private: Int_t fNprimary ; // Number of primaries - Int_t fNMaxPrimary ; //! Max Number of primaries - Int_t fPrimary[5] ; // Array of primaries + Int_t fNMaxPrimary ; // Max Number of primaries + Int_t *fPrimary ; //[fNMaxPrimary] Array of primaries Int_t fNiparent ; // Number of initial parents - Int_t fNMaxiparent ; //! Max Number of parents - Int_t fIparent[50] ; // Array of parents + Int_t fNMaxiparent ; // Max Number of parents + Int_t *fIparent ; //[fNMaxiparent] Array of parents Float_t fTime ; // Calculated time ClassDef(AliEMCALDigit,1) // Digit in EMCAL -- 2.39.3