// ctor
fMaxTrack = 0 ;
fMulDigit = 0 ;
+ fMaxParent = 0;
+ fMulParent = 0;
fAmp = 0. ;
fCoreEnergy = 0 ;
fEnergyList = 0 ;
+ fParentsList = 0;
fTime = 0. ;
fLocPos.SetX(0.) ; //Local position should be evaluated
fCoreRadius = 10; //HG Check this
{
// ctor
fMaxTrack = 200 ;
- fMulDigit = 0 ;
+ fMaxParent = 200;
+ fMulDigit = 0 ;
+ fMulParent = 0;
fAmp = 0. ;
fCoreEnergy = 0 ;
fEnergyList = 0 ;
+ fParentsList = new Int_t[fMaxParent];
fTime = -1. ;
fLocPos.SetX(1000000.) ; //Local position should be evaluated
fCoreRadius = 10; //HG Check this
// dtor
if ( fEnergyList )
delete[] fEnergyList ;
+ if ( fParentsList)
+ delete[] fParentsList;
}
//____________________________________________________________________________
EvalCoreEnergy(logWeight, digits);
EvalTime(digits) ;
- //EvalPrimaries(digits) ;
+ EvalPrimaries(digits) ;
+ EvalParents(digits);
}
//____________________________________________________________________________
}
+//______________________________________________________________________________
+void AliEMCALRecPoint::EvalParents(TClonesArray * digits)
+{
+ // Constructs the list of parent particles (tracks) which have contributed to this RecPoint
+
+ AliEMCALDigit * digit ;
+ Int_t * tempo = new Int_t[fMaxParent] ;
+
+ Int_t index ;
+ for ( index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits
+ digit = dynamic_cast<AliEMCALDigit *>(digits->At( fDigitsList[index] )) ;
+ Int_t nparents = digit->GetNiparent() ;
+ Int_t * newparentarray = new Int_t[nparents] ;
+ Int_t ii ;
+ for ( ii = 0 ; ii < nparents ; ii++)
+ newparentarray[ii] = digit->GetIparent(ii+1) ;
+
+ Int_t jndex ;
+ for ( jndex = 0 ; jndex < nparents ; jndex++ ) { // all primaries in digit
+ if ( fMulParent > fMaxParent ) {
+ fMulTrack = - 1 ;
+ Error("GetNiparent", "increase fMaxParent") ;
+ break ;
+ }
+ Int_t newparent = newparentarray[jndex] ;
+ Int_t kndex ;
+ Bool_t already = kFALSE ;
+ for ( kndex = 0 ; kndex < fMulTrack ; kndex++ ) { //check if not already stored
+ if ( newparent == tempo[kndex] ){
+ already = kTRUE ;
+ break ;
+ }
+ } // end of check
+ if ( !already) { // store it
+ tempo[fMulParent] = newparent ;
+ fMulParent++ ;
+ } // store it
+ } // all parents in digit
+ delete newparentarray ;
+ } // all digits
+
+
+ fParentsList = new Int_t[fMulParent] ;
+ for(index = 0; index < fMulParent; index++)
+ fParentsList[index] = tempo[index] ;
+
+ delete tempo ;
+
+}
+
//____________________________________________________________________________
void AliEMCALRecPoint::GetLocalPosition(TVector3 & lpos) const
{
virtual void EvalAll(Float_t logWeight, TClonesArray * digits);
virtual void EvalLocalPosition(Float_t logWeight, TClonesArray * digits) ;
virtual void EvalPrimaries(TClonesArray * digits) ;
+ virtual void EvalParents(TClonesArray * digits) ;
// virtual void GetGlobalPosition(TVector3 & gpos, TMatrix & /*gmat*/) const; // return global position in ALICE
virtual void GetGlobalPosition(TVector3 & gpos) const; // return global position (x, y, z) in ALICE
virtual void GetLocalPosition(TVector3 & lpos) const; // return local position (eta, phi, r) in EMCAL
virtual Int_t * GetPrimaries(Int_t & number) const {number = fMulTrack ;
return fTracksList ; }
+ virtual Int_t * GetParents(Int_t & number) const {number = fMulParent ;
+ return fParentsList ; }
Float_t GetCoreEnergy()const {return fCoreEnergy ;}
virtual Float_t GetDispersion()const {return fDispersion ;}
virtual void GetElipsAxis(Float_t * lambda)const {lambda[0] = fLambda[0]; lambda[1] = fLambda[1];};
Float_t *fEnergyList ; //[fMulDigit] energy of digits
Float_t fTime ; // Time of the digit with maximal energy deposition
Float_t fCoreRadius; // The radius in which the core energy is evaluated
+ Int_t fMulParent; // Multiplicity of the parents
+ Int_t fMaxParent; // Maximum number of parents allowed
+ Int_t * fParentsList; // [fMaxParent] list of the parents of the digits
- ClassDef(AliEMCALRecPoint,5) // RecPoint for EMCAL (Base Class)
+ ClassDef(AliEMCALRecPoint,6) // RecPoint for EMCAL (Base Class)
};