1. fPrimary and fParent are created by ctor
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jan 2002 23:32:09 +0000 (23:32 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jan 2002 23:32:09 +0000 (23:32 +0000)
2. added IsInPreShower method

EMCAL/AliEMCALDigit.cxx
EMCAL/AliEMCALDigit.h

index fbed5e9ab9e8b1b78a966c82835a7dd5607dc7af..f90e10f152a88d8fd763a5e1c362ffec54a35c17 100644 (file)
@@ -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){
index f46d0ac80ff84b1727cfca06f061dbd674335b6d..bc210f5589a09951f5699d193f7bdaf08fb6fa33 100644 (file)
@@ -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