68 fkRecoParam(recoParam),
70 fGeometryTransformer(0x0),
76 CreateGeometryTransformer();
77 CreateClusterServer(*fGeometryTransformer);
79 if (!fClusterServer || !fTracker) {
80 AliFatal(
"refitter initialization failed");
101 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
107 if (!newTrackStore)
return 0x0;
112 while ((track = static_cast<AliMUONTrack*>(next()))) {
114 if (newTrack) newTrackStore->
Add(newTrack);
118 return newTrackStore;
128 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
134 if (!newTrackStore)
return 0x0;
139 while ((track = static_cast<AliMUONTrack*>(next()))) {
144 return newTrackStore;
154 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
171 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
177 if (!track)
return 0x0;
197 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
203 if (!cluster)
return 0x0;
207 AliError(Form(
"no digit attached to cluster #%d in track %d",clusterId,trackId));
213 if (!clusterStore)
return 0x0;
223 while ((newCluster = static_cast<AliMUONVCluster*>(nextCl())))
237 AliError(
"the refitter must be connected to an ESDInterface containing the ESD event to reconstruct");
243 if (!cluster)
return 0x0;
247 AliError(Form(
"no digit attached to cluster %d",clusterId));
253 if (!clusterStore)
return 0x0;
263 while ((newCluster = static_cast<AliMUONVCluster*>(nextCl())))
295 UInt_t trackId = track.GetUniqueID();
297 AliError(Form(
"no digit attached to track #%d",trackId));
303 if (!newTrackStore)
return 0x0;
304 newTrackStore->
Add(track)->Clear(
"C");
308 if (!newClusterStore) {
309 delete newTrackStore;
316 while ((cluster = static_cast<AliMUONVCluster*>(nextCluster()))) {
319 newClusterStore->
Clear();
327 if (nNewClusters == 0) {
328 AliWarning(Form(
"refit gave no cluster (chamber %d)",cluster->
GetChamberId()));
329 AliInfo(
"initial ESD cluster:");
330 cluster->
Print(
"FULL");
337 while ((newCluster = static_cast<AliMUONVCluster*>(nextCl())))
342 delete newClusterStore;
343 delete newTrackStore;
349 if (newTrackStore->
GetSize() > 1000) AliInfo(Form(
"%d tracks to refit... be patient!!",newTrackStore->
GetSize()));
354 Int_t currentNCluster, bestNClusters = 0;
356 while ((currentTrack = static_cast<AliMUONTrack*>(next()))) {
371 if (currentNCluster > bestNClusters || (currentNCluster == bestNClusters && currentChi2 < bestChi2)) {
372 bestTrack = currentTrack;
373 bestNClusters = currentNCluster;
374 bestChi2 = currentChi2;
381 delete newClusterStore;
382 delete newTrackStore;
394 Int_t nClusters = clusterStore.
GetSize();
395 if (nClusters < 1)
return kTRUE;
399 AliError(Form(
"Too many track candidates (%d tracks). Stop refitting.", nClusters * trackStore.
GetSize()));
406 Int_t nTracks = trackStore.
GetSize();
412 while ((currentTrack = static_cast<AliMUONTrack*>(nextTrack())) && (iTrack < nTracks)) {
421 while ((newCluster = static_cast<AliMUONVCluster*>(nextCluster())) && (iCluster < nClusters - 1)) {
430 dummyParam.
SetZ(newCluster->
GetZ());
439 dummyParam.
SetZ(newCluster->
GetZ());
Base class of a track container.
Interface of a cluster finder.
Int_t GetNClusters() const
return the number of clusters attached to the track
virtual Int_t Clusterize(Int_t chamberId, AliMUONVClusterStore &clusterStore, const AliMpArea &area, const AliMUONRecoParam *recoParam=0x0)=0
Find and add clusters from a given region of a given chamber to the store.
AliMUONVCluster * FindCluster(UInt_t clusterId) const
void ImproveTracks(Bool_t flag)
switch on/off the track improvement and keep the default cut in sigma to apply on cluster (local chi2...
TIterator * CreateDigitIteratorInCluster(UInt_t clusterId) const
AliMUONTrack * RetrackFromDigits(UInt_t trackId)
virtual Double_t GetZ() const =0
Return coordinate Z (cm)
virtual Bool_t RefitTrack(AliMUONTrack &track, Bool_t enableImprovement=kTRUE)=0
Re-fit the given track.
void CreateGeometryTransformer()
virtual TIterator * CreateIterator() const =0
Create an iterator to loop over tracks.
static UInt_t BuildUniqueID(Int_t chamberId, Int_t detElemId, Int_t clusterIndex)
Build a single integer with id information.
const AliMUONESDInterface * fkESDInterface
container of MUON tracks/clusters/digits (not owner)
virtual ~AliMUONRefitter()
virtual AliMUONTrack * Remove(AliMUONTrack &track)=0
Remove a track from the store.
virtual Int_t GetSize() const =0
The number of objects stored.
AliMUONVTrackStore * ReconstructFromClusters()
A rectangle area positioned in plane..
TIterator * CreateTrackIterator() const
Track parameters in ALICE dimuon spectrometer.
AliMUONVClusterStore * ReClusterize(UInt_t trackId, UInt_t clusterId)
Option_t * GetClusteringMode() const
get the clustering (pre-clustering) mode
AliMUONTrack * RetrackFromClusters(UInt_t trackId)
virtual void Clear(Option_t *opt="")=0
Clear container.
Class with MUON reconstruction parameters.
AliMUONVClusterServer * fClusterServer
clusterizer (owner)
class to refit the ESD clusters/tracks
Int_t GetMaxTrackCandidates() const
Get the maximum number of track candidates above which the tracking abort.
virtual void Print(Option_t *option="") const
abstract base class for clusters
static AliMUONVClusterStore * NewClusterStore()
Double_t GetGlobalChi2() const
return the minimum value of the function minimized by the fit
static AliMUONVTrackStore * NewTrackStore()
Implementation of AliMUONVClusterServer interface.
TIterator * CreateDigitIterator() const
void AddTrackParamAtCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster &cluster, Bool_t copy=kFALSE)
virtual Int_t GetNDigits() const =0
Return number of associated digits.
Interface of a cluster container.
AliMUONVTrackStore * ReconstructFromDigits()
Bool_t AddClusterToTracks(const AliMUONVClusterStore &localClusterStore, AliMUONVTrackStore &trackStore)
static Int_t GetChamberId(UInt_t uniqueID)
Return chamber id (0..), part of the uniqueID.
const AliMUONRecoParam * fkRecoParam
pointer to reco param (not owner)
AliMUONTrack * FindTrack(UInt_t trackId) const
static Int_t GetDetElemId(UInt_t uniqueID)
Return detection element id, part of the uniqueID.
AliMUONVDigitStore * GetDigits() const
Return internal track store.
Reconstructed track in ALICE dimuon spectrometer.
Bool_t IsImproved() const
return kTRUE if the track has been improved
AliMUONVTrackReconstructor * fTracker
tracker (owner)
virtual void UseDigits(TIter &next, AliMUONVDigitStore *digitStore=0x0)=0
Specify an iterator to loop over the digits needed to perform our job.
Bool_t DigitsStored(UInt_t trackId) const
virtual Bool_t Add(TObject *object)
Add an object, if of the right type.
static AliMUONVTrackReconstructor * CreateTrackReconstructor(const AliMUONRecoParam *recoParam, AliMUONVClusterServer *clusterServer, const AliMUONGeometryTransformer *transformer)
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
void SetZ(Double_t z)
set Z coordinate (cm)
void CreateClusterServer(AliMUONGeometryTransformer &transformer)
TIterator * CreateClusterIterator() const
AliMUONGeometryTransformer * fGeometryTransformer
geometry transformer (owner)
static Double_t MaxChi2()
return the maximum chi2 above which the track can be considered as abnormal (due to extrapolation fai...
Int_t nextClusterIndex
Index of the next cluster produced by this refitter (to build its uniqueID)
TObjArray * GetTrackParamAtCluster() const