/* 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.
*
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<GetDigitsMultiplicity(); id++){
+ if(emax<fEnergyList[id])
+ imaxDigit=id ;
+ }
+ digit = dynamic_cast<AliPHOSDigit *>(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<AliPHOSDigit *>(digits->At( fDigitsList[index] )) ;
+ nprimaries = digit->GetNprimary() ;
+ for(Int_t ipr=0; ipr<nprimaries; ipr++){
+ Int_t iprimary = digit->GetPrimary(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<fMaxTrack){
+ tempo[fMulTrack]=iprimary ;
+ fMulTrack++ ;
+ }
+ else{
+ Error("EvalPrimaries", "GetNprimaries ERROR > 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) ;
}
//____________________________________________________________________________
/* 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
*
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 ;
// --- AliRoot header files ---
#include "AliLog.h"
+#include "AliPHOSLoader.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSDigit.h"
#include "AliPHOSRecPoint.h"
case kButton1Down:{
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
+ AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
Int_t iDigit;
Int_t relid[4] ;
{
//evaluates (if necessary) all RecPoint data members
- EvalPrimaries(digits) ;
}
//____________________________________________________________________________
}
}
-//______________________________________________________________________________
-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<AliPHOSDigit *>(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 *)
{
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 ;