From c307c6292ba899fcb5734b565a4f3643506f497c Mon Sep 17 00:00:00 2001 From: kharlov Date: Thu, 18 Oct 2007 15:12:22 +0000 Subject: [PATCH] Moved MakePrimary to EMCRecPoint to rpduce correct order of primaries --- PHOS/AliPHOSEmcRecPoint.cxx | 68 +++++++++++++++++++++++++++++++++++++ PHOS/AliPHOSEmcRecPoint.h | 4 +++ PHOS/AliPHOSRecPoint.cxx | 67 +++--------------------------------- PHOS/AliPHOSRecPoint.h | 1 - 4 files changed, 76 insertions(+), 64 deletions(-) diff --git a/PHOS/AliPHOSEmcRecPoint.cxx b/PHOS/AliPHOSEmcRecPoint.cxx index 2c9625246a1..b9249fa04dd 100644 --- a/PHOS/AliPHOSEmcRecPoint.cxx +++ b/PHOS/AliPHOSEmcRecPoint.cxx @@ -18,6 +18,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.58 2007/04/16 09:03:37 kharlov + * Incedent angle correction fixed + * * Revision 1.57 2007/04/05 10:18:58 policheh * Introduced distance to nearest bad crystal. * @@ -711,11 +714,76 @@ void AliPHOSEmcRecPoint::EvalMoments(Float_t logWeight,TClonesArray * digits, T fPhixe = phi; } +//______________________________________________________________________________ +void AliPHOSEmcRecPoint::EvalPrimaries(TClonesArray * digits) +{ + // Constructs the list of primary particles (tracks) which have contributed to this RecPoint + + AliPHOSDigit * digit ; + Int_t * tempo = new Int_t[fMaxTrack] ; + + //First find digit with maximal energy deposition and copy its primaries + Float_t emax=0.; + Int_t imaxDigit=0; + for(Int_t id=0; id(digits->At( fDigitsList[imaxDigit] )) ; + Int_t nprimaries = digit->GetNprimary() ; + if ( nprimaries > fMaxTrack ) { + fMulTrack = - 1 ; + Error("EvalPrimaries", "GetNprimaries ERROR > increase fMaxTrack" ) ; + nprimaries = fMaxTrack; //skip the rest + } + for(fMulTrack=1; fMulTrack<=nprimaries ; fMulTrack++){ + tempo[fMulTrack-1] = digit->GetPrimary(fMulTrack) ; + } + + //Now add other digits contributions + for (Int_t index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits + if(index==imaxDigit) //already in + continue ; + digit = dynamic_cast(digits->At( fDigitsList[index] )) ; + nprimaries = digit->GetNprimary() ; + for(Int_t ipr=0; iprGetPrimary(ipr+1) ; + Bool_t notIn=1 ; + for(Int_t kndex = 0 ; (kndex < fMulTrack)&& notIn ; kndex++ ) { //check if not already stored + if(iprimary == tempo[kndex]){ + notIn = kFALSE ; + } + } + if(notIn){ + if(fMulTrack increase fMaxTrack!!!" ) ; + break ; + } + } + } + } // all digits + + if(fMulTrack > 0){ + if(fTracksList)delete [] fTracksList; + fTracksList = new Int_t[fMulTrack] ; + } + for(Int_t index = 0; index < fMulTrack; index++) + fTracksList[index] = tempo[index] ; + + delete [] tempo ; + +} + //____________________________________________________________________________ void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits ) { EvalCoreEnergy(logWeight, digits); EvalTime(digits) ; + EvalPrimaries(digits) ; AliPHOSRecPoint::EvalAll(digits) ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSEmcRecPoint.h b/PHOS/AliPHOSEmcRecPoint.h index b3950cb93ec..62dafb8273a 100644 --- a/PHOS/AliPHOSEmcRecPoint.h +++ b/PHOS/AliPHOSEmcRecPoint.h @@ -8,6 +8,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.36 2007/04/05 10:18:58 policheh + * Introduced distance to nearest bad crystal. + * * Revision 1.35 2007/03/06 06:47:28 kharlov * DP:Possibility to use actual vertex position added * @@ -95,6 +98,7 @@ public: virtual void EvalDispersion(Float_t logWeight, TClonesArray * digits, TVector3 &vInc) ; // computes the dispersion of the shower virtual void EvalElipsAxis(Float_t logWeight, TClonesArray * digits, TVector3 &vInc ); // computes the axis of shower ellipsoide void EvalMoments(Float_t logWeight, TClonesArray * digits, TVector3 &vInc ); // computes shower moments + virtual void EvalPrimaries(TClonesArray * digits) ; void EvalTime( TClonesArray * digits ); virtual Bool_t AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const ; diff --git a/PHOS/AliPHOSRecPoint.cxx b/PHOS/AliPHOSRecPoint.cxx index 1822b191e04..9e9163ffc48 100644 --- a/PHOS/AliPHOSRecPoint.cxx +++ b/PHOS/AliPHOSRecPoint.cxx @@ -31,6 +31,7 @@ // --- AliRoot header files --- #include "AliLog.h" +#include "AliPHOSLoader.h" #include "AliPHOSGeometry.h" #include "AliPHOSDigit.h" #include "AliPHOSRecPoint.h" @@ -163,7 +164,7 @@ void AliPHOSRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) case kButton1Down:{ AliPHOSDigit * digit ; - AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance(); + AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry(); Int_t iDigit; Int_t relid[4] ; @@ -226,7 +227,6 @@ void AliPHOSRecPoint::EvalAll(TClonesArray * digits) { //evaluates (if necessary) all RecPoint data members - EvalPrimaries(digits) ; } //____________________________________________________________________________ @@ -244,76 +244,17 @@ void AliPHOSRecPoint::EvalPHOSMod(AliPHOSDigit * digit) } } -//______________________________________________________________________________ -void AliPHOSRecPoint::EvalPrimaries(TClonesArray * digits) -{ - // Constructs the list of primary particles (tracks) which have contributed to this RecPoint - - AliPHOSDigit * digit ; - Int_t * tempo = new Int_t[fMaxTrack] ; - - Int_t index ; - for ( index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits - digit = dynamic_cast(digits->At( fDigitsList[index] )) ; - Int_t nprimaries = digit->GetNprimary() ; - if(nprimaries){ - Int_t * newprimaryarray = new Int_t[nprimaries] ; - Int_t ii ; - for ( ii = 0 ; ii < nprimaries ; ii++) - newprimaryarray[ii] = digit->GetPrimary(ii+1) ; - - Int_t jndex ; - for ( jndex = 0 ; jndex < nprimaries ; jndex++ ) { // all primaries in digit - if ( fMulTrack > fMaxTrack ) { - fMulTrack = - 1 ; - Error("EvalPrimaries", "GetNprimaries ERROR > increase fMaxTrack" ) ; - break ; - } - Int_t newprimary = newprimaryarray[jndex] ; - Int_t kndex ; - Bool_t already = kFALSE ; - for ( kndex = 0 ; kndex < fMulTrack ; kndex++ ) { //check if not already stored - if ( newprimary == tempo[kndex] ){ - already = kTRUE ; - break ; - } - } // end of check - if ( !already) { // store it - tempo[fMulTrack] = newprimary ; - fMulTrack++ ; - } // store it - } // all primaries in digit - delete [] newprimaryarray ; - } - } // all digits - - if(fMulTrack > 0){ - if(fTracksList)delete [] fTracksList; - fTracksList = new Int_t[fMulTrack] ; - } - for(index = 0; index < fMulTrack; index++) - fTracksList[index] = tempo[index] ; - - delete [] tempo ; - -} //____________________________________________________________________________ void AliPHOSRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrixF & gmat) const { // returns the position of the cluster in the global reference system of ALICE // and the uncertainty on this position - AliPHOSGeometry * phosgeom = (AliPHOSGeometry::GetInstance()); - phosgeom->GetGlobalPHOS(this, gpos, gmat); - -// Float_t xyz[3]; -// GetGlobalXYZ(xyz); -// gpos.SetXYZ(xyz[0],xyz[1],xyz[2]); - + AliPHOSGeometry * phosgeom = (AliPHOSGeometry::GetInstance()); + phosgeom->GetGlobalPHOS(this, gpos, gmat); } - //______________________________________________________________________________ void AliPHOSRecPoint::Paint(Option_t *) { diff --git a/PHOS/AliPHOSRecPoint.h b/PHOS/AliPHOSRecPoint.h index 194ddadf1b0..d473a1bfce8 100644 --- a/PHOS/AliPHOSRecPoint.h +++ b/PHOS/AliPHOSRecPoint.h @@ -44,7 +44,6 @@ class AliPHOSRecPoint : public AliCluster { void EvalAll(TClonesArray * digits) ; void EvalLocal2TrackingCSTransform(); virtual void EvalPHOSMod(AliPHOSDigit * digit) ; - virtual void EvalPrimaries(TClonesArray * digits) ; virtual int * GetDigitsList(void) const { return fDigitsList ; } virtual Float_t GetEnergy() const {return fAmp; } virtual void GetLocalPosition(TVector3 & pos) const ; -- 2.39.3