* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id: $ */
//_________________________________________________________________________
// Class utility for Calorimeter specific selection methods ///
}
+//__________________________________________________________________________
+AliVTrack * AliCalorimeterUtils::GetMatchedTrack(const AliVCluster* cluster,
+ const AliVEvent* event,
+ const Int_t index) const
+{
+ // Get the matched track given its index, usually just the first match
+ // Since it is different for ESDs and AODs here it is a wrap method to do it
+
+ AliVTrack *track = 0;
+
+ // EMCAL case only when matching is recalculated
+ if(cluster->IsEMCAL() && IsRecalculationOfClusterTrackMatchingOn())
+ {
+ Int_t trackIndex = fEMCALRecoUtils->GetMatchedTrackIndex(cluster->GetID());
+ //printf("track index %d, cluster ID %d \n ",trackIndex,cluster->GetID());
+
+ if(trackIndex < 0 )
+ {
+ printf("AliCalorimeterUtils::GetMatchedTrack() - Wrong track index %d, from recalculation\n", trackIndex);
+ }
+ else
+ {
+ track = dynamic_cast<AliVTrack*> (event->GetTrack(trackIndex));
+ }
+
+ return track ;
+
+ }
+
+ // Normal case, get info from ESD or AOD
+ // ESDs
+ if(!strcmp("AliESDCaloCluster",Form("%s",cluster->ClassName())))
+ {
+ Int_t iESDtrack = cluster->GetTrackMatchedIndex();
+
+ if(iESDtrack < 0 )
+ {
+ printf("AliCalorimeterUtils::GetMatchedTrack() - Wrong track index %d\n", index);
+ return 0x0;
+ }
+
+ track = dynamic_cast<AliVTrack*> (event->GetTrack(iESDtrack));
+
+ }
+ else // AODs
+ {
+ if(cluster->GetNTracksMatched() > 0 )
+ track = dynamic_cast<AliVTrack*>(cluster->GetTrackMatched(index));
+ }
+
+ return track ;
+
+}
+
//_____________________________________________________________________________________________________
Int_t AliCalorimeterUtils::GetModuleNumber(AliAODPWG4Particle * particle, AliVEvent * inputEvent) const
{
#define ALICALORIMETERUTILS_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/* $Id: $ */
//_________________________________________________________________________
// Class utility for Calorimeter specific selection methods ///
//--- ANALYSIS system ---
class AliVEvent;
+class AliVTrack;
class AliAODPWG4Particle;
class AliVCluster;
class AliVCaloCells;
void RecalculateClusterPID(AliVCluster* clu) { fEMCALRecoUtils->RecalculateClusterPID(clu) ; }
- //Track matching recalculation
+ // *** Track Matching ***
+
+ AliVTrack * GetMatchedTrack(const AliVCluster * cluster, const AliVEvent * event, const Int_t index = 0) const ;
+
+ // Recalculation
void RecalculateClusterTrackMatching(AliVEvent * event, TObjArray* clusterArray = 0x0) ;
void GetMatchedResiduals(Int_t index, Float_t &dR, Float_t &dZ) {
AliCalorimeterUtils(const AliCalorimeterUtils & g) ; // cpy ctor
AliCalorimeterUtils & operator = (const AliCalorimeterUtils & g) ;//cpy assignment
- ClassDef(AliCalorimeterUtils,7)
+ ClassDef(AliCalorimeterUtils,8)
} ;