#include "AliMUONConstants.h"
#include "AliMUONVCluster.h"
+#include "AliMUONVClusterServer.h"
#include "AliMUONVClusterStore.h"
#include "AliMUONTrack.h"
#include "AliMUONTrackParam.h"
#include "AliMUONTrackExtrap.h"
+#include "AliMpArea.h"
+
#include "AliLog.h"
#include <TMinuit.h>
/// \endcond
//__________________________________________________________________________
-AliMUONTrackReconstructor::AliMUONTrackReconstructor()
- : AliMUONVTrackReconstructor()
+AliMUONTrackReconstructor::AliMUONTrackReconstructor(AliMUONVClusterServer& clusterServer)
+ : AliMUONVTrackReconstructor(clusterServer)
{
/// Constructor
}
}
//__________________________________________________________________________
-void AliMUONTrackReconstructor::MakeTrackCandidates(const AliMUONVClusterStore& clusterStore)
+void AliMUONTrackReconstructor::MakeTrackCandidates(AliMUONVClusterStore& clusterStore)
{
/// To make track candidates (assuming linear propagation if the flag fgkMakeTrackCandidatesFast is set to kTRUE):
/// Start with segments station(1..) 4 or 5 then follow track in station 5 or 4.
AliDebug(1,"Enter MakeTrackCandidates");
+ // Ask the clustering to reconstruct all clusters in station 4 and 5
+ if (AliMUONReconstructor::GetRecoParam()->CombineClusterTrackReco()) {
+ fClusterServer.Clusterize(6, clusterStore, AliMpArea());
+ fClusterServer.Clusterize(7, clusterStore, AliMpArea());
+ fClusterServer.Clusterize(8, clusterStore, AliMpArea());
+ fClusterServer.Clusterize(9, clusterStore, AliMpArea());
+ }
+
// Loop over stations(1..) 5 and 4 and make track candidates
for (Int_t istat=4; istat>=3; istat--) {
}
//__________________________________________________________________________
-void AliMUONTrackReconstructor::FollowTracks(const AliMUONVClusterStore& clusterStore)
+void AliMUONTrackReconstructor::FollowTracks(AliMUONVClusterStore& clusterStore)
{
/// Follow tracks in stations(1..) 3, 2 and 1
AliDebug(1,"Enter FollowTracks");
}
//__________________________________________________________________________
-Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation)
+Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation)
{
/// Follow trackCandidate in station(0..) nextStation and search for compatible cluster(s)
/// Keep all possibilities or only the best one(s) according to the flag fgkTrackAllTracks:
cout << "FollowTrackInStation: look for clusters in chamber(1..): " << ch2+1 << endl;
}
+ // Ask the clustering to reconstruct new clusters around the track position in the current station
+ // except for station 4 and 5 that are already entirely clusterized
+ if (AliMUONReconstructor::GetRecoParam()->CombineClusterTrackReco()) {
+ if (nextStation < 3) AskForNewClustersInStation(extrapTrackParamAtCh, clusterStore, nextStation);
+ }
+
// Create iterators to loop over clusters in both chambers
TIter nextInCh1(clusterStore.CreateChamberIterator(ch1,ch1));
TIter nextInCh2(clusterStore.CreateChamberIterator(ch2,ch2));
}
//__________________________________________________________________________
-Bool_t AliMUONTrackReconstructor::RecoverTrack(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation)
+Bool_t AliMUONTrackReconstructor::RecoverTrack(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation)
{
/// Try to recover the track candidate in the next station
/// by removing the worst of the two clusters attached in the current station
public:
- AliMUONTrackReconstructor(); // default Constructor
+ AliMUONTrackReconstructor(AliMUONVClusterServer& clusterServer); // default Constructor
virtual ~AliMUONTrackReconstructor(); // Destructor
protected:
// Functions
- virtual void MakeTrackCandidates(const AliMUONVClusterStore& clusterStore);
- virtual void FollowTracks(const AliMUONVClusterStore& clusterStore);
+ virtual void MakeTrackCandidates(AliMUONVClusterStore& clusterStore);
+ virtual void FollowTracks(AliMUONVClusterStore& clusterStore);
virtual void ComplementTracks(const AliMUONVClusterStore& clusterStore);
virtual void ImproveTracks();
virtual void Finalize();
/// Not implemented copy assignment operator
AliMUONTrackReconstructor& operator=(const AliMUONTrackReconstructor& rhs);
- Bool_t FollowTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation);
+ Bool_t FollowTrackInStation(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation);
Double_t TryTwoClusters(const AliMUONTrackParam &trackParamAtCluster, AliMUONVCluster* cluster2, AliMUONTrackParam &trackParamAtCluster2);
void UpdateTrack(AliMUONTrack &track, AliMUONTrackParam &trackParamAtCluster);
void UpdateTrack(AliMUONTrack &track, AliMUONTrackParam &trackParamAtCluster1, AliMUONTrackParam &trackParamAtCluster2);
- Bool_t RecoverTrack(AliMUONTrack &track, const AliMUONVClusterStore& clusterStore, Int_t nextStation);
+ Bool_t RecoverTrack(AliMUONTrack &track, AliMUONVClusterStore& clusterStore, Int_t nextStation);
void SetVertexErrXY2ForFit(AliMUONTrack &trackCandidate);
#include "AliMUONConstants.h"
#include "AliMUONVCluster.h"
+#include "AliMUONVClusterServer.h"
#include "AliMUONVClusterStore.h"
#include "AliMUONTrack.h"
#include "AliMUONTrackParam.h"
#include "AliMUONTrackExtrap.h"
+#include "AliMpArea.h"
+
#include "AliLog.h"
#include <Riostream.h>
/// \endcond
//__________________________________________________________________________
-AliMUONTrackReconstructorK::AliMUONTrackReconstructorK()
- : AliMUONVTrackReconstructor()
+AliMUONTrackReconstructorK::AliMUONTrackReconstructorK(AliMUONVClusterServer& clusterServer)
+ : AliMUONVTrackReconstructor(clusterServer)
{
/// Constructor
}
}
//__________________________________________________________________________
-void AliMUONTrackReconstructorK::MakeTrackCandidates(const AliMUONVClusterStore& clusterStore)
+void AliMUONTrackReconstructorK::MakeTrackCandidates(AliMUONVClusterStore& clusterStore)
{
/// To make track candidates (assuming linear propagation if the flag fgkMakeTrackCandidatesFast is set to kTRUE):
/// Start with segments station(1..) 4 or 5 then follow track in station 5 or 4.
AliDebug(1,"Enter MakeTrackCandidates");
+ // Unless we're doing combined tracking, we'll clusterize all stations at once
+ Int_t firstChamber(0);
+ Int_t lastChamber(9);
+
+ if (AliMUONReconstructor::GetRecoParam()->CombineClusterTrackReco()) {
+ // ... Here's the exception : ask the clustering to reconstruct
+ // clusters *only* in station 4 and 5 for combined tracking
+ firstChamber = 6;
+ }
+
+ for (Int_t i = firstChamber; i <= lastChamber; ++i )
+ {
+ fClusterServer.Clusterize(i, clusterStore, AliMpArea());
+ }
+
// Loop over stations(1..) 5 and 4 and make track candidates
for (Int_t istat=4; istat>=3; istat--) {
}
//__________________________________________________________________________
-void AliMUONTrackReconstructorK::FollowTracks(const AliMUONVClusterStore& clusterStore)
+void AliMUONTrackReconstructorK::FollowTracks(AliMUONVClusterStore& clusterStore)
{
/// Follow tracks in stations(1..) 3, 2 and 1
AliDebug(1,"Enter FollowTracks");
}
//__________________________________________________________________________
-Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation)
+Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation)
{
/// Follow trackCandidate in station(0..) nextStation and search for compatible cluster(s)
/// Keep all possibilities or only the best one(s) according to the flag fgkTrackAllTracks:
cout << "FollowTrackInStation: look for clusters in chamber(1..): " << ch2+1 << endl;
}
+ // Ask the clustering to reconstruct new clusters around the track position in the current station
+ // except for station 4 and 5 that are already entirely clusterized
+ if (AliMUONReconstructor::GetRecoParam()->CombineClusterTrackReco()) {
+ if (nextStation < 3) AskForNewClustersInStation(extrapTrackParamAtCh, clusterStore, nextStation);
+ }
+
// Create iterators to loop over clusters in both chambers
TIter nextInCh1(clusterStore.CreateChamberIterator(ch1,ch1));
TIter nextInCh2(clusterStore.CreateChamberIterator(ch2,ch2));
}
//__________________________________________________________________________
-Bool_t AliMUONTrackReconstructorK::RecoverTrack(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation)
+Bool_t AliMUONTrackReconstructorK::RecoverTrack(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation)
{
/// Try to recover the track candidate in the next station
/// by removing the worst of the two clusters attached in the current station
public:
- AliMUONTrackReconstructorK(); // default Constructor
+ AliMUONTrackReconstructorK(AliMUONVClusterServer& clusterServer); // default Constructor
virtual ~AliMUONTrackReconstructorK(); // Destructor
protected:
// Functions
- virtual void MakeTrackCandidates(const AliMUONVClusterStore& clusterStore);
- virtual void FollowTracks(const AliMUONVClusterStore& clusterStore);
+ virtual void MakeTrackCandidates(AliMUONVClusterStore& clusterStore);
+ virtual void FollowTracks(AliMUONVClusterStore& clusterStore);
virtual void ComplementTracks(const AliMUONVClusterStore& clusterStore);
virtual void ImproveTracks();
virtual void Finalize();
void RetraceTrack(AliMUONTrack &trackCandidate, Bool_t resetSeed);
void RetracePartialTrack(AliMUONTrack &trackCandidate, const AliMUONTrackParam* startingTrackParam);
- Bool_t FollowTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore, Int_t nextStation);
+ Bool_t FollowTrackInStation(AliMUONTrack &trackCandidate, AliMUONVClusterStore& clusterStore, Int_t nextStation);
Double_t RunKalmanFilter(AliMUONTrackParam &trackParamAtCluster);
void UpdateTrack(AliMUONTrack &track, AliMUONTrackParam &trackParamAtCluster1, AliMUONTrackParam &trackParamAtCluster2,
Double_t addChi2AtCluster1, Double_t addChi2AtCluster2);
- Bool_t RecoverTrack(AliMUONTrack &track, const AliMUONVClusterStore& clusterStore, Int_t nextStation);
+ Bool_t RecoverTrack(AliMUONTrack &track, AliMUONVClusterStore& clusterStore, Int_t nextStation);
Bool_t RunSmoother(AliMUONTrack &track);
#include "AliMUONTrackHitPattern.h"
#include "AliMUONTrackParam.h"
#include "AliMUONVCluster.h"
+#include "AliMUONVClusterServer.h"
#include "AliMUONTrackReconstructor.h"
#include "AliMUONTrackReconstructorK.h"
#include "AliMUONTrackStoreV1.h"
#include "AliMUONTriggerChamberEff.h"
#include "AliMUONTriggerTrackStoreV1.h"
-#include "AliMUONVClusterStore.h"
+#include "AliMUONClusterStoreV2.h"
#include "AliMUONVTriggerStore.h"
#include "AliESDEvent.h"
//_____________________________________________________________________________
-AliMUONTracker::AliMUONTracker(const AliMUONDigitMaker* digitMaker,
+AliMUONTracker::AliMUONTracker(AliMUONVClusterServer& clusterServer,
+ const AliMUONDigitMaker* digitMaker,
const AliMUONGeometryTransformer* transformer,
const AliMUONTriggerCircuit* triggerCircuit,
AliMUONTriggerChamberEff* chamberEff)
fTrackHitPatternMaker(0x0),
fTrackReco(0x0),
fClusterStore(0x0),
- fTriggerStore(0x0)
+ fTriggerStore(0x0),
+ fClusterServer(clusterServer)
{
/// constructor
if (fTransformer && fDigitMaker)
delete fTriggerStore;
}
+//_____________________________________________________________________________
+AliMUONVClusterStore*
+AliMUONTracker::ClusterStore() const
+{
+ /// Return (and create if necessary) the cluster container
+ if (!fClusterStore)
+ {
+ fClusterStore = new AliMUONClusterStoreV2;
+ }
+ return fClusterStore;
+}
+
//_____________________________________________________________________________
Int_t AliMUONTracker::LoadClusters(TTree* clustersTree)
{
- /// Load clusterStore and triggerStore from clustersTree
- delete fClusterStore;
+ /// Load triggerStore from clustersTree
+
+ ClusterStore()->Clear();
+
delete fTriggerStore;
if ( ! clustersTree ) {
return 1;
}
- fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
- if (!fClusterStore)
- {
- AliError("Could not get clusterStore");
- return 1;
- }
if (!fTriggerStore)
{
AliError("Could not get triggerStore");
return 2;
}
- fClusterStore->Connect(*clustersTree,kFALSE);
+ ClusterStore()->Connect(*clustersTree,kFALSE);
fTriggerStore->Connect(*clustersTree,kFALSE);
clustersTree->GetEvent(0);
// if the required tracking mode does not exist
if (!fTrackReco) return 1;
- if (!fClusterStore) {
+ if ( ! ClusterStore() )
+ {
AliError("ClusterStore is NULL");
return 2;
}
AliError("TriggerStore is NULL");
return 3;
}
-
+
// Make tracker tracks
AliMUONVTrackStore* trackStore = new AliMUONTrackStoreV1;
- fTrackReco->EventReconstruct(*fClusterStore,*trackStore);
+ fTrackReco->EventReconstruct(*(ClusterStore()),*trackStore);
// Make trigger tracks
AliMUONVTriggerTrackStore* triggerTrackStore(0x0);
if (strstr(opt,"ORIGINAL"))
{
- fTrackReco = new AliMUONTrackReconstructor();
+ fTrackReco = new AliMUONTrackReconstructor(fClusterServer);
}
else if (strstr(opt,"KALMAN"))
{
- fTrackReco = new AliMUONTrackReconstructorK();
+ fTrackReco = new AliMUONTrackReconstructorK(fClusterServer);
}
else
{
//_____________________________________________________________________________
void AliMUONTracker::UnloadClusters()
{
- /// Delete internal clusterStore
- delete fClusterStore;
- fClusterStore = 0x0;
+ /// Clear internal clusterStore
+
+ ClusterStore()->Clear();
}
-
class AliMUONVTrackReconstructor;
class AliMUONVTrackStore;
class AliMUONVTriggerStore;
+class AliMUONVClusterServer;
class AliMUONTracker : public AliTracker
{
public:
- AliMUONTracker(const AliMUONDigitMaker* digitMaker=0,
+ AliMUONTracker(AliMUONVClusterServer& clusterServer,
+ const AliMUONDigitMaker* digitMaker=0,
const AliMUONGeometryTransformer* transformer=0,
const AliMUONTriggerCircuit* triggerCircuit=0,
- AliMUONTriggerChamberEff* chamberEff=0);
+ AliMUONTriggerChamberEff* chamberEff=0);
virtual ~AliMUONTracker();
virtual Int_t Clusters2Tracks(AliESDEvent* esd);
/// Not implemented
AliMUONTracker& operator=(const AliMUONTracker& rhs);
+ AliMUONVClusterStore* ClusterStore() const;
+
void CreateTrackReconstructor();
void FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const;
AliMUONTriggerChamberEff* fTrigChamberEff; //!< trigger efficiency (not owner)
AliMUONTrackHitPattern* fTrackHitPatternMaker; //!< trigger hit pattern maker
AliMUONVTrackReconstructor* fTrackReco; //!< track reconstructor
- AliMUONVClusterStore* fClusterStore; //!< cluster container
+ mutable AliMUONVClusterStore* fClusterStore; //!< cluster container
AliMUONVTriggerStore* fTriggerStore; //!< trigger information
+ AliMUONVClusterServer& fClusterServer; //!< to get clusters
ClassDef(AliMUONTracker,0) //tracker base class for MUON
};
#include "AliMUONVTrackStore.h"
#include "AliMUONVClusterStore.h"
#include "AliMUONVCluster.h"
+#include "AliMUONVClusterServer.h"
#include "AliMUONVTriggerStore.h"
#include "AliMUONVTriggerTrackStore.h"
#include "AliMpDEManager.h"
+#include "AliMpArea.h"
#include "AliLog.h"
#include "AliCodeTimer.h"
#include <TClonesArray.h>
#include <TMath.h>
#include <TMatrixD.h>
+#include <TVector2.h>
#include <Riostream.h>
/// \endcond
//__________________________________________________________________________
-AliMUONVTrackReconstructor::AliMUONVTrackReconstructor()
+AliMUONVTrackReconstructor::AliMUONVTrackReconstructor(AliMUONVClusterServer& clusterServer)
: TObject(),
fRecTracksPtr(0x0),
- fNRecTracks(0)
+ fNRecTracks(0),
+ fClusterServer(clusterServer)
{
/// Constructor for class AliMUONVTrackReconstructor
}
//__________________________________________________________________________
-void AliMUONVTrackReconstructor::EventReconstruct(const AliMUONVClusterStore& clusterStore, AliMUONVTrackStore& trackStore)
+void AliMUONVTrackReconstructor::EventReconstruct(AliMUONVClusterStore& clusterStore, AliMUONVTrackStore& trackStore)
{
/// To reconstruct one event
AliDebug(1,"");
return;
}
+ //__________________________________________________________________________
+void AliMUONVTrackReconstructor::AskForNewClustersInStation(const AliMUONTrackParam &trackParam,
+ AliMUONVClusterStore& clusterStore, Int_t station)
+{
+ /// Ask the clustering to reconstruct new clusters around the track candidate position
+ /// in the 2 chambers of the given station
+
+ // maximum shift of the searching area due to distance between detection elements and the track slope
+ static const Double_t kgMaxShift = 2.; // 2 cm
+
+ // extrapolate track parameters to the second chamber of the station
+ AliMUONTrackParam extrapTrackParam(trackParam);
+ AliMUONTrackExtrap::ExtrapToZ(&extrapTrackParam, AliMUONConstants::DefaultChamberZ(2*station+1));
+
+ // build the searching area
+ TVector2 position(extrapTrackParam.GetNonBendingCoor(), extrapTrackParam.GetBendingCoor());
+ TVector2 dimensions(AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingDistanceToTrack() + kgMaxShift,
+ AliMUONReconstructor::GetRecoParam()->GetMaxBendingDistanceToTrack() + kgMaxShift);
+ AliMpArea area2(position, dimensions);
+
+ // ask to cluterize in the given area of the given chamber
+ fClusterServer.Clusterize(2*station+1, clusterStore, area2);
+
+ // extrapolate track parameters to the first chamber of the station
+ AliMUONTrackExtrap::ExtrapToZ(&extrapTrackParam, AliMUONConstants::DefaultChamberZ(2*station));
+
+ // build the searching area
+ position.Set(extrapTrackParam.GetNonBendingCoor(), extrapTrackParam.GetBendingCoor());
+// dimensions.Set(AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingDistanceToTrack() + kgMaxShift,
+// AliMUONReconstructor::GetRecoParam()->GetMaxBendingDistanceToTrack() + kgMaxShift);
+ AliMpArea area1(position, dimensions);
+
+ // ask to cluterize in the given area of the given chamber
+ fClusterServer.Clusterize(2*station, clusterStore, area1);
+}
+
//__________________________________________________________________________
Double_t AliMUONVTrackReconstructor::TryOneCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster* cluster,
- AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator)
+ AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator)
{
/// Test the compatibility between the track and the cluster (using trackParam's covariance matrix):
/// return the corresponding Chi2
class AliMUONVCluster;
class AliMUONTriggerTrack;
class AliMUONTrackHitPattern;
+class AliMUONVClusterServer;
class AliMUONVClusterStore;
class AliMUONVTrackStore;
class AliMUONVTriggerTrackStore;
class AliMUONVTrackReconstructor : public TObject {
public:
- AliMUONVTrackReconstructor(); // default Constructor
+ AliMUONVTrackReconstructor(AliMUONVClusterServer& clusterServer); // default Constructor
virtual ~AliMUONVTrackReconstructor(); // Destructor
// Reconstructed tracks
TClonesArray* GetRecTracksPtr() const {return fRecTracksPtr;} // Array
// Functions
- void EventReconstruct(const AliMUONVClusterStore& clusterStore,
+ void EventReconstruct(AliMUONVClusterStore& clusterStore,
AliMUONVTrackStore& trackStore);
void EventReconstructTrigger(const AliMUONTriggerCircuit& triggerCircuit,
TClonesArray *fRecTracksPtr; ///< pointer to array of reconstructed tracks
Int_t fNRecTracks; ///< number of reconstructed tracks
+ AliMUONVClusterServer& fClusterServer; ///< reference to our cluster server
// Functions
AliMUONVTrackReconstructor (const AliMUONVTrackReconstructor& rhs); ///< copy constructor
AliMUONVTrackReconstructor& operator=(const AliMUONVTrackReconstructor& rhs); ///< assignment operator
/// Make track candidats from clusters in stations(1..) 4 and 5
- virtual void MakeTrackCandidates(const AliMUONVClusterStore& clusterStore) = 0;
+ virtual void MakeTrackCandidates(AliMUONVClusterStore& clusterStore) = 0;
/// Follow tracks in stations(1..) 3, 2 and 1
- virtual void FollowTracks(const AliMUONVClusterStore& clusterStore) = 0;
+ virtual void FollowTracks(AliMUONVClusterStore& clusterStore) = 0;
/// Complement the reconstructed tracks
virtual void ComplementTracks(const AliMUONVClusterStore& clusterStore) = 0;
/// Improve the reconstructed tracks
void RemoveIdenticalTracks();
void RemoveDoubleTracks();
+ void AskForNewClustersInStation(const AliMUONTrackParam &trackParam,
+ AliMUONVClusterStore& clusterStore, Int_t station);
+
Double_t TryOneCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster* cluster,
AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator = kFALSE);
Bool_t TryOneClusterFast(const AliMUONTrackParam &trackParam, AliMUONVCluster* cluster);